ITPub博客

首页 > 应用开发 > Java > Cold Database backup script

Cold Database backup script

原创 Java 作者:foreverlee 时间:2005-03-09 17:38:34 0 删除 编辑
--Set SQL*Plus variables to manipulate output
set feedback off heading off verify off trimspool off
set pagesize 0 linesize 200
[@more@]--Set SQL*Plus variables to manipulate output
set feedback off heading off verify off trimspool off
set pagesize 0 linesize 200
--Set SQL*Plus user variables used in this script
define dir = '/backup/cold_backup'
define fil = /tmp/closed_backup_temp.sql'
prompt Spool to &fil ......
--Create a command file with file backup commands
spool &fil
 select 'host cp '||name||' &dir ' from v$datafile order by 1;
 select 'host cp '||member||' &dir ' from v$logfile order by 1;
 select 'host cp '||name||' &dir ' from v$controlfile order by 1;
 select 'host cp '||name||' &dir ' from v$tempfile order by 1;
spool off
--Shutdown the database cleanly
shudown immediate;
--Run the copy file commands using the os command
@fil
--Start the database
startup

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

上一篇: crontab
请登录后发表评论 登录
全部评论

注册时间:2008-11-26

  • 博文量
    72
  • 访问量
    1356218