千家信息网

【Oracle Database】数据库控制文件管理

发表于:2025-01-21 作者:千家信息网编辑
千家信息网最后更新 2025年01月21日,移动控制文件[oracle@wallet01 ~]$ sqlplus / as sysdbaSQL> set line 200SQL> col name for a60SQL> select stat
千家信息网最后更新 2025年01月21日【Oracle Database】数据库控制文件管理
移动控制文件[oracle@wallet01 ~]$ sqlplus / as sysdbaSQL> set line 200SQL> col name for a60SQL> select status,name from v$controlfile;STATUS  NAME------- ------------------------------------------------------------        /u01/app/oracle/oradata/wallet/control01.ctl        /u01/app/oracle/fast_recovery_area/wallet/control02.ctl                      SQL> alter system set control_files='/u01/app/oracle/oradata/wallet/control01.ctl','/u02/app/oracle/oradata/wallet/control02.ctl' scope=spfile;System altered.SQL> shutdown immediate   Database closed.Database dismounted.ORACLE instance shut down.[oracle@wallet01 ~]$ cp /u01/app/oracle/oradata/wallet/control01.ctl /u02/app/oracle/oradata/wallet/control02.ctl[oracle@wallet01 ~]$ sqlplus / as sysdbaSQL> startupORACLE instance started.Total System Global Area 1068937216 bytesFixed Size                  2260088 bytesVariable Size             335545224 bytesDatabase Buffers          725614592 bytesRedo Buffers                5517312 bytesDatabase mounted.Database opened.SQL> set line 200SQL> col name for a60SQL> select status,name from v$controlfile;STATUS  NAME------- ------------------------------------------------------------        /u01/app/oracle/oradata/wallet/control01.ctl        /u02/app/oracle/oradata/wallet/control02.ctl                      SQL> host rm -rf /u01/app/oracle/flash_recovery_area/wallet/control02.ctl


重建控制文件SQL> show parameter user_dump_destNAME                                 TYPE                              VALUE------------------------------------ --------------------------------- ------------------------------user_dump_dest                       string                            /u01/app/oracle/diag/rdbms/kin                                                                       g/wallet/trace                                                                       SQL> alter session set tracefile_identifier='trace_control';Session altered.SQL> alter database backup controlfile to trace;Database altered.[oracle@wallet01 ~]$ cd /u01/app/oracle/diag/rdbms/wallet/wallet/trace[oracle@wallet01 trace]$ more wallet_ora_28356_trace_control.trcSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> host rm -rf /u01/app/oracle/oradata/wallet/control01.ctlSQL> host rm -rf /u02/app/oracle/oradata/wallet/control02.ctlSQL> startup nomountORACLE instance started.Total System Global Area 1068937216 bytesFixed Size                  2260088 bytesVariable Size             335545224 bytesDatabase Buffers          725614592 bytesRedo Buffers                5517312 bytesSQL> CREATE CONTROLFILE REUSE DATABASE "WALLET" NORESETLOGS  ARCHIVELOG    MAXLOGFILES 16    MAXLOGMEMBERS 3    MAXDATAFILES 100    MAXINSTANCES 8    MAXLOGHISTORY 292LOGFILE  GROUP 1 (    '/u01/app/oracle/oradata/wallet/redo01a.log',    '/u02/app/oracle/oradata/wallet/redo01b.log'  ) SIZE 50M BLOCKSIZE 512,  GROUP 2 (    '/u01/app/oracle/oradata/wallet/redo02a.log',    '/u02/app/oracle/oradata/wallet/redo02b.log'  ) SIZE 50M BLOCKSIZE 512,  GROUP 3 (    '/u01/app/oracle/oradata/wallet/redo03a.log',    '/u02/app/oracle/oradata/wallet/redo03b.log'  ) SIZE 50M BLOCKSIZE 512-- STANDBY LOGFILEDATAFILE  '/u01/app/oracle/oradata/wallet/system01.dbf',  '/u01/app/oracle/oradata/wallet/sysaux01.dbf',  '/u01/app/oracle/oradata/wallet/undotbs01.dbf',  '/u01/app/oracle/oradata/wallet/users01.dbf',  '/u01/app/oracle/oradata/wallet/soe01.dbf',  '/u01/app/oracle/oradata/wallet/soe02.dbf',CHARACTER SET AL32UTF8;Control file created.SQL> shutdown abort    ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1068937216 bytesFixed Size                  2260088 bytesVariable Size             335545224 bytesDatabase Buffers          725614592 bytesRedo Buffers                5517312 bytesDatabase mounted.Database opened.


0