Wednesday 6 August 2014

Creating CATALOG Database in Oracle


Catalog Database creation:

I am using my windows os and oracle 11.2.0 express edition for catalog database


My database sid is XE and hotname is bhasskar-pc



1. Disable your firewall first



2. Network configuration: (for catalog and target databases)

In linux: 


#su - oracle


check if there is any listenter running 

$ps -ef | grep tns

check the hostname and note it down for forther user

$hostname

$netmgr


add listenter (give hostname and port number)

add database (give db details)
save the network configuration details
exit


it will create listenter.ora file at ORACLE_HOME/network/admin location


start the listeners
start database first.

 $lsnrctl start listener;


check the listeners status until it changes 

$lsnrctl status listenter;

check the xe status as 'READY' has 1 instances


$netca

add 'local net service name configuration'

it will create tnsnames.ora file at ORACLE_HOME/network/admin location



or 


In windows or linux 

u can create manually these files and details as follows

goto 


cd ORACLE_HOME/
network/admin

create files listener.ora and tnsnames.ora  files, and 
add listeners


listener.ora


SID_LIST_LISTENER =

  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = XE )
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (SID_NAME = XE )
    )
    ----------------------
    ----------------------
  )

LISTENER =

  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = bhasskar-PC)(PORT = 1521))
    )
  )

tnsnames.ora

XE =

  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = bhasskar-PC)(PORT = 1521))
    (CONNECT_DATA =
       (SERVICE_NAME = XE)
    )
  )

ORCL=

  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
       (SERVICE_NAME = ORCL)
    )
  )

NOTE:  ORCL is the tnsname configured in the target server who has a database
sid is orcl and the hostname is 'lcoalhost.localdomain'. you can do it alter.

shutdown the database



3. catalog database configuraton:

before starting the database


create password file at oracle_home/dbs location (in xe 'oracle_home'/database')

$orapwd   file=orapw  password=pass  force=y

start the database


sql> create tablespace  rcat datafile '/u02/app/oracle/oradata/rcat.dbf' size 100m;


sql> create user rcat identified by rcat  default tablespace rcat;


sql> grant connect, resource, recovery_catalog_owner to rcat;


sql> conn rcat/rcat;


sql> select * from tab;


after database creation at target side it will show all 149 views 



4. Start the listeners (at os level):


start the listeners if you need


$lsnrctl start listener;

check the listeners status until it changes 

$lsnrctl status listenter;

check the xe status as 'READY' has 1 instances

check if any listenter are running 

$ps -ef | grep tns

5. target database configuration: (In linux)

my database sid is orcl and hostname is 'localhost.localdomain'


a. first do the network configuraton 

b. create a password file at oracle_home/dbs location
c. start the database
d. start the listeners
e. connect to the rman 

$> rman targer /   catalog rcat/rcat@XE

if it is connected to orcl and xe databases

rman> create catalog

rman> register database


6. In the catalog database:

check whether the views are created in rcat

sql>select * from tab;

sql> select * from rc_database;

Optimizer Access Paths using Indexes

Introduction In this tutorial you will use the Optimizer Access Paths for the following cases (scenarios): Case 1: With and Without Index Ca...