For 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/TESTDB/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/TESTDB/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/TESTDB/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/TESTDB/controlfile/current.258.798205861”

7, restart instance and verify controlfile

shutdown immediate
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 TESTDB
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 [+ORADATA/RACTEST/controlfile] > ls
5) On node1 Set DB env. Use RMAN to duplicate the controlfile:

rman target /
RMAN> restore controlfile to ‘+ORADATA’ from ‘+ORADATA/RACTEST/controlfile/current.240.737948655’ ; # this will create 2th controlfile
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 [+ORADATA/RACTEST/controlfile] > ls
CONTROLFILE UNPROT FINE AUG 03 18:00:00 Y current.1026.790368247
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/RACTEST/controlfile/current.240.737948655′,’+ORADATA/RACTEST/controlfile/current.1026.790368247′ scope=spfile sid=’*’;

SQL> shutdown immediate
8) Start your db

srvctl start database -d RACTEST

  • January 18, 2017 | 21 views
  • Comments