8.4.1 Understanding the Easy Connect Naming Method
The Easy Connect naming method provides out-of-the-box TCP/IP connectivity to databases.
Overview
This naming method extends the functionality of the host naming method by enabling clients to connect to a database server with an optional port and service name in addition to the host name of the database:
CONNECT username@[//]host[:port][/[service_name][:server_type][/instance_name]]
Enter password: password
The connect identifier converts to the following connect descriptor:
(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=host
)(PORT=port
)) (CONNECT_DATA= (SERVICE_NAME=service_name
) (SERVER=server_type
) (INSTANCE_NAME=instance_name
)) )
If the Oracle Database server installation was performed in Typical mode, then the default service name used by the Oracle instance is the database name, and the following Easy Connect syntax can be used to connect to that instance:
SQLPLUS /nolog SQL> CONNECTusername
@host
/db_name
SQL> Enter password:password
Easy Connect Syntax Examples
sales.us.example.com
with a listening endpoint of 1521 on database server sales-server
:CONNECT scott@sales-server:1521/sales.us.example.com
CONNECT scott@//sales-server/sales.us.example.com
CONNECT scott@//sales-server.us.example.com/sales.us.example.com
After each of the connect strings, you must enter a password to connect to the database service.
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.example.com)))
Connect Identifier for Easy Connect Naming
This is a list of the Easy Connect syntax elements and descriptions for each:
Syntax Element | Description |
---|---|
|
Use Required for URL or JDBC connections. The connect identifier must be preceded by a double-slash ( scott@//sales-server
Enter password: Optional for SQL connections. The connect identifier can preceded by a double-slash ( SQL> CONNECT scott@sales-server SQL> CONNECT scott@//sales-server |
|
Required. Specify the host name or IP address of the database host computer. The host name is domain-qualified if the local operating system configuration specifies a domain. You may use an IPv4 or IPv6 address as a value. IPv6 addresses or host names that resolve to IPv6 addresses must be enclosed in square brackets, as in |
|
Optional. Specify the listening port. The default is 1521. |
|
Optional. Specify the service name of the database. If a user specifies a service name, then the listener connects the user to that specific database. Otherwise, the listener connects to the database specified by the |
|
Optional. Specify the database server type to use. This parameter instructs the listener to connect the client to a specific type of service handler. The values for the Note: In Oracle Call Interface documentation, server is referred to as |
|
Optional. Identify the database instance to access. The instance name can be obtained from the |
Related Topics
Parent topic: Configuring the Easy Connect Naming Method