الثلاثاء، 14 مايو 2013

Oracle Connection Manager Configuration

Oracle Connection Manager Configuring 

Introduction 

Oracle Connection Manager is a proxy server, an intermediate server that forwards connection requests to database servers or to other proxy servers. 


It has two primary functions:
        Session multiplexing
        Access control
With session multiplexing, you can quickly enable Oracle Connection Manager to funnel multiple client sessions through a network connection to a shared server destination.
With access control, you can use rule-based configuration to filter out certain client requests and accept others.

Configuring Oracle Connection Manager

To configure Oracle Connection Manager:
  1. Configure the cman.ora file on the Oracle Connection Manager computer. This file specifies the listening endpoint for the server, access control rules, and Oracle Connection Manager performance parameters.
  2. Configure clients with the protocol addresses of the Oracle Connection Manager listener.
  3. Optionally Configure the database server for session multiplexing.

1- Configuring the Oracle Connection Manager Computer

Before start using OCM , you have to install it from the oracle client software. It is not automatically installed. choose "Custom" and explicitly select "Oracle Connection Manager" and "Oracle Listener" because we will need them both.

After that create the following files in the proxy server inside the "NETWORK\ADMIN" folder of the oracle home.

1: CMAN.ora file
CMAN_ProxyServer =
  (CONFIGURATION=
   
  (ADDRESS=
      (PROTOCOL=tcp)(HOST=192.168.1.65)(PORT=1821)
  )
  (parameter_list =
    (aso_authentication_filter=off)   
    (connection_statistics=yes)
    (log_directory=C:\ss) -- choose any path for the log file
    (max_connections=256)
    (max_gateway_processes=16)
    (min_gateway_processes=2)
    (remote_admin=yes)
    (trace_directory=C:\ss) -- choose any path for the trace file
    (trace_timestamp=on)
    (trace_filelen=1000)
    (trace_fileno=1)
    (max_cmctl_sessions=4)
    (event_group=init_and_term,memory_ops)
   )
   (RULE_LIST=
  (RULE=
         (SRC=192.168.1.66)(DST=192.168.1.64)(SRV=Devora)(ACT=accept)
               (ACTION_LIST=(AUT=off)(MOCT=0)(MCT=120)(MIT=30)(CONN_STATS=on))
  )
  (RULE=
          (src=*)(dst=127.0.0.1)(srv=cmon)(act=accept)
                (ACTION_LIST=(AUT=off)(MOCT=0)(MCT=120)(MIT=30)(CONN_STATS=on))
  )
  (RULE=
         (src=192.168.1.0/24)(dst=192.168.1.64)(srv=Devora)(act=accept)
         (ACTION_LIST=(AUT=off)(MOCT=0)(MCT=120)(MIT=30))
  )
  (RULE=
   (src=*)(dst=192.168.1.64)(srv=*)(act=reject)
  )
 )
  )

Note: Devora is the service name of the oracle DB in the main server
Note: the first rule is for a simple connection from a client machine to the Main server, the second one is for the CMON process of the OCM, the third one is for client machines in the same subnet, the last one rejects any suspicious request not in the previous rules.

2. LISTENER.ora file
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.65)(PORT = 1821))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1821))
    )
  )

3. SQLNET.ora file
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
USE_CMAN = true

4. TNSNAMES.ora file
Devora =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.64)(PORT = 1821))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = Devora)
      (GLOBAL_NAME = Devora)
    )
  )

===============================================

2- Configuring Clients for Oracle Connection Manager

To route clients to the database server through Oracle Connection Manager, configure the tnsnames.ora file with a connect descriptor that specifies the protocol address of Oracle Connection Manager. This address enables clients to connect to the Oracle Connection Manager computer. The connect descriptor looks like this:

1- add the following to the TNSNAMES.ora
CMAN =
  (DESCRIPTION =
    (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.65)(PORT = 1821))
)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = Devora)
    )
  )

Note: Client machines will access the "Devora" DB service name through the proxy server

2- The SQLNET.ora file 
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
USE_CMAN = true

                                  ===============================================

3- Configuring the Oracle Database Server for Oracle Connection Manager

Configuring the database server is a two-part process that involves registering database information remotely with Oracle Connection Manager and, optionally, configuring the server for multiplexing.

1- SQLNET.ora file 
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
USE_CMAN = true

2- INIT.ora this file exists at 'OracleHome'\dbs add these two lines to it
dispatchers = "(PROTOCOL=TCP) (MULTIPLEX=ON))"
REMOTE_LISTENER=LISTENER1

Note: the first line is for session multiplexing and the second is an alias for service remote registration 
After the alias is specified, it must be resolved with a service name entry in the tnsnames.ora file.

3-TNSNAMES.ora file Add the following to it 
LISTENER1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.65)(PORT = 1821))
  )

Note: "Listener1" is the remote listener mentioned in init.ora file

4- LISTENER.ora file
LISTENER1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.65)(PORT = 1821))
  )

SID_LIST_LISTENER1 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = Devora)
      (ORACLE_HOME = 'OracleHome')
      (SID_NAME = Devora)
    )
  )


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.64)(PORT = 1521))
    )
  )


SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = 'OracleHome')
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = Devora)
      (ORACLE_HOME = 'OracleHome')
      (SID_NAME = Devora)
    )
  )

Note: "Listener1" is the remote listener, where as "Listener" is the local listener

Finally you have to alter the system - connect as SYSDBA - and execute  the following lines

alter system set remote_listener = 'listener1';
alter system set local_listener = 'listener';
alter system register;
commit;

That's it
If you have any Q or helpful updates just leave a comment 
Eng Saf1 M. Alselwi


ليست هناك تعليقات:

إرسال تعليق