oracle用户管理模式下备份模板

来源:互联网 发布:java中的for循环 编辑:程序博客网 时间:2024/06/10 00:26

     准备将chinaunix上的文章逐步转移过来,决定技术blog就安家到CSDN了。

 

Remark set sql*plus variables to manipulate output
set feedback off heading off verify off trimspool off
set pagesize 0 linesize 200
Remark set sql*plus user variables used in this script
define dir = 'D:/Backup/chapt4'
define fil = 'D:/Backup/chapt4/closed_backup_commands.txt'
prompt *** spooling to &fil
Remark Create a command file with file backup commands
spool &fil
select 'host copy ' || name || ' &dir' from v$datafile order by 1;
select 'host copy ' || member || ' &dir' from v$logfile order by 1;
select 'host copy ' || name || ' &dir' from v$controlfile order by 1;
select 'host copy ' || name || ' &dir' from v$tempfile order by 1;
spool off;
Remark shutdown the database cleanly
shutdown immediate;
Remark Run the copy file commands from the operating system
@&fil
Remark Start the database again
startup;

 

这个是oracle用户管理模式下的备份模板,其实就是手工备份啦!

原创粉丝点击