Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

DBA - Net Service

Back


Oracle Net


Establishing a Connection and Session

connection_session_diagram


Database Identification

Instance Name

example_service_name01

  • e.g.: sales and finance. (us.example.com is the hostname)

SHOW PARAMETER INSTANCE_NAME;
SELECT instance_name FROM v$isntacnes;

instance_name


example_rac01.png


Services Name

SHOW PARAMETER service_names;
# orcl
SHOW PARAMETER db_name;
# com
SHOW PARAMETER db_domain;
# orcl.com

SELECT name FROM v$database;
# orcl.com
SELECT name FROM v$services;
# ORCL
SELECT * FROM GLOBAL_NAME;
# ORCL.COM

service_name

service_name


diagram_service_name02

  • Three Web browsers connecting to the same database server.
    • two Web browsers are connecting to the book.us.example.com service.Here service name of the database is book, host name is us.example.
    • the other Web browser is connecting to the soft.us.example.com service. Here service name of the database is soft, host name is us.example.
    • Both services are associated with the same database.

Instance Name vs Service Name


Service Name & Net service

service_name_net

  • tnsname.ora: define a Net service named “orcl” using a descriptor, to map this “orcl” to a database with a service name “orcl.com”.
  • When client establish a connection using a connection string that contains this “orcl” net service, listener will map this request to the database with a service name “orcl.com”.

Connecting to a Database Service

Connect descriptor


sales-server/sales.us.example.com
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
  (CONNECT_DATA=
    (SERVICE_NAME=sales.us.example.com)))


Naming Methods

# a connect string that has a complete connect descriptor as the connect identifier instead of a network service name.
CONNECT hr@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server1)
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales.us.example.com)))

# connect identifiers is a network service name, a simple name for a service.
# uses network service name sales as the connect identifier
# connection processing takes place by first mapping sales to the connect descriptor.
CONNECT hr@sales

Types of Naming Methods


Choosing a Naming Method


Configuration Steps


Connection process


Local Naming: tnsnames.ora


Localized Management

File Locate Description
tnsnames.ora clients Contain mapping info. local naming method.
sqlnet.ora client+db server Contain Client domain, Order of naming methods, Logging and tracing features, Route of connections, External naming parameters, security parameters, and Database access control parameters
listener.ora db server Contain Protocol addresse, listening services, Control parameters
cman.ora computer where Oracle Connection Manager runs Contain listening endpoint, Access control rule list,Parameter list

TOP