delete archivelogs older than 1 day. [message #298822] |
Thu, 07 February 2008 17:08 |
geeklol
Messages: 59 Registered: March 2005
|
Member |
|
|
i am using ASM to store my archive logs. What i am trying to do is 1.) BACKUP THE ARCHIVELOGS 2.) DELETE ALL THE ARCHIVELOGS ON ASM THAT ARE OLDER THAN 1 DAY.
when i use the following command, i get the error,
If i say, archivelog all delete input IT WORKS. but when i say sysdate-1 is when it complains.
MY SCRIPT:
run {
# Hot database level 0 whole backup
allocate channel t1 type 'SBT_TAPE';
backup
incremental level 0
skip inaccessible
# recommended format
format 'dashgp_%s_%p_%t'
database
filesperset = 500;
sql 'alter system archive log current';
release channel t1;
allocate channel t1 type 'SBT_TAPE';
backup
format 'cntrl_%s_%p_%t'
current controlfile;
release channel t1;
allocate channel t1 type 'SBT_TAPE';
backup
format 'arch_%s_%p_%t'
archivelog all delete input 'sysdate-1';
release channel t1;
}
ERROR:
9> connect target
10> connect catalog *
11>
12> run {
13> # Hot database level 0 whole backup
14> allocate channel t1 type 'SBT_TAPE';
15> backup
16> incremental level 0
17> skip inaccessible
18> # recommended format
19> format 'dashgp_%s_%p_%t'
20> database
21> filesperset = 500;
22> sql 'alter system archive log current';
23> release channel t1;
24>
25> allocate channel t1 type 'SBT_TAPE';
26> backup
27> format 'cntrl_%s_%p_%t'
28> current controlfile;
29> release channel t1;
30>
31> allocate channel t1 type 'SBT_TAPE';
32> backup
33> format 'arch_%s_%p_%t'
34> #DELETE COPY OF ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-1';
35> #format 'arch_%s_%p_%t'
36> archivelog all delete input 'sysdate-1'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "single-quoted-string": expecting one of: "archivelog, backup, backupset, channel, copy, controlfile
copy, current, database, datafile, datafilecopy, delete, diskratio, db_recovery_file_dest, filesperset, format, from, force, include
, keep, (, maxsetsize, noexclude, nokeep, not, pool, plus, reuse, recovery, ;, skip, spfile, setsize, tablespace, tag, to"
RMAN-01007: at line 36 column 29 file: /home/oracle/nbscripts/dashgp_backup_level0.rcv
Thank you.
|
|
|
|
|