ORA-17629 ORA-20079

Yesterday I received page for ” ORA-17629: Cannot connect to the remote database server”  reported in Primary Database alert log.

Fri Apr 10 06:47:41 2015
Errors in file /oracle/app/diag/rdbms/testdb/testdb/trace/testdb_ora_161991.trc:
ORA-17627:
ORA-17629: Cannot connect to the remote database server
Errors in file /oracle/app/diag/rdbms/testdb/testdb/trace/testdb_ora_161991.trc:
ORA-17629: Cannot connect to the remote database server
ORA-17627:
ORA-17629: Cannot connect to the remote database server
Fri Apr 10 06:48:22 2015

The error trace file shows

*** 2015-04-10 06:47:13.005
*** SESSION ID:(3024.45081) 2015-04-10 06:47:13.005

*** CLIENT ID:() 2015-04-10 06:47:13.005
*** SERVICE NAME:(testdb) 2015-04-10 06:47:13.005
*** MODULE NAME:(oracle@oracle2.testdbds.com (TNS V1-V3)) 2015-04-10 06:47:13.005

*** ACTION NAME:() 2015-04-10 06:47:13.005

krbmsrvgrcf:Expected db_unique_name: testdb
krbmsrvgrcf:mydbuname = :testdb:
krbmsrvgrcf:Instance with connect id testdbSBY requested controlfile.
krbmsrvgrcf:Filespec: /oracle/app/product/11.2_1/dbs/snappcf_testdb.file

*** 2015-04-10 06:47:41.467
OCI error val is 184283056 and errmsg is ”
ORA-17627:
ORA-17629: Cannot connect to the remote database server
******************** WARNING ***************************
The errors during Server autobackup are not fatal, as it
is attempted after sucessful completion of the command.
However, it is recomended to take an RMAN control file
backup as soon as possible because the Autobackup failed
with the following error:
ORA-17629: Cannot connect to the remote database server
ORA-17627:
ORA-17629: Cannot connect to the remote database server
******************** END OF WARNING *******************
ORA-17629: Cannot connect to the remote database server
ORA-17627:
ORA-17629: Cannot connect to the remote database server

The trace file mentions the SID,SERIAL# and the module name. The module shows “oracle@oracle2.testdbds.com” which is the standby database.

I thought to check the sid details from v$active_session_history and the session is coming in from standby database and definitely related to RMAN.

SQL> @ash_sid
Enter value for sid: 3024
Enter value for serial: 45081
old  17: where    session_id = &sid and session_serial# = &serial
new  17: where    session_id = 3024 and session_serial# = 45081

                                                                         SQL                                                                                        Dur   CPU DB Time
Sid,Serial<Blk  STIME    Module               SqlId:ChildNo    SqlExecId Start CPH S PRXJBZ Sta    SEQ# EVENT                            P1:P2:P3   WCLASS           ms    ms      ms
--------------- -------- -------------------- ---------------- --------- ----- ------------ ---- ------ ------------------------ ------------------ ----------- ------- ----- -------
3024,45081      06:47:13 oracle@oracle2.testdbds.com                           NNN N NNNNN  Wait    129 control file single writ 9999999:  1024:  9 System I/O      105     8     113
                06:47:14                                                       NNN N NNNNN  Wait    269 control file single writ 9999999:  5504:  9 System I/O
                06:47:15                                                       NNN N NNNNN  Wait    395 control file single writ 9999999:  9536:  9 System I/O
                06:47:16                                                       NNN N NNNNN  Wait    473 control file single writ 9999999: 12032:  9 System I/O
                06:47:17                                                       NNN N NNNNN  Wait    560 control file sequential  9999999: 14848:  9 System I/O
                06:47:18                                                       NNN N NNNNN  Wait    673 control file single writ 9999999: 18432:  9 System I/O
                06:47:19                                                       NNN N NNNNN  Wait    768 control file sequential  9999999: 21504:  9 System I/O
                06:47:20                                                       NNN N NNNNN  Wait    863 control file single writ 9999999: 24512:  9 System I/O
                06:47:21                                                       NNN N NNNNN  Wait    959 control file single writ 9999999: 27584:  9 System I/O
                06:47:22                                                       NNN N NNNNN  cpu    1044                          9999999: 30336:  9
                06:47:23                                                       NNN N NNNNN  cpu    1132                          9999999: 33152:  9
                06:47:24                                                       NNN N NNNNN  Wait   1220 control file sequential  9999999: 35968:  9 System I/O
                06:47:25                                                       NNN N NNNNN  Wait   1318 control file sequential  9999999: 39104:  9 System I/O
                06:47:26                                                       NNN N NNNNN  Wait   1405 control file single writ 9999999: 41856:  9 System I/O
                06:47:27                                                       NNN N NNNNN  Wait   1489 control file single writ 9999999: 44544:  9 System I/O
                06:47:28                                                       NNN N NNNNN  Wait   1567 control file single writ 9999999: 47040:  9 System I/O
                06:47:29                                                       NNN N NNNNN  Wait   1649 control file single writ 9999999: 49664:  9 System I/O
                06:47:30                                                       NNN N NNNNN  Wait   1733 control file single writ 9999999: 52352:  9 System I/O
                06:47:31                                                       NNN N NNNNN  cpu    1817                          9999999: 55040:  9
                06:47:32                                                       NNN N NNNNN  Wait   1895 control file single writ 9999999: 57536:  9 System I/O
                06:47:33                                                       NNN N NNNNN  Wait   1965 control file single writ 9999999: 59776:  9 System I/O
                06:47:34                                                       NNN N NNNNN  Wait   2041 control file single writ 9999999: 62208:  9 System I/O
                06:47:35                                                       NNN N NNNNN  Wait   2113 control file single writ 9999999: 64512:  9 System I/O
                06:47:36                                                       NNN N NNNNN  Wait   2179 control file single writ 9999999: 66624:  9 System I/O
                06:47:37                                                       NNN N NNNNN  Wait   2238 control file sequential  9999999: 68544:  9 System I/O
                06:47:38                                                       NNN N NNNNN  Wait   2307 control file single writ 9999999: 70720:  9 System I/O
                06:47:39                                                       NNN N NNNNN  Wait   2369 control file single writ 9999999: 72704:  9 System I/O
                06:47:40                                                       NNN N NNNNN  Wait   2444 control file sequential  9999999: 75136:  9 System I/O


28 rows selected.

Looking into MOS I found “RMAN-06820 ORA-17629 During Backup at Standby Site (Doc ID 1616074.1)”. It stated something interesting, so I thought to mention it here, which I did not know

Change in 11.2.0.4 onward

Per ‘unpublished’ Bug 8740124, as of 11.2.0.4, we now include the current standby redo log as part of an RMAN archivelog backup at the standby site. This is achieved by forcing a log switch at the primary site.

I looked at the archive log backup trace file on standby database and there was no error reported. Then I started looking into the backup script and saw, after the backup is completed, resync function is called which connects to rcat database and perform resync catalog.

cle2.testdbs logs]$ more testdb_backup_testdb_resync_201504100617_Fri.log

Recovery Manager: Release 11.2.0.3.0 – Production on Fri Apr 10 06:46:55 2015

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

RMAN>
echo set on

RMAN>

RMAN> connect target *
connected to target database: testdb (DBID=3948365078)

RMAN> connect catalog *
connected to recovery catalog database

RMAN> resync catalog;
starting partial resync of recovery catalog
ORA-20079: full resync from primary database is not done

doing automatic resync from primary
resyncing from database with DB_UNIQUE_NAME testdb
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync command on default channel at 04/10/2015 06:47:13
ORA-17629: Cannot connect to the remote database server

ORA-17628: Oracle error 17629 returned by remote Oracle server

RMAN> exit;

Recovery Manager complete.

Tried “show all for db_unique_name testdb;” from standby

RMAN> show all for db_unique_name testdb;

ORA-20079: full resync from primary database is not done

doing automatic resync from primary
resyncing from database with DB_UNIQUE_NAME testdb
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 04/10/2015 07:53:40
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of partial resync command on default channel at 04/10/2015 07:53:40
ORA-17629: Cannot connect to the remote database server
ORA-17628: Oracle error 17629 returned by remote Oracle server

Connected to Primary Database and ran the same command

[oracle@oracle1 anand]$ rman target /

Recovery Manager: Release 11.2.0.3.0 – Production on Fri Apr 10 07:55:43 2015

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

connected to target database: testdb (DBID=3948365078)

RMAN> connect catalog rcat/xxxxxxxx@rcat

connected to recovery catalog database

RMAN> show all for db_unique_name testdb;

starting full resync of recovery catalog

full resync complete
RMAN configuration parameters for database with db_unique_name testdb are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 10 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’;
CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/mnt/oracle-backup/testdb/%U’;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM ‘AES192’;
CONFIGURE COMPRESSION ALGORITHM ‘BASIC’ AS OF RELEASE ‘DEFAULT’ OPTIMIZE FOR LOAD FALSE;
CONFIGURE DB_UNIQUE_NAME ‘testdbSBY’ CONNECT IDENTIFIER ‘testdbSBY’;
CONFIGURE DB_UNIQUE_NAME ‘testdb’ CONNECT IDENTIFIER ‘testdb’;
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/oracle/app/product/11.2_1/dbs/snappcf_testdb.file’;

RMAN>
RMAN> exit

The full resync completed on Primary database and then I performed “resync catalog” on standby as it completed successfully.

RMAN> resync catalog
2> ;

starting partial resync of recovery catalog
partial resync complete

RMAN> exit

Advertisements

set newname command made easier in 11gR2

From 11gR2 oracle introduced new options for “SET NEWNAME” command.

1.SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TEMPFILE
2.SET NEWNAME FOR TABLESPACE
3.SET NEWNAME FOR DATABASE

The following variables are introduced for SET NEWNAME from 11gR2 :-

%b The file name remains same as the original. For example, if a datafile is named D:\oracle\oradata\matrix\test.dbf, then %b results in test.dbf.
%f Specifies the absolute file number of the datafile for which the new name is generated.
%I Specifies the DBID.
%N Specifies the tablespace name.
%U Specifies the following format: data-D-%d_id-%I_TS-%N_FNO-%f.

Time to test 🙂

In my test, i am creating a duplicate database ORCL, from the rman backup of MATRIX database. As i am doing it on Windows box, i do hit ORA-600 [KSMFPG5], [0xAEC0000], which is a bug, and also mentioned in one of my previous blog.

1. taking backup of matrix database –

RMAN> run{
2> backup database format 'D:\oracle\backup\matrix\%d_%s_%p';
3> backup archivelog all format 'D:\oracle\backup\matrix\arc_%d_%s_%p';
4> }

Starting backup at 11-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\ORACLE\ORADATA\MATRIX\SYSTEM01.DBF
..............
channel ORA_DISK_1: finished piece 1 at 11-JAN-12
piece handle=D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1 tag=TAG20120111T133016 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 11-JAN-12

The database as well as the archivelog backupset exist in D:\ORACLE\BACKUP\MATRIX\

2. Duplicating db MATRIX to ORCL. Before executing the command, created ORCL pfile , passwordfile and windows service using oradim utility.

D:\scripts>set oracle_sid=ORCL

D:\scripts>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jan 11 13:32:14 2012

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

Connected to an idle instance.

SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1382112 bytes
Variable Size              92277024 bytes
Database Buffers           50331648 bytes
Redo Buffers                6676480 bytes
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

D:\scripts>
D:\scripts>
D:\scripts>rman auxiliary /

Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jan 11 13:33:02 2012

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

connected to auxiliary database: ORCL (not mounted)

RMAN> run {
2>
3> SET NEWNAME FOR DATABASE   TO 'D:\oracle\oradata\orcl\%b';
4> SET NEWNAME FOR TEMPFILE 1 TO 'D:\oracle\oradata\orcl\temp01.dbf' ;
5>
6> DUPLICATE DATABASE 'MATRIX' DBID 2312606933
7>  TO ORCL
8>   BACKUP LOCATION 'D:\oracle\backup\matrix'
9> LOGFILE
10> GROUP 1 ('D:\oracle\oradata\orcl\redo01a.log',
11> 'D:\oracle\oradata\orcl\redo01b.log') SIZE 50M REUSE,
12> GROUP 2 ('D:\oracle\oradata\orcl\redo02a.log',
13> 'D:\oracle\oradata\orcl\redo02b.log') SIZE 50M REUSE,
14> GROUP 3 ('D:\oracle\oradata\orcl\redo03a.log',
15> 'D:\oracle\oradata\orcl\redo03b.log') SIZE 50M REUSE;
16> }

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting Duplicate Db at 11-JAN-12

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MATRIX'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  'D:\ORACLE\BACKUP\matrix\MATRIX_9_1';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MATRIX'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

Starting restore at 11-JAN-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL02.CTL
Finished restore at 11-JAN-12

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

contents of Memory Script:
{
   set until scn  859591;
   set newname for datafile  1 to
 "D:\oracle\oradata\orcl\SYSTEM01.DBF";
   set newname for datafile  2 to
 "D:\oracle\oradata\orcl\SYSAUX01.DBF";
   set newname for datafile  3 to
 "D:\oracle\oradata\orcl\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "D:\oracle\oradata\orcl\USERS01.DBF";
   set newname for datafile  5 to
 "D:\oracle\oradata\orcl\EXAMPLE01.DBF";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 11-JAN-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to D:\oracle\oradata\orcl\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00002 to D:\oracle\oradata\orcl\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to D:\oracle\oradata\orcl\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to D:\oracle\oradata\orcl\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to D:\oracle\oradata\orcl\EXAMPLE01.DBF
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\MATRIX\MATRIX_8_1
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\MATRIX\MATRIX_8_1 tag=TAG20120111T132903
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 11-JAN-12

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=772292111 file name=D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF

contents of Memory Script:
{
   set until scn  859591;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 11-JAN-12
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1 tag=TAG20120111T133016
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=D:\ORACLE\ARCHIVELOG\ORCL\ORCL_0000000010_0772282200_0001.ARC thread=1 sequence=10
channel clone_default: deleting archived log(s)
archived log file name=D:\ORACLE\ARCHIVELOG\ORCL\ORCL_0000000010_0772282200_0001.ARC RECID=1 STAMP=772292118
media recovery complete, elapsed time: 00:00:03
Finished recover at 11-JAN-12
Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/11/2012 13:36:16
RMAN-05501: aborting duplication of target database
RMAN-04014: startup failed: ORA-00600: internal error code, arguments: [17099], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [KSMFPG5], [0xAEC0000], [], [], [], [], [], [], [], [], [], []

RMAN> exit

For the ORA-600, recreated the controlfile, opened the database using RESETLOGS option and added temp file.

In earlier versions of oracle we had to mention SET NEWNAME command to rename the duplicate datafiles while restoring/duplicating the database, where we mentioned it for each and every datafile.

# set new filenames for the datafiles
SET NEWNAME FOR DATAFILE 1 TO ‘/dup/oracle/oradata/trgt/system01.dbf’;
SET NEWNAME FOR DATAFILE 2 TO ‘/dup/oracle/oradata/trgt/undotbs01.dbf’;

From 11gR2 simply using SET NEWNAME FOR DATABASE has made things easier.

Duplicating Database without connecting to Target – 11gR2

From 11gR2, you can duplicate the database without connecting to the target database or recovery catalog which is termed as “Backup-Based Duplication Without a Target and a Recovery Catalog Connection”.

http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#BRADV435

OS – Windows
Duplicate Database – ORCL
Target Database – MATRIX

1. Backup the target database

D:\scripts>rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Sep 23 14:58:15 2011

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

connected to target database: MATRIX (DBID=2302797847)

RMAN> run{
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup as compressed backupset format 'D:\oracle\backup\matrix\%d_%u' database plus archivelog
5> include current controlfile;
6> release channel c1;
7> release channel c2;
8> }

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

allocated channel: c2
channel c2: SID=11 device type=DISK


Starting backup at 23-SEP-11
current log archived
released channel: c1
released channel: c2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 09/23/2011 14:58:42
RMAN-06029: the control file may be included only in a datafile backup set

RMAN> run{
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup as compressed backupset format 'D:\oracle\backup\matrix\%d_%u' database
5> include current controlfile;
6> backup archivelog all;
7> release channel c1;
8> release channel c2;
9> }

allocated channel: c1
channel c1: SID=198 device type=DISK

allocated channel: c2
channel c2: SID=11 device type=DISK

Starting backup at 23-SEP-11
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\ORACLE\ORADATA\MATRIX\SYSTEM01.DBF
input datafile file number=00004 name=D:\ORACLE\ORADATA\MATRIX\USERS01.DBF
input datafile file number=00005 name=D:\ORACLE\ORADATA\MATRIX\EXAMPLE01.DBF
channel c1: starting piece 1 at 23-SEP-11
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=D:\ORACLE\ORADATA\MATRIX\SYSAUX01.DBF
input datafile file number=00003 name=D:\ORACLE\ORADATA\MATRIX\UNDOTBS01.DBF
input datafile file number=00006 name=D:\ORACLE\ORADATA\MATRIX\TEST_01.DBF
channel c2: starting piece 1 at 23-SEP-11
channel c2: finished piece 1 at 23-SEP-11
piece handle=D:\ORACLE\BACKUP\MATRIX\MATRIX_02MN9ADQ tag=TAG20110923T145905 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:35
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
including current control file in backup set
channel c2: starting piece 1 at 23-SEP-11
channel c2: finished piece 1 at 23-SEP-11
piece handle=D:\ORACLE\BACKUP\MATRIX\MATRIX_03MN9AEU tag=TAG20110923T145905 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c1: finished piece 1 at 23-SEP-11
piece handle=D:\ORACLE\BACKUP\MATRIX\MATRIX_01MN9ADQ tag=TAG20110923T145905 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:55
Finished backup at 23-SEP-11

Starting backup at 23-SEP-11
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=1 STAMP=762487259
input archived log thread=1 sequence=6 RECID=2 STAMP=762521155
input archived log thread=1 sequence=7 RECID=3 STAMP=762523780
input archived log thread=1 sequence=8 RECID=4 STAMP=762523836
input archived log thread=1 sequence=9 RECID=5 STAMP=762562840
channel c1: starting piece 1 at 23-SEP-11
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=10 RECID=6 STAMP=762600646
input archived log thread=1 sequence=11 RECID=7 STAMP=762609637
input archived log thread=1 sequence=12 RECID=8 STAMP=762620322
input archived log thread=1 sequence=13 RECID=9 STAMP=762620401
channel c2: starting piece 1 at 23-SEP-11
channel c1: finished piece 1 at 23-SEP-11
piece handle=D:\ORACLE\PRODUCT\11.2.0.2\DBHOME_1\DATABASE4MN9AFI_1_1 tag=TAG20110923T150002 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c2: finished piece 1 at 23-SEP-11
piece handle=D:\ORACLE\PRODUCT\11.2.0.2\DBHOME_1\DATABASE5MN9AFI_1_1 tag=TAG20110923T150002 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
Finished backup at 23-SEP-11

Starting Control File and SPFILE Autobackup at 23-SEP-11
piece handle=D:\ORACLE\PRODUCT\11.2.0.2\DBHOME_1\DATABASE\C-2302797847-20110923-00 comment=NONE
Finished Control File and SPFILE Autobackup at 23-SEP-11

released channel: c1

released channel: c2

RMAN>

The backup location is D:\ORACLE\BACKUP\MATRIX\ . Copy the backupset to the auxiliary/duplicate database server. I copied all the backupsets created as part of backup to D:\oracle\backup\orcl

2. Crerate the initORCL file for duplicate database –

db_name=ORCL
db_unique_name=ORCL
control_files='D:\oracle\oradata\orcl\control01.ctl','D:\oracle\oradata\orcl\control02.ctl'
audit_file_dest='D:\ORACLE\PRODUCT\ADMIN\ORCL\ADUMP'
compatible='11.2.0.0.0'
diagnostic_dest='D:\ORACLE\PRODUCT'
db_file_name_convert='D:\oracle\oradata\matrix','D:\oracle\oradata\orcl'
log_file_name_convert='D:\oracle\oradata\matrix','D:\oracle\oradata\orcl'

3. Create a new instance using ORADIM utility

D:\scripts>oradim -new -sid ORCL -pfile D:\oracle\product\11.2.0.2\dbhome_1\database\INITorcl.ORA
Instance created.

4. Create the password file

D:\scripts>orapwd file=D:\oracle\product\11.2.0.2\dbhome_1\database\PWDORCL.ora entries=2 password=sys123

5. Startup nomount the ORCL instance

D:\scripts>set oracle_sid=ORCL
D:\scripts>
D:\scripts>sqlplus sys/sys123 as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 24 00:06:33 2011

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1382112 bytes
Variable Size              92277024 bytes
Database Buffers           50331648 bytes
Redo Buffers                6676480 bytes
SQL>

6. Connect to the auxiliary ORCL database and run the duplicate command

D:\scripts>set oracle_sid=ORCL
D:\scripts>rman auxiliary /

Recovery Manager: Release 11.2.0.2.0 - Production on Sat Sep 24 00:31:00 2011

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

connected to auxiliary database: ORCL (not mounted)

RMAN> duplicate database to ORCL  backup location 'D:\oracle\backup\orcl';

memory script content –

Starting Duplicate Db at 24-SEP-11

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MATRIX'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  'D:\ORACLE\BACKUP\orcl\C-2302797847-20110923-00';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MATRIX'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

Starting restore at 24-SEP-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL02.CTL
Finished restore at 24-SEP-11

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

contents of Memory Script:
{
   set until scn  937053;
   set newname for datafile  1 to
 "D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF";
   set newname for datafile  2 to
 "D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF";
   set newname for datafile  3 to
 "D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "D:\ORACLE\ORADATA\ORCL\USERS01.DBF";
   set newname for datafile  5 to
 "D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF";
   set newname for datafile  6 to
 "D:\ORACLE\ORADATA\ORCL\TEST_01.DBF";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 24-SEP-11
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to D:\ORACLE\ORADATA\ORCL\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\ORCL\MATRIX_01MN9ADQ
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\ORCL\MATRIX_01MN9ADQ tag=TAG20110923T145905
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00006 to D:\ORACLE\ORADATA\ORCL\TEST_01.DBF
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\ORCL\MATRIX_02MN9ADQ
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\ORCL\MATRIX_02MN9ADQ tag=TAG20110923T145905
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 24-SEP-11

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=12 STAMP=762655138 file name=D:\ORACLE\ORADATA\ORCL\TEST_01.DBF

contents of Memory Script:
{
   set until scn  937053;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 24-SEP-11
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=13
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\ORCL5MN9AFI_1_1
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\ORCL5MN9AFI_1_1 tag=TAG20110923T150002
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=D:\ORACLE\PRODUCT\11.2.0.2\DBHOME_1\RDBMS\ARC0000000013_0762473114.0001 thread=1 sequence=13
channel clone_default: deleting archived log(s)
archived log file name=D:\ORACLE\PRODUCT\11.2.0.2\DBHOME_1\RDBMS\ARC0000000013_0762473114.0001 RECID=1 STAMP=762655142
media recovery complete, elapsed time: 00:00:01
Finished recover at 24-SEP-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/24/2011 00:39:15
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
RMAN-04014: startup failed: ORA-00600: internal error code, arguments: [17099], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [KSMFPG5], [0xAEC0000], [], [], [], [], [], [], [], [], [], []

As per metalink –

ORA-00600: internal error code, arguments: [KSMFPG5], [0xAEC0000], [], [], [], [], [], [], [], [], [], []
Bug 10024309 –This issue is not seen in 11.2.0.1 and seen only in 11.2.0.2 and only on Windows platforms.

Lucky me 😉

Lets try and start the ORCL database –


D:\scripts>sqlplus sys/sys123 as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Sep 24 00:44:49 2011

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1382112 bytes
Variable Size              92277024 bytes
Database Buffers           50331648 bytes
Redo Buffers                6676480 bytes
Database mounted.
ORA-19838: Cannot use this control file to open database

How to resolve it?

SQL> alter database backup controlfile to trace as 'D:\oracle\backup\orcl\orcl_ctl.lst';

Database altered.

The controlfile trace showed

CREATE CONTROLFILE REUSE DATABASE "MATRIX" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'D:\ORACLE\ORADATA\MATRIX\REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 'D:\ORACLE\ORADATA\MATRIX\REDO02.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 'D:\ORACLE\ORADATA\MATRIX\REDO03.LOG'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  'D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF',
  'D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF',
  'D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF',
  'D:\ORACLE\ORADATA\ORCL\USERS01.DBF',
  'D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF',
  'D:\ORACLE\ORADATA\ORCL\TEST_01.DBF'
CHARACTER SET AL32UTF8
;

The controlfile still has the db_name as matrix and the redo logfile location as D:\ORACLE\ORADATA\MATRIX\ which is for the target.


SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      MATRIX
SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      ORCL
SQL> alter system set db_name=ORCL scope=spfile;

System altered.

recreate the controlfile with new db name and correct redo logfile location –

SQL> startup nomount
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1382112 bytes
Variable Size              92277024 bytes
Database Buffers           50331648 bytes
Redo Buffers                6676480 bytes
SQL>
SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      ORCL
SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      ORCL
SQL>
SQL>
SQL> CREATE CONTROLFILE SET DATABASE "ORCL" RESETLOGS  ARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 'D:\ORACLE\ORADATA\ORCL\REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  9    GROUP 2 'D:\ORACLE\ORADATA\ORCL\REDO02.LOG'  SIZE 50M BLOCKSIZE 512,
 10    GROUP 3 'D:\ORACLE\ORADATA\ORCL\REDO03.LOG'  SIZE 50M BLOCKSIZE 512
 11  -- STANDBY LOGFILE
 12  DATAFILE
 13    'D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF',
 14    'D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF',
 15    'D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF',
 16    'D:\ORACLE\ORADATA\ORCL\USERS01.DBF',
 17    'D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF',
 18    'D:\ORACLE\ORADATA\ORCL\TEST_01.DBF'
 19  CHARACTER SET AL32UTF8
 20  ;

Control file created.

Once the controlfile is re-created, simply open the database with resetlogs option


SQL> alter database open resetlogs;

Database altered.

Shell Script for RMAN Backup

Few days back  i devoted my time in creating a shell script to take RMAN backup for a 2-node RAC database on Sun Solaris.Both the datafiles and the archive logfiles(for both the instances) are on a shared SAN box. Below is the script :-

ORACLE_HOME=/projects/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=test1
export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin
export PATH

set -x

RMAN_BACKUP=/projects/test_backup
Rman_Log=$RMAN_BACKUP/"$ORACLE_SID"_backup_log

touch $Rman_Log

echo "\n\n ****RMAN FULL BACKUP****" >> $Rman_Log
echo "\n rman full startup time: `date`" >> $Rman_Log
DD=`date +%d%m%y`
mkdir /backup/rman/datafiles_backup/bkp_${DD}
mkdir /backup/rman/controlfile_backup/bkp_${DD}
mkdir /backup/rman/arch_backup/bkp_${DD}

sqlplus -s "sys/xxxxxx@TEST1 as sysdba" <<EOF  >> $Rman_Log
set feedback off;
alter system archive log current
/
set serveroutput on
declare
x number;
y number;
begin
select max(SEQUENCE#) into x from gv\$archived_log where thread#=1;
dbms_output.put_line('The Strat Sequence number on instance 1 = '||x||'');
sys.dbms_system.ksdwrt(2,'Note to DBA : On Instance 1 RMAN Backup Starts at '||to_char(x)||' on '||to_char(sysdate,'DD/MON/YYYY HH:MM:MI'));
select max(SEQUENCE#) into y from gv\$archived_log where thread#=2;
dbms_output.put_line('The Strat Sequence number on instance 2 = '||y||'');
sys.dbms_system.ksdwrt(2,'Note to DBA : On Instance 2 RMAN Backup Starts at '||to_char(y)||' on '||to_char(sysdate,'DD/MON/YYYY HH:MM:MI'));
end;
/
exit
EOF
rman target / nocatalog log=$RMAN_BACKUP/rman_fullbackup_${DD}.log << EOF1
change archivelog all crosscheck;
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
backup as compressed backupset incremental level 0 database tag 'TEST_FULL_BACKUP' format '/backup/rman/datafiles_backup/bkp_${DD}/%d_%s_%p';
backup as compressed backupset archivelog all not backed up 1 times FORMAT '/backup/rman/arch_backup/bkp_${DD}/ARCH_%d_%s_%p';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO  '/ora_backup/rman/controlfile_backup/bkp_${DD}/%F';
delete noprompt obsolete;
delete noprompt archivelog all completed before 'sysdate-2';
}
EXIT;
EOF1

sqlplus -s "sys/xxxxxxx@TEST1 as sysdba" <<EOF2 >> $Rman_Log
set feedback off;
alter system archive log current
/
set serveroutput on
declare
x number;
y number;
begin
select max(SEQUENCE#+1) into x from gv\$archived_log where thread#=1;
dbms_output.put_line('The Finished Sequence number on instance 1 = '||x||'');
sys.dbms_system.ksdwrt(2,'Note to DBA : On Instance 1 RMAN Backup Finished at '||to_char(x)||' on '||to_char(sysdate,'DD/MON/YYYY HH:MM:MI'));
select max(SEQUENCE#+1) into y from gv\$archived_log where thread#=2;
dbms_output.put_line('The Finished Sequence number on instance 2 = '||y||'');
sys.dbms_system.ksdwrt(2,'Note to DBA : On Instance 2 RMAN Backup Finished at '||to_char(y)||' on '||to_char(sysdate,'DD/MON/YYYY HH:MM:MI'));
end;
/
exit
EOF2

echo "\n rman fullbackup end time: `date`" >> $Rman_Log

Some Features:-

1. Two log files will be generated.One with the name “$ORACLE_SID_backup_log” and the other with “rman_fullbackup_${DD}.log” (DD will be the current date).The first log file ($ORACLE_SID_backup_log) will have the

a. The startup time of the script run

b. The maximum archive log sequence number – before the start of the backup and after the end of the backup

c. The end time of the backup.

The rman_fullbackp_${DD} will look like rman_fullbackp_030310,if run on 03rd March 2010.Every time the script runs it will generate a new logfile.It will contain the details of the RUN block in RMAN backup.

2. A line in the alert log of both the instances ,with the maximum sequence number (before the start of the backup and after the end of the backup) will be written.For example

Note to DBA : On Instance 2 RMAN Backup Starts at 2289 on 03/03/2010 02:40:00

3. All the archivelogs will be backed up as  “NOT BACKED UP 1 TIMES” is being used.Even if the crontab didn’t run a particular day or time , the next time it runs it will take the backup of all those archivelogs that haven’t been backed up even once.

4. The backup pieces goes to the current date folder which is created using

     mkdir /backup/rman/datafiles_backup/bkp_${DD}

Suppose the backup is run on 03rd March 2010, so it will create a folder bkp_030310 inside “/backup/rman/datafiles_backup” and place all the backup pieces inside it.Similar is the case for archivelogs and the controlfile.

5. The retention and the deletion policy varies as per the requirements .I take a full backups on Sunday and rest all the days its incremental, with the same script with few modifications and the most important one is

     backup as compressed backupset incremental level 1 database

Hope this helps someone and as always, suggestions are welcomed. 🙂