Or you could do write a SQL script (i.e. "cold_backup.sql") like this:
conn &1/&[Email Address Removed] as sysdba
define v_backup_dir=c:\tmp
set echo off
set feedback off
set heading off
set linesize 400
set pages 0
set timing off
set trim on
set trimspool on
set verify off
spool run_cold_backup.sql
select 'shutdown immediate;' from dual;
select 'host copy '||file_name||' &v_backup_dir'
from dba_data_files
order by tablespace_name, file_name
;
select 'startup open;' from dual;
spool off
set echo on
set feedback on
set heading on
set linesize 90
set pages 20
set timing on
set verify on
spool run_cold_backup.log
@run_cold_backup.run
spool off
undefine v_backup_dir
exit
Then run it like so:
c:\ sqlplus /nolog @cold_backup.sql sys change_on_install orcl
Of course, you could/should do something to hide passwords from peering
eyes, but that's a different story. And with a minor mod or two you could
make this run on both Unix/Linux and Windows.
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete the material from any
computer.
Oracle LazyDBA home page