--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
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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/76065/viewspace-792091/