Oracle冷备份(一致备份)脚本

'系统:linux redhat 3
closed_backup.sql脚本存放在/u01/backup/目录下

脚本内容:
      1 Remark set sql*plus variables to manipulate output
      2 set feedback off heading off verify off trimspool off
      3 set pagesize 0 linesize 200
      4 Remark set sql*plus user variables used in this script
      5 define dir ='/u01/backup'
      6 define fil='/u01/backup/closed_backup_commands.sql'
      7 prompt *** Spooling to &fil
      8 Remark create a command file with file backup commands
      9 spool &fil
     10 select 'host cp '|| name ||' &dir' from v$datafile order by 1;
     11 select 'host cp '|| member ||' &dir' from v$logfile order by 1;
     12 select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
     13 select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
     14 spool off;
     15 Remark Shutdown the database cleanly
     16 shutdown immediate;
     17 Remark Run the copy file commands from the operation system
     18 @&fil
     19 Remark start the database again
     20 startup;
     21


用oracle中的sys  or  system 用户在sqlplus中运行
>@/u01/backup/closed_backup.sql

即可.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12778571/viewspace-201786/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12778571/viewspace-201786/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值