Saturday, 19 March 2016

MOVING CONTROLFILES IN ASM

MOVING CONTROLFILES TO DIFFERENT LOCATION IN ASM


1) BACKUP YOUR SPFILE and CONTROLFILE
SQL> !rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Mar 18 01:00:19 2016

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL1 (DBID=1291218066)

RMAN> backup spfile;

Starting backup at 18-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=49 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 18-MAR-16
channel ORA_DISK_1: finished piece 1 at 18-MAR-16
piece handle=+DATA/orcl1/backupset/2016_03_18/nnsnf0_tag20160318t094509_0.292.906803113 tag=TAG20160318T094509 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 18-MAR-16

RMAN> backup current controlfile;

Starting backup at 18-MAR-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 18-MAR-16
channel ORA_DISK_1: finished piece 1 at 18-MAR-16
piece handle=+DATA/orcl1/backupset/2016_03_18/ncnnf0_tag20160318t094558_0.293.906803163 tag=TAG20160318T094558 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 18-MAR-16

Starting Control File and SPFILE Autobackup at 18-MAR-16
piece handle=+DATA/orcl1/autobackup/2016_03_18/s_906803165.294.906803169 comment=NONE
Finished Control File and SPFILE Autobackup at 18-MAR-16

RMAN>


2) IDENTIFY THE CONTROLFILE LOCATION
RMAN> exit
Recovery Manager complete.

SQL> show parameter control_files

NAME                                        TYPE      VALUE
-------------------------------- ----------- ------------------------------
control_files                            string               +DATA/orcl1/controlfile/current.267.906768595       

                +DATA/orcl1/controlfile/current.272.906768603


3) SHUTDOWN YOUR DATABASE AND BRING IT IN NOMOUNT MODE

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                                1336232 bytes
Variable Size                        142609496 bytes
Database Buffers               163577856 bytes
Redo Buffers                         6336512 bytes

SQL> alter system set control_files='+DATA’ scope=spfile;
System altered.


4) SHUTDOWN YOUR DATABASE & AGAIN START IN NOMOUNT
SQL> shutdown immediate
SQL>startup nomount

Note:  you need to specify your original copy of the control file for restoring

SQL> !  rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Mar 18 01:09:15 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL1 (not mounted)

RMAN> restore controlfile from '+DATA/orcl1/autobackup/2016_03_18/s_906803165.294.906803169' ;

Starting restore at 18-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
output file name=+DATA/orcl1/controlfile/current.295.906803541
Finished restore at 18-MAR-16

RMAN> alter database mount;
Database altered.


SQL> show parameter control_files

NAME                                      TYPE        VALUE
-------------------------------  ----------- ------------------------------
control_files                            string       +DATA/orcl1/controlfile/current.295.906803541

SQL> alter database open;
Database altered.

SQL>



                                                                                                                                                See Also.. How to Move Tablespace within DISKS in ASM

                                                                                                                                                


No comments:

Post a Comment