Home Database Mysql Tutorial Oracle数据库基本知识及问题解决

Oracle数据库基本知识及问题解决

Jun 07, 2016 pm 03:14 PM
or oracle basic knowledge database solve Enter question

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 概序 Oracle数据库作为一个大型的关系型数据库,它与其他关系型数据库相比,有许多个性的东西,下面作一个简单的说明,其中包括我们在日常运行和维护中可能用到的知识,希望对大家有所帮助 一、基本

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

概序

Oracle数据库作为一个大型的关系型数据库,它与其他关系型数据库相比,有许多个性的东西,下面作一个简单的说明,其中包括我们在日常运行和维护中可能用到的知识,希望对大家有所帮助

一、基本知识

1、表空间对于数据库是唯一性的,且要求每个数据库最少有一个表空间。

表空间可以分为系统表空间和非系统表空间、回滚段表空间;也可以分为用户表空间和非用户表空间,他们只是分类方式不同,其实实质差不多;

临时表空间:临时表空间并不包含真正的数据,恢复的方法是删除临时表空间并重建即可.。系统表空间:如果备份不可用,则只能采用重建数据库的方法 。

表空间的大小可以根据需要和设备的情况进行设置

表空间可以简单的理解为存放信息的空间,我们一般按如下顺序进行数据库系统的创建:创建表空间---》修改表空间---》创建回滚段---》创建用户和授权---》创建用户表---》创建表索引,用户只要按这个顺序就可以建立自己的数据库系统了,至于创建的数据库是否有最佳的性能,我会在以后的文章中做专门的讨论。表空间的建立可以用图形用户界面的方式很方便的建立,相信大家都会,在这里我不进行详细的介绍。

2、控制文件在每个数据库中必不可少,为了使数据库的性能提高建议多建几个控制文件,求要求放在不同的磁盘上。 ORACLE数据库由数据文件,控制文件和联机日志文件三种文件组成。由于磁盘空间的变化,或者基于数据库磁盘I/O性能的调整等,数据库管理员可能会考虑移动数据库文件。下面以UNIX平台为例,分别讨论三种数据库文件的移动方法

不能被忽视的数据库日志文件

请注意日志文件在恢复数据库时非常重要

日志可分为在线日志和离线日志,在线日志能记录每一个Oracle数据库中所作的全部修改。一个在线日志由多个在线日志文件组成,每一个运行的Oracle数据库实例相应地有一个在线日志,它与Oracle后台进程LGWR一起工作,立即记录该实例所作的全部修改。离线日志是可选择的?当ORACLE填满了在线日志文件后,就要进行归档了。

二、创建表空间、回滚段、用户、表的语法

1、创建表空间(这是在建数据库时的第一步要做的工作,表空间好比容器,将数据库的各种东西包含在里面)

<ccid_code>CREATE TABLESPACE test DATAFILE '/dev/test_name1' SIZE
1000M, '/dev/test_name2' SIZE 1000M , '/dev/test_name3' SIZE 1000M 
      DEFAULT STORAGE ( INITIAL 64K NEXT 64K MAXEXTENTS UNLIMITED PCTINCREASE 50 );</ccid_code>
Copy after login

注意:这里没有对表空间的扩展进行限制。

2、修改表空间

<ccid_code>alter TABLESPACE ts_name1 add DATAFILE '/dev/name4' SIZE 1000M;</ccid_code>
Copy after login

3、回滚段

<ccid_code>CREATE ROLLBACK SEGMENT "RStest" TABLESPACE "Test_name" 
      STORAGE ( INITIAL 16M NEXT 16M MAXEXTENTS UNLIMITED);</ccid_code>
Copy after login

注意不要建不同的大小的回滚段,因为ORACLE不会自己挑选和需要最相符的回滚段

4、创建用户和授权

<ccid_code>CREATE USER test_user IDENTIFIED BY test_user 
DEFAULT TABLESPACE Test_name1 TEMPORARY TABLESPACE Test_name2; 
GRANT CONNECT TO test_user; 
GRANT DBA TO test_user; 
      GRANT resource TO test_user;</ccid_code>
Copy after login

 

[1] [2] 

Oracle数据库基本知识及问题解决

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How long will Oracle database logs be kept? How long will Oracle database logs be kept? May 10, 2024 am 03:27 AM

The retention period of Oracle database logs depends on the log type and configuration, including: Redo logs: determined by the maximum size configured with the "LOG_ARCHIVE_DEST" parameter. Archived redo logs: Determined by the maximum size configured by the "DB_RECOVERY_FILE_DEST_SIZE" parameter. Online redo logs: not archived, lost when the database is restarted, and the retention period is consistent with the instance running time. Audit log: Configured by the "AUDIT_TRAIL" parameter, retained for 30 days by default.

How much memory does oracle require? How much memory does oracle require? May 10, 2024 am 04:12 AM

The amount of memory required by Oracle depends on database size, activity level, and required performance level: for storing data buffers, index buffers, executing SQL statements, and managing the data dictionary cache. The exact amount is affected by database size, activity level, and required performance level. Best practices include setting the appropriate SGA size, sizing SGA components, using AMM, and monitoring memory usage.

Oracle database server hardware configuration requirements Oracle database server hardware configuration requirements May 10, 2024 am 04:00 AM

Oracle database server hardware configuration requirements: Processor: multi-core, with a main frequency of at least 2.5 GHz. For large databases, 32 cores or more are recommended. Memory: At least 8GB for small databases, 16-64GB for medium sizes, up to 512GB or more for large databases or heavy workloads. Storage: SSD or NVMe disks, RAID arrays for redundancy and performance. Network: High-speed network (10GbE or higher), dedicated network card, low-latency network. Others: Stable power supply, redundant components, compatible operating system and software, heat dissipation and cooling system.

How much memory is needed to use oracle database How much memory is needed to use oracle database May 10, 2024 am 03:42 AM

The amount of memory required for an Oracle database depends on the database size, workload type, and number of concurrent users. General recommendations: Small databases: 16-32 GB, Medium databases: 32-64 GB, Large databases: 64 GB or more. Other factors to consider include database version, memory optimization options, virtualization, and best practices (monitor memory usage, adjust allocations).

Oracle scheduled tasks execute the creation step once a day Oracle scheduled tasks execute the creation step once a day May 10, 2024 am 03:03 AM

To create a scheduled task in Oracle that executes once a day, you need to perform the following three steps: Create a job. Add a subjob to the job and set its schedule expression to "INTERVAL 1 DAY". Enable the job.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to start the listening program in oracle How to start the listening program in oracle May 10, 2024 am 03:12 AM

Oracle listeners are used to manage client connection requests. Startup steps include: Log in to the Oracle instance. Find the listener configuration. Use the lsnrctl start command to start the listener. Use the lsnrctl status command to verify startup.

See all articles