oracle控制檔案複製、移動方式

renjixinchina發表於2015-01-29

一、      遷移步驟

 1 確定控制檔案位置

SQL> select name from v$controlfile;

NAME
--------------------------------------------------
/oradata/V11/control01.ctl

SQL> shutdown immediate;

SQL> startup nomount;

2 複製

$ rman target /

RMAN> restore controlfile to '/recovery_area/V11/control02.ctl' from '/oradata/V11/control01.ctl';

--OR--

Copy the controlfile using OS-commands

% cp /oradata/V11/control01.ctl /recovery_area/V11/control02.ctl

---Or----

dd if=/path/to/source_RLV of=/path/to/target_RLV bs=4096 skip=? seek=?

3修改控制檔案

SQL >alter system set control_files=’/recovery_area/V11/control02.ctl’, ‘/oradata/V11/control01.ctl' scope=spfile;

Note: If you have an init.ora simply update this to reflect the changes.


4
啟動資料庫

SQL> startup mount force; 

-- Note: selecting from v$controlfile will reflect the changes.

SQL> select name from v$controlfile;

NAME
-------------------------------------
/recovery_area/V11/control02.ctl
/oradata/V11/control01.ctl

SQL> alter database open;

二、      遷移方式選擇

 

遷移方式

支援型別

Rman

restore controlfile to '< NEW_PATH>' from ''; 

File system

asm

Raw Logical Volumes

之前都支援

cp

File system

Asmcmd cp

+dg1/db11g/controlfile/Current.256.651275203 +dg1/db11g/controlfile/cf_copy

Asm

Dd

dd if=/path/to/source_RLV of=/path/to/target_RLV bs=4096 skip=? seek=?

Raw Logical Volumes  

File system

備註:

目的路徑為ASM RMAN方式分兩種:

1 Rman  不指定名稱

RMAN>restore controlfile to '' from ''; 

Using ASMCMD:
$ asmcmd
ASMCMD> cd

ASMCMD> find -t controlfile . *
+DG1/P10R2/CONTROLFILE/backup.308.577785757
ASMCMD>

2 Rman 指定名稱

Asm例項下建立目錄

SQL> alter diskgroup DG1 add directory '+DG1/P10R2/CONTROLFILE';

ASMCMD>cd dg1
ASMCMD>mkdir controlfile

複製

restore controlfile to '+DG1/PROD/controlfile/control02.ctl' from '/oradata2/102b/oradata/P10R2/control01.ctl';

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

相關文章