脚本里面的路径,用户密码需要根据实际情况调整,压缩一定要开启,并行度根据实际环境设置:
vi full_bak.sh
#!/bin/bash
cd /home/dmdba/dmdbms/bin/
./disql SYSDBA/SYSDBA<<EOF
set serveroutput on
DECLARE
SQL_ VARCHAR;
begin
print sysdate;
SQL_='backup database backupset ''/dmbak/DB_FULL_'||to_char(sysdate,'YYYY_MM_DD')||''' compressed level 1 parallel 4';
EXECUTE IMMEDIATE SQL_;
print sql_;
print sysdate;
end;
/
exit;
EOF
vi increment_bak.sh
#!/bin/bash
cd /home/dmdba/dmdbms/bin/
./disql SYSDBA/SYSDBA<<EOF
set serveroutput on
DECLARE
SQL_ VARCHAR;
begin
print sysdate;
SQL_='backup database INCREMENT WITH BACKUPDIR ''/dmbak'' backupset ''/dmbak/DB_INC_'||to_char(sysdate,'YYYY_MM_DD')||''' compressed level 1 parallel 4';
EXECUTE IMMEDIATE SQL_;
print sql_;
print sysdate;
end;
/
exit;
EOF
文章
阅读量
获赞