Oracle Database 控制文件管理

前端之家收集整理的这篇文章主要介绍了Oracle Database 控制文件管理前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
移动控制文件

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;


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相关文章