【備份恢復】 控制檔案多路徑

不一樣的天空w發表於2016-10-23

 控制檔案多路徑

更改控制檔案為多路徑,至少要在4個位置。

1.檢視控制檔案路徑:
SQL> show parameter control

 

NAME                                 TYPE        VALUE

------------------------------------ -----------

control_file_record_keep_time        integer     7

control_files                        string      /u01/app/oracle/oradata/PROD/c

                                                 ontrol01.ctl, /u01/app/oracle/

                                                 oradata/PROD/control02.ctl

control_management_pack_access       string      DIAGNOSTIC+TUNING

SQL>

[oracle@wang oradata]$ cd /u01/app/oracle/oradata/


2.建立目錄:

[oracle@wang oradata]$ mkdir con1/ con2/ con3

[oracle@wang oradata]$ ls

con1  con2  con3  ORA11GR2  PROD


3.修改引數
control_files:

SQL> alter system set control_files='/u01/app/oracle/oradata/PROD/control01.ctl','/u01/app/oracle/oradata/con1/control02.ctl','/u01/app/oracle/oradata/con2/control03.ctl','/u01/app/oracle/oradata/con3/control04.ctl' scope=spfile;

 

System altered.

4.關庫(使觸發檢查點保證資料庫一致性狀態):

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.


5.進入作業系統層面複製控制檔案:

[oracle@wang PROD]$ ls

control01.ctl  redo01.log  redo03.log    system01.dbf  temp1.dbf  test01.dbf  undotbs01.dbf  users02.dbf

control02.ctl  redo02.log  sysaux01.dbf  temp01.dbf    temp2.dbf  tool01.dbf  users01.dbf

[oracle@wang PROD]$ cp control01.ctl control03.ctl

[oracle@wang PROD]$ cp control01.ctl control04.ctl

[oracle@wang PROD]$ ls

control01.ctl  control03.ctl  redo01.log  redo03.log    system01.dbf  temp1.dbf  test01.dbf  undotbs01.dbf  users02.dbf

control02.ctl  control04.ctl  redo02.log  sysaux01.dbf  temp01.dbf    temp2.dbf  tool01.dbf  users01.dbf

[oracle@wang PROD]$ mv control02.ctl /u01/app/oracle/oradata/con1/

[oracle@wang PROD]$ mv control03.ctl /u01/app/oracle/oradata/con2/

[oracle@wang PROD]$ mv control04.ctl /u01/app/oracle/oradata/con3/

[oracle@wang PROD]$ ls

control01.ctl  redo02.log  sysaux01.dbf  temp01.dbf  temp2.dbf   tool01.dbf     users01.dbf

redo01.log     redo03.log  system01.dbf  temp1.dbf   test01.dbf  undotbs01.dbf  users02.dbf

[oracle@wang PROD]$


6.驗證:

[oracle@wang PROD]$ cd ..

[oracle@wang oradata]$ ls

con1  con2  con3  ORA11GR2  PROD

[oracle@wang oradata]$ cd con1

[oracle@wang con1]$ ls

control02.ctl

[oracle@wang con1]$ cd ..

[oracle@wang oradata]$ ls

con1  con2  con3  ORA11GR2  PROD

[oracle@wang oradata]$ cd con2

[oracle@wang con2]$ ls

control03.ctl

[oracle@wang con2]$ cd ..

[oracle@wang oradata]$ cd con3

[oracle@wang con3]$ ls

control04.ctl

[oracle@wang con3]$


7.重啟資料庫使控制引數生效:

SQL> show parameter control

 

NAME                                 TYPE        VALUE

------------------------------------ -----------

control_file_record_keep_time        integer     7

control_files                        string      /u01/app/oracle/oradata/PROD/c

                                                 ontrol01.ctl, /u01/app/oracle/

                                                 oradata/con1/control02.ctl, /u

                                                 01/app/oracle/oradata/con2/con

                                                 trol03.ctl, /u01/app/oracle/or

                                                 adata/con3/control04.ctl

control_management_pack_access       string      DIAGNOSTIC+TUNING

SQL>
完成!!!!!!!!!!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2126953/,如需轉載,請註明出處,否則將追究法律責任。

相關文章