| Oracle9i Net Services Administrator's Guide Release 2 (9.2) Part Number A96580-02 |
|
|
View PDF |
This chapter describes how to configure connectivity information for client connections to the database server.
This chapter contains these topics:
| See Also:
"Naming" for an overview of naming methods |
To connect to a service, clients use a connect identifier in the connect string to connect to a service. The connect identifier can be a connect descriptor or a simple name that maps to a connect descriptor. The connect descriptor contains:
A simple name is resolved to a connect descriptor by a naming method. Naming method configuration consists of the following steps:
A connect descriptor is comprised of one or more protocol addresses of the listener and connect data information for the destination service.
The following example shows a connect descriptor mapped to simple name called sales:
sales=
(DESCRIPTION=
(ADDRESS= (PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)))
The ADDRESS section contains the listener protocol address, and the CONNECT_DATA section contains the destination service information. In this example, the destination service is a database service named sales.us.acme.com.
When creating a connect descriptor to an Oracle9i or Oracle8i database service, you must identify the service with the SERVICE_NAME parameter. Optionally, you can identify an instance with the INSTANCE_NAME parameter, as shown in the following:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)
(INSTANCE_NAME=sales)))
The values for these parameters come from the SERVICE_NAMES (with an S) and INSTANCE_NAME parameters in the initialization parameter file. The SERVICE_NAMES parameter in the initialization parameter file is typically the global database name, a name comprising the database name and domain name, entered during installation or database creation. For example, sales.us.acme.com has a database name of sales and a domain of us.acme.com. The INSTANCE_NAME parameter in the initialization parameter file defaults to the SID entered during installation or database creation.
When creating a connect a descriptor for an Oracle release 8.0 or version 7 database, you identify the service with the SID parameter. The following example shows a connect descriptor for an Oracle release 8.0 database with a SID of sales:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SID=sales)))
Table 9-1 describes the naming methods that Oracle Net supports.
| Naming Method | Description |
|---|---|
|
Local Naming |
Resolves a net service name stored in a Local naming is most appropriate for simple distributed networks with a small number of services that change infrequently. See Also: "Configuring the Local Naming Method" |
|
Directory Naming |
Resolves a database service name, net service name, or net service alias stored in a centralized LDAP-compliant directory server |
|
Oracle Names |
Resolves a database or alias objects stored in an Oracle Names server See Also: "Configuring the Oracle Names Method" Note: In future releases, Oracle Names will not be supported as a centralized naming method. |
|
Host Naming |
Enables users to connect to an Oracle server by using a host name alias. Host names are mapped to a connect descriptor in an existing names resolution service or a centrally-maintained set of No client configuration is required to take advantage of this feature. This method is recommended for simple TCP/IP environments. See Also: "Configuring the Host Naming Method" |
|
External Naming |
Resolves service information stored in an a third-party naming service See Also: "Configuring External Naming Methods" |
The local naming method adds net service names to the tnsnames.ora file. Each net service name maps to a connect descriptor. The example a net service name mapped to a connect descriptor:
sales=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com)))
In this example, the net service name sales is mapped to the connect descriptor contained in DESCRIPTION. DESCRIPTION contains the protocol address and identifies the destination database service.
You can configure local naming during or after installation, as described in these topics:
Oracle Net Configuration Assistant enables you to configure net service names for clients. Oracle Universal Installer launches Oracle Net Configuration Assistant after software installation. The configuration varies depending on the installation mode.
Oracle Net Configuration Assistant prompts you to configure net service names in the tnsnames.ora file to connect to an Oracle database service.
Oracle Net Configuration Assistant prompts you to select naming methods to use. If Local is selected, then Oracle Net Configuration Assistant prompts you to configure net service names in a tnsnames.ora file to connect to an Oracle database service.
You can add net service names to the tnsnames.ora file at any time. To configure the local naming method, perform the following tasks:
Task 1: Configure Net Service Names
Task 2: Configure TNSNAMES as the First Naming Method
Task 3: Distribute Configuration
Task 4: Configure the Listener
Task 5: Connect to the Database
| Note:
The underlying network connection must be operational before attempting to configure connectivity with Oracle Net. |
To configure with the local naming method, use either of the following tools:
To configure net service names in the tnsnames.ora file with Oracle Net Manager:
The Welcome page of the Net Service Name Wizard appears.
You can qualify the net service name with the client's domain. The net service name is automatically domain qualified if the sqlnet.ora file parameter NAMES.DEFAULT_DOMAIN is set.
The Protocol page appears.
The Protocol Settings page appears.
| See Also:
Oracle9i Net Services Reference Guide for protocol parameter settings |
The Service page appears.
Text description of the illustration netwiz4.gif
If the destination service is Oracle9i or Oracle8i database, then select Oracle8i or later, and enter a service name in the Service Name field. If destination service is an Oracle release 8.0 database, then select Oracle8 or Previous, and enter an Oracle System Identifier for an instance in the Database SID field.
| See Also:
"About Connect Descriptors" for further information about the service name string to use |
Oracle Corporation recommends that you use the default setting of Database Default for the connection type. If shared server is configured in the initialization parameter file, you can select Dedicated Server to force the listener to spawn a dedicated server, bypassing shared server configuration. If shared server is configured in the initialization parameter file and you want to guarantee the connection always uses shared server, select Shared Server.
| See Also:
Chapter 14, "Configuring Shared Server" for further information about shared server configuration |
The Test page appears.
If you click Test, then Oracle Net connects to the database server by using the connect descriptor information you configured. Therefore, the database and the listener must be running for a successful test. If they are not, see "Starting Oracle Net Services Components" to start components before testing. During testing, a Connection Test dialog box appears, providing status and test results. A successful test results in the following message:
The connection test was successful.
If the test was successful, click Close to dismiss the Connect Test dialog box, and proceed to Step 13.
If the test was not successful:
See Also:
|
To configure net service names in the tnsnames.ora file with Oracle Net Configuration Assistant:
The Welcome page appears.
The Net Service Name Configuration page appears.
The Net Service Name Configuration, Database Version page appears.
Configure local naming as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net uses to resolve connect identifiers to connect descriptors.
To specify local naming as the first naming method:
The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing tnsnames first:
NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)
After one client is configured, it is best simply to copy the tnsnames.ora and sqlnet.ora configuration files to the same location on the other clients. This ensures that the files are consistent. Alternatively, you can use Oracle Net Manager or Oracle Net Configuration Assistant on every client.
Ensure that the listener (located on the server) is configured to "listen on" the same protocol address you configured for the net service name. By default, the listener should already be configured for the TCP/IP protocol on port 1521.
| See Also:
Chapter 12, "Configuring and Administering the Listener" for listener configuration details |
Clients can connect to the database using the following syntax:
CONNECT username/password@net_service_name
With the directory naming method, connect identifiers are mapped to connect descriptors contained in an LDAP-compliant directory server, including Oracle Internet Directory and Microsoft Active Directory. A directory provides central administration of database services and net service names, making it easier to add or relocate services.
A database service entry is created with Database Configuration Assistant during installation; net service name and net service alias entries can be created with Oracle Net Manager. To modify Oracle Net attributes of a database service entry and the net service name entries, use Oracle Net Manager.
Clients configured to access the directory can use these entries to connect to the database.
This section contains these topics:
To configure the directory naming method, perform the following tasks:
Task 1: Configure Directory Usage on Server and Clients
Task 2: Create Net Service Name Entries (Optional)
Task 3: Configure LDAP as the First Naming Method
Task 4: Configure the Listener
Task 5: Connect to the Database
Before a directory naming entry can be created to a directory, you must complete directory usage configuration with the Select the directory server you want to use, and configure the directory server for Oracle usage option in Oracle Net Configuration Assistant. Likewise, before a directory naming entry can be looked up by a client, you must complete directory usage configuration with the Select the directory server you want to use option in Oracle Net Configuration Assistant. You can configure directory server usage during or after installation.
| See Also:
Chapter 8, "Setting Up Directory Server Usage" for further information about configuring directory server usage |
|
Notes:
|
You can configure clients to use a net service name rather than the database service entry created by Database Configuration Assistant.
To create a net service name in a directory server:
| See Also:
"Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option "Starting Oracle Net Manager" for instructions on using Oracle Net Manager |
The Welcome page of the Net Service Name Wizard appears.
The Protocol page appears.
The Protocol Settings page appears.
| See Also:
Oracle9i Net Services Reference Guide for protocol parameter settings |
The Service page appears.
Text description of the illustration netwiz4.gif
If the destination service is Oracle9i or Oracle8i database, then select Oracle8i or later, and enter a service name in the Service Name field. If destination service is an Oracle release 8.0 database, then select Oracle8 or Previous, and enter an Oracle System Identifier for an instance in the Database SID field.
| See Also:
"About Connect Descriptors" for further information about the service name string to use |
Oracle Corporation recommends that you use the default setting of Database Default for the connection type. If shared server is configured in the initialization parameter file, you can select Dedicated Server to force the listener to spawn a dedicated server, bypassing shared server configuration. If shared server is configured in the initialization parameter file and you want to guarantee the connection always uses shared server, select Shared Server.
| See Also:
Chapter 14, "Configuring Shared Server" for further information about shared server configuration |
The Test page appears.
If you click Test, then Oracle Net connects to the database server by using the connect descriptor information you configured. Therefore, the database and the listener must be running for a successful test. If they are not, see "Starting Oracle Net Services Components" to start components before testing. During testing, a Connection Test dialog box appears, providing status and test results. A successful test results in the following message:
The connection test was successful.
If the test was successful, click Close to dismiss the Connect Test dialog box, and proceed to Step 12.
If the test was not successful:
See Also:
|
Configure directory naming as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net uses to resolve connect identifiers to connect descriptors.
To specify directory naming as the first naming method:
The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing ldap first:
NAMES.DIRECTORY_PATH=(ldap, tnsnames, onames, hostname)
Ensure that the listener (located on the server) is configured to listen on the same protocol address configured for the net service name. By default, the listener is configured to listen on the TCP/IP protocol, port 1521.
| See Also:
Chapter 12, "Configuring and Administering the Listener" for listener configuration details |
Clients that are configured with a default directory entry that matches the directory location of the database service or net service name can connect to the database using the following syntax:
CONNECT username/password@connect_identifier
Clients that are configured with a default directory entry that does not match the entry's directory location cannot use the connect identifier in the connect string. Instead, these connections require the entry's distinguished name or its absolute name.
See Also:
|
|
Note:
|
When database registration with the directory completes, Database Configuration Assistant creates a database service entry in the directory. By default, this entry contains network route information that includes the location of the listener through a protocol address. You can re-create this information, if it has been removed, or modify the existing network route information.
To create or modify network route information for a database service:
| See Also:
"Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option "Starting Oracle Net Manager" for instructions on using Oracle Net Manager |
A new Address tab appears.
| See Also:
Oracle9i Net Services Reference Guide for protocol parameter settings |
|
Notes:
|
Net service aliases in a directory server enable clients to refer to a database service or a net service name by an alternative name. For example, a net service alias of salesalias can be created for a net service name of sales. When salesalias is used to connect to a database, as in CONNECT scott/tiger@salesalias, it will actually resolve to and use the connect descriptor information for sales.
There are two main uses of net service aliases:
| See Also:
"Net Service Alias Entries" for an overview of net service aliases |
To create a net service alias:
| See Also:
"Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option "Starting Oracle Net Manager" for instructions on using Oracle Net Manager |
The Create Alias dialog box appears.
The Aliases folder updates with the created net service alias.
|
Note: In future releases, Oracle Names will not be supported as a centralized naming method. Because no new enhancements are being added to Oracle Names, consider using directory naming or migrating an existing Oracle Names configuration to directory naming, as described in Chapter 10, "Exporting Naming Data to a Directory Server". The material presented here is primarily for reference to enable you to maintain your current Oracle Names environment. |
| See Also:
Oracle9i Database Migration for the procedures for upgrading previous release of Oracle Names to 9i |
Oracle Names simplifies the setup and administration of global, client/server computing networks. Oracle Names makes network address and database link information available to all nodes throughout the network. Each database server network address is identified with a simple service name. Client applications then can request a database connection with that name rather than a lengthy address. Oracle Names shields users and applications from changes to the network infrastructure. It provides for centralized administration of network service names.
Configuring Oracle Names involves these tasks:
Task 1: Consider Oracle Names Options
Task 2: Install Necessary Components
Task 3: Create an Oracle Names Server
Task 4: Configure Clients and Database Servers To Use Oracle Names Servers
Task 5: (Optional) Configure Client Caches
Task 6: Configure the Listener
Task 7: Register Data with the Oracle Names Server
Task 8: Delegate Domains to Delegated Administrative Regions
Task 9: Specify Domain Hints to Forward Requests to Remote Oracle Names Servers
Prior to creating an Oracle Names server, you must decide whether:
Ensure that the following are installed:
How an Oracle Names server is created depends upon how you want region data stored. You can have the data:
When information is added to an Oracle Names server, the information is stored in the database and in the Oracle Names server checkpoint files. If the database is unavailable, the information in these files is used.
When information is added to an Oracle Names server, the information is stored in checkpoint files, and then replicated to the other Oracle Names servers.
By default, the checkpoint files are stored in $ORACLE_HOME/network/names on UNIX operating systems, and ORACLE_HOME\network\names on Windows NT. Table 9-3 describes the checkpoint files.
The following sections cover both modes, as well as a default Oracle Names server that requires no configuration:
Whichever method you select, Oracle Corporation recommends that you create more than one Oracle Names server for the network, in case one should go down.
An Oracle Names server can run without any configuration. Its name defaults to ONAMES_host if its name is configured in the names.ora file. The protocol address defaults to TCP/IP, port 1575 on the local host.
If the NAMES.DOMAINS parameter is not configured in the names.ora file, the Oracle Names server assumes authority for the root domain.
If you would like to use this Oracle Names server, proceed to "Task 2: Discover Oracle Names Servers".
To store service data in an Oracle database, perform the following tasks:
To configure the database server:
SYSTEM user:
SQL> CONNECT system/password
where password is MANAGER for the SYSTEM user account by default.
users and the temporary tablespace is temp:
CREATE USER user IDENTIFIED BY password DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
GRANT CREATE SESSION TO user;
users tablespace:
GRANT RESOURCE users TO user;
GRANT CREATE SYNONYM TO user;
| See Also:
Oracle9i Database Administrator's Guide for further information about creating users |
namesini.sql script located in $ORACLE_HOME/network/admin on UNIX operating systems and ORACLE_HOME\network\admin\names on Windows NT. This script creates the tables needed by Oracle Names to store information. Optionally, run namesupg.sql to upgrade old tables.
SQL> CONNECTuser/passwordSQL> @oracle_home/network/admin/namesini.sql;
For each computer where Oracle Names is installed and where you want an Oracle Names server, create an Oracle Names server from Oracle Net Manager.
The Names Wizard starts.
The wizard guides you through the creation and configuration process, prompting for:
If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1575 for the Oracle Names server.
(Click Use a region database.)
If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1521 for the listener.
If you specify that this Oracle Names server is in the root administrative region, configuration completes.
If you specify that this Oracle Names server is not in the root administrative region, it assumes that this Oracle Names server is in a delegated administrative region. The wizard then prompts you for the local administrative region's domain name and the address of an Oracle Names server in the root administrative region before completing.
When the wizard completes, the following message appears:
A Names Server, onames_server, has been created with default settings. Use the Configure Server section to modify the default configuration.
Oracle Net Manager creates a names.ora file with the following settings:
NAMES.SERVER_NAME)NAMES.ADDRESSES)NAMES.ADMIN_REGION)NAMES.DOMAIN_HINTS)NAMES.DOMAINS)The names.ora file is created in the $ORACLE_HOME/network/admin directory on UNIX operating systems and the ORACLE_HOME\network\admin directory on Windows NT.
A names.ora file follows with annotations of content:
#Oracle Names server name. The name should include the name of the domain this Oracle Names server is in.NAMES.SERVER_NAME=namesvr2.us.acme.com #Oracle Names server listening protocol addressNAMES.ADDRESSES=[(ADDRESS_LIST=](ADDRESS=(PROTOCOL=tcp)(HOST=namesrv2-server)(PORT=1575))[(ADDRESS=...))][)] #Database repository informationNAMES.ADMIN_REGION=(REGION=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com))(USERID=system) (PASSWORD=password) (NAME=local_region)(REFRESH=86400)(RETRY=60)(EXPIRE=600))#If an Oracle Names server is in a delegated administrative region, identify the address of an Oracle Names server in the root administrative region. NAMES.DOMAIN_HINTS= (HINT_DESC= (HINT_LIST= (HINT= (NAME=namesvr1) (ADDRESS=(PROTOCOL=tcp)(HOST=namesvr1-server)(PORT=1575)) # Specify the domain controlled by this region and the time to live (TTL). If this is the root administrative region, specify NAME=(null) or NAME=. to identify the root domain.NAMES.DOMAINS=(DOMAIN=(NAME=us.acme.com)(MIN_TTL=86400))
| See Also:
Oracle9i Net Services Reference Guide for |
If you want the region to administer more than one domain, specify the additional domains in the NAMES.DOMAINS parameter with Oracle Net Manager:
In the following example, NAMES.DOMAINS contains a listing for the root (value of null), com, acme.com, and hq.acme.com domains. all the domain precedent to hq.acme.com must be defined in order to define hq.acme.com.
NAMES.DOMAINS=(DOMAIN_LIST=(DOMAIN=(NAME=)(MIN_TTL=86400))(DOMAIN=(NAME=com)(MIN_TTL=86400))(DOMAIN=(NAME=acme.com)(MIN_TTL=86400))(DOMAIN=(NAME=hq.acme.com)(MIN_TTL=86400)))
To start the Oracle Names server, use either Oracle Net Manager or Oracle Names Control utility:
To replicate data among Oracle Names server in checkpoint files, perform these tasks:
For each computer where Oracle Names is installed and where you want an Oracle Names server, create an Oracle Names server from Oracle Net Manager:
The Names Wizard starts.
The wizard guides you through the creation and configuration process, prompting you for:
If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1575 for the Oracle Names server.
(Click Don't use a region database.)
If this is not the first Oracle Names server in the region, the wizard then prompts you to discover the other Oracle Names servers or to specify the address of another Oracle Names server in the region.
If you specify that this Oracle Names server is in the root administrative region, configuration completes.
If you specify that this Oracle Names server is not in the root administrative region, it assumes that this Oracle Names server is in a delegated administrative region. The wizard then prompts you for the local administrative region's domain name and the address of an Oracle Names server in the root administrative region before completing.
When the wizard completes, the following message appears:
A Names Server, onames_server, has been created with default settings. Use the Configure Server section to modify the default configuration.
Oracle Net Manager creates a names.ora file with the following settings:
NAMES.SERVER_NAME)NAMES.ADDRESSES)NAMES.DOMAIN_HINTS)NAMES.DOMAINS)The names.ora file is created in the $ORACLE_HOME/network/admin directory on UNIX operating systems and the ORACLE_HOME\network\admin directory on Windows NT.
A names.ora file follows with annotations of content:
#Oracle Names server name. The name should include the name of the domain this Oracle Names server is in.NAMES.SERVER_NAME=namesvr2.us.acme.comNAMES.ADDRESSES=[(ADDRESS_LIST=](ADDRESS=(PROTOCOL=tcp)(HOST=namesrv2-server)(PORT=1575))[(ADDRESS=...))][)] #If an Oracle Names server is in a delegated administrative region, identify the address of an Oracle Names server in the root administrative region. NAMES.DOMAIN_HINTS= (HINT_DESC= (HINT_LIST= (HINT= (NAME=namesrv1) (ADDRESS=(PROTOCOL=tcp)(HOST=namesrv1-svr)(PORT=1575)) # Specify the domain controlled by this region and the time to live (TTL). If this is the root administrative region, you must have NAME= (null) to identify the root domain properly.NAMES.DOMAINS=(DOMAIN=(NAME=us.acme.com)(MIN_TTL=86400))
| See Also:
Oracle9i Net Services Reference Guide for |
If you want the region to administer more than one domain, specify the additional domains in the NAMES.DOMAINS parameter with Oracle Net Manager:
In the following example, NAMES.DOMAINS contains a listing for the root (value of null), com, acme.com, and hq.acme.com domains. all the domain precedent to hq.acme.com must be defined in order to define hq.acme.com.
NAMES.DOMAINS=(DOMAIN_LIST=(DOMAIN=(NAME=)(MIN_TTL=86400))(DOMAIN=(NAME=com)(MIN_TTL=86400))(DOMAIN=(NAME=acme.com)(MIN_TTL=86400))(DOMAIN=(NAME=hq.acme.com)(MIN_TTL=86400)))
After all the Oracle Names servers are created, have each Oracle Names server, except the first one in the region, discover the other Oracle Names servers in a region.
To discover other Oracle Names servers, use either Oracle Net Manager or Oracle Names Control utility:
To configure client and database server computers to use Oracle Names servers:
sqlnet.ora file, as described in "Configuring Preferred Oracle Names Servers"..sdns.ora file in $ORACLE_HOME\network\names on UNIX operating systems, and sdns.ora file in ORACLE_HOME\network\names on Windows operating systems. This file contains the order of names and addresses of the Oracle Names server(s) to contact. Client computers read this file to find the addresses of Oracle Names servers to contact.Preferred Oracle Names servers take precedence over the Oracle Names servers configured in the .sdns.ora or sdns.ora file.
| See Also:
"About Discovery" for a description of discovery |
To create an .sdns.ora file or an sdns.ora file, use either Oracle Net Manager or Oracle Names Control utility:
| Use Oracle Net Manager... | Use Oracle Names Control utility... |
|---|---|
|
Discover the other Oracle Names servers:
The If an Oracle Names server cannot be found, and you know the network address of a particular Oracle Names server, enter the address at the prompt. For example:
|
NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file in the following manner:
The sqlnet.ora file should contain an entry that lists onames first in the NAMES.DIRECTORY_PATH parameter:
NAMES.DIRECTORY_PATH=(onames, tnsnames, hostname)
sqlnet.ora file settings for Oracle Names.
To add or configure these features:
To avoid clients sending requests to Oracle Names server for name lookups, you can create a client cache process local to the client. A client cache:
The most optimal environment for the client cache is a large multiuser computer where the users are running a particular Oracle client application. Clients on a single-user computer with wide-ranging interests in the databases will also derive some benefit from a cache.
A client cache involves running a