RMAN hot backup plus archivelog files [message #293275] |
Fri, 11 January 2008 09:17 |
M.Shakeel Azeem
Messages: 226 Registered: September 2006
|
Senior Member |
|
|
Dear All
I had a production db with archive logging enabled
SQL> select name,status
2 from v$archived_log;
NAME STATUS
---------------------------------------- -
D:\ORACLE\ARCHIVE_ORCL1\1_13.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_14.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_15.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_16.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_17.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_18.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_19.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_20.DBF A
D:\ORACLE\ARCHIVE_ORCL1\1_21.DBF A
after that i had taken the full RMAN hot backup
RMAN>RUN{
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK MAXPIECESIZE = 1G FORMAT 'D:\oracle\backup\%D_RMAN_BACKUP_%U.bak';
BACKUP DATABASE TAG 'FULL_BACKUP';
SQL "alter database backup controlfile to trace as ''D:\oracle\backup\Controlfile_Backup_Trace.trc''";
RELEASE CHANNEL disk1;
} and now i feel that old archivelog files generated before full rman backups are not needed ,so i deleted the old archivelog files from os using os command
1_13.DBF to 1_19.DBF are deleted from os level
but after that transaction is going on and archivelog files are generated now i want to backup all archivelog with RMAN by the following script
RMAN>run {
allocate channel c1 type disk;
sql 'alter system archive log current';
backup archivelog all format 'D:\oracle\backup\log_t%t_s%s_p%p';
release channel c1;
} but i got the error
RMAN-06059: expected archived log not found, lost of archived log compromises re
coverability
ORA-19625: error identifying file D:\ORACLE\ARCHIVE_ORCL1\1_13.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.
because some files are deleted from os level
and now i do the following
RMAN>crosscheck archivelog all;
RMAN> list expired archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ---- ---------------------------------------------
40 1 13 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_13.DBF
41 1 14 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_14.DBF
42 1 15 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_15.DBF
43 1 16 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_16.DBF
44 1 17 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_17.DBF
45 1 18 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_18.DBF
46 1 19 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_19.DBF
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=17 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
39 1 7 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_7.DBF
38 1 8 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_8.DBF
34 1 9 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_9.DBF
36 1 10 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_10.DBF
37 1 11 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_11.DBF
35 1 12 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL\1_12.DBF
40 1 13 X 08-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_13.DBF
41 1 14 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_14.DBF
42 1 15 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_15.DBF
43 1 16 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_16.DBF
44 1 17 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_17.DBF
45 1 18 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_18.DBF
46 1 19 X 09-JAN-08 D:\ORACLE\ARCHIVE_ORCL1\1_19.DBF
Do you really want to delete the above objects (enter YES or NO)? y
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_7.DBF recid=39 stamp=643445960
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_8.DBF recid=38 stamp=643445954
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_9.DBF recid=34 stamp=643445948
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_10.DBF recid=36 stamp=643445949
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_11.DBF recid=37 stamp=643445953
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL\1_12.DBF recid=35 stamp=643445948
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_13.DBF recid=40 stamp=643507565
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_14.DBF recid=41 stamp=643520370
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_15.DBF recid=42 stamp=643530361
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_16.DBF recid=43 stamp=643540352
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_17.DBF recid=44 stamp=643550373
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_18.DBF recid=45 stamp=643560365
deleted archive log
archive log filename=D:\ORACLE\ARCHIVE_ORCL1\1_19.DBF recid=46 stamp=643570420 Deleted 13 EXPIRED objects
and now run the script again to backup all archivelogs which were generated after RMAN backup
So the backup of all archive log files are successfully created
RMAN> run {
2> allocate channel c1 type disk;
3> sql 'alter system archive log current';
4> backup archivelog all format 'D:\oracle\backup\log_t%t_s%s_p%p' delete input;
5> release channel c1;
6> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=17 devtype=DISK
sql statement: alter system archive log current
Starting backup at 11-JAN-08
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=20 recid=47 stamp=643748014
input archive log thread=1 sequence=21 recid=48 stamp=643749225
input archive log thread=1 sequence=22 recid=49 stamp=643749685
input archive log thread=1 sequence=23 recid=50 stamp=643749830
input archive log thread=1 sequence=24 recid=51 stamp=643749838
input archive log thread=1 sequence=25 recid=52 stamp=643749896
input archive log thread=1 sequence=26 recid=53 stamp=643749902
input archive log thread=1 sequence=27 recid=54 stamp=643750888
input archive log thread=1 sequence=28 recid=55 stamp=643750895
channel c1: starting piece 1 at 11-JAN-08
channel c1: finished piece 1 at 11-JAN-08
piece handle=D:\ORACLE\BACKUP\LOG_T643750897_S30_P1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:17
Finished backup at 11-JAN-08
Starting Control File and SPFILE Autobackup at 11-JAN-08
piece handle=D:\ORACLE\BACKUP\CONTROLFILE_RMAN_BACKUP_C-1170788205-20080111-01.B
AK comment=NONE
Finished Control File and SPFILE Autobackup at 11-JAN-08
released channel: c1
and now i want to restore and recover db
so first i need to restore archive log files to start recovery
RMAN>restore archivelog all;
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/11/2008 19:47:57
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of log thread 1 seq 19 scn 1153648 found to restore
RMAN-06025: no backup of log thread 1 seq 18 scn 1117890 found to restore
RMAN-06025: no backup of log thread 1 seq 17 scn 1081613 found to restore
RMAN-06025: no backup of log thread 1 seq 16 scn 1045027 found to restore
RMAN-06025: no backup of log thread 1 seq 15 scn 1008694 found to restore
RMAN-06025: no backup of log thread 1 seq 14 scn 973424 found to restore
RMAN-06025: no backup of log thread 1 seq 13 scn 946303 found to restore
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
17 4M DISK 00:00:08 11-JAN-08
BP Key: 17 Status: AVAILABLE Tag: TAG20080111T194135
Piece Name: D:\ORACLE\BACKUP\LOG_T643750897_S30_P1
List of Archived Logs in backup set 17
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 20 1189490 09-JAN-08 1217442 11-JAN-08
1 21 1217442 11-JAN-08 1220635 11-JAN-08
1 22 1220635 11-JAN-08 1222338 11-JAN-08
1 23 1222338 11-JAN-08 1222764 11-JAN-08
1 24 1222764 11-JAN-08 1222832 11-JAN-08
1 25 1222832 11-JAN-08 1223026 11-JAN-08
1 26 1223026 11-JAN-08 1223030 11-JAN-08
1 27 1223030 11-JAN-08 1226496 11-JAN-08
1 28 1226496 11-JAN-08 1226501 11-JAN-08
So i need to restore archivelogs by using sequence
RMAN>RESTORE ARCHIVELOG FROM SEQUENCE 20 UNTIL SEQUENCE 28;
So the restore is completed successfully
So its very hard to monitor archivelog files
i feel i should have included all archivelog files while taking RMAN backup
RMAN >backup database plus archivelog all delete input;
but the problem is my RMAN backup is already 360GB in size and it takes 4-5 hrs to complete .
so i need to schedule RMAN backup at one time (e.g sunday) ,delete the archivelog files older than sunday
and now schedule the archivelog backup at another day (e.g wed &sat)
my question is
where i have to change my script to backup all avaialbe archivelog files if old archivelog files are deleted at os level?
RMAN> run {
2> allocate channel c1 type disk;
3> sql 'alter system archive log current';
4> backup archivelog all format 'D:\oracle\backup\log_t%t_s%s_p%p' delete input;
5> release channel c1;
6> }
please suggest!
|
|
|
Re: RMAN hot backup plus archivelog files [message #293306 is a reply to message #293275] |
Fri, 11 January 2008 11:32 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
Just Add this archive log script at the end of your backup database script and try..
like this..an example...
Run
{
allocate channel ch1 type disk format '$***_ORABACKUP/%U.bck';
allocate channel ch2 type disk format '$***_ORABACKUP/%U.bck';
allocate channel ch3 type disk format '$***_ORABACKUP/%U.bck';
allocate channel ch4 type disk format '$***_ORABACKUP/%U.bck';
allocate channel ch5 type disk format '$***_ORABACKUP/%U.bck';
set limit channel ch1 kbytes 2024800;
set limit channel ch2 kbytes 2024800;
set limit channel ch3 kbytes 2024800;
set limit channel ch4 kbytes 2024800;
set limit channel ch5 kbytes 2024800;
backup database;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
backup archivelog all format '$***_ORABACKUP/al_%U.bck';
backup current controlfile
tag = cf1
format '$***_ORABACKUP/cf_%U.bck';
}
|
|
|
|
|
|
Re: RMAN hot backup plus archivelog files [message #602998 is a reply to message #293275] |
Tue, 10 December 2013 14:36 |
pcworld
Messages: 1 Registered: May 2009
|
Junior Member |
|
|
Did you get your answer ?
Then please forward to me. Thanks
tanweer_q@yahoo.kom
Quated:
but the problem is my RMAN backup is already 360GB in size and it takes 4-5 hrs to complete .
so i need to schedule RMAN backup at one time (e.g sunday) ,delete the archivelog files older than sunday
and now schedule the archivelog backup at another day (e.g wed &sat)
my question is
where i have to change my script to backup all avaialbe archivelog files if old archivelog files are deleted at os level?
|
|
|
|
Re: RMAN hot backup plus archivelog files [message #603100 is a reply to message #602998] |
Wed, 11 December 2013 07:34 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
pcworld wrote on Tue, 10 December 2013 14:36Did you get your answer ?
Then please forward to me. Thanks
tanweer_q@yahoo.kom
Quated:
but the problem is my RMAN backup is already 360GB in size and it takes 4-5 hrs to complete .
so i need to schedule RMAN backup at one time (e.g sunday) ,delete the archivelog files older than sunday
and now schedule the archivelog backup at another day (e.g wed &sat)
my question is
where i have to change my script to backup all avaialbe archivelog files if old archivelog files are deleted at os level?
Why are you taking the db backup only once per week? I'd be taking a level 0 once per week, and a level 1 the other six days?
And why do you seem to think you can only backup the archivelogs along with the once per week backup of the db? In addition to backing up the archivelogs along with the db (but as a seperate step, not with 'backup database .. plus archivelog') you could have a seperate job to backup only the archivelogs. That job could be run daily, or every 'n' hours throughout the day.
As others said, you should NOT be deleting the archivelogs outside of rman, and without having backed them up using rman. Therein lies disaster.
|
|
|