Oracle® Database 2 Day DBA 11g Release 1 (11.1) Part Number B28301-01 |
|
|
View PDF |
A client is any application that connects to Oracle Database to send or retrieve data. An Oracle Database client application can reside on any computer provided it has Oracle Database client software installed.
Oracle Net is a software layer that resides on the client computer and on the Oracle Database host computer. It establishes and maintains the connection between the client application and the database over a network, and exchanges messages between them using industry standard protocols.
For a client application and a database to communicate, the client application must be able to identify the database it wants to connect to, and the database must provide some sort of identification or address. You can use a service name to connect to a database. A service name is a logical representation of a database, which is the way a database is presented to clients. A single database can be presented as multiple services.
Using service names can provide location transparency such that the client application does not need to know the server's location. When the database is moved to another location, you need to reconfigure only Oracle Net. No changes are necessary to client applications.
On the database server, the Oracle Net listener, commonly known as the listener, is a process that listens for client connection requests. It receives incoming client connection requests and manages the traffic of these requests to the database server.
The default listener configuration file is called listener.ora
, and it is located in the Oracle_home
/network/admin
directory. The file contains a protocol address that identifies the database. This address defines the protocol the listener is listening on and any other protocol-specific information. For example, the listener could be configured to listen at the following protocol address:
(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=my-server) (PORT=1521)))
This example shows a TCP/IP address that specifies the host computer of the listener and a port number.
The listener.ora
file is automatically configured during installation, but can be reconfigured with Oracle Enterprise Manager Database Control. For more information, see "Viewing Listener Configuration" and "Starting and Stopping the Listener" .
Because all of the configuration parameters have default values, it is possible to start and use a listener without configuring it. This default listener has a name of LISTENER
, supports no service names upon startup, and listens on the following TCP/IP protocol address:
(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)(PORT=1521))
An Oracle database registers with the listener within a minute or so of starting up. Supported service names, that is, the service names, or databases, to which the listener forwards client requests, can be configured in the listener.ora
file, or this information can be dynamically registered with the listener. This dynamic registration feature is called service registration. The registration is performed by the process monitor (PMON) process—an instance background process—of each database instance that has the necessary configuration in the database initialization parameter file. Dynamic service registration does not require any configuration in the listener.ora
file.
See Also:
Oracle Database Net Services Administrator's Guide for more information about configuring listenersThe client uses a connect descriptor to specify the database to which it wants to connect. This connect descriptor contains a protocol and a database service name. A database can have multiple service names defined, so a specific service name must be specified for the connect descriptor. In a preconfigured database, there is only one service name, which defaults to the global database name.
The following example shows a connect descriptor that enables clients to connect to a database with service name mydb.us.acme.com
:
(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=my-server) PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=mydb.us.acme.com)))
Users initiate a connection request by providing a connect string. A connect string includes a user name and password, and a connect identifier. This connect identifier can be the connect descriptor itself, or a name that resolves to the connect descriptor using mapping information stored in one or more repositories accessed with the naming methods described in "Naming Methods". This name is referred to as a net service name.
A naming method is a resolution method used by a client application to resolve a connect identifier to a connect descriptor when attempting to connect to a database service.
Oracle Net provides support for the following naming methods:
The easy connect naming method enables clients to connect to an Oracle database by using only a TCP/IP connect string consisting of a host name and service name. The easy connect naming method requires no configuration. See "Connecting to an Oracle Database from a Client Computer" for an example of easy connect naming.
The local naming method stores connect descriptors, identified by their net service names, in a configuration file on the client named tnsnames.ora
. This file is located in the Oracle_home
/network/admin
directory. When you create a database using Oracle Database Configuration Assistant (DBCA), local naming is configured automatically.
Oracle Database enables you to manage your network configuration with the following tools:
During a typical database installation, Net Configuration Assistant (NETCA) automatically configures a listener called LISTENER
that has a TCP/IP listening protocol address for the database. If you do a custom installation, then NETCA prompts you to configure a listener name and protocol address of your choice.
Use NETCA for initial network configuration after database installation. Thereafter, you can use Oracle Enterprise Manager and Oracle Net Manager to configure and administer your networks.
Oracle Enterprise Manager enables you to manage your server-side network configuration with a Listener page. The Listener page displays information such as the current status, Oracle home location, and host name.
See Also:
"Viewing Listener Configuration"