Oracle Database 控制文件管理
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle Database 控制文件管理相关的知识,希望对你有一定的参考价值。
移动控制文件
[[email protected] ~]$ sqlplus / as sysdba SQL> set line 200 SQL> col name for a60 SQL> select status,name from v$controlfile; STATUS NAME --------------------- ------------------------------------------------------------ /u01/app/oracle/oradata/king/control01.ctl /u01/app/oracle/flash_recovery_area/king/control02.ctl
SQL> alter system set control_files= '/u01/app/oracle/oradata/king/control01.ctl', '/u02/app/oracle/oradata/king/control02.ctl' scope=spfile;
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> quit
[[email protected] ~]$ cp /u01/app/oracle/oradata/king/control01.ctl /u02/app/oracle/oradata/king/control02.ctl
[[email protected] ~]$ sqlplus / as sysdba SQL> startup ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2220200 bytes Variable Size 289410904 bytes Database Buffers 771751936 bytes Redo Buffers 5554176 bytes Database mounted. Database opened.
SQL> set line 200 SQL> col name for a60 SQL> select status,name from v$controlfile; STATUS NAME --------------------- ------------------------------------------------------------ /u01/app/oracle/oradata/king/control01.ctl /u02/app/oracle/oradata/king/control02.ctl
SQL> host rm -rf /u01/app/oracle/flash_recovery_area/king/control02.ctl
重建控制文件
SQL> show parameter user_dump_dest NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ user_dump_dest string /u01/app/oracle/diag/rdbms/kin g/king/trace SQL> alter session set tracefile_identifier='trace_control'; SQL> alter database backup controlfile to trace; [[email protected] ~]$ cd /u01/app/oracle/diag/rdbms/king/king/trace [[email protected] trace]$ more king_ora_20316_trace_control.trc
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> host rm -rf /u01/app/oracle/oradata/king/control01.ctl SQL> host rm -rf /u01/app/oracle/oradata/king/control02.ctl
SQL> startup nomount ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2220200 bytes Variable Size 289410904 bytes Database Buffers 771751936 bytes Redo Buffers 5554176 bytes SQL> CREATE CONTROLFILE REUSE DATABASE "KING" NORESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/u01/app/oracle/oradata/king/redo01.log' SIZE 50M BLOCKSIZE 512, GROUP 2 '/u01/app/oracle/oradata/king/redo02.log' SIZE 50M BLOCKSIZE 512, GROUP 3 '/u01/app/oracle/oradata/king/redo03.log' SIZE 50M BLOCKSIZE 512 -- STANDBY LOGFILE DATAFILE '/u01/app/oracle/oradata/king/system01.dbf', '/u01/app/oracle/oradata/king/sysaux01.dbf', '/u01/app/oracle/oradata/king/users01.dbf', '/u01/app/oracle/oradata/king/tpcc01.dbf', '/u01/app/oracle/oradata/king/tpcc02.dbf', '/u01/app/oracle/oradata/king/undotbs02.dbf' CHARACTER SET AL32UTF8; SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2220200 bytes Variable Size 289410904 bytes Database Buffers 771751936 bytes Redo Buffers 5554176 bytes Database mounted. Database opened.
以上是关于Oracle Database 控制文件管理的主要内容,如果未能解决你的问题,请参考以下文章