首页 » ORACLE 9i-23c » How to duplicate or multiplex control files on ASM ?(复制控制文件)

How to duplicate or multiplex control files on ASM ?(复制控制文件)

ON single-instance

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]

打赏

,

对不起,这篇文章暂时关闭评论。