Operating System - HP-UX
1820199 Members
3882 Online
109620 Solutions
New Discussion юеВ

Oracle listener and process

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Oracle listener and process

What is the difference between oracle listener and oracle database process ? If we want to find the status of database; should we be interested in database or listener process ?

Thanks,
Shiv
13 REPLIES 13
Steven E. Protter
Exalted Contributor
Solution

Re: Oracle listener and process

The listener "listens" for incoming connections to the database. No listener, nobody can use the data.

The other database processes do other job. smon, monitors, logwr writes logs and such.

ps -ef | grep oracle

You will see a list that accomplishes various tasks within the database system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rita C Workman
Honored Contributor

Re: Oracle listener and process

Stephen has answer the one. Let me add another.....if a listener gets out of sync with the database, like when you have a network disruption or reset, it is like a heart beat having a problem arythmia.

So both the database must be up, and the listener listening properly for everything to work right.

Rgrds,
Rita
Devender Khatana
Honored Contributor

Re: Oracle listener and process

Hi,

A database running and lintener not running would be the scenario like a machine having a Ethernet card without a IP address.

So everything is there but you can not access it. So listener should always be running when you wish to connect to database.

HTH,
Devender
Impossible itself mentions "I m possible"
Shivkumar
Super Advisor

Re: Oracle listener and process

What is the command to find the listener process ?

Thanks,
Shiv
James R. Ferguson
Acclaimed Contributor

Re: Oracle listener and process

Hi Shiv:

Try:

# ps -ef|grep -i listen

...you will see something like:

oracle 2216 1 0 Apr 23 ? 92:33 /ora_apps/app/oracle/product/8.1
.7.0/bin/tnslsnr LISTENER -i

Regards!

...JRF...
Devender Khatana
Honored Contributor

Re: Oracle listener and process

Hi,

From oracle user you can also give to find out the status of listener.

#lsntctl status

HTH,
Devender
Impossible itself mentions "I m possible"
Indira Aramandla
Honored Contributor

Re: Oracle listener and process

Hi Shiv,

Listener process
The listener process is a process listening for incomming connections on behalf of 1 or more databases.
The following are listener Characteristics:
- a listener process can listen on behalf of more than one database
- multiple listeners can listen on behalf of one single database (load balancing)
- can listen on multiple protocols
- default name is LISTENER
- the name must be unique on the machine it resides on

The listener process is responsible for detecting and routing the incoming requests to the proper destination. Except when connection is established through a special method called hostnaming.

A user initiates a connect request by passing password/username and servicename The service name maps to a connect descriptor wich is resolved by hostnaming, local naming or oracle names. (sqlnet.ora tnsnames.ora names.ora). When a service name is resolved a request is send to the listener. The listener determines were to direct the request.

Oracle processes
There are different oracle program types. The first program type you should be aware of are the Oracle user or client processes. These processes are created when you start a program which will work with an Oracle database. The second program type you should be aware of are the Oracle shadow or server processes. Shadow processes work directly with the database instance to carry out the requests from the user processes. The third program type you should be aware of are the Oracle background processes.

Oracle background processes. These processes are created when you start a database instance. Common examples of Oracle background processes are log writer (lgwr), database writer (dbw0), system monitor (smon), process monitor (pmon), recovery (reco), and check point (ckpt), but may include others. These processes run with the name ora_ProcessName_SID, where ProcessName is the name of the background process and SID is the value of ORACLE_SID.

These are the processes which manage the Oracle RDBMS. Some must always be running for the server to be available; others are optional on all platforms; and some are optional and specific to certain platforms.

To verify a database is up and runing loomfor the following process.
A = Must always be running
O = Optional on all platforms
P = Optional and specific to a platform


DBWR (A) - the database writer
LGWR (A) - the log writer
PMON (A) - the process monitor
SMON (A) - the system monitor
CKPT (O) - the checkpoint process (or thread)
ARCH (O) - the archive process (or thread)
RECO (O) - the recoverer process (or thread)

Attached are two documents that explains the various Oracle Back ground processes and the new Oracle Background processes in 10g.

Indira A


Never give up, Keep Trying
Ganesha Sridhara
Honored Contributor

Re: Oracle listener and process

Hello Shiv,

In oracle the listener "listens" will accept incoming connections to the database which by default runs on port 1521.
The status of listener can be obtained by command:
lsnrctl status (execute as oracle user)

e.g., output
Service "oracle" has 2 instance(s).
Instance "sid1", status UNKNOWN, has 1 handler(s) for this service...
Instance "sid1", status READY, has 1 handler(s) for this service...

For each instance one listener will be running.

The database background processors which manage DB are:
PMON - Process monitor
SMON - system monitor
DBWR - Database writer
LGWR - Log Writer

Optional
ARCH - Archiver
CKPT - Checkpoint
RECO - Recovery
PMON - Process monitor
SMON - system monitor
DBWR - Database writer
LGWR - Log Writer

Optional
ARCH - Archiver
CKPT - Checkpoint
RECO ├в Recovery

The status of DB can be obtained by executed following command as oracle user
ps -ef | grep

Which will list the background processes.

ps - ef | grep sid1
e.g.,
oracle 3136 1 0 Jul 22 ? 14:26 ora_pmon_sid1
oracle 3144 1 0 Jul 22 ? 8:40 ora_smon_sid1
oracle 1582 1552 0 13:07:47 pts/th 0:00 grep sid1
oracle 3140 1 0 Jul 22 ? 5:45 ora_lgwr_sid1
oracle 3138 1 0 Jul 22 ? 5:44 ora_dbw0_sid1
oracle 3142 1 0 Jul 22 ? 18:38 ora_ckpt_sid1
oracle 3146 1 0 Jul 22 ? 0:02 ora_reco_sid1
oracle 3148 1 0 Jul 22 ? 13:09 ora_cjq0_sid1
oracle 3150 1 0 Jul 22 ? 11:19 ora_qmn0_sid1


Regards
Ganesha Sridhara
Yogeeraj_1
Honored Contributor

Re: Oracle listener and process

Dear shiv,

allow me to add the following:

A listener can also be configured with one or more listening protocol addresses, information about supported services, and parameters that control its runtime behavior. The listener configuration is stored in a configuration file named listener.ora.

Because all of the configuration parameters have default values, it is possible to start and use a listener with no configuration. This default listener has a name of LISTENER, supports no services upon startup, and listens on the following TCP/IP protocol address:
(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)(PORT=1521))

For more information see also:
http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96580/listener.htm#454524

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
ram chaitanya muppalla_1
Occasional Advisor

Re: Oracle listener and process

Hello Shiv,

To answer ur question.

In explicit sense status both are different.

These can be treated as two separate components.

If db is open , the status is said to be open for all operations. (internal user aka sys doesn't need to have listener available to connect and work).

If listener is available, all the users will be able to connect (only if the description from listener and tnsnames.ora incase of c/s techno.. else description provided should match incase of a java client) or the client shall receive the famous tns-12* errors. Which doesn't mean that db is unavailable (problem with configuration etc,.)


listener process => waits for incoming requests from users as specified in listener.ora file located under ${ORACLE_HOME}/network/admin

Listener process is a server side network file used in TNS configuration. On the client side we have java jndi or tnsnames.ora etc,. which contains the description.

If listener process is not running on the server side and client makes a request , then we get TNS- no listener error...

DB Processes: As detailed by other members, these are server side database processes.

That's my two cents and if u need more details.. feel free.

Regards,
Ram
Rajesh SB
Esteemed Contributor

Re: Oracle listener and process

Hi Shiv,

Oracle database server designed as client server.
On Server Oracle Database instance will be running, is identified by SID.

Locally db user access the database by
setting env ORACLE_SID=
$ sqlplus dbuser/pass@

If db user wants to access the Database across the network, Listener role is important. Listener provides the network tcp service to access the database via Oracle client and tnsnames.ora configuration.

How to check the listener status.

As a oracle user run
$ /oracle/app/ora9i/bin/lsnrctl status
OR
$ /oracle/app/ora9i/bin/lsnrctl status []

How to verify the listner is responding for database access.
As a oracle user
$ tnsping

where sid_name is defined in tnsnames.ora file. DB user connect/access to Database using this sid_name across the network.


Regards,
Rajesh
morganelan
Trusted Contributor

Re: Oracle listener and process

The Oracle TNS Listener is the server-based process that provides basic network connectivity for clients, application servers, and other databases to an Oracle database. In addition to databases, the Listener can also be configured to support binary executables.

The Listener can be configured in one of three modes (as configured in listener.ora):
├в Database :Provides network access to an Oracle database instance
- PLSExtProc : Method for PL/SQL packages to access operating system executables
- Executable: Provides network access to operating system executables.

The ├в Database├в mode is the most widely used mode and is the standard mode used by every database for connectivity. ├в PLSExtProc├в allows PL/SQL database packages to access external programs and is configured by default for many instances. ├в Executable├в mode allows an external program to be defined and accessed through a TNS connection.
Kamal Mirdad
TwoProc
Honored Contributor

Re: Oracle listener and process

Just wanted to a note re: James' post:
If you want to search for each listener by name - then use James' posting:
ps -ef | grep LISTEN

but, you can name your listeners (LISTENER is the default name), so searching for all tnslisteners, I use:

ps -ef | grep tns

or for more exact (in case there is a conflict with another program which has the word "tns" in it - but I doubt it)

ps -ef | grep tnslsnr
We are the people our parents warned us about --Jimmy Buffett