Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Help automating SQL Hot Backup script with batch file...

Help automating SQL Hot Backup script with batch file...

From: Denmark Weatherburne <>
Date: Tue, 14 Aug 2001 08:23:06 -0700
Message-ID: <>

Hi DBA's,

I know this question was asked some time ago. Although I tried the recommended solution, it did not work for me. I'll paste my scripts. Hopefully, someone can point out my error. First the background:
I want to run this scripts from a remote client machine which has the Oracle DBA client (NT) installed or from another remote NT server which has Oracle 8.0.5 installed as well. The target database (Production) is located on the LAN. It is running Oracle 8.0.5 on NT 4.0 as well. I can connect start up either an SQLPLUS session or SVRMGR session and execute the Hot_Backup.sql script. However, when I try to invoke the SQLPLUS or SVRMGR program with the Hot_Backup script it fails with a message that I'm not connected to Oracle or Oracle is not available. As you can see from the commented lines in the batch file, I tried other options as well but none seems to work. Of course I want to use Winat.exe when it works.
I know that there are some commands that can only be executed from the SVRMGR prompt. For other scripts, can any script that can be run in SQLPLUS also be run from the SVRMGR prompt?

Here is the batch file (Hot_Backup_PROD.bat): SET ORACLE_SID=PROD
REM \\lamanai\e$\orant\BIN\PLUS80W.EXE

Here is the Hot_Backup.sql script:

connect internal/********;

spool C:\WINNT\Profiles\Administrator.000\Desktop\SQLs\DBA\Hot_Backup.out

alter system switch logfile;
alter system switch logfile;
alter tablespace IRD_BASE begin backup;
Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\IRDBASEPROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace IRD_BASE end backup;
alter tablespace IRD_DATA_LARGE begin backup; Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\USR1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace IRD_DATA_LARGE end backup; alter tablespace IRD_INDEXES begin backup; Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\INDX1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace IRD_INDEXES end backup; alter tablespace IRD_TEMP begin backup;
Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\TMP1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace IRD_TEMP end backup;
alter tablespace RBS begin backup;
Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\RBS1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace RBS end backup;
alter tablespace ROLLBACKSPACE1 begin backup; Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\ROLL1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace ROLLBACKSPACE1 end backup; alter tablespace SYSTEM begin backup;
Host L:\orant\bin\ocopy80.exe L:\ORANT\DATABASE\SYS1PROD.ORA N:\ORA_Hot_Bkup\PROD
alter tablespace SYSTEM end backup;
alter system switch logfile;
alter system switch logfile;
alter database backup controlfile to 'ctl1PROD.bak'; --Binary copy created in ORACLE_HOME\database\ctrlPROD.bak; alter database backup controlfile to trace; --SQL file appended to ORACLE_HOME\RDBMS80\Trace\(current Ora99999.trc file);
spool off
Thanks in advance for your help,

Denmark Weatherburne
"Knowledge is power, but It is only useful if it is shared!"

Get your FREE download of MSN Explorer at
Please see the official ORACLE-L FAQ:
Author: Denmark Weatherburne

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
To REMOVE yourself from this mailing list, send an E-Mail message
to: (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Aug 14 2001 - 10:23:06 CDT

Original text of this message