"Turn" Oracle infrastructure cognitive-oracle physical Structure eight mesh 2017-12-13 20:31:06

Source: Internet
Author: User
Tags sqlplus

Original address: https://www.toutiao.com/i6499008214980362765/

Oracle Database Startup: The Oracle service starts, the parameter file is searched for the control file, and the control file is started, and the control file calls the data file and the log file.

Oracle's file system composition: Parameter files, control files, data files, log files.

1. parameter files (initialization parameter file): Is the primary configuration point of the Orale RDBMS, which is a collection of configuration parameters and values. Each parameter value controls or modifies some aspect of the database and instance.

2. Control file: The internal binaries that are accessed by the Oracle DB instance at startup, and the paths that they hold are determined by the control_files= parameter of the parameter file. Oracle typically has two or more control files, each with the same information, and Oracle automatically uses another control file when a control file goes wrong in a database run. The system will not work when all the control files are corrupted, and the control file is the link file for the instance and database.

3. Data file: Data files for all databases, automatic creation of multiple necessary data files during Oracle installation. These data files are used to hold basic data for the Oracle system. In the application development process, we can create some additional data files as needed. If divided by data storage type: User data (the data that holds the application system), System data (manage user data and database system itself data, such as: Data dictionary, user's name of table, data type, etc.).

3. log file: Also called a transaction log file, which records everything that has been done to the database to modify operations or transactions.

4. Other supporting documents: Sqlnet.ora file, Tnsnames.ora file, Listener.ora file; Linux as an example generally stored in the/database/oracle/product/11.2.0/db_1/network/ Admin.

Parameter file: Log in to Sqlplus type: Show parameter spfile;, view the location of SPFile. Windos:g:oracleproduct. 2.0db_1dbsspfileorcl.ora,linux:/ Database/oracle/.../dbs/spfile.ora.

View SPFile file Locations in Oracle

#尽可能的多备份控制文件 to avoid the inconvenience caused by data paralysis; When backing up a control file, the database must be close and copying a database control file in an open state can cause corruption of a block of data.

1. Log in to the database via Oracle's Sqlplus built-in tools. Linux:sqlplus '/as sysdba ', windows:sqlplus "/as sysdba", type: SELECT * from V$controfile; The SQL command query controls where the file is stored and remembers the path to the control file.

2. Stop the current database, shutdown immediate; It is not recommended to apply shutdown, a data-oriented data access more frequent, direct application of shutdown may cause database data loss or data error problems.

3. Locate the initialization parameter file for Oracle, LINUX:VI/DATABASE/ORAC/.../SPFILEORCL. Ora;wiondows:g:oracleproduct. 2.0db_1dbsspfileorcl.ora; Edit the new path to the control_file of the parameter file and note the save after editing is complete. And in the control file of the storage directory copy any control.ctl,linux:cp-p/. /control01.ctl/.. /control04.ctl.

4. Log in to the Linux or Windows Sqlplus tool and start the Oracle database; recommended: Stratup. When boot is complete, type select Status,name from V$controlfile After that you will find a new backup control file.

* View Control file location via Sqlplus

Select Status,name from V$controlfile;

* View data file location via Sqlplus

Select Status,name from V$datafile;

* View Log file location via Sqlplus

Select Status,member from V$logfile;

*. View redo log file information through Sqlplus

Archive log list;

Select * from V$log;

Redo log file (Redolog file) All of Oracle's operations are recorded in a log file, and the Oracle system saves all of these changes by making changes to the file (writing data files) as soon as it does not make changes to each record in the work. When all modifications are last written to the data file, all modifications are still recorded in the online redo log, which facilitates the recovery of these transaction records. However, if it is not an online redo log, only some of the recent operations can be restored. The primary Storage database executes DML (INSET,UPDATE,DELETE) statements, Sequential writes, and automatic switching after full write. Only archive mode can recover data, and non-archive mode can only restore current data.

----View Redo log file information

Archive log list;

Select * from V$log;

----switch access to physical files (not used in normal work)

Alter system Switch Logfiel;

Select * from V$logfile;

----adding redo log files

Linux:alter database Add logfile '/database/. /redolog09.rdo ' size 2g autoextend off;

Windows:alter Database Add Logfie

(' g:oracleproduct.2.0db_1databasearchive edolog09.rdo ') size 2g;

Alter system switch Logfiel; Make new log file effective

Select * from V$logfile; View log information

-----Develop workgroups add redo log files

Alter database Add logfile member '/database/. /redolog11.rdo ' to group 1, '/database/. /redolog12.rdo ' to group 2;

Alter system Switch Logfiel;

Select * from V$logfile;

"Turn" Oracle infrastructure cognitive-oracle physical Structure eight mesh 2017-12-13 20:31:06

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.