保留最近的2個歸檔

perfychi發表於2012-11-01
#!/bin/bash

. /home/oracle/.bash_profile

keep=2
seq=`sqlplus  -S / as sysdba <
set pagesize 0  feedback off linesize 200 echo off termout off trimspool on
select max(sequence#)-$keep from v\\$archived_log;
exit
EOF`

rman target / <
delete noprompt archivelog  until sequence $seq;
exit;
<
----------------------------------------------------------------------------------


#!/bin/bash

. /home/oracle/.bash_profile

keep=2
seq=`sqlplus  -S / as sysdba <
set pagesize 0  feedback off linesize 200 echo off termout off trimspool on
select max(sequence#)-$keep from v\\$archived_log;
exit
EOF`

rman target / <
delete noprompt archivelog  high sequence $seq;
exit;


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


#!/bin/bash

. /home/oracle/.bash_profile

keep=2
seq=`sqlplus  -S / as sysdba <
set pagesize 0  feedback off linesize 200 echo off termout off trimspool on
select max(sequence#)-$keep from v\\$archived_log;
exit
EOF`

rman target / <
delete noprompt archivelog  high logseq $seq;
exit;
<

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


#!/bin/bash

. /home/oracle/.bash_profile

keep=2
seq=`sqlplus  -S / as sysdba <
set pagesize 0  feedback off linesize 200 echo off termout off trimspool on
select max(sequence#)-$keep from v\\$archived_log;
exit
EOF`

rman target / <
delete noprompt archivelog  until logseq $seq;
exit;
<

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

 上面都是可以的,綜上所述: ("<=>" 表示等價)
logseq  <=> sequence
low <=> from   (low與high成對出現,from與until成對出現)
high <=> until

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-748116/,如需轉載,請註明出處,否則將追究法律責任。

保留最近的2個歸檔
請登入後發表評論 登入
全部評論

相關文章