Posts Tagged ‘RMAN’

Duplicate Database from RMAN Backup – Oracle

April 10th, 2022, posted in Oracle Queries
Share

Duplicate Database from RMAN Backup


Seven Steps for Duplicate Database :

Step 1) RMNA Backup (Prerequisites)

Step 2) Create Password File

Step 3) Create Directory Structure

Step 4) Create Pfile

Step 5) Start Database in nomount Stage

Step 6) Run Duplicate Database Command

Step 7) Verify Duplicate Database

 

Step 1 RMAN Full database backup required (Prerequisites)

If database is in non archivelog mode then Shutdown the database and open in mount stage then take database backup i.e.RMAN > backup database;

If database is in archivelog mode use command i.e.  RMAN > backup database plus archivelog;

Backup Database using following command

Backup Database

-bash-4.1$ rman

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Mar 11 12:19:23 2016

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

RMAN> connect target sys/sysdba123@orcl

connected to target database: ORCL (DBID=1611723298)

RMAN>

RMAN> configure controlfile autobackup on;

using target database control file instead of recovery catalog

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters are successfully stored

RMAN> backup database plus archivelog;



Step 2 Create a password file for the duplicate instance.

Copy Source database password file and rename it to new database password file

Go to directory: /mnt/devops_0/Oracle/db1212/product/12.1.0.2/db_1/dbs/

$ cp orapworcl orapwduporcl





Step 3 Create directory structure for Duplicate Database

Login with user db1212

Following directories need to be created

–          DupOrcl

–          Oradata

–          Fast_recovery_area

–          Diag

–          Adump

Following are sample commands

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl/adump

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl/oradata

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl/fast_recovery_area

-bash-4.1$ mkdir /mnt/devops_0/DupDB/DupOrcl/diag

-bash-4.1$





Step 4 Create Pfile with few parameters.

Login with db1212

Create Pfile with following parameters

Go to directory: /mnt/devops_0/Oracle/db1212/product/12.1.0.2/db_1/dbs/

Parameters as below for initduporcl.ora,

*.audit_file_dest='/mnt/devops_0/DupDB/DupOrcl/adump'

*.audit_trail='db'

*.compatible='12.1.0.2.0'

*.db_block_size=8192

*.db_create_file_dest='/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl'

*.db_name='duporcl'

*.db_recovery_file_dest='/mnt/devops_0/DupDB/DupOrcl/fast_recovery_area'

*.db_recovery_file_dest_size=4560m

*.diagnostic_dest='/mnt/devops_0/DupDB/DupOrcl/diag'

*.undo_tablespace='UNDOTBS1'





Step 5 Start Database in nomount stage.

-bash-4.1$ export ORACLE_SID=duporcl

-bash-4.1$

-bash-4.1$ echo $ORACLE_SID

duporcl

-bash-4.1$

SQL> startup nomount

ORACLE instance started.

Total System Global Area  222298112 bytes

Fixed Size                  2922760 bytes

Variable Size             163579640 bytes

Database Buffers           50331648 bytes

Redo Buffers                5464064 bytes

SQL>

SQL> exit




Step 6 Run Duplicate Database command.
$ rman auxiliary /

$ DUPLICATE DATABASE TO duporcl

SPFILE

set control_files='/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/control01.ctl'

set DB_FILE_NAME_CONVERT='/mnt/devops_0/OrclNew/oradata/orclnew/','/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'

set LOG_FILE_NAME_CONVERT='/mnt/devops_0/OrclNew/oradata/orclnew/','/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'

BACKUP LOCATION '/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW'

;






Following is the log for above command for future references.

-bash-4.1$ rman auxiliary /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Mar 11 12:04:18 2016

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

connected to auxiliary database: DUPORCL (not mounted)

RMAN> DUPLICATE DATABASE TO duporcl

SPFILE

set control_files='/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/control01.ctl'

set DB_FILE_NAME_CONVERT='/mnt/devops_0/OrclNew/oradata/orclnew/','/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'

set LOG_FILE_NAME_CONVERT='/mnt/devops_0/OrclNew/oradata/orclnew/','/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'

BACKUP LOCATION '/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW'

;

Starting Duplicate Db at 11-MAR-16

contents of Memory Script:

{

   restore clone spfile to  '/mnt/devops_0/Oracle/db1212/product/12.1.0.2/db_1/dbs/spfileduporcl.ora' from

 '/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/autobackup/2016_03_10/o1_mf_s_906121024_cg2639ch_.bkp';

   sql clone "alter system set spfile= ''/mnt/devops_0/Oracle/db1212/product/12.1.0.2/db_1/dbs/spfileduporcl.ora''";

}

executing Memory Script

Starting restore at 11-MAR-16

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=13 device type=DISK

channel ORA_AUX_DISK_1: restoring spfile from AUTOBACKUP /mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/autobackup/2016_03_10/o1_mf_s_906121024_cg2639ch_.bkp

channel ORA_AUX_DISK_1: SPFILE restore from AUTOBACKUP complete

Finished restore at 11-MAR-16

sql statement: alter system set spfile= ''/mnt/devops_0/Oracle/db1212/product/12.1.0.2/db_1/dbs/spfileduporcl.ora''

contents of Memory Script:

{

   sql clone "alter system set  db_name =

 ''DUPORCL'' comment=

 ''duplicate'' scope=spfile";

   sql clone "alter system set  control_files =

 ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/control01.ctl'' comment=

 '''' scope=spfile";

   sql clone "alter system set  db_file_name_convert =

 ''/mnt/devops_0/OrclNew/oradata/orclnew/'', ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'' comment=

 '''' scope=spfile";

   sql clone "alter system set  LOG_FILE_NAME_CONVERT =

 ''/mnt/devops_0/OrclNew/oradata/orclnew/'', ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'' comment=

 '''' scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

}

executing Memory Script

sql statement: alter system set  db_name =  ''DUPORCL'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  control_files =  ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/mnt/devops_0/OrclNew/oradata/orclnew/'', ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'' comment= '''' scope=spfile

sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''/mnt/devops_0/OrclNew/oradata/orclnew/'', ''/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area    1073741824 bytes

Fixed Size                     2932632 bytes

Variable Size                713031784 bytes

Database Buffers             352321536 bytes

Redo Buffers                   5455872 bytes

contents of Memory Script:

{

   sql clone "alter system set  db_name =

 ''ORCLNEW'' comment=

 ''Modified by RMAN duplicate'' scope=spfile";

   sql clone "alter system set  db_unique_name =

 ''DUPORCL'' comment=

 ''Modified by RMAN duplicate'' scope=spfile";

   shutdown clone immediate;

   startup clone force nomount

   restore clone primary controlfile from  '/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/autobackup/2016_03_10/o1_mf_s_906121024_cg2639ch_.bkp';

   alter clone database mount;

}

executing Memory Script

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area    1073741824 bytes

Fixed Size                     2932632 bytes

Variable Size                713031784 bytes

Database Buffers             352321536 bytes

Redo Buffers                   5455872 bytes

Starting restore at 11-MAR-16

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=12 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=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/control01.ctl

Finished restore at 11-MAR-16

database mounted

released channel: ORA_AUX_DISK_1

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=12 device type=DISK

contents of Memory Script:

{

   set until scn  1804148;

   set newname for datafile  1 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/system01.dbf";

   set newname for datafile  3 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf";

   set newname for datafile  4 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf";

   set newname for datafile  5 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf";

   set newname for datafile  6 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.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-MAR-16

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 /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/system01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00003 to /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00004 to /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00005 to /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf

channel ORA_AUX_DISK_1: restoring datafile 00006 to /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.dbf

channel ORA_AUX_DISK_1: reading from backup piece /mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/backupset/2016_03_10/o1_mf_nnndf_TAG20160310T121557_cg2615wf_.bkp

channel ORA_AUX_DISK_1: piece handle=/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/backupset/2016_03_10/o1_mf_nnndf_TAG20160310T121557_cg2615wf_.bkp tag=TAG20160310T121557

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-MAR-16

contents of Memory Script:

{

   switch clone datafile all;

}

executing Memory Script

datafile 1 switched to datafile copy

input datafile copy RECID=6 STAMP=906206847 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/system01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=7 STAMP=906206847 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=8 STAMP=906206847 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=9 STAMP=906206847 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=10 STAMP=906206847 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.dbf

contents of Memory Script:

{

   set until scn  1804148;

   recover

   clone database

    delete archivelog

   ;

}

executing Memory Script

executing command: SET until clause

Starting recover at 11-MAR-16

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=11

channel ORA_AUX_DISK_1: reading from backup piece /mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/backupset/2016_03_10/o1_mf_annnn_TAG20160310T121703_cg2637go_.bkp

channel ORA_AUX_DISK_1: piece handle=/mnt/devops_0/OrclNew/fast_recovery_area/ORCLNEW/backupset/2016_03_10/o1_mf_annnn_TAG20160310T121703_cg2637go_.bkp tag=TAG20160310T121703

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=/mnt/devops_0/OrclNew/Archives/1_11_906113933.dbf thread=1 sequence=11

channel clone_default: deleting archived log(s)

archived log file name=/mnt/devops_0/OrclNew/Archives/1_11_906113933.dbf RECID=1 STAMP=906206849

media recovery complete, elapsed time: 00:00:01

Finished recover at 11-MAR-16

Oracle instance started

Total System Global Area    1073741824 bytes

Fixed Size                     2932632 bytes

Variable Size                713031784 bytes

Database Buffers             352321536 bytes

Redo Buffers                   5455872 bytes

contents of Memory Script:

{

   sql clone "alter system set  db_name =

 ''DUPORCL'' comment=

 ''Reset to original value by RMAN'' scope=spfile";

   sql clone "alter system reset  db_unique_name scope=spfile";

}

executing Memory Script

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

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance started

Total System Global Area    1073741824 bytes

Fixed Size                     2932632 bytes

Variable Size                713031784 bytes

Database Buffers             352321536 bytes

Redo Buffers                   5455872 bytes

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPORCL" RESETLOGS ARCHIVELOG

  MAXLOGFILES     16

  MAXLOGMEMBERS      3

  MAXDATAFILES      100

  MAXINSTANCES     8

  MAXLOGHISTORY      292

 LOGFILE

  GROUP   1 ( '/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/redo01.log' ) SIZE 50 M  REUSE,

  GROUP   2 ( '/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/redo02.log' ) SIZE 50 M  REUSE,

  GROUP   3 ( '/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/redo03.log' ) SIZE 50 M  REUSE

 DATAFILE

  '/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/system01.dbf'

 CHARACTER SET AL32UTF8

contents of Memory Script:

{

   set newname for tempfile  1 to

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/temp01.dbf";

   switch clone tempfile all;

   catalog clone datafilecopy  "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf",

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf",

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf",

 "/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.dbf";

   switch clone datafile all;

}

executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/temp01.dbf in control file

cataloged datafile copy

datafile copy file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf RECID=1 STAMP=906206886

cataloged datafile copy

datafile copy file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf RECID=2 STAMP=906206886

cataloged datafile copy

datafile copy file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf RECID=3 STAMP=906206886

cataloged datafile copy

datafile copy file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.dbf RECID=4 STAMP=906206886

datafile 3 switched to datafile copy

input datafile copy RECID=1 STAMP=906206886 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=2 STAMP=906206886 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/undotbs01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=3 STAMP=906206886 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/example01.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=4 STAMP=906206886 file name=/mnt/devops_0/DupDB/DupOrcl/oradata/duporcl/users01.dbf

contents of Memory Script:

{

   Alter clone database open resetlogs;

}

executing Memory Script

database opened

Finished Duplicate Db at 11-MAR-16




Step 7 Check Duplicate Database Status

-bash-4.1$ ps -ef | grep pmon

db1212    8550     1  0 Mar09 ?        00:00:12 ora_pmon_orcl12c

db1212   32132     1  0 12:07 ?        00:00:00 ora_pmon_duporcl

 -bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Mar 11 12:09:06 2016

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

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE

——— ——————–

DUPORCL   READ WRITE

Share

TSPITR Issue By Doing Mount Clone Database

November 15th, 2020, posted in Oracle EBS Application, Oracle Queries
Share

alter database mount clone database is a statement that forces all datafiles to be put OFFLINE when mounting the target instance.ORA-19588: archived log RECID 1003 STAMP 2001986 is no longer valid,oracle error,imam dba,dba imam,immam dba,dba immam,rman error
You’ll see it’s being used in the background when you run RMAN commands like:

transport tablespace
recover tablespace .. auxiliary destination ..
“recover table”  (12c feature)

In my case, i was trying to recover an 11.2.0.4 dropped table using “Tablespace Point In Time Recovery” by following the MOS note “How to Recover From a DROP / TRUNCATE / DELETE TABLE with RMAN (Doc ID 223543.1)“. The basic steps are:

– create pfile
– restore controlfile
– mount with “alter database mount clone database;”
– restore and recover a subset of the database with an RMAN script similar to:

RMAN> connect target /
        run {
        allocate channel c1 device type DISK;
        set until time "to_date( '13-01-2016 13:50', 'DD-MM-YYYY HH24:MI')";
        set newname for datafile 1 to "+RECO";
        set newname for datafile 3 to "+RECO";
        set newname for datafile 4 to "+RECO";
        set newname for datafile 23 to "+RECO";
        restore tablespace SYSTEM, UNDOTBS01, UNDOTBS02, TOOLS;
        switch datafile all;
        sql "alter database datafile 1,3,4,23 online";
        recover database skip forever tablespace TEMP,INDX,USERS,etc.;
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_1.281.739547347'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_2.282.739547353'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_3.283.739547359'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_4.284.739547365'' to ''+RECO''";
release channel c1;
}

After completing the required steps, recovery raised the following 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

Of course i got the error when tried to open with resetlogs. After struggling with possible causes, i found an internal support note similar with my issue: “ORA-1547 After Recovery When Database Was Mounted As Clone (Doc ID 252181.1)“. The interesting part was this note was published at Oct 23, 2003 for versions 8.1.7.4 to 9.2.0.4 and the fix was:

Use the following workaround until the bug gets resolved :
Do not mount the database as CLONE as in :
SQL> alter database mount clone database;
but mount is as normal database with :
SQL> alter database mount;

But there’s no bug number stated in the note. Even i thought that mysterious bug must have been fixed many years ago, desperation made me try the workaround with mounting the instance with “alter database mount” and manually taking the required datafiles offline. Suprisingly it worked and i was able to open the database with resetlogs.

As a result, it’s fine for me that RMAN uses “mount clone database” statement internally, however when I’ll do TSPITR again you can be sure that I’ll mount the instance with the way I used to !!

Share

RMAN-08137: WARNING: archived log not deleted, needed for standby

November 6th, 2018, posted in Oracle Queries
Share

Recently I met with an Oracle error “RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process” while deleting the archived logs through RMAN prompt.
I simulated the same on my test machine.Note. I had configured standby for my primary database but not the upstream.Followings are the excerpts from the RMAN output.

RMAN> delete noprompt archivelog all;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/admin/db1/arch/1_146_812203684.dbf thread=1 sequence=146
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/admin/db1/arch/1_147_812203684.dbf thread=1 sequence=147
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/admin/db1/arch/1_148_812203684.dbf thread=1 sequence=148
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/admin/db1/arch/1_149_812203684.dbf thread=1 sequence=149

 

I could delete those archivelogs using “force” option as well.
RMAN > delete noprompt force archivelog all;

 

But I dont want to do the same as those archivelogs have not shipped yet to the standby server.
So I changed the rman configuration to do the same.
RMAN> show all;

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default


RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

new RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

new RMAN configuration parameters are successfully stored

RMAN-08591: WARNING: invalid archived log deletion policy
RMAN> show all;

CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

 

Now I was able to delete those archivelogs.
RMAN> delete noprompt archivelog all;




released channel: ORA_DISK_1

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=147 device type=DISK

List of Archived Log Copies for database with db_unique_name DB1

=====================================================================




Key     Thrd Seq     S Low Time

------- ---- ------- - ---------

239     1    146     A 24-MAY-13

        Name: /u01/app/oracle/admin/db1/arch/1_146_812203684.dbf




247     1    147     A 24-MAY-13

        Name: /u01/app/oracle/admin/db1/arch/1_147_812203684.dbf




249     1    148     A 24-MAY-13

        Name: /u01/app/oracle/admin/db1/arch/1_148_812203684.dbf




250     1    149     A 24-MAY-13
        Name: /u01/app/oracle/admin/db1/arch/1_149_812203684.dbf

..........

..........

deleted archived log

archived log file name=/u01/app/oracle/admin/db1/arch/1_146_812203684.dbf RECID=239 STAMP=816273514

deleted archived log

.........

………

RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
specification does not match any archived log in the repository

 

Once I deleted those logs, I changed the rman configuration by the default one.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;

 

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

 

RMAN configuration parameters are successfully reset to default value
Share

RMAN-06059: expected archived log not found, loss of archived log compromises recoverability

November 4th, 2018, posted in Oracle Queries
Share

While RMAN full backup, today i have encountered “RMAN-06059: expected archived log not found, loss of archived log compromises recoverability”

RMAN error.
Solution for the mentioned error is to Crosscheck your archive logs from RMAN prompt and delete those expired logs who are not needed anymore.

While crosscheck archivelogs, RMAN will marked archives as Expired in his repository (i.e. controlfile or catalog) those who are not physically present there. So we can easily delete expired archives from controlfile or catalog repository.

 

Error log 1 :

RMAN> RUN
 2> {
 3> ALLOCATE CHANNEL backup1 DEVICE TYPE DISK FORMAT 'Z:\RMAN\%U';
 4> BACKUP DATABASE PLUS ARCHIVELOG;
 5> }
using target database control file instead of recovery catalog
 allocated channel: backup1
 channel backup1: SID=70 device type=DISK
Starting backup at 10-SEP-14
 current log archived
 released channel: backup1
 RMAN-00571: ===========================================================
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
 RMAN-00571: ===========================================================
 RMAN-03002: failure of backup plus archivelog command at 09/10/2014 18:22:35
 RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
 ORA-19625: error identifying file E:\ORACLE\--ORACLE_SID--\ORAARCH\1_35338_778192583.DBF
 ORA-27041: unable to open file
 OSD-04002: unable to open file
 O/S-Error: (OS 2) The system cannot find the file specified.

Error log 2 :

Starting backup at 26-JUL-12
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 07/26/2012 22:55:32
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /app/oracle/product/10.2/dbs/arch1_1_781981525.dbf
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3


Cause:

This can happen for a variety of reasons; the file has been manually moved or deleted,
the archive log destination has recently been changed,
the file has been compressed, etc

Solution:

Your options are either to restore the missing file(s), or to perform a crosscheck.
To perform a crosscheck, run the following command from within RMAN:

RMAN> CROSSCHECK ARCHIVELOG ALL;

Above command will give information of expired RMAN repository after verification. (i.e. in catalog or controlfile)

Above will marked archives as Expired who are not available physically and who are not required for any kind of recovery.

RMAN> DELETE EXPIRED ARCHIVELOG ALL;

Above command will delete all archive logs who are marked as expired while crosscheck.

 

Enabling And Checking the Status of Flashback On Database,Oracle Database,Oracle DBA,Enabling Flashback On Database,Checking the Status of Flashback On Database, Status of Flashback On Database, Enable Flashback On Database, Enabling Flashback On Database,Enable Flashback On Oracle Database, Enabling Flashback On Oracle Database,ORA-01153: an incompatible media recovery is active,ORA-01153,Oracle Error,Ora Error,Oracle DBA,Oracle Database Error,Oracle Database Solution,an incompatible media recovery is active,Ora : an incompatible media recovery is active,Oracle an incompatible media recovery is active,Oracle Error Solution,Database DBA,oracle data guard,oracle data guard issues,oracle data guard error

Details :

What? When using RMAN to backup archivelog files, an error “RMAN-06059: Errror identifying file ” is returned. Prior to this the backups have been running successfully.

RMAN-03002: failure of backup plus archivelog command
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
RMAN-6059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625 “error identifying file %s”

Why? Oracle is trying to backup an archivelog and is expecting for it to be available as it could be required for recovery.

Cause: The archive log is no longer accessible. One of the common reasons is that the archive log has been removed manually to free up space on the system or the permissions on the file was changed.

Resolution: The most important thing is to determine what caused the file to not be available.

Then to get around this error, to allow RMAN to continue backing up the database first connect to the RMAN repository. The run the “CROSSCHECK ARCHIVELOG ALL”.

RMAN will continue to backup the rest of the archivelogs.

Caution: Ensure that you also take a full backup since one f the archivelogs is not available in the backupsets and will limit your ability to do a complete recovery without it.

Share

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

September 7th, 2018, posted in Oracle Queries
Share

When we are taking archive log backup with delete then got an error.

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

archived log file name=/pac/lci9t1/arch/redo_1_16470_842608348.arc thread=1 sequence=16470

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

archived log file name=/pac/lci9t1/arch/redo_1_16471_842608348.arc thread=1 sequence=16471

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

SOLUTION:

Cause: The archive logs seems that it is not yet applied in the standby database.

                        Select sequence# , applied from v$archived_log;

Action: Check the standby database and apply the logs manually and the start the deletion process.

              I can delete the archive logs by force using the below command.

      RMAN > delete noprompt force archivelog all;

But I don’t want to delete the archives which are not applied in standby  so i’m changing the configuration

RMAN> show all;

Old configuration:

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

Change as Below:

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

new RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

new RMAN configuration parameters are successfully stored

RMAN-08591: WARNING: invalid archived log deletion policy


Now check the configuration
RMAN> show all;

CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;

Now I am able to delete those archivelogs now.

RMAN> delete noprompt archivelog all;

RMAN> crosscheck archivelog all;

Once I deleted those logs, I changed the rman configuration by the default one.

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;

RMAN> Show all;
Share