Friday, 18 January 2013

Networking fundamentals | Oracle DBA Tutorial pdf

Networking fundamentals

Oracle Net is an internal layer which manages communication between client and server. It is configured on server, client, web server etc.

Configuring Oracle Net on server

Listener is a server-side networking component, which listens for requests from client on server. To communicate with Oracle server, Listener service must be started on server. Listener is configured in server using listener.ora file.
Following is a sample listener.ora file.
# LISTENER.ORA Network Configuration File:
E:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ensel)(PORT =
1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = MDB)
(ORACLE_HOME = E:\oracle\ora92)
(SID_NAME = MDB)
)
)

You can manage listener from OS command prompt using LSNRCTL utility.
Oracle Net Manager is a tool using which you can manage most client/server configuration files.

Configuring Oracle Net on client

Usually you connect to Oracle server from client as USER/PASSWORD@DB (this is known as connect descriptor).
How the database name you specified in connection is resolved to exact database in the server is known as name resolution method.
Most popular name resolution methods are – host naming, local naming (most common using tnsnames.ora) and Oracle Internet Directory naming.
In tnsnames.ora file (usually in client machine it resides in $ORACLE_HOME /network/admin folder). A sample tnsnames.ora file is shown below.
# TNSNAMES.ORA Network Configuration File:
E:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
MDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ensel)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MDB)
)
)
MARKET =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 109.125.257.250)(PORT
= 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MARKET)
)
)

Most common connection problem is “ORA-12154 TNS could not resolve service name”. When this occurs, check the client is looking at correct tnsnames.ora file (there may be multiple version in computer). You can verify
this by checking TNS_ADMIN environment variable. Also check whether client computer can talk to server computer by running “TNSPING server ip address” command. Or you can use PING SID command as well.
Check sqlnet.ora file and see whether it specifies local naming first. This file resides in both client and server.
Sample of what an sqlnet.ora file will contain.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)

No comments: