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

Home -> Community -> Usenet -> c.d.o.server -> Re: Backup Script

Re: Backup Script

From: Glen A. Stromquist <nobody_at_nospam.com>
Date: Tue, 16 Jul 2002 17:08:48 GMT
Message-ID: <AqYY8.11375$K6.655092@news2.telusplanet.net>


Howard:

For what its worth I use a much simpler version to to an online backup of my database running on AIX, basically just altering my NT/2000 one to use the unix commands.

As my 'nix skills are limited to say the least, this seemed like the simplest method for me at the time.

Here it is:


--hot Backup script --
--Written by Glen Stromquist July 14 2000--
--Modified for tbase on Feb 14 2002

--SET SESSION PARAMETERS AND SPOOL TO HOTBACKUP_8X.SQL-- connect user/pwd
set pages 0
set termout off
set heading off
set feed off
set linesize 95
column sqlline newline
spool /home/oracle/scripts/hotback_tbase.sql

select 'spool /home/oracle/scripts/hotback.log' from dual
/

select 'alter tablespace '||tablespace_name||' begin backup;' sqlline,
       '!cp '||file_name||' /u00/tbback/tbhot;' sqlline,
       'alter tablespace '||tablespace_name||' end backup;'
from dba_data_files
where tablespace_name in ('DATA_USER','DATA_TB','INDEX_TB','ROLLBACK_TB') UNION
select 'alter tablespace '||tablespace_name||' begin backup;' sqlline,
       '!cp '||file_name||' /test/tbhot;' sqlline,
       'alter tablespace '||tablespace_name||' end backup;'
from dba_data_files
where tablespace_name in
('STATISTICS','SYSTEM','TEMP_TB','TEMP_USER','TOOLS')
/

select '!rm /<<location>>/ctrlTBV7.ctl;' from dual
/

select 'alter database backup controlfile to '||'''/<<location>>/ctrlTBV7.ct l'''||';' from dual
/

select 'alter database backup controlfile to trace;' from dual
/

select '!cp /<<location>>/configTBV7.ora /test/tbhot/;' from dual
/

select '!cp /<<location>>/initTBV7.ora /test/tbhot/;' from dual
/

select 'spool off' from dual
/

select 'exit' from dual
/

spool off
--@/home/oracle/scripts/hotback_tbase.sql

exit


I elected to run this script and the generated one from a simple unix script (can't remember exactly why) that runs the both of them,(hence the commented out line at the end) however I have just noticed that I am backing up some tablespaces that do not need it!

As well, the UNION clause is in there as I did not have enough room in one location for the backed up files so I split them among 2 locations.

hth Received on Tue Jul 16 2002 - 12:08:48 CDT

Original text of this message

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