Sql*Plus User’s Guide and Reference


Download 5.34 Mb.
Pdf ko'rish
bet40/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   36   37   38   39   40   41   42   43   ...   103
Bog'liq
E18404-12

Net Service Name
Your DBA is responsible for creating the databases you use and defining net service 
names for them in the tnsnames.ora file.
A net service name definition in the tnsnames.ora file has the syntax:
net_service_name= 
(DESCRIPTION= 
(ADDRESS=(PROTOCOL=tcp)(HOST=
host
)(PORT=
port
) )
(CONNECT_DATA= 
(SERVICE_NAME=
service_name
) ) ) 
To use a net service name (alias), it must have an entry in the tnsnames.ora file on the 
machine running SQL*Plus. An entry in tnsnames.ora is not required if you use a 
connection identifier.
Example 3–1
The tnsnames.ora entry for the sales database
SALES1 =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521) )
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com) ) )
Example 3–2
Start a command-line session to the sales database using the net service 
name
SQLPLUS hr@SALES1
See the Oracle Database Net Services Reference and the Oracle Database Net Services 
Administrator's Guide for more information about database connections and net service 
name definitions. 
Full Connection Identifier
Depending on your configuration, use the full connection identifier syntax like:
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=
host
)(PORT=
port
) )
(CONNECT_DATA=
(SERVICE_NAME=
service_name
) ) )
The 
SERVICE_NAME
is the global database name entered during database creation. It 
combines a database name with a domain name. For example, the 
SERVICE_NAME
sales.us.acme.com
has a database name of 
sales
and a domain of 
us.acme.com



Starting SQL*Plus
3-4
SQL*Plus User's Guide and Reference
An 
INSTANCE_NAME
is the name you give to the database instance during creation. It 
defaults to the SID you entered during database creation. 
An Oracle System Identifier (
SID
) identifies a specific Oracle release 8.0 database 
instance.
You can optionally use an 
INSTANCE_NAME
in place of the 
SERVICE_NAME
phrase. 
Use a 
SID
in place of the 
SERVICE_NAME
when connecting to an Oracle release 8.0 or 
earlier database. 

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling