编写各自对应的级别备份脚本 rmanbklevel_0.sh rmanbklevel_1.sh rmanbklevel_2.sh
[Oracle@oracle11gR2 scripts]$ pwd
/u01/scripts
[oracle@oracle11gR2 scripts]$ ll
total 44
-rw-r--r--. 1 oracle oinstall 102 Jul 20 04:39 audit.sql
-rwxr-xr-x. 1 oracle oinstall 398 Jul 22 03:50 coldbak.sh
-rw-r--r--. 1 oracle oinstall 829 Jul 17 02:08 deadlock.sql
-rw-r--r--. 1 oracle oinstall 126 Jul 20 04:29 fail_count.sql
-rw-r--r--. 1 oracle oinstall 327 Jul 20 04:28 fail_user.sql
-rwxr-xr-x. 1 oracle oinstall 260 Jul 22 19:45 rmanbklevel_0.sh //0级备份要有可执行权限x
-rwxr-xr-x. 1 oracle oinstall 260 Jul 22 19:46 rmanbklevel_1.sh //1级备份要有可执行权限x
-rwxr-xr-x. 1 oracle oinstall 260 Jul 22 19:47 rmanbklevel_2.sh //2级备份要有可执行权限x
-rw-r--r--. 1 oracle oinstall 116 Jul 20 00:44 spid.sql
-rw-r--r--. 1 oracle oinstall 143 Jul 17 04:59 undo.sql
-rwxr-xr-x. 1 oracle oinstall 613 Jul 22 15:00 userbak.sh
[oracle@oracle11gR2 scripts]$
[oracle@oracle11gR2 scripts]$ vi rmanbklevel_0.sh //0级备份脚本
#!/bin/sh
export ORACLE_SID=orcl
rman log='/rmanbk/bakl0.log' append