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;
阅读(846) | 评论(0) | 转发(0) |