Backup Script
From: Hari Om <hari_om_at_hotmail.com>
Date: 6 Aug 2003 12:04:06 -0700
Message-ID: <d1d5ebe4.0308061104.6a68c67e_at_posting.google.com>
#!/bin/ksh
ORACLE_SID=$1
export ORACLE_SID
export ORAENV_ASK=NO
BACKUP_DIR=/test01/app/oracle
. oraenv
sqlplus -s system/remorse << EOF
set head off feed off echo off trimspool on linesize 200 spool /u01/app/oracle/dba/cold_backup.ksh
exit;
EOF
Date: 6 Aug 2003 12:04:06 -0700
Message-ID: <d1d5ebe4.0308061104.6a68c67e_at_posting.google.com>
I have a question on the Cold Backup Scripts. I was reading a book and it showed how to use scripts to automate BACKUP. Here is a sample:
#!/bin/ksh
ORACLE_SID=$1
export ORACLE_SID
export ORAENV_ASK=NO
BACKUP_DIR=/test01/app/oracle
. oraenv
sqlplus -s system/remorse << EOF
set head off feed off echo off trimspool on linesize 200 spool /u01/app/oracle/dba/cold_backup.ksh
select 'cp' || file_name || '{$BACKUP_DIR}' from sys.dba_data_files; select 'cp' || name || '{$BACKUP_DIR}' from v$controlfile; select 'cp' || member || '{$BACKUP_DIR}' from v$logfile;spool off;
exit;
EOF
My question is with reference to line 6 (. oraenv) and Line 7
(sqlplus...)
What does Line 6 do? What is . oraenv used for?
What does SQLPLUS with '-s" option do?
I am a newbie and so please excuse my ignorance on this topic. Where can I find more startup scripts on Oracle DB?
Thanks! Received on Wed Aug 06 2003 - 21:04:06 CEST