Skip to main content

REMOVING ARCHIVED LOG FILES USING RMAN IN REAL TIME.


oracle@. oraenv     >   set env to the specific dB

ORACLE_SID = [TEST] ?

oracle@/home/oracle/db/scripts: rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Tue Jan 27 19:35:06 2015

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

connected to target database: TEST (DBID=2909445435)

RMAN> list archivelog all;


allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK


6692    1    4137    A 21-JAN-15 /backup/TEST/arch/1_4137_860869935.dbf
6693    1    4138    A 21-JAN-15 /backup/TEST/arch/1_4138_860869935.dbf
6694    1    4139    A 21-JAN-15 /backup/TEST/arch/1_4139_860869935.dbf
6695    1    4140    A 21-JAN-15 /backup/TEST/arch/1_4140_860869935.dbf
6696    1    4141    A 21-JAN-15 /backup/TEST/arch/1_4141_860869935.dbf
6697    1    4142    A 21-JAN-15 /backup/TEST/arch/1_4142_860869935.dbf
6698    1    4143    A 21-JAN-15 /backup/TEST/arch/1_4143_860869935.dbf
6699    1    4144    A 21-JAN-15 /backup/TEST/arch/1_4144_860869935.dbf
6729    1    4174    A 22-JAN-15 /backup/TEST/arch/1_4174_860869935.dbf
6730    1    4175    A 22-JAN-15 /backup/TEST/arch/1_4175_860869935.dbf
6747    1    4192    A 22-JAN-15 /backup/TEST/arch/1_4192_860869935.dbf
6748    1    4193    A 22-JAN-15 /backup/TEST/arch/1_4193_860869935.dbf
6749    1    4194    A 22-JAN-15 /backup/TEST/arch/1_4194_860869935.dbf
6750    1    4195    A 22-JAN-15 /backup/TEST/arch/1_4195_860869935.dbf
6751    1    4196    A 22-JAN-15 /backup/TEST/arch/1_4196_860869935.dbf
6752    1    4197    A 22-JAN-15 /backup/TEST/arch/1_4197_860869935.dbf
6753    1    4198    A 22-JAN-15 /backup/TEST/arch/1_4198_860869935.dbf
6754    1    4199    A 22-JAN-15 /backup/TEST/arch/1_4199_860869935.dbf

RMAN> delete archivelog all;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
6653    1    4098    A 20-JAN-15 /backup/TEST/arch/1_4098_860869935.dbf
6654    1    4099    A 20-JAN-15 /backup/TEST/arch/1_4099_860869935.dbf
6655    1    4100    A 20-JAN-15 /backup/TEST/arch/1_4100_860869935.dbf
6656    1    4101    A 20-JAN-15 /backup/TEST/arch/1_4101_860869935.dbf
6657    1    4102    A 20-JAN-15 /backup/TEST/arch/1_4102_860869935.dbf
6658    1    4103    A 21-JAN-15 /backup/TEST/arch/1_4103_860869935.dbf
6659    1    4104    A 21-JAN-15 /backup/TEST/arch/1_4104_860869935.dbf
6660    1    4105    A 21-JAN-15 /backup/TEST/arch/1_4105_860869935.dbf
6661    1    4106    A 21-JAN-15 /backup/TEST/arch/1_4106_860869935.dbf
6662    1    4107    A 21-JAN-15 /backup/TEST/arch/1_4107_860869935.dbf
6663    1    4108    A 21-JAN-15 /backup/TEST/arch/1_4108_860869935.dbf
6664    1    4109    A 21-JAN-15 /backup/TEST/arch/1_4109_860869935.dbf
6665    1    4110    A 21-JAN-15 /backup/TEST/arch/1_4110_860869935.dbf
6666    1    4111    A 21-JAN-15 /backup/TEST/arch/1_4111_860869935.dbf
6667    1    4112    A 21-JAN-15 /backup/TEST/arch/1_4112_860869935.dbf

Do you really want to delete the above objects (enter YES or NO)? Yes
deleted archive log
archive log filename=/backup/TEST/arch/1_4212_860869935.dbf recid=6767 stamp=869666930
deleted archive log
archive log filename=/backup/TEST/arch/1_4213_860869935.dbf recid=6768 stamp=869667072
deleted archive log
archive log filename=/backup/TEST/arch/1_4214_860869935.dbf recid=6769 stamp=869667162
deleted archive log
archive log filename=/backup/TEST/arch/1_4215_860869935.dbf recid=6770 stamp=869667166
deleted archive log
archive log filename=/backup/TEST/arch/1_4216_860869935.dbf recid=6771 stamp=869670222
deleted archive log
archive log filename=/backup/TEST/arch/1_4217_860869935.dbf recid=6772 stamp=869695326
deleted archive log
archive log filename=/backup/TEST/arch/1_4218_860869935.dbf recid=6773 stamp=869756665
deleted archive log
archive log filename=/backup/TEST/arch/1_4219_860869935.dbf recid=6774 stamp=869781675
deleted archive log
archive log filename=/backup/TEST/arch/1_4220_860869935.dbf recid=6775 stamp=869843102
deleted archive log
archive log filename=/backup/TEST/arch/1_4221_860869935.dbf recid=6776 stamp=869929536
deleted archive log
archive log filename=/backup/TEST/arch/1_4222_860869935.dbf recid=6777 stamp=870015980
deleted archive log
archive log filename=/backup/TEST/arch/1_4223_860869935.dbf recid=6778 stamp=870040855
deleted archive log
archive log filename=/backup/TEST/arch/1_4224_860869935.dbf recid=6779 stamp=870102414
deleted archive log
archive log filename=/backup/TEST/arch/1_4225_860869935.dbf recid=6780 stamp=870114069
deleted archive log
archive log filename=/backup/TEST/arch/1_4226_860869935.dbf recid=6781 stamp=870114249
deleted archive log
archive log filename=/backup/TEST/arch/1_4227_860869935.dbf recid=6782 stamp=870114277
deleted archive log
archive log filename=/backup/TEST/arch/1_4228_860869935.dbf recid=6783 stamp=870116856
deleted archive log
archive log filename=/backup/TEST/arch/1_4229_860869935.dbf recid=6784 stamp=870116913
deleted archive log
archive log filename=/backup/TEST/arch/1_4230_860869935.dbf recid=6785 stamp=870116965
deleted archive log
archive log filename=/backup/TEST/arch/1_4231_860869935.dbf recid=6786 stamp=870117163
deleted archive log
archive log filename=/backup/TEST/arch/1_4232_860869935.dbf recid=6787 stamp=870117464
deleted archive log
archive log filename=/backup/TEST/arch/1_4233_860869935.dbf recid=6788 stamp=870117515
deleted archive log
archive log filename=/backup/TEST/arch/1_4234_860869935.dbf recid=6789 stamp=870117594
Deleted 137 objects


RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK
specification does not match any archive log in the recovery catalog

RMAN> exit


Recovery Manager complete.
oracle@/home/oracle/db/scripts:


Comments

Popular posts from this blog

ORA-39014: One or more workers have prematurely exited.ORA-00018: maximum number of sessions exceeded

ERROR: I was Performing a full database import and during the import I faced the below error. ORA-39014: One or more workers have prematurely exited. ORA-39029: worker 6 with process name "DW07" prematurely terminated ORA-31672: Worker process DW07 died unexpectedly. Job "SYSTEM"."SYS_IMPORT_FULL_04" stopped due to fatal error at 00:59:40 ORA-39014: One or more workers have prematurely exited. SOLUTION:  Run the import with fewer parallel processes, like PARALLEL=2 instead of 8. I was able to run the import successfully. NOTE 1: This errors occurs when there are less session allocation in the database. check the session,process parameters and increase them accordingly. To avoid such errors again. NOTE 2 : Note: Increasing processes parameter increases the amount of shared memory that needs to be reserved & the OS must be configured to support the larger amount of shared memory. So here we first need to increase the Memory & SG...

ORA-01143: cannot disable media recovery - file 1 needs media recovery

I got a request from the client - To flashback the database to the existing restore point & disable flashback and archive log mode for database UATB. Here I came a cross error - ORA-01143. I followed the below steps. 1. SQL> select name from v$database; NAME ------------ UATB 2. SQL> SELECT NAME FROM V$RESTORE_POINT WHERE GUARANTEE_FLASHBACK_DATABASE='YES' ORDER BY TIME; NAME --------- UATB_COPY Here I'm going to restore the database to the above restore point. NOTE: The flashback database restore has to be done in MOUNT stage of the database. SQL> select name from v$database; NAME --------- UATB SQL> shut immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area  612368384 bytes Fixed Size                  1250428 bytes Variable Size             167775108 bytes ...