Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Control file multiplexing

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Control file is one of the most important files in oracle database. It records the name of the database and other key configurations, as well as the location and status of all the data files and log files in the current database. It is a key file that must be found and used in the process of database startup. By default, there are two control files in the database, and the contents and sizes of the two control files are the same. In a production environment, it is common to build multiple copies of control files on different disks. It should be noted that no matter how many control files the database has, when the database starts, it will check all the control files, and only if the contents of these control files are consistent and undamaged can the database start successfully.

Method 1:

View the current control file of the database

SQL > show parameter control_files

NAME TYPE VALUE

Control_files string / u01/app/oracle/oradata/orcl/control01.ctl

/ u01/app/oracle/oradata/orcl/control02.ctl

two。 Modify control file

SQL > alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/control/control03.ctl' scope=spfile

System altered.

3. Consistency shuts down database

SQL > shutdown immediate

4. Copy the control file to the appropriate directory in the operating system

[oracle@ymm oracle] $cp / u01/app/oracle/oradata/orcl/control01.ctl / u01/app/oracle/control/control03.ctl

5. Start the database

SQL > startup

6. View the current control file of the database

SQL > show parameter control_files

NAME TYPE VALUE

-

Control_files string / u01/app/oracle/oradata/orcl/control01.ctl

/ u01/app/oracle/oradata/orcl/control02.ctl

/ u01/app/oracle/control/control03.ctl

Method 2: modify the parameter file pfile

Generate pfile parameter file

SQL > show parameter spfile

NAME TYPE VALUE

Spfile string / u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora

SQL > create pfile from spfile

File created.

By default, both pfile and spfile are stored in the $ORACLE_HOME/dbs directory. Pfile begins with init and spfile begins with spfile.

two。 Consistency shuts down database

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

3. Modify control file parameters in pfile

[oracle@ymm dbs] $vi initorcl.ora

4. Copy control file copy

[oracle@ymm control] $cp control03.ctl control04.ctl-- I copy in a relative path without adding a path

[oracle@ymm control] $ls

Control03.ctl control04.ctl

5. Regenerate spfile and start the database

SQL > create spfile from pfile

File created.

SQL > startup

ORACLE instance started.

Total System Global Area 730714112 bytes

Fixed Size 2231952 bytes

Variable Size 239075696 bytes

Database Buffers 482344960 bytes

Redo Buffers 7061504 bytes

Database mounted.

Database opened.

6. Check the status of control files

SQL > show parameter control_files

NAME TYPE VALUE

Control_files string / u01/app/oracle/oradata/orcl/control01.ctl

/ u01/app/oracle/oradata/orcl/control02.ctl

/ u01/app/oracle/control/control03.ctl

/ u01/app/oracle/control/control04.ctl

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report