您的位置:首页 > 数据库 > Oracle

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

2010-04-03 11:38 363 查看
     准备将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用户管理模式下的备份模板,其实就是手工备份啦!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息