Wednesday, July 2, 2008

On Oracle services

Dynamic Registration

server-side failover configuration

Definition 1: A SERVICE is a logical abstraction of a single group of database clients or a single application and is primarily used for performance management and high availability.

 

In Oracle 10.2.0.1 you can’t (and shouldn’t) have more than about 20 active services in a single database.

 

There are two system services called SYS$BACKGROUND and SYS$USERS.
Background processes run under the former and users who connect without using a service name (i.e. with a SID) run under the latter.

These two system services are not registered with the listener and are only used for workload monitoring and reporting.

 

 

SQL> select value from v$parameter where name=’db_domain’;
VALUE
----------------------
lab.ardentperf.com


SQL> alter system set service_names=’jtest2,cust-portal-prod,cust-portal-bulk-load,crm-prod,development-wiki,rman-repository’ scope=both;
System altered.

SQL> host lsnrctl status -- the update may take a few seconds
...
Service "crm-prod.lab.ardentperf.com" has 1 instance(s).
Instance "jtest2", status READY, has 1 handler(s) for this service...
Service "cust-portal-bulk-load.lab.ardentperf.com" has 1 instance(s).
Instance "jtest2", status READY, has 1 handler(s) for this service...
Service "cust-portal-prod.lab.ardentperf.com" has 1 instance(s).
Instance "jtest2", status READY, has 1 handler(s) for this service...
Service "development-wiki.lab.ardentperf.com" has 1 instance(s).
Instance "jtest2", status READY, has 1 handler(s) for this service...
Service "rman-repository.lab.ardentperf.com" has 1 instance(s).
Instance "jtest2", status READY, has 1 handler(s) for this service...

 

** what services are active for the instance by querying the V$SERVICES dynamic performance view

 

When a service becomes active the PMON process will connect to the listener and inform it of all currently available services.

This process - called REGISTRATION - is automatically triggered

  1. when the database starts,
  2. when you update the SERVICE_NAMES initialization parameter,
  3. and every 60 seconds while the database is running (in case the listener restarts)

You can also force PMON to immediately register with the listener by issuing the command

ALTER SYSTEM REGISTER.

How does PMON know where to find the listener?

By default it looks on port 1521.

You can tell it to look elsewhere by setting the initialization parameter LOCAL_LISTENER with an alias from your local TNSNAMES.ORA or with an explicit connection descriptor.

In fact it is a strong recommendation and best practice to always explicitly set this parameter even if your listener is running on the default port.

No comments:

Post a Comment