Net8
Getting Started
Release 8.0.5 for Windows NT and Windows 95/98 A64419-01 |
|
This chapter describes how to connect to a database from
a client machine.
Specific topics discussed are:
Client workstations and other servers connect to a network
listener with a service name when logging onto an Oracle server. The appropriate
Oracle Protocol Adapter is used when the database alias (or service name)
used to request a connection specifies that protocol in the configuration
file.
If you are using Oracle Names, start an Oracle Names Server
on the machine where Oracle Names Server is installed and configured with
the NAMESCTL80 control utility or the Control Panel:
Use the control utility NAMESCTL80... | Use the Windows NT Control Panel... |
---|---|
From the command line, enter:C:\> NAMESCTL80NAMESCTL> STATUSIf the STATUS command indicates the Oracle Names Server is running, go to Step 3. If the Oracle Names Server is not running, go to Step 2. NAMESCTL> START NAMESCTL> EXIT | The Services window appears. Look for the OracleORACLE_HOMENamesService80 service. A blank in the Status column indicates that the service is not running. If the service is already running, close the window and go to the section "Step 2: Start the Network Listener". The service starts. |
For Net8 to accept connections on the server, a network listener
must be started. If you have started an Oracle Names Server, the network
listener upon startup automatically registers the databases specified in
the SID_LIST_LISTENER_NAME section of the ORACLE_HOME\NET80\ADMIN\LISTENER.ORA
file with the well-known Oracle Names Servers.
On the server, start the listener with the LSNRCTL80 control
utility or the Control Panel:
Use the control utility LSNRCTL80... | Use the Windows NT Control Panel... |
---|---|
C:\> LSNRCTL80LSNRCTL> STATUS LISTENER_NAMEwhere LISTENER_NAME is the name of the network listener defined in the LISTENER.ORA file with the alias LISTENER. It is not necessary to identify the network listener if you are using the default network listener, named LISTENER.If the STATUS command indicates the network listener is running, go to Step 2. If the network listener is not running, go to Step 3. LSNRCTL> SET PASSWORD PASSWORDLSNRCTL> STOP LISTENER_NAMESET PASSWORD is only required if the password is set in the LISTENER.ORA file. The password defaults to ORACLE. LSNRCTL> START LISTENER_NAMEOracleORACLE_HOMETNSListenerLSNR is created if this command is run for the first time against a non-default network listener name. LSNRCTL> EXIT | The Services window appears. Look for OracleHOME_NAMETNSListener80 (the service name if you are using the default network listener name LISTENER) or OracleHOME_NAMETNSListener80LSNR (where LSNR is the non-default network listener name). OracleHOME_NAMETNSListener80LSNR is only created if the following command has been run:LSNRCTL80 START LISTENER_NAMEA blank in the Status column indicates that the service is not running. If the service is already running, close the window and go to the section "Step 3: Start Oracle Connection Manager(s)". The service starts. |
If you are using Oracle Connection Manager, start it on the
machine where Oracle Connection Manager is installed and configured with
the CMCTL80 control utility or the Control Panel:
If you are using Oracle Names, you may enable client caching
on clients with the NAMESCTL80 control utility or the Control Panel (for
Windows NT only). Client caching will update the SDNS.ORA file with the
new Oracle Names Server information. If you do not want to update the SDNS.ORA
file, it is not necessary to start this service.
Two ways to make database connections are to:
To connect to a database using Server Manager:
C:\>SVRMGR30
The SVRMGR> prompt appears.
For... | Enter... |
---|---|
Host Naming method |
SVRMGR> CONNECT USERNAME/PASSWORD@HOSTNAME1 |
Local Naming method |
SVRMGR> CONNECT USERNAME/PASSWORD@SERVICE_NAME |
Oracle Names method |
SVRMGR> CONNECT USERNAME/PASSWORD@GLOBAL_DBNAME GLOBAL_DBNAME is the global database name and domain you defined in the LISTENER.ORA for the Oracle Names Server. |
Bequeath Protocol Adapter |
SVRMGR> CONNECT SYSTEM/MANAGER2 |
Server Manager returns a "Connected" message to the screen.
SELECT * FROM DUAL;
SVRMGR> EXIT
Exiting Server Manager closes the database connection.
To connect to a remote database using SQL*Plus:
A Log On dialog box appears.
User Name |
USERNAME |
Password |
PASSWORD |
Host String |
The Oracle SQL*Plus window appears with a SQL> prompt.
SQL>SELECT * FROM DUAL;
SQL> EXIT
Exiting SQL*Plus closes the database connection.