Oracle® Database 2 Day DBA 11g Release 1 (11.1) Part Number B28301-01 |
|
|
View PDF |
To connect to an Oracle database, you must first install Oracle Database client software on the client computer.
The easy connect naming method can eliminate the need for service name lookup in the tnsnames.ora
files for TCP/IP environments. It enables clients to connect to an Oracle database by using only a TCP/IP connect identifier consisting of a host name and service name:
CONNECT username/password@host/service_name
This naming method provides TCP/IP connectivity to databases without configuring anything.
To run SQL statements against the database, you use the SQL*Plus utility. On Microsoft Windows platforms, the environment is configured when the software is installed. On other platforms, you may have to configure environment variables such as ORACLE_HOME
and PATH
before you can start SQL*Plus.
To connect to an Oracle database from a Microsoft Windows client computer using easy connect naming:
On the desktop, click Start.
From the Start menu, select Programs (or All Programs), then select the folder that contains the installed Oracle software, for example, Oracle - OracleDB11g_Home.
Select Application Development, and then select SQL*Plus.
When SQL*Plus starts, the Log On window appears first.
In the Log On window, enter the name and password of the user you want use to connect to the database. In the Host String field, supply the easy connect naming string for the target database, which is of the form:
host/service_name In this string, host is the name of the Oracle database computer and service_name is one of the services defined by the database. If there are no service names specifically defined, then you can use the name of the service that the database creates by default. This service name defaults to the global database name, a name comprising the database name (DB_NAME parameter) and domain name (DB_DOMAIN parameter). For example, to connect as the sample schema user hr to a database with the default database name orcl on a host named main at domain name us.acme.com, you would enter the following:
User Name: HR
Password: password
Host String: main/orcl.us.acme.com
The SQL*Plus window appears and displays the prompt:
SQL>You can now issue SQL statements against the database.