Sie sind auf Seite 1von 5

Learning RMAN And Managing Multiple Oracle Instances On A Single Windows Server

Introduction................................................................................................................................................... 2
Server Configuration ..................................................................................................................................... 2
Shutdown Instance and Service "DB114"...................................................................................................... 2
Installing Oracle database Instance "EUDB114": .......................................................................................... 2
Shut down Oracle Instance and Windows Service "EUDB114" ..................................................................... 2
Installing Oracle database Instance "USDB114" ........................................................................................... 2
Setting Oracle Environment Variables .......................................................................................................... 3
Setting Oracle SID .......................................................................................................................................... 3
RMAN Practice............................................................................................................................................... 3
Tablespace for RMAN .................................................................................................................................... 3
RMAN User .................................................................................................................................................... 3
Create Catalog ............................................................................................................................................... 3
Connect Target Database and Catalog .......................................................................................................... 4
Change RMAN Configuration Parameters ..................................................................................................... 4
Run the Configuration File............................................................................................................................. 4
Backup Database and Archives ..................................................................................................................... 4
Instance and Service "EUDB114" Startup...................................................................................................... 5
Useful Links.................................................................................................................................................... 5

Introduction

The idea is to practice installing multiple Oracle Instances on a Single Windows Server and also
learning RMAN.
Creating and managing two or more Oracle Instances on a single Windows Server.
Using RMAN connecting these Instances and getting backup.
The links at the bottom would help more to learn or test if you are new to Oracle on Windows
like I am with it :-).
ORADIM is one of the tool to manage Oracle on Windows .
The Oracle Instances created and named as :
"EUDB114" (EUDB-> Europe Database->) and "USDB114" (USDB-> USA Database).

Server Configuration
On "orasys1" Host we already created a database Instance. It is found here.
http://de.scribd.com/doc/225333424/Primary-and-Standby-on-Windows

Shutdown Instance and Service "DB114"


Using " ORADIM" we shutdown Instance and Windows Service of "db114".
C:\> oradim -shutdown -sid db114 -shuttype srvc, inst

Installing Oracle database Instance "EUDB114":


Note: During Installation with "DBCA" I preferred not to configure EM.
Open CMD Window as "run as administrator".
Using DBCA we create a database called "eudb114".

Shut down Oracle Instance and Windows Service "EUDB114"


Using ORADIM we shut down database Instance and Service.
C:\> oradim -shutdown -sid eudb114 -shuttype srvc, inst

Installing Oracle database Instance "USDB114"


Using DBCA we create a database called "usdb114".
Using "ORADIM" we can shut down database Instance and Service.
C:\> oradim -shutdown -sid usdb114 -shuttype srvc, inst
We now have 3 databases Instances installed on this host.

Setting Oracle Environment Variables


Environment Variable of PATH and ORACLE_HOME are set. See the Section "Environment Variables" on
the below link.
http://de.scribd.com/doc/225333424/Primary-and-Standby-on-Windows

Setting Oracle SID


We just need to set "ORACLE_SID" to connect an Oracle instance and Start it.
Using "ORADIM" we now start up a database Instance and Service if it's not started.
C:\> set oracle_sid=usdb114
Startup Instance and Service "USDB114" :
Open a CMD Window as "run as administrator".
C:\> oradim -startup -sid usdb114 -starttype srvc, inst

RMAN Practice
Created a Directory called "Scripts" in "F" Drive.
To change to Drive "F".
C:\> f:
F:\> cd scripts
F:\scripts> set oracle_sid=usdb114
F:\scripts> sqlplus sys as sysdba
Press just "Enter" Key as the password is automatically read if Password file is present in the directory "
%ORACLE_HOME%\database ".

Tablespace for RMAN


SQL> create tablespace rmantbs datafile ' /u01/oradata/DB114/rmantbs.dbf '
size 300M
autoextend on extent management local;

RMAN User
SQL> create user rman identified by rman default tablespace rmantbs quota unlimited on
rmantbs;
SQL> grant resource, recovery_catalog_owner to rman;
Create Catalog
F:\scritps\> rman catalog rman/rman
RMAN> create catalog;
output : recovery catalog created
RMAN> exit

Connect Target Database and Catalog


F:\scritps\> rman target / catalog rman/rman@USDB114
RMAN> list incarnation;
The above command tells us the databases registered in our RMAN Catalog.
RMAN> register database;
RMAN> list incarnation;
Change RMAN Configuration Parameters
We Spool a Log File when we are at RMAN prompt .
F:\scripts> rman target / catalog rman/rman@USDB114
Note: We should know our present working directory as it will Spool there.
RMAN> spool log to rman_config.txt;
RMAN> show all;
RMAN> spool log off ;
Open the "rman_config.txt" and change the RMAN Configuration Parameters that is suitable to you.
These are the basic RMAN Configuration that I changed initially and saved only the below in the
"rman_config.txt" File.

CONFIGURE CONTROLFILE AUTOBACKUP ON;


CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE
DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'
G:\recovery_area\USDB114\snapcf_%d.f ' ;
Run the Configuration File
RMAN> @F:\scripts\rman_config.txt
In the below link check the sections "Show" and "Configure" to learn more.
http://satya-dba.blogspot.de/2010/04/rman-commands.html
Database should be in archive log mode.

Backup Database and Archives

RMAN> backup database tag='test backup' plus archive log;


Verify the Backup:
RMAN> spool log to list_bkp.txt;
RMAN> list backup;
RMAN> spool log off;
Open the file "list_bkp.txt" and see how the Backup is performed.

Lastly I shut down this instance so that I connect to another database Instance.
RMAN> exit
F:\scripts> oradim -shutdown -sid usdb114 -shuttype srvc, inst

Instance and Service "EUDB114" Startup


F:\scripts> oradim -startup -sid eudb114 -starttype srvc, inst
F:\scripts> set oracle_sid=eudb114
F:\scripts> sqlplus sys as sysdba
SQL> select instance_name from v$instance;
Same steps that were performed above to do backup using RMAN.

Useful Links
http://satya-dba.blogspot.de/2010/04/rman-commands.html
https://community.oracle.com/thread/1128974
http://www.dba-oracle.com/t_rman_recovery_window_retention.htm
http://pavandba.com/2011/07/11/how-to-define-rman-retention-policy-time/