Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: shutdown script for Oracle on NT

Re: shutdown script for Oracle on NT

From: Matthias Gresz <GreMa_at_t-online.de>
Date: Thu, 25 Feb 1999 08:40:21 +0100
Message-ID: <36D4FE65.9A0BF4D9@t-online.de>

Dave Nguyen schrieb:
>
> Hi all,
> Hope you can make this clear. I am running Oracle
> 7.3.4 on NT and want to automate shutdown and restart
> Oracle to perform cold backup. I was told I could use
> the following, but I am not sure this will actually
> close my database for cold backup (I know it stops the
> Oracle Services). Please, if you have any
> suggestions, I would appreciate it.
>
> Stop an instance
> ORADIM73 -SHUTDOWN -SID sid [-USRPWD user_pwd] -
> SHUTTYPE SRVC, INST - SHUTMODE a, i, n
>
> Start the instance
> ORADIM73 -STARTUP -SID sid -PFILE filename [-USRPWD
> user_pwd] -STARTTYPE SRVC,INST
>
> *** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***

Hi Dave,

I wont use these scripts for a cold backup since shutting down the services is like cutting the power line. In case of a backup your backupped databse will always need a instance recovery, which isn't the aim of a cold backup.

To do a cold backup, shutdown the instance immediate(let service run), startup restrict to do an instance recovery if necessary, switch redo logs so that all online redo logs are archived and therefore emptied, backup controlfile to trace and then backup all your datafiles, your controfiles and the archived redo logs.

Call server manager to run the SQL-script:

c:\programm\orant\bin\SVRMGR23.EXE @c:\cmd\sql\down_bac.sql

SQL-script would look like:

CONNECT <dba>/<pwd>
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;

alter rollback segment rb1 SHRINK;
alter rollback segment rb2 SHRINK;
alter rollback segment rb3 SHRINK;
alter rollback segment rb4 SHRINK;
alter rollback segment rb5 SHRINK;
alter rollback segment rb6 SHRINK;
alter rollback segment rb7 SHRINK;
alter rollback segment rb8 SHRINK;
alter rollback segment rb9 SHRINK;
alter rollback segment rb10 SHRINK;
alter rollback segment rb11 SHRINK;
alter rollback segment rb12 SHRINK;
alter rollback segment rb13 SHRINK;
alter rollback segment rb14 SHRINK;

alter rollback segment rb15 SHRINK;
alter rollback segment rb16 SHRINK;
alter rollback segment rbbig SHRINK;
ALTER SYSTEM SWITCH LOGFILE;	-- number of logfiles in group times
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;

ALTER DATABASE BACKUP CONTROLFILE TO TRACE; SHUTDOWN; Then run your backup. The cmd-file could also be run as the pre-job of your backup-software.

HTH
Matthias
--
grema_at_t-online.de

Es gibt nichts Neues mehr.
Alles, was man erfinden kann, ist schon erfunden worden. Charles H. Duell, Leiter des US Patentamtes bei seinem Rücktritt 1899 Received on Thu Feb 25 1999 - 01:40:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US