facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Latest Post

Creating Physycal Standby With RMAN Recovery Option

Written By askMLabs on Monday, December 19, 2011 | 2:00 PM

In this article, I am going to explain step by step procedure to create a physical standby database using RMAN with database restore and recovery. We can also create physical standby database using RMAN duplicate, but in this article we are creating physical standby database without duplicate command.

  1. Backup primary database ( including archive logs)
  2. Backup controlfile for Standby database
  3. Copy created RMAN backups to standby server
  4. Modify init.ora parameters on primary and standby servers
  5. Configure listener.ora and tnsnames.ora on primary and standby
  6. Verify the connectivity on primary and standby
  7. Restore database on the standby server
  8. Recover database on the standby server
  9. Put the database in Managed Recovery mode on standby server


1. Backup Primary Database :

In this step we are backing up primary database including archive logs.

SQL> select name,user from v$database;
NAME      USER
--------- ------------------------------
ORCL      SYS


SQL> select GROUP#,THREAD#,MEMBERS,BYTES FROM V$LOG;
GROUP#    THREAD#    MEMBERS      BYTES
---------- ---------- ---------- ----------
1          1          1   52428800
2          1          1   52428800
3          1          1   52428800


SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
GROUP#      BYTES
---------- ----------
4   52428800
5   52428800
6   52428800
7   52428800


SQL> sho parameter spfile;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /home/oracle/app/oracle/produc
t/11.2.0/dbhome_2/dbs/spfileor
cl.ora
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmpri01 orcl]$ clear
[oracle@dgaskmpri01 orcl]$ rman target /


Recovery Manager: Release 11.2.0.2.0 - Production on Mon Nov 21 05:08:01 2011

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

connected to target database: ORCL (DBID=1229390655)

RMAN> run {
2> allocate channel t1 type disk format '/tmp/askm/%U';
3> backup database plus archivelog;
4> }


using target database control file instead of recovery catalog
allocated channel: t1
channel t1: SID=79 device type=DISK


Starting backup at 21-NOV-11
current log archived
channel t1: starting archived log backup set
channel t1: specifying archived log(s) in backup set
input archived log thread=1 sequence=370 RECID=10 STAMP=766832613
……………………………..


…………………………….

input archived log thread=1 sequence=443 RECID=137 STAMP=767436824
input archived log thread=1 sequence=444 RECID=138 STAMP=767436837
input archived log thread=1 sequence=445 RECID=139 STAMP=767436927
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/02ms6eba_1_1 tag=TAG20111121T050849 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:07
channel t1: starting archived log backup set
channel t1: specifying archived log(s) in backup set
input archived log thread=1 sequence=446 RECID=140 STAMP=767436935
input archived log thread=1 sequence=447 RECID=141 STAMP=767436937
input archived log thread=1 sequence=448 RECID=142 STAMP=767436952
input archived log thread=1 sequence=449 RECID=146 STAMP=767436985
input archived log thread=1 sequence=450 RECID=148 STAMP=767436997
input archived log thread=1 sequence=451 RECID=150 STAMP=767768458
input archived log thread=1 sequence=452 RECID=151 STAMP=767768928
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/03ms6ebi_1_1 tag=TAG20111121T050849 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-NOV-11


Starting backup at 21-NOV-11
channel t1: starting full datafile backup set
channel t1: specifying datafile(s) in backup set
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00001 name=/home/oracle/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/orcl/users01.dbf
input datafile file number=00003 name=/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00005 name=/home/oracle/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/orcl/APEX_1265209995679366.dbf
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/orcl/APEX_1246426611663638.dbf
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/04ms6ebl_1_1 tag=TAG20111121T050908 comment=NONE
channel t1: backup set complete, elapsed time: 00:09:36
channel t1: starting full datafile backup set
channel t1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/05ms6etl_1_1 tag=TAG20111121T050908 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:04
Finished backup at 21-NOV-11


Starting backup at 21-NOV-11
current log archived
channel t1: starting archived log backup set
channel t1: specifying archived log(s) in backup set
input archived log thread=1 sequence=453 RECID=152 STAMP=767769533
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/06ms6etu_1_1 tag=TAG20111121T051853 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-NOV-11
released channel: t1


RMAN>

2. Backup controlfile for Standby database :

RMAN> run {
2> allocate channel t1 type disk format '/tmp/askm/%U';
3> backup current controlfile for standby;
4> }


allocated channel: t1
channel t1: SID=79 device type=DISK


Starting backup at 21-NOV-11
channel t1: starting full datafile backup set
channel t1: specifying datafile(s) in backup set
including standby control file in backup set
channel t1: starting piece 1 at 21-NOV-11
channel t1: finished piece 1 at 21-NOV-11
piece handle=/tmp/askm/07ms6f0f_1_1 tag=TAG20111121T052015 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:02
Finished backup at 21-NOV-11
released channel: t1


RMAN>

3. Copy created RMAN backups to standby server  :

[root@dgaskmsby01 askm]# scp 192.168.1.34:/tmp/askm/* .
root@192.168.1.34's password:
01ms6eb2_1_1                                                                                                                          100%   29MB   1.5MB/s   00:19
02ms6eba_1_1                                                                                                                          100%   23MB   1.9MB/s   00:12
03ms6ebi_1_1                                                                                                                          100% 1292KB   1.3MB/s   00:00
04ms6ebl_1_1                                                                                                                          100% 1916MB   1.6MB/s   20:05
05ms6etl_1_1                                                                                                                          100% 9824KB   2.4MB/s   00:04
06ms6etu_1_1                                                                                                                          100% 2049KB   2.0MB/s   00:01
07ms6f0f_1_1                                                                                                                          100% 9792KB   3.2MB/s   00:03
[root@dgaskmsby01 askm]# ls -lrt
total 2039416
-rw-r----- 1 root root   30110720 Nov 21 05:21 01ms6eb2_1_1
-rw-r----- 1 root root    1322496 Nov 21 05:21 03ms6ebi_1_1
-rw-r----- 1 root root   23854080 Nov 21 05:21 02ms6eba_1_1
-rw-r----- 1 root root 2008809472 Nov 21 05:42 04ms6ebl_1_1
-rw-r----- 1 root root   10059776 Nov 21 05:42 05ms6etl_1_1
-rw-r----- 1 root root    2097664 Nov 21 05:42 06ms6etu_1_1
-rw-r----- 1 root root   10027008 Nov 21 05:42 07ms6f0f_1_1
[root@dgaskmsby01 askm]# chown oracle:oracle *
[root@dgaskmsby01 askm]# ls -lrt
total 2039416
-rw-r----- 1 oracle oracle   30110720 Nov 21 05:21 01ms6eb2_1_1
-rw-r----- 1 oracle oracle    1322496 Nov 21 05:21 03ms6ebi_1_1
-rw-r----- 1 oracle oracle   23854080 Nov 21 05:21 02ms6eba_1_1
-rw-r----- 1 oracle oracle 2008809472 Nov 21 05:42 04ms6ebl_1_1
-rw-r----- 1 oracle oracle   10059776 Nov 21 05:42 05ms6etl_1_1
-rw-r----- 1 oracle oracle    2097664 Nov 21 05:42 06ms6etu_1_1
-rw-r----- 1 oracle oracle   10027008 Nov 21 05:42 07ms6f0f_1_1
[root@dgaskmsby01 askm]# chmod 660 *
[root@dgaskmsby01 askm]# ls -lrt
total 2039416
-rw-rw---- 1 oracle oracle   30110720 Nov 21 05:21 01ms6eb2_1_1
-rw-rw---- 1 oracle oracle    1322496 Nov 21 05:21 03ms6ebi_1_1
-rw-rw---- 1 oracle oracle   23854080 Nov 21 05:21 02ms6eba_1_1
-rw-rw---- 1 oracle oracle 2008809472 Nov 21 05:42 04ms6ebl_1_1
-rw-rw---- 1 oracle oracle   10059776 Nov 21 05:42 05ms6etl_1_1
-rw-rw---- 1 oracle oracle    2097664 Nov 21 05:42 06ms6etu_1_1
-rw-rw---- 1 oracle oracle   10027008 Nov 21 05:42 07ms6f0f_1_1


4. Modify init.ora parameters on primary and standby servers  :

On Primary :

DB_NAME=orcl
DB_UNIQUE_NAME=orcl
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,sbyorcl)'
LOG_ARCHIVE_DEST_1='LOCATION=/home/oracle/app/oracle/flash_recovery_area/orcl/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'
LOG_ARCHIVE_DEST_2='SERVICE=sbyorcl ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sbyorcl'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=sbyorcl
DB_FILE_NAME_CONVERT='sbyorcl','orcl'
LOG_FILE_NAME_CONVERT='/home/oracle/app/oracle/flash_recovery_area/sbyorcl/','/home/oracle/app/oracle/flash_recovery_area/orcl/'
STANDBY_FILE_MANAGEMENT=AUTO


On Standby :

DB_NAME=orcl
DB_UNIQUE_NAME=sbyorcl
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,sbyorcl)'
CONTROL_FILES='/home/oracle/app/oracle/oradata/sbyorcl/s_control01.ctl', '/home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl'
DB_FILE_NAME_CONVERT='orcl','sbyorcl'
LOG_FILE_NAME_CONVERT='/home/oracle/app/oracle/flash_recovery_area/orcl/','/home/oracle/app/oracle/flash_recovery_area/sbyorcl/'
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_DEST_1='LOCATION=/home/oracle/app/oracle/flash_recovery_area/sbyorcl/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=sbyorcl'
LOG_ARCHIVE_DEST_2='SERVICE=orcl ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=orcl


5. Configure listener.ora and tnsnames.ora on primary and standby :

On Primary :

[oracle@dgaskmpri01 admin]$ cat listener.ora
LISTENER_PRI =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
)
)


SID_LIST_LISTENER_PRI =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = orcl)
)
)
[oracle@dgaskmpri01 admin]$ cat tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=orcl)
)
)


sbyorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=sbyorcl)
)
)
[oracle@dgaskmpri01 admin]$


On Standby :

[oracle@dgaskmsby01 admin]$ cat listener.ora
LISTENER_SBY =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
)
)


SID_LIST_LISTENER_SBY =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = sbyorcl)
)
)
[oracle@dgaskmsby01 admin]$ cat tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=orcl)
)
)


sbyorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=sbyorcl)
)
)
[oracle@dgaskmsby01 admin]$


6. Verify the connectivity on primary and standby :

On Primary Server:[oracle@dgaskmpri01]$ lsnrctl stop LISTENER_PRI
[oracle@dgaskmpri01]$ lsnrctl start LISTENER_PRI
[oracle@dgaskmpri01]$ tnsping orcl
[oracle@dgaskmpri01]$ tnsping sbyorcl
[oracle@dgaskmpri01]$ sqlplus sys/xxxxx@orcl
[oracle@dgaskmpri01]$ sqlplus sys/xxxxx@sbyorcl


On Standby Server:[oracle@dgaskmsby01]$ lsnrctl stop LISTENER_SBY
[oracle@dgaskmsby01]$ lsnrctl start LISTENER_SBY
[oracle@dgaskmsby01]$ tnsping orcl
[oracle@dgaskmsby01]$ tnsping sbyorcl
[oracle@dgaskmsby01]$ sqlplus sys/xxxxx@orcl
[oracle@dgaskmsby01]$ sqlplus
sys/xxxxx@sbyorcl

7. Restore database on the standby server :

[oracle@dgaskmsby01 dbs]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Mon Nov 21 05:47:02 2011

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

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     456146944 bytes

Fixed Size                     1344840 bytes
Variable Size                322964152 bytes
Database Buffers             125829120 bytes
Redo Buffers                   6008832 bytes


RMAN> set dbid=1229390655;  ( Get dbid from primary database using select dbid from v$database )

executing command: SET DBID

RMAN> restore standby controlfile from '/tmp/askm/07ms6f0f_1_1'; (find controlfile backup using “list backup of controlfile”)

Starting restore at 21-NOV-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK


channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/home/oracle/app/oracle/oradata/sbyorcl/s_control01.ctl
output file name=/home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl
Finished restore at 21-NOV-11


RMAN> sql 'alter database mount standby database';

sql statement: alter database mount standby database
released channel: ORA_DISK_1


RMAN> restore database;

Starting restore at 21-NOV-11
Starting implicit crosscheck backup at 21-NOV-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=70 device type=DISK
Crosschecked 6 objects
Finished implicit crosscheck backup at 21-NOV-11


Starting implicit crosscheck copy at 21-NOV-11
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 21-NOV-11


searching for all files in the recovery area
cataloging files...
no files cataloged


using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oracle/app/oracle/oradata/sbyorcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/oracle/app/oracle/oradata/sbyorcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/oracle/app/oracle/oradata/sbyorcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/oracle/app/oracle/oradata/sbyorcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/oracle/app/oracle/oradata/sbyorcl/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /home/oracle/app/oracle/oradata/sbyorcl/APEX_1246426611663638.dbf
channel ORA_DISK_1: restoring datafile 00007 to /home/oracle/app/oracle/oradata/sbyorcl/APEX_1265209995679366.dbf
channel ORA_DISK_1: reading from backup piece /tmp/askm/04ms6ebl_1_1
channel ORA_DISK_1: piece handle=/tmp/askm/04ms6ebl_1_1 tag=TAG20111121T050908
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:06:43
Finished restore at 21-NOV-11


RMAN>

8. Recover database on the standby server :

In the recovery we need to recover database till the sequence number that we backed up on primary. So we first need to find out the sequence until which we need to recover database. As we got the controlfile on standby server from primary, it contains the archive log information.

RMAN> list backup of archivelog all;

List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1       28.72M     DISK        00:00:04     21-NOV-11
BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20111121T050849
Piece Name: /tmp/askm/01ms6eb2_1_1


  List of Archived Logs in backup set 1
Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
---- ------- ---------- --------- ---------- ---------
1    370     8283932    10-NOV-11 8294856    10-NOV-11
1    371     8294856    10-NOV-11 8295635    15-NOV-11
1    372     8295635    15-NOV-11 8295841    15-NOV-11
1    373     8295841    15-NOV-11 8299622    15-NOV-11
1    374     8299622    15-NOV-11 8299779    15-NOV-11
1    375     8299779    15-NOV-11 8299786    15-NOV-11
1    376     8299786    15-NOV-11 8300508    15-NOV-11
1    377     8300508    15-NOV-11 8303447    16-NOV-11
1    378     8303447    16-NOV-11 8303644    16-NOV-11
1    379     8303644    16-NOV-11 8304443    16-NOV-11
1    380     8304443    16-NOV-11 8306427    16-NOV-11
1    381     8306427    16-NOV-11 8311445    16-NOV-11


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
2       22.75M     DISK        00:00:04     21-NOV-11
BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20111121T050849
Piece Name: /tmp/askm/02ms6eba_1_1


  List of Archived Logs in backup set 2
Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
---- ------- ---------- --------- ---------- ---------
1    382     8311445    16-NOV-11 8331453    16-NOV-11
1    383     8331453    16-NOV-11 8331456    16-NOV-11
1    384     8331456    16-NOV-11 8331535    16-NOV-11
1    385     8331535    16-NOV-11 8331848    16-NOV-11
1    386     8331848    16-NOV-11 8331991    16-NOV-11
1    387     8331991    16-NOV-11 8332501    16-NOV-11
1    388     8332501    16-NOV-11 8352510    16-NOV-11
1    389     8352510    16-NOV-11 8352513    16-NOV-11
1    390     8352513    16-NOV-11 8352520    16-NOV-11
1    391     8352520    16-NOV-11 8352812    16-NOV-11
1    392     8352812    16-NOV-11 8352893    16-NOV-11
1    393     8352893    16-NOV-11 8356299    16-NOV-11
1    394     8356299    16-NOV-11 8356573    16-NOV-11
1    395     8356573    16-NOV-11 8359371    16-NOV-11
1    396     8359371    16-NOV-11 8359432    16-NOV-11
1    397     8359432    16-NOV-11 8359877    17-NOV-11
1    398     8359877    17-NOV-11 8359922    17-NOV-11
1    399     8359922    17-NOV-11 8360248    17-NOV-11
1    400     8360248    17-NOV-11 8360292    17-NOV-11
1    401     8360292    17-NOV-11 8360731    17-NOV-11
1    402     8360731    17-NOV-11 8361395    17-NOV-11
1    403     8361395    17-NOV-11 8381405    17-NOV-11
1    404     8381405    17-NOV-11 8381408    17-NOV-11
1    405     8381408    17-NOV-11 8381599    17-NOV-11
1    406     8381599    17-NOV-11 8381636    17-NOV-11
1    407     8381636    17-NOV-11 8384663    17-NOV-11
1    408     8384663    17-NOV-11 8384724    17-NOV-11
1    409     8384724    17-NOV-11 8384813    17-NOV-11
1    410     8384813    17-NOV-11 8405084    17-NOV-11
1    411     8405084    17-NOV-11 8405087    17-NOV-11
1    412     8405087    17-NOV-11 8405116    17-NOV-11
1    413     8405116    17-NOV-11 8405193    17-NOV-11
1    414     8405193    17-NOV-11 8405410    17-NOV-11
1    415     8405410    17-NOV-11 8405440    17-NOV-11
1    416     8405440    17-NOV-11 8408755    17-NOV-11
1    417     8408755    17-NOV-11 8408924    17-NOV-11
1    418     8408924    17-NOV-11 8409211    17-NOV-11
1    419     8409211    17-NOV-11 8409218    17-NOV-11
1    420     8409218    17-NOV-11 8409575    17-NOV-11
1    421     8409575    17-NOV-11 8409813    17-NOV-11
1    422     8409813    17-NOV-11 8410578    17-NOV-11
1    423     8410578    17-NOV-11 8430587    17-NOV-11
1    424     8430587    17-NOV-11 8430590    17-NOV-11
1    425     8430590    17-NOV-11 8430598    17-NOV-11
1    426     8430598    17-NOV-11 8430913    17-NOV-11
1    427     8430913    17-NOV-11 8431165    17-NOV-11
1    428     8431165    17-NOV-11 8431186    17-NOV-11
1    429     8431186    17-NOV-11 8432049    17-NOV-11
1    430     8432049    17-NOV-11 8452060    17-NOV-11
1    431     8452060    17-NOV-11 8452063    17-NOV-11
1    432     8452063    17-NOV-11 8452070    17-NOV-11
1    433     8452070    17-NOV-11 8452190    17-NOV-11
1    434     8452190    17-NOV-11 8452423    17-NOV-11
1    435     8452423    17-NOV-11 8452439    17-NOV-11
1    436     8452439    17-NOV-11 8453802    17-NOV-11
1    437     8453802    17-NOV-11 8454030    17-NOV-11
1    438     8454030    17-NOV-11 8454220    17-NOV-11
1    439     8454220    17-NOV-11 8474230    17-NOV-11
1    440     8474230    17-NOV-11 8474233    17-NOV-11
1    441     8474233    17-NOV-11 8474463    17-NOV-11
1    442     8474463    17-NOV-11 8474511    17-NOV-11
1    443     8474511    17-NOV-11 8474680    17-NOV-11
1    444     8474680    17-NOV-11 8474693    17-NOV-11
1    445     8474693    17-NOV-11 8494871    17-NOV-11


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
3       1.26M      DISK        00:00:01     21-NOV-11
BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20111121T050849
Piece Name: /tmp/askm/03ms6ebi_1_1


  List of Archived Logs in backup set 3
Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
---- ------- ---------- --------- ---------- ---------
1    446     8494871    17-NOV-11 8494874    17-NOV-11
1    447     8494874    17-NOV-11 8494901    17-NOV-11
1    448     8494901    17-NOV-11 8495084    17-NOV-11
1    449     8495084    17-NOV-11 8495266    17-NOV-11
1    450     8495266    17-NOV-11 8495280    17-NOV-11
1    451     8495280    17-NOV-11 8496187    21-NOV-11
1    452     8496187    21-NOV-11 8497172    21-NOV-11


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6       2.00M      DISK        00:00:00     21-NOV-11
BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20111121T051853
Piece Name: /tmp/askm/06ms6etu_1_1


  List of Archived Logs in backup set 6
Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
---- ------- ---------- --------- ---------- ---------
1    453     8497172    21-NOV-11 8498444    21-NOV-11


RMAN>

The last sequence number from the above session log is 453. So we need to recover database on standby untill sequence number 454.

RMAN> recover database until sequence 454;

Starting recover at 21-NOV-11
using channel ORA_DISK_1


starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=453
channel ORA_DISK_1: reading from backup piece /tmp/askm/06ms6etu_1_1
channel ORA_DISK_1: piece handle=/tmp/askm/06ms6etu_1_1 tag=TAG20111121T051853
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archived log file name=/home/oracle/app/oracle/flash_recovery_area/sbyorcl/1_453_701609923.arc thread=1 sequence=453
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/home/oracle/app/oracle/oradata/sbyorcl/system01.dbf'


media recovery complete, elapsed time: 00:00:10
Finished recover at 21-NOV-11


RMAN> exit

If you get any warnings, ( something like we got in the above session log) , we can ignore it.

9. Put the database in Managed Recovery mode on standby server :

[oracle@dgaskmsby01 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Mon Nov 21 05:59:36 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Database altered.

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY TO PRIMARY


SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Verify on the Primary :

[oracle@dgaskmpri01 askm]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Mon Nov 21 06:01:51 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          RESOLVABLE GAP


SQL>

SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          TO STANDBY


SQL>

This is how we will create physical standby database with RMAN recovery option. I am going to explain in my next article the process of creating a physical standby database with RMAN duplicate option.

References : 469493.1

Hope it helps

SRI

Creating A Dataguard Broker Configuration Using DGMGRL

Written By askMLabs on Tuesday, December 13, 2011 | 2:25 PM

In this article we will see step by step instructions on how to configure dataguard broker configuration using DGMGRL utility. The dataguard broker makes it easy to maintain and administer several standby databases. Dataguard broker maintains its own configuration files and runs a background process DMON both on primary and standby database servers. Dataguard broker configuration can be created using either OEM grid control or using a command line utility DGMGRL. In the present article we are using DGMGRL to create dataguard broker configuration to maintain standby databases.

Setup:

Primary Site
Standby Site
Hostname
dgaskmpri01
dgaskmsby01
Database Name
orcl
orcl
Database Unique Name
orcl
sbyorcl
Net Service Name
orcl
sbyorcl

  1. Prepare Primary Site ( Modify init.ora and listener.ora ) 
  2. Prepare Standby site ( Modify init.ora and listener.ora ) 
  3. Create Dataguard configuration 
  4. Adding Standby Database 
  5. Verify the Configuration 
  6. Enable Configuration 
  7. Verifying Configuration With Switchover 
  8. Monitoring DataGuard Broker Configuration

Prepared By SRI

1.Prepare Primary Site :
Init.ora Changes: DB_BROKER_CONFIG_FILEn parameter is used to specify the location of the dataguard configuration. DG_BROKER_START parameter is used to start the broker automatically when the instance starts.
SQL> alter system set dg_broker_config_file1='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr1orcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_config_file2='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr2orcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_start=true  sid='*';
System altered.
Listener.ora Changes : GLOBAL_DBNAME attribute value should be set as shown in the following listener.ora configuraiton on primary site otherwise you will get TNS-12154 error during switch over configuration. A service with name <sid>_DGMGRL will be started when the listener is started.
[oracle@dgaskmpri01 admin]$ cat listener.ora 
LISTENER_PRI = 
  (DESCRIPTION_LIST = 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525)) 
    ) 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525)) 
    ) 
  )

SID_LIST_LISTENER_PRI = 
  (SID_LIST = 
    (SID_DESC = 
      (GLOBAL_DBNAME = orcl_DGMGRL.localdomain) 
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2) 
      (SID_NAME = orcl) 
      (SERVICE_NAME = orcl.localdomain) 
    ) 
  ) 
[oracle@dgaskmpri01 admin]$
2. Prepare Standby site:
Init.ora Changes:
SQL> alter system set dg_broker_config_file1='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr1sbyorcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_config_file2='/home/oracle/app/oracle/product/11.2.0/dbhome_2/dbs/dr2sbyorcl.dat' sid='*';
System altered.
SQL> alter system set dg_broker_start=true  sid='*';
System altered.
Listener.ora Changes:
[oracle@dgaskmsby01 admin]$ cat listener.ora
LISTENER_SBY = 
  (DESCRIPTION_LIST = 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525)) 
    ) 
    (DESCRIPTION = 
      (ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525)) 
    ) 
  )

SID_LIST_LISTENER_SBY = 
  (SID_LIST = 
    (SID_DESC = 
      (GLOBAL_DBNAME = sbyorcl_DGMGRL.localdomain) 
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2) 
      (SID_NAME = sbyorcl) 
      (SERVICE_NAME = sbyorcl.localdomain) 
    ) 
  ) 
[oracle@dgaskmsby01 admin]$

3. Create Dataguard configuration:
On the primary Database Server connect to database using DGMGRL utility.
[oracle@dgaskmpri01 dbs]$ dgmgrl 
DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> CREATE CONFIGURATION 'askm_config' AS PRIMARY DATABASE IS 'orcl' CONNECT IDENTIFIER IS orcl; 
Configuration "askm_config" created with primary database "orcl"
DGMGRL> show configuration;
Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl - Primary database

Fast-Start Failover: DISABLED
Configuration Status: 
DISABLED
DGMGRL>
In the created configuration command,
askm_config = It is the name of the configuration. And it can be anything that your choice.
Primary Database is ‘orcl’ = Here ‘orcl’ is primary database db_unique_name value
Connect Identifier is ‘orcl’ = Here ‘orcl’ is alias name defined in tnsnames.ora to connect to primary database.
4. Adding Standby Databas:
DGMGRL> ADD DATABASE 'sbyorcl' AS CONNECT IDENTIFIER IS sbyorcl MAINTAINED AS PHYSICAL;
Database "sbyorcl" added 
DGMGRL> show configuration;
Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl    - Primary database
    sbyorcl - Physical standby database

Fast-Start Failover: DISABLED
Configuration Status: 
DISABLED
DGMGRL>
6. Enable Configuration:
DGMGRL> help enable configuration;
Enables a configuration, a database, or fast-start failover
Syntax:
  ENABLE CONFIGURATION;
  ENABLE DATABASE <database name>;
  ENABLE FAST_START FAILOVER [CONDITION <condition>];
DGMGRL> enable configuration; 
Enabled.
DGMGRL> show configuration;

Configuration - askm_config
  Protection Mode: MaxPerformance 
  Databases:
    orcl    - Primary database
    sbyorcl - Physical standby database

Fast-Start Failover: DISABLED
Configuration Status: 
SUCCESS
DGMGRL>
7. Verifying Configuration With Switchover:
[oracle@dgaskmpri01 dbs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> switchover to 'sbyorcl';
Performing switchover NOW, please wait...
New primary database "sbyorcl" is opening...
Operation requires shutdown of instance "orcl" on database "orcl"
Shutting down instance "orcl"...
ORACLE instance shut down.
Operation requires startup of instance "orcl" on database "orcl"
Starting instance "orcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "sbyorcl"
DGMGRL>

DGMGRL> exit 
[oracle@dgaskmpri01 dbs]$ clear
[oracle@dgaskmpri01 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 17 08:54:54 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to: 
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS 
--------------- -------------------- PHYSICAL STANDBY NOT ALLOWED
SQL> exit 
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmpri01 dbs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information. 
DGMGRL> connect sys/oracle
Connected.
DGMGRL> switchover to 'orcl';
Performing switchover NOW, please wait...
New primary database "orcl" is opening...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "orcl"
DGMGRL> exit
[oracle@dgaskmpri01 dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Thu Nov 17 08:56:46 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to: 
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS 
---------------- -------------------- PRIMARY          TO STANDBY
SQL> 

8. Monitoring DataGuard Broker Configuration:
DGMGRL> help DGMGRL> show configuration;
DGMGRL> edit database "orcl" set property LogXptMode='SYNC';
DGMGRL> show database 'orcl' 'LogXptStatus';
DGMGRL> edit configuration set protection mode as MaxAvailability;
DGMGRL> enable fast_start failover; DGMGRL> show database 'orcl';
DGMGRL> enable database 'orcl'; DGMGRL> remove configuration;
DGMGRL> show database verbose orcl;
DGMGRL> show database orcl InconsistentProperties
DGMGRL> show database 'orcl' 'StatusReport';

Reference :
http://docs.oracle.com/cd/B12037_01/server.101/b10822/cli.htm
Setup and maintenance of Data Guard Broker using DGMGRL [ID 201669.1]
10g DGMGRL CLI Configuration [ID 260112.1]
Unable To Recreate Data Guard Fast Start Failover Configuration With DGMGRL [ID 454418.1]
Creating a configuration using Data Guard Manager [ID 214071.1]
Interaction Between the Data Guard Broker and a Data Guard Configuration [ID 249703.1]
http://www.izzysoft.de/oracle/ifaqmaker.php?id=7;toc=1

Hope It Helps
SRI


Data Guard Switch Over With DGMGRL and SQL*PLUS

Written By askMLabs on Wednesday, December 7, 2011 | 5:16 PM

In this article I am going to explain the step by step instructions to do switchover in standby setup with data guard broker configuration command line utility (DGMGRL) and with sql commands.
To present this article, I assume that I already have a physical standby setup and data guard broker is also configured to administer standby setup. Please follow my other articles on how to setup physical standby database and how to configure data guard broker configuration.
Before performing switchover, make sure your physical standby database is running with no large redo gaps and delay time is set to 0.
Verifying that there is no large redo gaps :
On Primary :
[oracle@dgaskmpri01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 26 10:37:36 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          TO STANDBY

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence     409
Next log sequence to archive   411
Current log sequence           411
SQL>

On Standby :
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 26 10:38:11 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY NOT ALLOWED

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
Oldest online log sequence     409
Next log sequence to archive   0
Current log sequence           411
SQL>


Then do some log switches on primary to verify if they are transferred and applied immediately to the standby side or not.
On Primary :
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence     411
Next log sequence to archive   413
Current log sequence           413
SQL>

On Standby :
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
Oldest online log sequence     411
Next log sequence to archive   0
Current log sequence           413
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

  SEQUENCE# APPLIED
---------- ---------

………
       409 YES
       410 YES
       411 YES
       412 IN-MEMORY

48 rows selected.
SQL>

SwitchOver With DGMGRL:
SwitchOver with DGMGRL is a very simple and single command. “switchover to ‘<DB_UNIQUE_NAME>’. When connecting to database using DGMGRL you need to use username and password instead of OS authentication. ( Don’t use connect / ). This is because during switchover operations the new standby database may not start due to OS authentication on the other server.
[oracle@dgaskmpri01 ~]$ dgmgrl DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle Connected.
DGMGRL> show configuration;

Configuration - askm_config
  Protection Mode: MaxPerformance
  Databases:
    orcl    - Primary database
    sbyorcl - Physical standby database

Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

DGMGRL> switchover to 'sbyorcl'; Performing switchover NOW, please wait...
New primary database "sbyorcl" is opening...
Operation requires shutdown of instance "orcl" on database "orcl"
Shutting down instance "orcl"...
ORACLE instance shut down.
Operation requires startup of instance "orcl" on database "orcl"
Starting instance "orcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "sbyorcl"
DGMGRL> switchover to 'orcl'; Performing switchover NOW, please wait...
New primary database "orcl" is opening...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "orcl"
DGMGRL> exit
[oracle@dgaskmpri01 ~]$


SwithOver With SQLPLUS :
Switchover operation with sqlplus will be performed by executing sqlplus commands in the same sequence as shown below.
SQL> alter database commit to switchover to standby with session shutdown; => On Primary Database
SQL> alter database commit to switchover to primary with session shutdown; => On Standby Database
SQL> alter database open; => On Primary Database ( Old Standby )
SQL> shut abort => On Standby Database ( Old Primary )
SQL> startup mount => On Standby Database ( Old Primary )
SQL> alter database recover managed standby database using current logfile disconnect from session; => On Standby Database ( Old Primary )

On Primary :
[oracle@dgaskmpri01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 26 10:44:53 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          TO STANDBY

SQL> alter database commit to switchover to standby with session shutdown;
Database altered.
SQL>
On Standby :
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 26 10:45:21 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY NOT ALLOWED

SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY TO PRIMARY

SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL>
On Primary ( Old Standby ) :
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 26 10:45:21 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database open;
Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          FAILED DESTINATION

SQL>
On Standby ( Old Primary ) :
SQL> shut abort ORACLE instance shut down.
SQL> startup mount ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             390073016 bytes
Database Buffers           58720256 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Database altered.
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY NOT ALLOWED

SQL>

Reference :  1305019.1 and  1304939.1
Hope It Helps
SRI

Creating Physical Standby Controlfile

  1. Stop Managed Recovery Process On Standby Database
  2. Shutdown Standby Database
  3. Connect To Primary Database As SYS
  4. Create A New Physical Standby Controlfile From The Primary
  5. Copy Created Controlfile to Standby Server
  6. Mount Standby Database With Newly Created Controlfile
  7. Rename Datafiles ( Optional If db_file_name_convert and log_file_name_convert are specified)
  8. Create Standby Redo Logs ( Optional )
  9. Re-Enable Flashback
  10. Start Managed Recovery
On Standby Server :
STEP 1:
[oracle@dgaskmsby01 ~]$ clear
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sun Nov 27 10:09:21 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database recover managed standby database cancel;
Database altered.

STEP 2:
SQL> shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmsby01 ~]$ clear

On Primary Server :
STEP 3 : 
[oracle@dgaskmpri01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sun Nov 27 10:10:14 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

STEP 4:
SQL> alter database create standby controlfile as '/tmp/askm/askm_control01.ctl';
Database altered.

On Standby Server :
STEP 5 :
[oracle@dgaskmsby01 ~]$ cd /tmp/askm
[oracle@dgaskmsby01 askm]$ scp root@192.168.1.34:/tmp/askm/askm_control01.ctl .
root@192.168.1.34's password:
askm_control01.ctl                                                                                                                    100%   10MB   3.3MB/s   00:03
[oracle@dgaskmsby01 askm]$ grep -i controlfile $ORACLE_HOME/dbs/initsbyorcl.ora
*.control_files='/home/oracle/app/oracle/oradata/sbyorcl/s_control01.ctl','/home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl'#Restore Controlfile
[oracle@dgaskmsby01 askm]$ cp askm_control01.ctl /home/oracle/app/oracle/oradata/sbyorcl/s_control01.ctl
[oracle@dgaskmsby01 askm]$ cp askm_control01.ctl /home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl
STEP 6 :
[oracle@dgaskmsby01 askm]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sun Nov 27 10:12:55 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             348129976 bytes
Database Buffers          100663296 bytes
Redo Buffers                6008832 bytes
Database mounted.
STEP 9 :
SQL> alter database flashback off;
Database altered.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is active
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database flashback on;
Database altered.
STEP 10 :SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.

Reference :  459411.1

Hope It Helps
SRI

Creating A Physical Standby Database (11gR2)

Setup:




Primary Site


Standby Site


Hostname


dgaskmpri01


dgaskmsby01


Database Name


orcl


orcl


Database Unique Name


orcl


sbyorcl


Net Service Name


orcl


sbyorcl



Prepared By SRI



Prepared By SRI


Primary Site Preparation :
1.      Enable Database Force Logging
2.      Create SRL (Standby Redo Logs)
3.      Modify Init.ora parameters
4.      Enable Archiving
5.      Backup Primary Database
6.      Create a controlfile for Standby Database
7.      Create a init.ora file for Standby Database
8.      Configure listener.ora and tnsnames.ora
9.      Copy backups and configuration files to Standby Server

Standby Site Preparation :
1.      Create a remote login password file ( if it is not copied from primary site )
2.      Create a directory structure
3.      Modify the init.ora parameter file
4.      Configure listener.ora and tnsnames.ora
5.      Verify connectivity

Creating Physical Standby Database :
1.      Start the physical Standby Database
2.      Keep it in recovery

Verifications

Primary Site Preparation :
1. Enable Database Force Logging:
SQL> select FORCE_LOGGING from v$database;
SQL> ALTER DATABASE FORCE LOGGING;
2. Create SRL ( Standby Redo Logs):
You need to create SRL with the same size or greater size as of the online redo logs and also the number of SRLs should be one greater than the online redologs.

SQL> select name,user from v$database;
NAME USER
--------- ------------------------------
ORCL SYS
SQL> col group# for 9999
SQL> col member for a50
SQL> set linesize 120
SQL> select name,user from v$database;
NAME USER
--------- ------------------------------
ORCL SYS
SQL> select GROUP#,THREAD#,MEMBERS,BYTES FROM V$LOG;
GROUP# THREAD# MEMBERS BYTES
------ ---------- ---------- ----------
1 1 1 52428800
2 1 1 52428800
3 1 1 52428800
SQL> select group#,member from v$logfile;
GROUP# MEMBER
------ --------------------------------------------------
3 /home/oracle/app/oracle/oradata/orcl/redo03.log
2 /home/oracle/app/oracle/oradata/orcl/redo02.log
1 /home/oracle/app/oracle/oradata/orcl/redo01.log
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
no rows selected
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/home/oracle/app/oracle/oradata/orcl/s_redo01.log') SIZE 52428800;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/home/oracle/app/oracle/oradata/orcl/s_redo02.log') SIZE 52428800;
Database altered.
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
GROUP# BYTES
------ ----------
4 52428800
5 52428800
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/home/oracle/app/oracle/oradata/orcl/s_redo03.log') SIZE 52428800;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE ('/home/oracle/app/oracle/oradata/orcl/s_redo04.log') SIZE 52428800;
Database altered.
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
GROUP# BYTES
------ ----------
4 52428800
5 52428800
6 52428800
7 52428800
SQL>
3. Modify the init.ora parameters:
Modify the init.ora parameters on the primary database side to reflect the following values. If you are using spfile, you can add these parameter online without shutting down the primary database.
DB_NAME=orcl
DB_UNIQUE_NAME=orcl
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,sbyorcl)'LOG_ARCHIVE_DEST_1='LOCATION=/home/oracle/app/oracle/flash_recovery_area/orcl/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'LOG_ARCHIVE_DEST_2='SERVICE=sbyorcl ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sbyorcl'LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=sbyorcl
DB_FILE_NAME_CONVERT='sbyorcl','orcl'LOG_FILE_NAME_CONVERT='/home/oracle/app/oracle/flash_recovery_area/sbyorcl/','/home/oracle/app/oracle/flash_recovery_area/orcl/'STANDBY_FILE_MANAGEMENT=AUTO
4. Enable Archiving :

Make sure that your database is running in archive log mode. Because in a physical standby setup all the redologs generated on the primary database will be transferred to standby site and applied to the standby database.
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.
Total System Global Area 456146944 bytes
Fixed Size 1344840 bytes
Variable Size 381684408 bytes
Database Buffers 67108864 bytes
Redo Buffers 6008832 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;
Database altered.
SQL> ALTER DATABASE OPEN;
Database altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence 360
Next log sequence to archive 362
Current log sequence 362
SQL>

5.      Backup Primary Database :
In this demo I am using cold backup of the primary database. There are various other options like RMAN duplicate from active database to create physical standby database without even having the primary database backup in 11g. But in this article I am showing setup without RMAN and using simple sql commands.

Create a temporary directory (/tmp/askm/) on primary server and copy all the controlfile,online redolog files and database files to this location after shutting down the database.
6.      Create a controlfile for Standby Database:
SQL> startup mount
ORACLE instance started.
Total System Global Area 456146944 bytes
Fixed Size 1344840 bytes
Variable Size 381684408 bytes
Database Buffers 67108864 bytes
Redo Buffers 6008832 bytes
Database mounted.
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/askm/s_control01.ctl';
Database altered.
SQL> ALTER DATABASE OPEN;
Database altered.
7.  Create a init.ora file for Standby Database:
SQL> CREATE PFILE='/tmp/askm/initsbyorcl.ora' FROM SPFILE;
File created.

8. Configure listener.ora and tnsnames.ora:
[oracle@dgaskmpri01 admin]$ cat listener.ora
LISTENER_PRI =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
)
)
SID_LIST_LISTENER_PRI =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = orcl)
)
)
[oracle@dgaskmpri01 admin]$ cat tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=orcl)
)
)
sbyorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=sbyorcl)
)
)
[oracle@dgaskmpri01 admin]$



9.      Copy backups and configuration files to Standby Server:
Create a temporary directory(/tmp/askm) on standby server and copy coldbackup, init.ora, password file(orapwsbyorcl) and standby controlfile (s_control01.ctl) from primary server to standby server.

Standby Site Preparation :

1.      Create a remote login password file ( if it is not copied from primary site )

Copy the password file /tmp/askm/orapwsbyorcl to $ORACLE_HOME/dbs

2.      Create a directory structure

If you are using a different directory structure on the standby server, they you need to create all the directories on the standby site.

Then copy coldbackup to the appropriate locations on the standby server. Also copy init.ora to $ORACLE_HOME/dbs location.
[oracle@dgaskmsby01]$ mkdir /home/oracle/app/oracle/oradata/sbyorcl/
[oracle@dgaskmsby01]$ mkdir /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
[oracle@dgaskmsby01]$ cd $ORACLE_HOME/dbs
[oracle@dgaskmsby01 dbs]$ cd /home/oracle/app/oracle/oradata/sbyorcl/
[oracle@dgaskmsby01 sbyorcl]$ cp /tmp/askm/*.dbf .
[oracle@dgaskmsby01 sbyorcl]$ cp /tmp/askm/*.log .
[oracle@dgaskmsby01 sbyorcl]$ cp /tmp/askm/s_control01.ctl .
[oracle@dgaskmsby01 sbyorcl]$ cp /tmp/askm/s_control01.ctl /home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl
[oracle@dgaskmsby01 sbyorcl]$ cp /tmp/askm/initsbyorcl.ora $ORACLE_HOME/dbs

3. Modify the init.ora parameter file

Modify the initsbyorcl.ora file to reflect the following initialization parameters
DB_NAME=orcl
DB_UNIQUE_NAME=sbyorcl
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,sbyorcl)'CONTROL_FILES='/home/oracle/app/oracle/oradata/sbyorcl/s_control01.ctl', '/home/oracle/app/oracle/flash_recovery_area/sbyorcl/s_control02.ctl'DB_FILE_NAME_CONVERT='orcl','sbyorcl'LOG_FILE_NAME_CONVERT='/home/oracle/app/oracle/flash_recovery_area/orcl/','/home/oracle/app/oracle/flash_recovery_area/sbyorcl/'LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_DEST_1='LOCATION=/home/oracle/app/oracle/flash_recovery_area/sbyorcl/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=sbyorcl'LOG_ARCHIVE_DEST_2='SERVICE=orcl ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=orcl
4. Configure listener.ora and tnsnames.ora:
[oracle@dgaskmsby01 admin]$ cat listener.ora
LISTENER_SBY =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
)
)
SID_LIST_LISTENER_SBY =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = sbyorcl)
)
)
[oracle@dgaskmsby01 admin]$ cat tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmpri01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=orcl)
)
)
sbyorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgaskmsby01.localdomain)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=sbyorcl)
)
)
[oracle@dgaskmsby01 admin]$
5. Verify connectivity
On Primary Server:
[oracle@dgaskmpri01]$ lsnrctl stop LISTENER_PRI
[oracle@dgaskmpri01]$ lsnrctl start LISTENER_PRI
[oracle@dgaskmpri01]$ tnsping orcl
[oracle@dgaskmpri01]$ tnsping sbyorcl
[oracle@dgaskmpri01]$ sqlplus sys/xxxxx@orcl
[oracle@dgaskmpri01]$ sqlplus sys/xxxxx@sbyorcl
On Standby Server:
[oracle@dgaskmsby01]$ lsnrctl stop LISTENER_SBY
[oracle@dgaskmsby01]$ lsnrctl start LISTENER_SBY
[oracle@dgaskmsby01]$ tnsping orcl
[oracle@dgaskmsby01]$ tnsping sbyorcl
[oracle@dgaskmsby01]$ sqlplus sys/xxxxx@orcl
[oracle@dgaskmsby01]$ sqlplus sys/xxxxx@sbyorcl
Creating Physical Standby Database :
1.      Start the physical Standby Database:
SQL> startup mount
ORACLE instance started.
Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             381684408 bytes
Database Buffers           67108864 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL>
2.      Keep it in recovery:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Verifications :
On Standby:
SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

On Primary :
Do some redo log switches
SQL> ALTER SYSTEM SWITCH LOGFILE;
On Standby:
  Verify that the recent archived log file is shifted to standby side and applied with the following commands.
SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;



Other Useful Information:

To verify all the init.ora parameter in a single command:
egrep -i "DB_NAME|DB_UNIQUE_NAME|LOG_ARCHIVE_CONFIG|CONTROL_FILES|LOG_ARCHIVE_DEST_1|LOG_ARCHIVE_DEST_2|LOG_ARCHIVE_DEST_STATE_1|LOG_ARCHIVE_DEST_STATE_2|REMOTE_LOGIN_PASSWORDFILE|LOG_ARCHIVE_FORMAT|LOG_ARCHIVE_MAX_PROCESSES|FAL_SERVER|DB_FILE_NAME_CONVERT|LOG_FILE_NAME_CONVERT|STANDBY_FILE_MANAGEMENT" <specify init.ora parameter file>
To Cancel the Standby Recovery Mode:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Useful commands To Troubleshoot:
select message from v$dataguard_status where dest_id = 2;
select archived_thread#, archived_seq#, applied_thread#, applied_seq# from v$archive_dest_status;
select registrar, creator, thread#, sequence#, first_change#, next_change# from v$archived_log;
select thread#, sequence#, first_change#, next_change# from v$log_history;
To Verify Recover Process On Standby:
select thread#, sequence# from v$log where status='CURRENT'; = > On Primary
select thread#, sequence#, status from v$managed_standby where process='MRP0'; = > On Standby
References :
http://download.oracle.com/docs/cd/E11882_01/server.112/e25608/create_ps.htm#i63561
MOS ID :  249703.1

Hope It Helps

SRI

Deleting RMAN "NO EXPIRE" BACKUPS FROM TAPE

Written By askMLabs on Thursday, November 3, 2011 | 4:49 PM

The following steps are useful to delete the backups which are marked as NO-EXPIRE. No expire backup are the backups for which the retention policy will not apply and the backups remain till you manually and forcibly delete these backups.  The best example for No-expire backups are the backups kept for training purposes. After successfully creating any training environment, we will backup the database with NO-Expire option and these backups will be used to refresh the database every week.

The following commands show you how to delete these no-expire backups on tape from  RMAN CATALOG. This is useful in cases where if you made any changes to the databases and need to preseve these changes in the database forever, you will take new NO-EXPIRE backups and delete the old backups.

RMAN> list backup summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
145913  B  0  A SBT_TAPE    25-APR-11       1       1       YES        NOEXPIRE
145914  B  0  A SBT_TAPE    25-APR-11       1       1       YES        NOEXPIRE
145915  B  0  A SBT_TAPE    25-APR-11       1       1       YES        NOEXPIRE
145916  B  0  A SBT_TAPE    25-APR-11       1       1       YES        NOEXPIRE
145917  B  0  A SBT_TAPE    25-APR-11       1       1       YES        NOEXPIRE
147274  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147275  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147276  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147277  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147278  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147498  B  F  A SBT_TAPE    29-APR-11       1       1       NO         NOEXPIRE

RMAN> DELETE BACKUPSET 145913,145914,145915,145916,145917;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=522 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 05/01/2011 01:20:25
RMAN-06160: no backup pieces found for backup set key: 145913

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
released channel: ORA_DISK_1
allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: sid=522 devtype=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: Data Protection for Oracle: version 5.5.2.0
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
allocated channel: ORA_MAINT_SBT_TAPE_2
channel ORA_MAINT_SBT_TAPE_2: sid=525 devtype=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_2: Data Protection for Oracle: version 5.5.2.0
RMAN> DELETE BACKUPSET 145913,145914,145915,145916,145917;
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
145919  145913  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set9_piece1_copy1_20110425_09mal5t9_1_1
145920  145914  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set8_piece1_copy1_20110425_08mal5t9_1_1
145921  145915  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set11_piece1_copy1_20110425_0bmal6d9_1_1
145922  145916  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set7_piece1_copy1_20110425_07mal5t9_1_1
145923  145917  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set10_piece1_copy1_20110425_0amal6br_1_1
Do you really want to delete the above objects (enter YES or NO)? NO
RMAN> delete noprompt BACKUPSET 145913,145914,145915,145916,145917;
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
145919  145913  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set9_piece1_copy1_20110425_09mal5t9_1_1
145920  145914  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set8_piece1_copy1_20110425_08mal5t9_1_1
145921  145915  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set11_piece1_copy1_20110425_0bmal6d9_1_1
145922  145916  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set7_piece1_copy1_20110425_07mal5t9_1_1
145923  145917  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set10_piece1_copy1_20110425_0amal6br_1_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_MAINT_SBT_TAPE_1 channel at 05/01/2011 01:27:05
ORA-27191: sbtinfo2 returned error
Additional information: 2

RMAN> delete noprompt force BACKUPSET 145913,145914,145915,145916,145917;
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
145919  145913  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set9_piece1_copy1_20110425_09mal5t9_1_1
145920  145914  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set8_piece1_copy1_20110425_08mal5t9_1_1
145921  145915  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set11_piece1_copy1_20110425_0bmal6d9_1_1
145922  145916  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set7_piece1_copy1_20110425_07mal5t9_1_1
145923  145917  1   1   AVAILABLE   SBT_TAPE    backup_CRTRNG_3679252776_set10_piece1_copy1_20110425_0amal6br_1_1
deleted backup piece
backup piece handle=backup_CRTRNG_3679252776_set9_piece1_copy1_20110425_09mal5t9_1_1 recid=7 stamp=749377449
deleted backup piece
backup piece handle=backup_CRTRNG_3679252776_set8_piece1_copy1_20110425_08mal5t9_1_1 recid=8 stamp=749377449
deleted backup piece
backup piece handle=backup_CRTRNG_3679252776_set11_piece1_copy1_20110425_0bmal6d9_1_1 recid=9 stamp=749377962
deleted backup piece
backup piece handle=backup_CRTRNG_3679252776_set7_piece1_copy1_20110425_07mal5t9_1_1 recid=10 stamp=749377449
deleted backup piece
backup piece handle=backup_CRTRNG_3679252776_set10_piece1_copy1_20110425_0amal6br_1_1 recid=11 stamp=749377916
Deleted 5 objects
RMAN> list backup summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
147274  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147275  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147276  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147277  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147278  B  0  A SBT_TAPE    29-APR-11       1       1       YES        NOEXPIRE
147498  B  F  A SBT_TAPE    29-APR-11       1       1       NO         NOEXPIRE
RMAN>


Hope it helps

SRI

OEM Grid Control 10.2.0.1 Installation On Linux 5.4

In this article, we will discuss how to install OEM grid control 10.2.0.1 on Linux 5.4(32 bit).

Download the required software from the location : Download Software
Download the installation Document from the location : Download Installation Document

If you are planning to install OEM grid control in a vmware linux machine, Please follow the article VMware Server - Linux installation  and complete the linux machine creation. You can omit this point if you are directly provided with linux machine with OS linux 5.4.

Prepare the linux machine ( Linux 5.4 ) for the OEM grid control 10201 installation. Please use the article  Prepare Linux virtual machine for OEM Grid Control Installation. Though this is to prepare the linux machine for 11gR2 database, it holds good for OEM 10201 installation also. You can also refer the document mentioned above to prepare the linux machine for OEM grid control installation.

There are some identified Common Installation Errors while installing OEM 10201 on Linux 5.4. Please follow the article OEM Gridcontrol 10201 Installation Errors On Linux 5.4 to correct all the issues.

Follow the video to complete the installation of OEM grid control 10.2.0.1 on Linux 5.4.

Video will be uploaded very soon. <video place holder>

Hope It Helps
SRI
 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger