SPOOL COLBUP.TXT
REM YOU MUST HAVE SELECT PRIVILEGES ON THE V$PARAMETER
REM V$LOGFILE V$DBFILE AND V$CONTROL_FILE DATE
REM DICTIONARY VIEWS BELONGING TO SYS TO RUN THIS PROGRAM
SET PAGES 0 FEED OFF ECHO OFF
COL A NEW_VALUE B
COL C NEW_VALUE D
SELECT VALUE A,SYSDATE C FROM V$PARAMETER
WHERE NAME='db_name';
spool off
set linesize 63
spool cold.txt
prompt cold backup for "&b" database on &d...
prompt
prompt# Redo logs
prompt
select 'tar -rvf /dev/st0 '||member from v$logfile;
prompt
prompt # Datafiles
prompt
select 'tar -rvf /dev/st0 '||name from v$dbfile;
prompt
prompt # Control files
prompt
select 'tar -rvf /dev/st0 '||name from v$controlfile;
prompt
prompt # Temporary files
prompt
select 'tar -rvf /dev/st0 '||name from v$tempfile;
prompt
prompt # pfile and spfile and controlfile trace
prompt
prompt tar -rvf /dev/st0 $ORACLE_HOME/dbs/initapvm1.ora
prompt tar -rvf /dev/st0 $ORACLE_HOME/dbs/spfileapvm1.ora
prompt tar -rvf /dev/st0 $ORACLE_HOME/dbs/ctrlfile.ora
prompt tar -rvf /dev/st0 $ORACLE_HOME/network/admin/listener.ora
prompt
prompt # Password and Shadow file
prompt
prompt tar -rvf /dev/st0 /etc/passwd
prompt tar -rvf /dev/st0 /etc/shadow
spool off