• Nenhum resultado encontrado

Configuring the Listener File (listener.ora)

No documento Oracle® Real Application Clusters (páginas 96-99)

New Features for Release 1(11.1)

7.8 Configuring the Listener File (listener.ora)

You can configure two types of listeners in the listener.ora file as described in the following sections:

Grid Naming Service (GNS) and Listeners

Local Listeners

Multiple Listeners

How Oracle Database Uses the Listener File (listener.ora)

7.8.1 Grid Naming Service (GNS) and Listeners

If you enable Grid Naming Service (GNS), then manual listener configuration is not required.

In a GNS configuration, there is one GNS daemon for the cluster. Service requests to the cluster domain managed by GNS are routed to the GNS virtual IP address, which routes these requests to the GNS daemon.

The GNS daemon listens for registrations. When a SCAN virtual IP comes up, it registers its addresses with GNS. When GNS receives a request from a DNS for the SCAN, it sends back the registered addresses to the DNS.

7.8.2 Local Listeners

During Oracle Database creation, the LOCAL_LISTENER parameter is automatically configured to point to the local listener for the database. The Database Agent sets the LOCAL_LISTENER parameter to a connect descriptor that does not require a TNS alias.

You can set a value manually for LOCAL_LISTENER. However, Oracle recommends that you leave the parameter unset so that the Database Agent can maintain it automatically.

Note: Where the notation db_name appears in the previous example and throughout this chapter, it refers to the database name (or Oracle SID) that you entered when prompted by DBCA, or it refers to the entry you made for the DATABASE keyword of the CREATE DATABASE statement.

See Also: Oracle Database Net Services Administrator's Guide for further information about cross-instance registration, shared and dedicated server configurations, and connection load balancing

Configuring the Listener File (listener.ora)

Understanding the Oracle Real Application Clusters Installed Configuration 7-7 If you set LOCAL_LISTENER, then the Agent does not automatically update this value. If you do not set LOCAL_LISTENER, then the Database Agent automatically keeps the database associated with the Grid home's node listener updated, even as the ports or IP of that listener are changed.

The tnsnames.ora file is located in the path $ORACLE_HOME/network/admin. By default, the tnsnames.ora file is read from the grid infrastructure home, in the path Grid_home/network/admin.

The listener association no longer requires tnsnames.ora file entries. The REMOTE_

LISTENER is configured by DBCA to reference the SCAN name and port, without any need for a tnsnames.ora entry.

The following is an example of an Oracle RAC 11g release 2 (11.2) tnsnames.ora file:

# tnsnames.ora Network Configuration file:

/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle Configuration tools RACDB =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = myscan.mycluster.example.com)(PORT = 1521) )

(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RACDB) )

)

7.8.3 Multiple Listeners

If DBCA detects more than one listener on the node, then it displays a list of the listeners. You can select one or all of these listeners with which to register your database.

7.8.4 How Oracle Database Uses the Listener File (listener.ora)

Services coordinate their sessions by registering their load with the Local Listener and the SCAN Listeners. Clients are redirected by the SCAN Listener to a local listener on the least loaded node that is running the instance for a particular service. That Listener either redirects the client to a Dispatcher process (if the database was configured for Shared Server), or redirects the client to a dedicated server process. Local Listeners are configured to respond to database connection requests, and to non-database

connection requests, such as external procedures or XDB requests.

The Listener agent dynamically updates endpoints with the listener. With the Oracle Database 11g release 2 installation, the listener.ora file now only contains an IPC key and the following information:

See Also: Oracle Database Net Services Administrator's Guide for information about understanding and configuring listeners

Note: To administer 11g release 2 (11.2) local and scan listeners using the lsnrctl command, set your ORACLE_HOME environment variable to the path for the grid infrastructure home (Grid home). Do not attempt to use the lsnrctl commands from Oracle home locations for previous releases, as they cannot be used with the new release.

Configuring the Listener File (listener.ora)

(ADDRESS = (PROTOCOL=TCP)(HOST=)(PORT=1521))

This information refers implicitly to the local node's HOST endpoint. The listener.ora file is the same on every node.

Before you install Oracle RAC, during the Oracle grid infrastructure installation, Oracle Net Configuration Assistant creates and starts a default listener in the Grid home called LISTENER. The listener is configured with default protocol listening addresses. The listener is configured to respond to connection requests that are directed to one protocol address specified during installation.

During Oracle RAC installation, the Oracle RAC database uses the Oracle Clusterware listener, and configures service information about the Oracle RAC database. An Oracle Database 11g release 2 (11.2) database service automatically registers its information with the listener, such as its service name, instance names, and load information. This feature, called service registration, does not require configuration in the

listener.ora file. After listener creation, Oracle Net Configuration Assistant starts the listener.

After installation, you can modify listeners by using srvctl commands, or by using NetCA. Manual editing of the listener.ora file is not required.

The following is an example listener.ora file with an entry for a node named node1:

LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_

SCAN1)))) # line added by Agent

LISTENER_NODE1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC) (KEY=LISTENER))))

# line added by Agent

# listener.ora.mycluster Network Configuration File:

/u01/app/oracle/11.2.0/dbhome_1/network/admin/listener.ora.mycluster

# Generated by Oracle configuration tools.

LISTENER_NODE1 = (DESCRIPTION_LIST = (DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) )

)

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_NODE1=ON# line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON# line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON# line added by Agen

7.8.4.1 Listener Registration and PMON Discovery

When a listener starts after the Oracle instance starts, and the listener is listed for service registration, registration does not occur until the next time the Oracle Database process monitor (PMON) discovery routine starts. By default, PMON discovery occurs every 60 seconds.

To override the 60-second delay, use the SQL ALTER SYSTEM REGISTER statement.

This statement forces the PMON process to register the service immediately.

Oracle recommends that you create a script to run this statement immediately after starting the listener. If you run this statement while the listener is up and the instance is already registered, or while the listener is down, then the statement has no effect.

Net Service Names (tnsnames.ora File)

Understanding the Oracle Real Application Clusters Installed Configuration 7-9

No documento Oracle® Real Application Clusters (páginas 96-99)