Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a client connection to a database?

Tips and Tricks

How to create a client connection to a database?

by  Michael42  Posted    (Edited  )
OVERVIEW
To make client connection to a database you need to create an Oracle Network Service entry. This will create an appropriate entry in the tnsnames.ora file. This example session uses dbsrv1 as the Oracle DB Server.

PROCEDURE
Sun
cd /<ORACLE_HOME>/.../bin
./netmgr
Windows
Start Menu->Programs->Oracle OraHome92->Configuration and Migration Tools->Net Manager
Create ShortCut using:
C:\oracle\ora92\bin\launch.exe "C:\oracle\ora92\network\tools" ..\network\tools\netmgr.cl

Expand + Local then select Service Naming
Select Add (+) button on left.
Enter:
Service Name: dbsrv1.dev02
Select Protocol: TCP/IP
Enter Hostname and Port Number: dbsrv1
1521
Enter Service Name (as it is known on the server): dev02
Select Connection Type: Dedicated Server

Select: Test
Exit Oracle Net Mgr and Select Yes to save.

Entry will have been made in the tnsnames.ora

APPENDIX - tnsnames.ora Example
Common path to file: C:\<ORACLE_HOME>\network\admin\tnsnames.ora

dbsrv1.DEV02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbsrv1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dev02)
)
)


APPENDIX - SQLPlus Command Line
The SQLPlus command line from the client would be:
C:\oracle\ora92\bin\sqlplusw.exe scott/tiger@dbsrv1.DEV02


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top