ON single-instance
1, make sure asm diskgroup is avaliable
2, check current controlfile and using spfile
3, add new controlfile to spfile
4, restart oracle database instance, shutdown and startup in mount (not ASM instance)
5, Dumplicate controlfile to new path in spfile using rman
Note: that the command prints the name of the new created file in new ASM diskgroup(my case is +NEW_DATA)
6, Modify the control_file parameter with the complete path of the new file
new control file name like this "+NEW_DATA/ANBOB/controlfile/current.258.798205861"
7, restart instance and verify controlfile
Another way on RAC
1). Identify the location of the current controlfile::
2) For can duplicate our control file our database must be down. So I am going to close my database first:
3) After my database down. I am loginning one of the my node. In my case I am loginning node 1:
On node1:
Set DB env. than:
4) On node1 set ASM env. than check your current controlfile:
5) On node1 Set DB env. Use RMAN to duplicate the controlfile:
note:
We are only specifying the name of the diskgroup, so Oracle will create an OMF (Oracle Managed File). Use ASMCMD or sqlplus to identify the name assigned to the controlfile or rman restore log .
6) Checking those file create or not follow setp 4 and use ls command
note:
As you can see We have new 1 controlfile "current.1026.790368247"
7) On node1 Set DB env. Modify the control_file parameter in spifle .than:
8) Start your db
Summary:
Of course, you can use create a directory and copy confile using dbms_file_transfer.copy_file too. or using rman COPY CURRENT CONTROLFILE TO ''.
Reference:
How to duplicate a controlfile when ASM is involved [ID 345180.1]
1, make sure asm diskgroup is avaliable
Select name,total_mb,free_mb from v$asm_diskgroup where state='CONNECTED';
2, check current controlfile and using spfile
show parameter control_files
show parameter pfile
3, add new controlfile to spfile
alter system set control_files='[original file]','[asm diskgroup name where new control file will stored]' scope=spfile ;
for example:
alter system set control_files='+OLD/ANBOB/controlfile/current.258.798205861','+NEW_DATA' scope=spfile ;
4, restart oracle database instance, shutdown and startup in mount (not ASM instance)
shutdown immediate
stratup nomount
5, Dumplicate controlfile to new path in spfile using rman
rman target /
rman> restore controlfile from '[original file full name]' ; exmaple: '+SYSTEM/ANBOB/controlfile/current.258.798205861'
Note: that the command prints the name of the new created file in new ASM diskgroup(my case is +NEW_DATA)
6, Modify the control_file parameter with the complete path of the new file
alter system set control_files='+OLD/ANBOB/controlfile/current.258.798205861','[ full name of the new controlfile generated in the previous step ]' scope=spfile sid='*';
new control file name like this "+NEW_DATA/ANBOB/controlfile/current.258.798205861"
7, restart instance and verify controlfile
shutdown immediate
startup
show parameter control
Another way on RAC
1). Identify the location of the current controlfile::
SQL> select name from v$controlfile;
2) For can duplicate our control file our database must be down. So I am going to close my database first:
srvctl stop database -d anbob
3) After my database down. I am loginning one of the my node. In my case I am loginning node 1:
On node1:
Set DB env. than:
sqlplus / as sysdba
startup nomount
4) On node1 set ASM env. than check your current controlfile:
# asmcmd -p
ASMCMD> cd ORADATA/RAC00/CONTROLFILE/
ASMCMD [+ORADATA/RAC00/controlfile] > ls
Current.240.737948655
5) On node1 Set DB env. Use RMAN to duplicate the controlfile:
rman target /
RMAN> restore controlfile to '+ORADATA' from '+ORADATA/RAC00/controlfile/current.240.737948655' ; # this will create 2th controlfile
note:
We are only specifying the name of the diskgroup, so Oracle will create an OMF (Oracle Managed File). Use ASMCMD or sqlplus to identify the name assigned to the controlfile or rman restore log .
6) Checking those file create or not follow setp 4 and use ls command
# asmcmd -p
ASMCMD> cd ORADATA/RAC00/CONTROLFILE/
ASMCMD [+ORADATA/RAC00/controlfile] > ls
Current.240.737948655
CONTROLFILE UNPROT FINE AUG 03 18:00:00 Y current.1026.790368247
note:
As you can see We have new 1 controlfile "current.1026.790368247"
7) On node1 Set DB env. Modify the control_file parameter in spifle .than:
sqlplus “/as sysdba”
SQL> alter system set control_files='+ORADATA/RAC00/controlfile/current.240.737948655','+ORADATA/RAC00/controlfile/current.1026.790368247' scope=spfile sid='*';
SQL> shutdown immediate
8) Start your db
srvctl start database -d anbob
Summary:
Of course, you can use create a directory and copy confile using dbms_file_transfer.copy_file too. or using rman COPY CURRENT CONTROLFILE TO ''.
Reference:
How to duplicate a controlfile when ASM is involved [ID 345180.1]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




