These sections help you completely configure your client/server network:
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 an identification. 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.
Service names can provide location transparency so that the client application does not have to know the server's location. If the database is moved to another location, then you must reconfigure only Oracle Net. No changes are necessary to client applications.
This section contains these topics:
On the database host, the Oracle Net listener (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
network/admin subdirectory of the Oracle home directory. For example, if your Oracle home directory is
/u01/app/oracle/product/11.2.0/dbhome_1, then the
listener.ora file is created by default in the
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=dbhost.example.com) (PORT=1521)))
This example shows a TCP/IP protocol address that specifies the host computer of the listener and a port number. The listener can listen for connection requests on network interfaces with either IP version 4 (IPv4) or IP version 6 (IPv6) addresses.
listener.ora file is automatically configured during installation.
Because the configuration parameters have default values, you can start and use a listener without configuring it. This default listener is named
LISTENER, supports no service names on startup, and listens on the following TCP/IP protocol address:
An Oracle database registers with the listener within a minute or so of starting up. The service names, or the databases that they represent, to which the listener forwards client requests, can be configured in the
listener.ora file. This information can also be dynamically registered with the listener. Dynamic registration of services and databases with the listener is called service registration.
Service registration is performed by the listener registration (LREG) process—an instance background process—of each database instance. Dynamic service registration does not require modification of the
Oracle Database Concepts for more information about listeners and service names
Oracle Database Net Services Administrator's Guide for more information about configuring listeners
"About Background Processes" for more information about database processes
The 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
DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=my-server)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=mydb.us.example.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.
Easy Connect Naming
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 client configuration file named
tnsnames.ora. This file is located in the
/network/admin directory. When you create a database using Oracle Database Configuration Assistant (DBCA), local naming is configured automatically. You must then use the Net Configuration Assistant to create connect descriptors and their corresponding net service names.
Oracle Database Administrator’s Guide for more information about database services
Net Configuration Assistant
During a typical database installation, Net Configuration Assistant automatically configures a listener called
LISTENER that has a TCP/IP listening protocol address for the database. If you do a custom installation, then Net Configuration Assistant prompts you to configure a listener name and protocol address of your choice.
Use Net Configuration Assistant for initial network configuration after database installation. Thereafter, you can use Oracle Net Manager to configure and administer your networks.
Oracle Net Manager
Oracle Net Manager provides various network configuration features, including the ability to configure profiles.
On Microsoft Windows operating systems only, if a non-administrator, low privileged Windows User Account was specified as the Oracle Home User during database installation, you are prompted for the Oracle Home User password when you access the Net Configuration Assistant and Oracle Net Manager.
Oracle Database Platform Guide for Microsoft Windows for more information about the Oracle Home Users on Windows feature
The Oracle Net listener (the listener) runs on your database host and handles incoming client requests. You can view the listener status at the command line.
To view information about the listener at the command line:
The Oracle listener is set to start automatically whenever the host is restarted. However, when your system encounters unforeseen circumstances, or when you have manually stopped the listener, you can restart it at the command line.
To start or stop the listener at the command line:
lsnrctl start lsnrctl stop
You can use the instructions in this section to test your network configuration.
To connect to an Oracle database from a client computer using easy connect naming:
(UNIX, Linux, or Windows systems) Open a command window and enter the following command:
(Windows systems only) Click Start, select Programs (or All Programs), then Oracle - HOME_NAME, then Application Development, and then SQL*Plus.
The place holders used in the connect identifier format represent:
host — the name or IP address of the Oracle database host computer.
Both IPv4 and IPv6 addresses are supported. IPv6 addresses must be enclosed in square brackets. See Oracle Database Net Services Administrator's Guide for information about IPv6 addressing.
port (optional) — the TCP port number on which the Oracle Net listener listens for connections.
port is excluded, then the standard port number 1521 is assumed.
service_name — a database service name.
If no database service names are defined, then you can use the name of the default service that is created for the database. This service name consists of the global database name, which is made up of the
DB_DOMAIN initialization parameters as follows:
DB_DOMAIN is null, then the standard service name is just
server — the type of service handler. Acceptable values are
pooled. If omitted, then the default type of server is chosen by the listener: shared server if configured, otherwise dedicated server.
instance_name — the instance to which to connect. When you specify only instance name, you connect to the default database service. If there is no default service configured in the
listener.ora file, then an error is generated.You can obtain the instance name from the
INSTANCE_NAME initialization parameter.
For example, to connect as user
NICK to the database service
orcl.example.com on the host
dbhost.example.com, enter the following at the user name prompt:
The following examples substitute IPv4 and IPv6 addresses for the host name:
Oracle Database Administrator’s Guide for more examples of connecting with SQL*Plus and for a discussion of environment variables
Oracle Database Net Services Administrator's Guide for information about easy connect, connect identifiers, and other naming methods
Oracle Database Net Services Reference for information about how to define the default service in
Oracle By Example (OBE) has a series on the Oracle Database 2 Day DBA guide. This OBE steps you through the tasks in this chapter and includes annotated screenshots.
To view the Configuring the Network Environment OBE, enter the following URL in your web browser: