WE CAN SEE HERE THAT WE HAVE 3 CONTROLFILE IN /u01
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 12 11:57:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
---------------------------------------------------
/u01/app/oracle/oradata/shoaibdb/control01.ctl
/u01/app/oracle/oradata/shoaibdb/control02.ctl
/u01/app/oracle/oradata/shoaibdb/control03.ctl
SQL> show parameter spfile
NAME TYPE VALUE
------ ------- ----------------------------------------------------------
spfile string /u01/app/oracle/product/10.2.0/db_1/dbs/spfileshoaibdb.ora
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/shoaibdb/c
ontrol01.ctl, /u01/app/oracle/
oradata/shoaibdb/control02.ctl, /u
01/app/oracle/oradata/shoaibdb/con
trol03.ctl
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
NOW WE WILL TAKE THE BACKUP OF THE DATABASE AND CONTROLFILE
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:34:36 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (DBID=563191061)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_shoaibdb.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 12-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/shoaibdb/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/shoaibdb/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/shoaibdb/rmans01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/shoaibdb/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/shoaibdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 12-AUG-12
channel ORA_DISK_1: finished piece 1 at 12-AUG-12
piece handle=/u01/app/oracle/flash_recovery_area/shoaibdb/backupset/2012_08_12/o1_mf_nnndf_TAG20120812T123853_82gon5tp_.bkp tag=TAG20120812T123853 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 12-AUG-12
Starting Control File and SPFILE Autobackup at 12-AUG-12
piece handle=/u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-AUG-12
RMAN> exit
NOW WE WILL EDIT THE CONTROL_FILES INIT PARAMETER AND ADD THE 4th CONTROLFILE PATH OF THE ASM STORAGE
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 12 11:57:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> alter system set control_files='/u01/app/oracle/oradata/shoaibdb/control01.ctl','/u01/app/oracle/oradata/shoaibdb/control02.ctl','/u01/app/oracle/oradata/shoaibdb/control03.ctl','+DATA' scope=spfile;
System altered.
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
SQL>
SQL>
SQL> select status from v$instance;
STATUS
------------
STARTED
NOW USING THE RMAN WE WILL RESTORE THE CONTROLFILE FROM THE RMAN BACKUP TO THE ASM STORAGE
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:42:22 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (not mounted)
RMAN> restore controlfile from autobackup;
Starting restore at 12-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: shoaibdb
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u01/app/oracle/oradata/shoaibdb/control01.ctl
output filename=/u01/app/oracle/oradata/shoaibdb/control02.ctl
output filename=/u01/app/oracle/oradata/shoaibdb/control03.ctl
output filename=+DATA/shoaibdb/controlfile/current.256.791124165
Finished restore at 12-AUG-12
RMAN> exit
NOW WE WILL RECOVER THE DATABASE
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:49:16 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (DBID=563191061, not open)
RMAN> recover database;
Starting recover at 12-AUG-12
Starting implicit crosscheck backup at 12-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 12-AUG-12
Starting implicit crosscheck copy at 12-AUG-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 12-AUG-12
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 3 is already on disk as file /u01/app/oracle/oradata/shoaibdb/redo02.log
archive log filename=/u01/app/oracle/oradata/shoaibdb/redo02.log thread=1 sequence=3
media recovery complete, elapsed time: 00:00:01
Finished recover at 12-AUG-12
RMAN>
BACK ON THE SQLPLUS WE CAN SEE THAT WE HAVE MULTIPLEX THE CONTROLFILE AND THE 4th CONTROLFILE IS ADDED IN ASM
SQL> alter database open resetlogs;
Database altered.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/shoaibdb/control01.ctl
/u01/app/oracle/oradata/shoaibdb/control02.ctl
/u01/app/oracle/oradata/shoaibdb/control03.ctl
+DATA/shoaibdb/controlfile/current.256.791124165
SQL>
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 12 11:57:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
---------------------------------------------------
/u01/app/oracle/oradata/shoaibdb/control01.ctl
/u01/app/oracle/oradata/shoaibdb/control02.ctl
/u01/app/oracle/oradata/shoaibdb/control03.ctl
SQL> show parameter spfile
NAME TYPE VALUE
------ ------- ----------------------------------------------------------
spfile string /u01/app/oracle/product/10.2.0/db_1/dbs/spfileshoaibdb.ora
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/shoaibdb/c
ontrol01.ctl, /u01/app/oracle/
oradata/shoaibdb/control02.ctl, /u
01/app/oracle/oradata/shoaibdb/con
trol03.ctl
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
NOW WE WILL TAKE THE BACKUP OF THE DATABASE AND CONTROLFILE
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:34:36 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (DBID=563191061)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_shoaibdb.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> backup database;
Starting backup at 12-AUG-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/shoaibdb/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/shoaibdb/sysaux01.dbf
input datafile fno=00005 name=/u01/app/oracle/oradata/shoaibdb/rmans01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/shoaibdb/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/shoaibdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 12-AUG-12
channel ORA_DISK_1: finished piece 1 at 12-AUG-12
piece handle=/u01/app/oracle/flash_recovery_area/shoaibdb/backupset/2012_08_12/o1_mf_nnndf_TAG20120812T123853_82gon5tp_.bkp tag=TAG20120812T123853 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 12-AUG-12
Starting Control File and SPFILE Autobackup at 12-AUG-12
piece handle=/u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 12-AUG-12
RMAN> exit
NOW WE WILL EDIT THE CONTROL_FILES INIT PARAMETER AND ADD THE 4th CONTROLFILE PATH OF THE ASM STORAGE
[oracle@localhost ~]$ export ORACLE_SID=shoaibdb
[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Aug 12 11:57:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> alter system set control_files='/u01/app/oracle/oradata/shoaibdb/control01.ctl','/u01/app/oracle/oradata/shoaibdb/control02.ctl','/u01/app/oracle/oradata/shoaibdb/control03.ctl','+DATA' scope=spfile;
System altered.
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
SQL>
SQL>
SQL> select status from v$instance;
STATUS
------------
STARTED
NOW USING THE RMAN WE WILL RESTORE THE CONTROLFILE FROM THE RMAN BACKUP TO THE ASM STORAGE
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:42:22 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (not mounted)
RMAN> restore controlfile from autobackup;
Starting restore at 12-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: shoaibdb
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u01/app/oracle/oradata/shoaibdb/control01.ctl
output filename=/u01/app/oracle/oradata/shoaibdb/control02.ctl
output filename=/u01/app/oracle/oradata/shoaibdb/control03.ctl
output filename=+DATA/shoaibdb/controlfile/current.256.791124165
Finished restore at 12-AUG-12
RMAN> exit
NOW WE WILL RECOVER THE DATABASE
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Aug 12 12:49:16 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: shoaibdb (DBID=563191061, not open)
RMAN> recover database;
Starting recover at 12-AUG-12
Starting implicit crosscheck backup at 12-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 12-AUG-12
Starting implicit crosscheck copy at 12-AUG-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 12-AUG-12
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/shoaibdb/autobackup/2012_08_12/o1_mf_s_791123989_82goozc0_.bkp
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 3 is already on disk as file /u01/app/oracle/oradata/shoaibdb/redo02.log
archive log filename=/u01/app/oracle/oradata/shoaibdb/redo02.log thread=1 sequence=3
media recovery complete, elapsed time: 00:00:01
Finished recover at 12-AUG-12
RMAN>
BACK ON THE SQLPLUS WE CAN SEE THAT WE HAVE MULTIPLEX THE CONTROLFILE AND THE 4th CONTROLFILE IS ADDED IN ASM
SQL> alter database open resetlogs;
Database altered.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/shoaibdb/control01.ctl
/u01/app/oracle/oradata/shoaibdb/control02.ctl
/u01/app/oracle/oradata/shoaibdb/control03.ctl
+DATA/shoaibdb/controlfile/current.256.791124165
SQL>
No comments:
Post a Comment