Duplicating a controlfile into ASM when original controlfile is stored on ASM

 

应客户要求要给某个库再增加一个control file,当前的控制文件放在ASM磁盘组上,数据库版本为10.2.0.5。引用metalink文章[ID 345180.1]内容:

If using spfile to start the instance:
1. Modify the spfile specifically the parameter control_files. In this example, a second controlfile
is going to be created on same diskgroup DATA1.

sql> alter system set control_files='+DATA1/v102/controlfile/current.261.637923577','+DATA1'
scope=spfile sid='*';


2. Start the instance in NOMOUNT mode.


3. From rman, duplicate the controlfile

$ rman nocatalog
RMAN>connect target
RMAN> restore controlfile from '+DATA1/v102/controlfile/current.261.637923577';


The output for the execution is like:
Starting restore at 08-NOV-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 instance=V1021 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=+DATA1/v102/controlfile/current.261.637923577
output filename=+DATA1/v102/controlfile/current.269.638120375
Finished restore at 08-NOV-07
Note that the command prints the name of the new created file: +DATA1/v102/controlfile/current.269.638120375


4. Mount and Open the database

RMAN> sql 'alter database mount';
RMAN> sql 'alter database open';


5. Validate both controlfiles are present

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA1/v102/controlfile/current.261.637923577
+DATA1/v102/controlfile/current.269.638120375


6. Modify the control_file parameter with the complete path of the new file:

sql> alter system set control_files='+DATA1/v102/controlfile/current.261.637923577','+DATA1/v102/controlfile/current.269.638120375'
scope=spfile sid='*';


Next time instance are restarted, will pick both files.

When using init.ora file:
1) Edit init.ora and add new disk group name or same disk group name for mirroring controlfiles.
Example:
control_files=('+GROUP1','+GROUP2')


(2) Start the instance in NOMOUNT mode.


(3)  Execute restore command, to duplicate the controlfile using the original location. Presuming, your current controlfile location DISK path is '+data/V10G/controlfile/Current.260.605208993' , execute:

RMAN> restore controlfile from '+data/V10G/controlfile/Current.260.605208993';
Starting restore at 29-APR-05
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=317 devtype=DISK
channel ORA_DISK_1: copied controlfile copy
output filename=+GROUP2/v10g/controlfile/backup.268.7
output filename=+GROUP2/v10g/controlfile/backup.260.5
Finished restore at 29-APR-05


(4) Mount and open the database:

RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> alter database open;
database opened
RMAN> exit


(5) Verify new mirrored controlfiles via sqlplus

SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +GROUP2/v10g/controlfile/backup.268.7, +GROUP2/v10g/controlfile/backup.260.5

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值