脚本内容:
[oracle@localhost ~]$ cat chenchao.sh
#!/bin/bash
# This is shell.
export ORACLE_SID=SMTCDB
rman target /
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-5';
yum install -y
crosscheck archivelog all;
delete expired archivelog all;
exit
执行过程:
[oracle@localhost ~]$ ./chenchao.sh
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 19 09:35:23 2019
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SMTCDB (DBID=2761098402)
RMAN>
第三句就不执行了!
[oracle@localhost ~]$ cat chenchao.sh
#!/bin/bash
# This is shell.
export ORACLE_SID=SMTCDB
rman target /
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-5';
yum install -y
crosscheck archivelog all;
delete expired archivelog all;
exit
执行过程:
[oracle@localhost ~]$ ./chenchao.sh
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 19 09:35:23 2019
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SMTCDB (DBID=2761098402)
RMAN>
第三句就不执行了!