Oracle Database - Easy Connect Method with host, port and service name (EZCONNECT)

> Database > Oracle Database

1 - About

The easy connect method is one of the naming method to get all the data needed to identified the location of the database.

The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments; in fact, no naming or directory system is required if you use this method.

This naming method provides out-of-the-box TCP/IP connectivity to databases.

This method allow you to give :

  • the host name
  • the port (optional default 1521)

instead of the net service name to be able to connect to a database.

Advertising

3 - Syntax

Check your parameters : Oracle Database - How to retrieve the connect descriptor parameters? (host, port, service name and SID)

CONNECT username/[email protected][//]host[:port][/service_name]

where :

  • is optional. Specify for a URL.
  • host is required. Specify the host name or IP address of the database server computer.
  • port is optional. Specify the listening port. The default is 1521.
  • service name is optional. Specify the service name of the database. The default is the host of the database server computer. Note that this might not be the same value that you entered in the connect string for the host. For example, for the host emp, the service name might be emp.acme.com. If the host does not match the database service name, then enter a valid service name value rather than accepting the default.

4 - Example

Then you can perform a easy connection with sqlplus or with the connect command.

C:\Documents and Settings\Nicolas>sqlplus gerardnico/password@ngerard:1521/orcl
 
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 10 14:16:13 2009
 
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
gerardnico@ngerard:1521/orcl>connect gerardnico/password@ngerard:1521/orcl
Connected.

5 - Reference

db/oracle/easy_connect_method.txt · Last modified: 2017/09/06 19:28 by gerardnico