首页 > 数据库 > Oracle > oracle net services
Aflter completing this lesson you should be able to do the following:
--create additional listeners
--create oracle net service aliases
--configure connect time failover
--control the oracle net listener
Oracle Net Services
Oracle net services enable network connections from a client or middle-tier application to the oralce database server. After a network session is established, oralce net acts as the data courier for both the client application and the database server.
On the client machine, oralce net is a backgroud component accessed by wharever application needs to connect to the database.
On the database server, oralce net includes an active process called listener.
Oracle Net Listener
The oracle net listener is the gateway to the oracle instance for all nonlocal user connections, a single listener can service multiple database instances and thousands of client connections
The oracle net listener is controlled by Database Control or by the lsnrctl command line utility.
For a listener to forward client connections to an instance, the listener must know the name of the instance and where the instance’s ORALCE_HOME is located. The listener can find this information in two ways:
Oracle net listener can also be controlled with the command-line lsnrctl utility
Commands form the listener control utility can by issued form the command-line or form the LSNRCTL prompt
# lsnrctl
# lsnrctl start
# lsnrctl status
LSNRCTL>
LSNRCTL> start
LSNRCTL> status
Remember that is your listener is named something other than LISTENER, you must either include the listener name with the command or use the SET CURRENT_LISTENER command.
Listener contral provides two monitoring options,services and status.
Oracle Net Connections
To make a client or middl-tier connection,oracle net requires the client to know the:
The process of determining this connection information is called Names Resolution.
Names Resolution
Oracle net supports serveral methods of resolving connection information:
Easy connect
Easy connect connection strings take the form of :
Local naming
The local list of known services is stored in in the text configuration file:
$ORALCE_HOME/netword/admin/tnsnames.ora
Local naming is appropriate for organizations where oralce net service configuration do not change ofter
Directory naming
One adventage of directory naming is that as soon as a new service name is added to the LDAP directory, the service name is available for users to connect with. With local naming the DBA must first distribute update tnsnames.ora files containing the changed service name information before users can connect to new or modified services
Directory naming is appropriate for organizations where oracle net service configurations change frequently.
Oralce net support advanced connection options with local and directory naming
Connect-time failover: oralce net will keep trying addresses in order until it reaches a listener that is functioning or util all address have been tried and failed.
Load balancing : oracle net picks an address at random form the list of addresses.
Source routing: oracle net treats the addresses as a list of relays, connecting to the first address and the requesting to be passed from the first to the second until destination is reached.
Enterprise manager database control configures the server side of oracle net, but does not help with client or middle-tier configuration. The oracle net manager is a grahpical tool promarily used to configure client-side oracle net connections including:
The oralce net manager can also be used to create and configure oralce net listeners, and to configure Lightweight Directory Access Protocol(LDAP) service name resolution.
Testing oracle net connectivity
# tnsping db.us.oracle.com:1521/dba10g
l Supports local and directory naming
# tnsping foo
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7199022/viewspace-1002811/ ,如需转载,请注明出处,否则将追究法律责任。