Skip to main content

rman delete backup without mounting db

########################################################
Description :
BIDTST database is accidently dropped before it's RMAN database backups on tapes are removed.
so we need to remove the backups without having BIDTST db mounted.
The doc retains the error messages which help troubleshooting...

Date : June 1, 2011
DBA : Jiulu Sun & Kevin Ma
########################################################

$ rman catalog rman/password@catalog target /

Recovery Manager: Release 10.2.0.4.0 - Production on Thu Jun 2 15:26:52 2011

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

connected to target database: DUMMY (not mounted)
connected to recovery catalog database

RMAN> @generic_config.rman

RMAN> configure channel device type sbt parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 06/02/2011 15:27:01
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

RMAN> CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 06/02/2011 15:27:01
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog

...

RMAN> set dbid=989504976

executing command: SET DBID
database name is "BIDTST" and DBID is 989504976

RMAN> @generic_config.rman

RMAN> configure channel device type sbt parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 06/02/2011 15:27:21
ORA-01507: database not mounted <-- you cannot configure anything if the db is not mounted.
...
RMAN> **end-of-file**

RMAN> list backup summary; <-- but you still can list backup


List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
105378 B 0 A SBT_TAPE 20100819-21:54 1 1 YES TAG20100819T213534
254877 B F A SBT_TAPE 20110508-18:44 1 1 NO TAG20110508T184450

RMAN> restore controlfile; <-- now we are able to restore the controlfile.

Starting restore at 20110602-15:30
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=39 devtype=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/02/2011 15:30:12
RMAN-06026: some targets not found - aborting restore
RMAN-06101: no channel to restore a backup or copy of the control file

I shutdown the db and removed the controlfile, startup nomount the dummy db again, those output is not included here...

RMAN> run {
2> allocate channel t1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)';
3> restore controlfile; <-- we are able to restore control file
4> }

released channel: ORA_DISK_1
allocated channel: t1
channel t1: sid=39 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0

Starting restore at 20110602-15:31

channel t1: starting datafile backupset restore
channel t1: restoring control file
channel t1: reading from backup piece c-989504976-20110508-01
channel t1: restored backup piece 1
piece handle=c-989504976-20110508-01 tag=TAG20110508T184450
channel t1: restore complete, elapsed time: 00:00:03
output filename=/oracle/10.2.0/dbs/cntrlBIDTST.dbf
Finished restore at 20110602-15:32
released channel: t1

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup force nomount; <-- startup a dummy database without a spfile

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/10.2.0/dbs/initBIDTST.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 2082504 bytes
Variable Size 67111224 bytes
Database Buffers 83886080 bytes
Redo Buffers 6303744 bytes

RMAN> set dbid=989504976;

executing command: SET DBID
database name is "BIDTST" and DBID is 989504976

RMAN> run {
2> allocate channel t1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)';
3> crosscheck backup; <-- we are able to crosscheck backup with the dummy nomount database
4> }

allocated channel: t1
channel t1: sid=36 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0

crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=v1llot17_1_1 recid=1105 stamp=727479335
crosschecked backup piece: found to be 'AVAILABLE'
...
Crosschecked 184 objects

released channel: t1

RMAN> drop database;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-01507: database not mounted <<-- however, we cannot drop database because it's not mounted

RMAN> run {
2> allocate channel t1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_rman_agcoux043.opt)';
3> delete backup; <-- now let's delete the tape backup with the nomount dummy db
4> }

allocated channel: t1
channel t1: sid=36 devtype=SBT_TAPE
channel t1: Data Protection for Oracle: version 5.4.1.0


List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
105387 105378 1 1 AVAILABLE SBT_TAPE v1llot17_1_1
105388 105379 1 1 AVAILABLE SBT_TAPE uullot17_1_1
...
254879 254877 1 1 AVAILABLE SBT_TAPE c-989504976-20110508-01

Do you really want to delete the above objects (enter YES or NO)? yes
\^Hdeleted backup piece
backup piece handle=v1llot17_1_1 recid=1105 stamp=727479335
...
Deleted 184 objects

released channel: t1

RMAN> list backup summary;
<-- nothing left

RMAN>

Comments

Popular posts from this blog

Opatch apply/lsinventory error: oneoff is corrupted or does not exist

I am applying the quarterly patch for 19c RDBMS, I tried using napply but failed, but somehow it corrupted the inventory though nothing applied. further apply and lsinventory command ran into error like this: $ ./OPatch/opatch lsinventory Oracle Interim Patch Installer version 12.2.0.1.21 Copyright (c) 2020, Oracle Corporation.  All rights reserved. Oracle Home       : /u02/app/oracle/19.0.0 Central Inventory : /u01/app/oraInventory    from           : /u02/app/oracle/19.0.0/oraInst.loc OPatch version    : 12.2.0.1.21 OUI version       : 12.2.0.7.0 Log file location : /u02/app/oracle/19.0.0/cfgtoollogs/opatch/opatch2020-09-08_13-35-59PM_1.log Lsinventory Output file location : /u02/app/oracle/19.0.0/cfgtoollogs/opatch/lsinv/lsinventory2020-09-08_13-35-59PM.txt -------------------------------------------------------------------------------- Inventory load failed... OPatch cannot load inventory ...

oracle dba_hist_sysmetric_summary

found this blog is helpful to get CPU and IO statistics on oracle database. http://shob-dbadmin.blogspot.ca/2012/12/how-to-find-total-io-of-database.html courtesy to  Shomil Bansal , below are hist writing, not mine. How to find total IO of the database instance Total IO of database instance is sum of the physical reads, physical writes and redo writes. There are several views to find these values. v$sysmetric  - Reports metric values for only the most current time sample 60 secs. v$sysmetric_summary  - Reports metric values for time sample of 1 hour. v$sysmetric_history  - Reports metric values every 60 sec from the time instance is up. Better way to analyse IO using this view to take deltas between two time periods. dba_hist_sysmetric_history  - All the above views are refreshed when the instance is restarted. This view, part of AWR, stores the historical stats. I have used this view for my report. Query: ====== set lines 350...

ORA_RMAN_SGA_TARGET

assume that we lost all the files of oracle database but we do have rman backup, when trying to bring up a dummy database before restore start, I get this error. RMAN> startup nomount force; WARNING: cannot translate ORA_RMAN_SGA_TARGET value startup failed: ORA-01078: failure in processing system parameters ORA-01565: error in identifying file '+DATA/PROD/spfilePROD.ora' ORA-17503: ksfdopn:2 Failed to open file +DATA/PROD/spfilePROD.ora ORA-15056: additional error message ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/prod/spfileprod.ora ORA-17503: ksfdopn:2 Failed to open file +DATA/prod/spfileprod.ora ORA-15173: entry 'spfileprod.ora' does not exist in directory 'prod' ORA-06512: at line 4 starting Oracle instance without parameter file for retrival of spfile RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =================================...