Home » RDBMS Server » Backup & Recovery » RMAN Backup jobs on 10g Release 2
RMAN Backup jobs on 10g Release 2 [message #176827] Fri, 09 June 2006 18:57 Go to next message
suryamz
Messages: 17
Registered: March 2006
Junior Member
Hi

We are on 10g R2 (10.2.0.2)/Windows 2003 Server.

The Scenario is we have a database A on this server, and we want to create a second Database B on the same server that would handle the RMAN backups of the Database A.

I understand in 10g, the Database Control comes individually on each of the DB Creation.

[Grid Control might be of use, but we dont want to use Latest Grid Release - 10 R1 for now.]

We want to accomplish the task of RMAN backup of A using the Enterprise Manager (DB Console) of Database B.

I went through different options of Database "B" DB Console and couldnt figure out as how to set the RMAN Backup for Database A.

Can anyone help me out on this issue ?

Thanks in Advance,
Sj
Re: RMAN Backup jobs on 10g Release 2 [message #176878 is a reply to message #176827] Sun, 11 June 2006 01:33 Go to previous message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
I did not care for RMAN much so I wrote my own scripts that our Operator runs nightly. Your database must be in archivelog mode.

#!/bin/ksh
#@(#)oprmenu.ksh - S2000 database Operations menu
###
# Korn script to display a menu for our operators
# Ask operator which database maintenance job
# they would like to run.
#
# Autor: Neil MacDannald
# Date: 12/02/1999
# Modified: 01/08/2003 - add export and xfer jobs
###
#
# Ask operator what database job they would like to run
#
quit=n
clear
while test "$quit" = "n"
do
echo " "
echo " Menu"
echo "-----------------------------------------------"
echo " "
echo "1. Run S2000 hot backup "
echo "2. Run S2000 file compression "
echo "3. Run S2000 archive maintenance "
echo "4. Run S2000 export for Tracy "
echo "5. Run S2000 xfer export file to Tracy "
echo "6. Run S2000 hot backup cancel "
echo " "
echo "8. Run s2000 background process stop "
echo "9. Quit "
echo " "
echo "Enter choice: "
read choice
case $choice in
1) . ./hotbackup_start.ksh;;
2) . ./hotbackup_compress.ksh;;
3) . ./archivemaint.ksh;;
4) . ./export-s2000-database.ksh;;
5) . ./export-xfer-to-solarflare.ksh;;
6) . ./hotbackup_cancel.ksh;;
Cool . ./bgprockill.ksh;;
9) quit=y;;
*) echo "Invalid selection, enter 1, 2, 3, 4, 5, 6, 8, or 9 only \07\07"
sleep 5;;
esac
done

#!/bin/ksh
#@(#)hotbackup_start -- starts S2000 hotbackup
###
# Korn script to start hot backup of the S2000 database
#
# Autor: Neil MacDannald
# Date: 9/30/1999
# Modification: 04/26/2002 - multiplex archive files, copy from both locations
###
#
# Inform operator what job they have requested
# Ask if they wish to continue
#
echo " "
echo "*****"
echo Starting hot backup of S2000 database
echo "Continue? (Y/N)"
read answer
echo " "
if [[ "$answer" = [Yy]* ]]
then
df -k /u26
echo `date`
thedir=`pwd`
echo " "
echo Enter password for S2000 ORADBA
sttyops=`stty -g`
stty -echo
echo "Password: "\\c
read password
echo " "
stty $sttyops
#
# Start the hot backup job
#
sqlplus ORADBA/$password << EOF
@$thedir/hotbackup_start
exit
EOF
sleep 20
cp /u02/oradata/os2p/arch/*.ARC* /u26/oradata/os2p/budir/
cp /u24/oradata/os2p/arch/*.ARC* /u26/oradata/os2p/budir/u24arch/
df -k
echo `date`
fi

#!/bin/ksh
rem========================================================================
rem
rem Filename: hotbackup.sql
rem Purpose: Hot backup of Oracle database
rem Created: 9/14/1999
rem Modified: 04/02/2002 move backup directory
rem
rem It assumes :
rem - An underlying UNIX system
rem - The use of the 'cp' command to backup the files to a special
rem backup directory the name of which is prompted for in the
rem script
rem
rem Because of the high importance of backup procedures, due care is
rem given to the handling of errors. Any SQL or operating system error
rem will cause the script to exit and return a non-0 value to the
rem operating system.
rem
rem IT IS EXTREMELY IMPORTANT IN SUCH A CASE TO RUN THE ASSOCIATED
rem hotbackup_cancel.sql AS SOON AS POSSIBLE TO CANCEL THE
rem POSSIBLE 'BACKUP' STATE OF A TABLESPACE.
rem
rem========================================================================
set linesize 600
set pause off
set pagesize 0
set echo off
set feedback off
--
-- Hot-backup requires our running in ARCHIVELOG mode.
-- This is tested from the outset.
--
whenever sqlerror exit sql.sqlcode
declare
dummy char(1);
begin
select 'x'
into dummy
from v$database
where log_mode = 'ARCHIVELOG';
exception
when no_data_found then
raise_application_error(-20000, 'Database not in ARCHIVELOG mode !');
end;
/
set scan off
--
-- Interactively input the name of the directory (or device)
-- where to backup. This kind of dialogue is likely to prove
-- a hindrance in automated, daily operations.
-- You can either hard-code the directory name by using
-- define backup_dir = ...
-- or suppose it is passed as an argument to the current
-- script, in which case you should replace &&backup_dir by
-- &1 everywhere in this script and comment the following
-- 'accept' command
--
-- accept backup_dir prompt 'Backup directory : '
define backup_dir = /u26/oradata/os2p/budir/
--
set recsep off
set scan on
set verify off
--
-- You must absolutely check that everything goes according
-- to plans! If the backup fails because of, say, a
-- 'file system full' error, the script must exit with a
-- non-0 return code.
--
whenever sqlerror exit sql.sqlcode
whenever oserror exit 99
--
-- To be certain we have a consistent set of files which
-- we shall be able to recover, we also want to backup
-- all the redo log files generated during the backup,
-- and the final state of the control file.
-- Note that when recovering you normally must use the
-- current (i.e. at crash time) control file. However,
-- we want to be ready for the worst case scenario and
-- be able to use the current backup as if it were a
-- cold backup.
-- In order to know which redo log files have been generated
-- during the backup, we first identify which is, before
-- backup, the (current - 1) redo log file.
--
variable last_log varchar2(255)
begin
--
-- Format %S and %T (left-padded with zeros)
-- are not supported because length is OS-dependent.
-- Easy to support for a specific machine
--
select replace(pd.value, '?', '$ORACLE_HOME') ||
replace(replace(pf.value, '%s', rtrim(to_char(l.sequence#))),
'%t', rtrim(to_char(l.thread#)))
into :last_log
from v$parameter pd,
v$parameter pf,
v$log l
where pd.name = 'log_archive_dest'
and pf.name = 'log_archive_format'
and l.sequence# = (select max(sequence#)
from v$log
where status != 'CURRENT');
end;
/
--
-- Generate the backup script
--
-- online$ = 3 means a tablespace which once
-- existed but was dropped.
--
column dummy noprint
spool hbu_doit.sql
select ts# dummy,
1 dummy,
'alter tablespace ' || name || ' begin backup;'
from sys.ts$
where online$ != 3
and name <> 'TEMP_01'
union
select f.ts#,
2,
'host cp ' || d.name || ' &&backup_dir'
from sys.file$ f,
v$datafile d
where f.file# = d.file#
union
select ts#,
3,
'alter tablespace ' || name || ' end backup;'
from sys.ts$
where online$ != 3
and name <> 'TEMP_01'
order by 1, 2
/
spool off
--
-- Run the backup script just generated
--
set echo on
set feedback on
@hbu_doit
--
-- Take a backup of the control file for the worst-case scenario
-- Do not worry, parameter replacement is not echoed but done.
--
alter database backup controlfile to '&&backup_dir./control.ctl' reuse;
--
-- Trigger a redo log switch to close the current redo log file
--
alter system switch logfile;
set echo off
--
-- Force the archival of all the redo log files
--
declare
Stmt varchar2(100);
cid number;
dummy number;
nothing_to_archive exception;
PRAGMA EXCEPTION_INIT(nothing_to_archive, -271);
begin
Stmt := 'alter system archive log all';
cid := dbms_sql.open_cursor;
begin
dbms_sql.parse(cid, Stmt, dbms_sql.native);
dummy := dbms_sql.execute(cid);
exception
when nothing_to_archive then
null;
--
-- Unexpected errors
--
when others then
if (dbms_sql.is_open(cid))
then
dbms_sql.close_cursor(cid);
end if;
raise_application_error(-20000, Stmt || chr(10) || SQLERRM);
end;
dbms_sql.close_cursor(cid);
end;
/
set feedback off
--
-- Backup all the redo log files generated during hot backup
-- in ksh script when this completes until later
set echo on
--
-- All done!
--
exit 0
Previous Topic: exp problem
Next Topic: why more redologs generated ??
Goto Forum:
  


Current Time: Fri Mar 29 08:39:07 CDT 2024