Here are two files, a NT cmd and a sql script that do hot backup of archivelog
databases.
Remember to configure the scripts and ajust to your enviroment
jaimin wrote:
> Hello guru's,
> I am using one database in nonarchive log mode, I want to change it to
> archive log mode.
>
> Platform Windows nt 4.0
> Oracle 7.3.0
> database size 10GB.
>
> Can any body give me the script which will automatically take online backup
> of my database?
>
> BFN,
> Jaimin.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: jaimin
> INET: [EMAIL PROTECTED]
>
> 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: [EMAIL PROTECTED] (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).
hotbackup.cmd
The previous attachment was filtered out by the ListGuru mailing
software at fatcity.com because binary attachments are not appropriate
for mailing lists. If you want a copy of the attachment which was
removed, contact the sender directly and ask for it to be sent to
you by private E-mail.
This warning is inserted into all messages containing binary
attachments which have been removed by ListGuru. If you have questions
about this message, contact [EMAIL PROTECTED] for clarification.
-- HOTBACKUP pl/sql program to perform a hot database copy to disc:\filesystem (NT)
-- Backup destination is set in the 'begin' section below, the line after: -- put your
..
-- Log file is made of database alteration: dohotbackup.log and not for the copy
process,
-- Ocopy73 is unable to redirect output!
-- Copyright (C) Svend Jensen & IFS Danmark 1998. All rights reserved.
REM ------------------------------------------------------------------------
REM DISCLAIMER:
REM This script is provided AS IS. It is NOT supported by
REM Oracle World Wide Technical Support nor IFS IOS.
REM The script has been tested and appears to work as intended.
REM You should always run new scripts on a test instance initially.
REM ------------------------------------------------------------------------
set serveroutput on size 1000000
set heading off
set feedback off
set linesize 80
set long 2000
set pagesize 500
set newpage 0
spool dohotbackup.sql
declare
-- put your filesystem below for the backup target directory. (<drive>:\target)
targetdir varchar2(80) := 'D:\Orabackup';
copylog varchar2(80) := 'Hotcopy.log';
fname varchar2(80);
tname varchar2(80);
tname1 varchar2(80);
cursor tspaces is select tablespace_name,
file_name
from v$datafile vdf,
sys.dba_data_files ddf
where vdf.enabled like '%WRITE%'
and ddf.status not in ('OFFLINE')
and vdf.file# = ddf.file_id
order by 1;
begin
dbms_output.enable(32000);
dbms_output.put_line('spool dohotbackup.log');
dbms_output.put_line('alter system switch logfile ;');
dbms_output.put_line('alter system archive log all ;');
dbms_output.put_line('alter system archive log current ;');
open tspaces;
fetch tspaces into tname, fname;
tname1 := tname;
dbms_output.put_line('host echo Start oracle copy process >> '||copylog );
dbms_output.put_line('host date /t >> '||copylog );
dbms_output.put_line('alter tablespace '||tname||' begin backup;');
while tspaces%FOUND loop
if tname1 != tname then
dbms_output.put_line('alter tablespace '||tname1||' end backup;');
dbms_output.put_line('alter tablespace '||tname||' begin backup;');
tname1 := tname;
end if;
dbms_output.put_line('host ocopy73.exe '||fname||' '||targetdir);
fetch tspaces into tname, fname;
end loop;
dbms_output.put_line('alter tablespace '||tname1||' end backup;');
close tspaces;
dbms_output.put_line('alter database backup controlfile to trace;');
dbms_output.put_line('alter database backup controlfile to '||''''||
targetdir||'\control.'||
to_char(sysdate,'DDMMYYYYHH24MISS')||''''||';');
dbms_output.put_line('alter system switch logfile ;');
dbms_output.put_line('alter system archive log all ;');
dbms_output.put_line('spool off');
dbms_output.put_line('exit');
end;
/
spool off
set heading on
set feedback on
set serveroutput off
-- Unremark/Uncomment the last following line if you want to run the script
-- or you can run it yourself at the sqlplus prompt.
-- @dohotbackup.sql
exit