Oracle Network Products Getting Started for Windows Platforms Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence Go to next file in sequence

Database Connection Tasks



Connecting to a Database from a Client Machine

Client workstations and other servers connect to a server's network listener with a service name when logging onto an Oracle7 Server. The appropriate Oracle Protocol Adapter is used automatically when the database alias (or service name) used to request a connection specifies that protocol in the configuration file.

This section describes:

Starting Server Services

In order to perform a loopback test, the following must be performed prior to connecting to a database from a client machine:

Starting Oracle Names

Command Line To start Oracle Names from the command line:

  1. Verify whether the Oracle Names Server is running or not running by using the Names Control Utility, NAMESCTL. Enter:

    NAMESCTL
    NAMESCTL>STATUS
    If the STATUS command indicates the Oracle Names Server is running, continue to Step 3. If the Oracle Names Server is not running, continue to Step 2.

  2. Start the Oracle Names Server. Enter:

    NAMESCTL>START
  3. Exit from the NAMESCTL utility. Enter:

    NAMESCTL>QUIT
Control Panel To start the Oracle Names Server from the Windows NT Control Panel's Services dialog box:

  1. Choose the Services icon in the Control Panel window.

    The Services dialog box appears.

  2. Look for the OracleNamesService.

    A blank in Status column indicates that the service stops.

    If the service is not running, continue to Step 3. Otherwise, skip to Step 4.

  3. Select the OracleNameService service and choose Start.

    The service is started.

  4. In the Services dialog box, choose the Close button.

Starting the Listener

For SQL*Net to accept connections on the server, a listener must be started. If you have started an Oracle Names Server, the listener upon start-up automatically registers the databases specified in the SID_LIST_listener_name section of the LISTENER.ORA file with the well-know Oracle Names Servers.

Command Line To start the listener from the command line:

  1. Verify whether the listener is running or not running by using the Listener Control Utility, LSNRCTL. Enter:

    LSNRCTL
    LSNRCTL>STATUS [listener_name]
    where listener_name is the name of the listener defined in the LISTENER.ORA file. It is not necessary to identify the listener if you are using the default listener, named LISTENER.

    If the STATUS command indicates the listener is running, continue to Step 2. If the listener is not running, skip to Step 3.

  2. Even if the listener is running, it advised to stop and start it again. To stop the listener, enter:

    LSNRCTL>SET PASSWORD password
    LSNRCTL>STOP [listener_name]
    SET PASSWORD is only required if the password is set in the LISTENER.ORA file. The password defaults to ORACLE.

  3. Start the listener. Enter:

    LSNRCTL>START [listener_name]
  4. Exit from the LSNRCTL utility. Enter:

    LSNRCTL>QUIT
Control Panel To start the listener from the Windows NT Control Panel's Services dialog box:

  1. In the Control Panel window, choose the Services icon.

    The Services dialog box appears.

  2. Look for the OracleTNSListener service.

    A blank in Status column indicates that the service stops.

    If the listener is running, continue to Step 3. If the listener is running, skip to Step 4.

  3. Select the OracleTNSListener service and choose Start

    The service is started.

  4. In the Services dialog box, choose the Close button.

Connecting to a Database Using Server Manager

To connect to a database using Server Manager:

  1. Choose the Server Manager icon (if you are on a Windows 3.1x) or enter the following for other operating systems:

    SVRMGR23
    The SVRMGR> prompt appears:

  2. Connect to the database. Enter:

    SVRMGR>CONNECT SYSTEM/MANAGER@service_name
    or

    SVRMGR>CONNECT SYSTEM/MANAGER@global_dbname
    The service_name is the database alias you defined earlier and the global_dbname is the global database name you defined in the LISTENER.ORA for the Oracle Names Server.

    Sever Manager returns a Connected message to the screen.

  3. Issue SQL commands.

  4. When done, enter:

    SVRMGR>EXIT
    Exiting Server Manager closes the database connection.

  5. Continue to the next section, "Closing a Database Connection."

Connecting to a Database Using SQL*Plus

To connect to a remote database using SQL*Plus:

  1. Start the SQL*Plus application:

    A Log On dialog box appears:

  2. Enter SYSTEM in the User Name field, MANAGER in the Password field, and the database alias (from the TNSNAMES.ORA file) or the global database name for the Oracle Names Server (from the LISTENER.ORA file) in the Host String field.

  3. Choose OK.

    The Oracle SQL*Plus window appears with a SQL> prompt.

  4. Issue SQL commands.

  5. When done, enter:

    SQL>EXIT
    Exiting SQL*Plus closes the database connection.

  6. Continue to the section, "Closing a Database Connection."

Closing a Database Connection

Closing a database connection involves:

Stopping Oracle Names

Stop the Oracle Names Server (if you are using it) when you have completed database connections.

To stop Oracle Names from the command line:

  1. Stop the Oracle Names Server by using the Names Control Utility, NAMESCTL. Enter:

    NAMESCTL
    NAMESCTL>STOP
  2. Exit from the NAMESCTL utility. Enter:

    NAMESCTL>QUIT
To stop the Names Server from the Windows NT Control Panel's Services dialog box:

  1. Choose the Services icon in the Control Panel window.

    The Services dialog box appears.

  2. Look for the OracleNameService service.

  3. Select the OracleNameService service and choose Stop.

    The service stops.

  4. In the Services dialog box, choose the Close button.

Stopping the Listener

Stop the listener when all database connections have completed and the Oracle Names Server has been stopped.
Note:
The listener can be left running on the server, if you choose.

Command Line To stop the listener from the command line:
Note
If you are not authorized for access on the server, ask your server administrator for assistance.

  1. Stop the listener from the Listener Control Utility, LSNRCTL. Enter:,

    LSNRCTL
    LSNRCTL>SET PASSWORD password
    LSNRCTL>STOP [listener_name]
    where listener_name is the name of the listener defined in the LISTENER.ORA file. It is not necessary to identify the listener if you are using the default listener, named LISTENER.

    SET PASSWORD is only required if the password is set in the LISTENER.ORA file. The password is defaulted to ORACLE.

  2. Exit from the LSNRCTL utility. Enter:

    LSNRCTL>QUIT
Control Panel To stop the listener from the Windows NT Control Panel's Services dialog box:

  1. Choose the Services icon in the Control Panel window.

    The Services dialog box appears.

  2. Look for the OracleTNSListener service.

  3. Select the OracleTNSListener service and choose Stop.

    The Services confirmation dialog box confirms it is OK to stop the Service.

  4. Choose Yes.

    The listener stops.

  5. Choose the Close button in the Services dialog box.

Connecting from Windows on Windows NT/95

This section describes connecting to a database from a 32-bit Windows NT/95 machine running 16-bit windows tools.

Windows 16-bit applications are unable to look into a 32-bit environment because the 16-bit applications are expecting to find a real Windows environment with the AUTOEXEC.BAT, WIN.INI, and ORACLE.INI files (rather than the Registry), even though the applications are running on a 32-bit system.

For example, unlike the 32-bit SQL*Plus application, which is able to communicate to the local Oracle7 Server through the native 32-bit internal process communication of the 32-bit operating system, the 16-bit SQL*Plus application requires SQL*Net to break through the "imaginary wall" created when running in 16-bit emulation mode.

Resolving this problem depends upon if you want to connect to a remote or local database

Connecting to a Remote Database

For a 16-bit application to connect to a remote database, you must install 16-bit SQL*Net on your client in addition to your existing 32-bit SQL*Net on the server to make a remote database connection:

The 16-bit client applications can use the TNSNAMES.ORA and SQLNET.ORA files from the 32-bit ORANT\NETWORK\ADMIN directory as long as the TNS_ADMIN parameter is defined in the ORACLE.INI file and is set to this directory path.

Connecting to a Local Database

For a 16-bit application to connect to a local database, the TCP/IP Protocol Adapter, Named Pipes Protocol Adapter or the Bequeath Protocol Adapter can be used.

The Bequeath Protocol Adapter, which is automatically installed with the Oracle7 server products, does not use a listener. Therefore, no server configuration is required.

Connecting with Authentication Adapters

SQL*Net has two authentication adapters that allow you to access a server and Oracle7 database with a single login:

Using the Windows NT Networking Authentication Adapter

The Windows NT Networking Authentication Adapter allows clients connecting to an Oracle7 database on a Windows NT server to be authenticated at the operating system level. The database maps Windows NT user accounts to Oracle database accounts. By default, the authentication adapter does not perform any additional checks once it obtains the operating system user name. This allows a user logged into a Windows NT server to be automatically authenticated to use that server's Oracle7 database without entering an additional username and password.
Note
This type of operating system authentication only works with Windows NT, Windows 95, and Windows for Workgroups 3.11 clients.

When using NT 3.51, users must have Service Pack 5 installed in order for operating system authentication to work.

Note
The operating system user name that is seen by the database is not prefixed with the Windows NT domain name for domain users by default. If qualification of all domain user accounts in the database with their Windows NT domain name is necessary, the Registry entry HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OSAUTH_PREFIX_DOMAIN can be set to TRUE.

To connect with the Windows NT Authentication Adapter:

  1. Install and configure SQL*Net version 2.3.3 on clients and servers.

    The Windows NT Authentication Adapter is automatically installed on both the clients and server.

  2. For both clients and server, add the following entry to the SQLNET.ORA file:

    SQLNET.AUTHENTICATIONS_SERVICES = (NTS)
  3. Configure the clients to login to the windows NT domain to which that Windows NT server belongs or to a Windows NT domain that trusts the domain.

    If qualification of all domain users accounts with their Windows NT domain name is necessary, continue to Step 4. Otherwise, skip to Step 5.

  4. Set the NT Registry variable HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OSAUTH_ENFORCE_STRICT to TRUE on the server to enforce the adapter to verify the operating system's user account's membership to one of the following Windows NT local groups:

  5. Create a special Oracle7 Server account for the database you want to access on the machine where the Oracle7 Server database is installed. Do not create an operating system account. This Oracle7 Server account specifies the username required when you perform a Windows for Workgroups 3.11 login.

    a. Open SQL*Plus on your server.

    b. Enter the following:

    SQL>CONNECT SYSTEM/MANAGER;
    SQL>CREATE USER ``OPS$[DOMAIN]\USERNAME IDENTIFIED EXTERNALLY'';
    where [DOMAIN]\USERNAME must be specified in uppercase.

  6. Grant the privileges to this user account.

    SQL>GRANT role to ``OPS$[DOMAIN]\USERNAME'';
    SQL>GRANT CONNECT to ``OPS$[DOMAIN]\USERNAME'';
  7. Establish a networking session between your client and Windows NT server.

  8. Open SQL*Plus on your client.

  9. Enter the following command to access an Oracle7 Server for Windows NT database:

    CONNECT /@service_name
    where service_name identifies the database alias.

Using the NDS Authentication Adapter
Note
To use the NDS Authentication Adapter, you must run NetWare 4.1 or above with NDS.

The NDS Authentication Adapter lets a client applications and users access a multi-server and multi-database network. A user logged into an NDS directory tree can be automatically authenticated to use an Oracle7 database in the same NDS directory tree. This lets a user access an Oracle7 Server without entering an additional username and password.

If the ANO NDS Naming Adapter is also used, an NDS user can view the entire network under a single NDS directory tree.
Additional Information
See:

To connect with the NDS Authentication Adapter:

  1. Install and configure SQL*Net version 2.3.3 on client and server.

  2. For both clients and server, add the following entry to the SQLNET.ORA file:

    SQLNET.AUTHENTICATIONS_SERVICES = (NDS)
  3. Log into the NDS tree.

  4. Open SQL*Plus on your client.

  5. Enter the following command to access an Oracle7 Server for NetWare database:

    CONNECT /@service_name
    where service_name identifies the database alias.

Understanding Windows 3.x Connection Issues

When using SQL*Net for Windows, be aware of the following issues:

Setting the LOCAL and REMOTE Parameters

Specify a default database without having to specify a connect string using the LOCAL and REMOTE parameters in the ORACLE.INI file for Windows 3.1x. See "Modifying Oracle Parameters for Windows 3.1x" for instructions. These parameters can also be implemented on the Windows NT server. See "Modifying Oracle Configurations for Windows NT and Windows 95."

Working with Security for the Named Pipes Protocol Adapter

If SQL*Net Server and the Named Pipes Protocol Adapter are on the same machine, you must set up the proper security permission for the Named Pipes Protocol Adapter.

The instructions below explain the procedure for Windows NT 4.0. The instructions are very similar for Windows NT 3.51. Please see your operating system documentation for specific information for Windows NT 3.51.

To set up the Named Pipes permissions:

  1. Choose the Services icon in the Control Panel window,.

    The Services dialog box appears.

  2. Select the OracleNamesService service and double-click.

    The Service dialog box appears.

  3. Choose the:

    The Add User dialog box appears.

  4. Select your login ID (user ID) from the Names list box and choose the Add button.

    The user ID appears in the Add Name field.

  5. Choose OK.

    The Services dialog box appears with the user ID displayed in the This Account field.

  6. Enter your password in the Password field.

  7. Retype the same login ID password in the Confirm Password field.

  8. Choose OK.


Go to previous file in sequence Go to next file in sequence
Prev Next
Oracle
Copyright © 1996 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index