Description:
WILL TAKE COLD BACKUP OF WHOLE DATABASE. WILL PERFORM SHUTDOWN/STARTUP AUTOMATICALLY.
Code:
Following script should be executed by dba account. This script will create batch file and will take a cold backup of your database. Shutdown and Startup will be handeled by Script.
Save following script as a "COLDBK.SQL"
Before executing this script please create DBBACKUP folder on C: drive.
--------------COLDBK.SQL--------------- set term off set head off set feedback off set verify off spool c:\startcopy.bat select 'copy '||name||' c:\DBBACKUP' from v$datafile; select 'copy '||name||' c:\DBBACKUP' from v$controlfile; select 'copy '||name||' c:\DBBACKUP' from v$tempfile; select 'copy '||member||' c:\DBBACKUP' from v$logfile; spool off shutdown IMMEDIATE host c:\startcopy.bat startup host del c:\startcopy.bat set term on set head on set feedback on set verify on -------------------------------