Connection to Oracle database can be splitted into a few parts:
1. Client process (end user application requests a query)
2. TNS listener process (connects end application with requested instance)
3. Database instance (accesses the real database)
4. Real database
There are two main applications from Oracle to connect to Oracle database.
SqlPlus is console application installed together with the database server. To connect using this app you should:
connect username/password@server:port/instance; -- to connect as a normal user connect sysname/syspassword@server:port/instance as sysdba; -- to connect as db admin connect /as sysdba; -- to connect as db admin without passing password (it is possible only when you are logged on server where your database is installed with admin privileges.
SqlDeveloper is forms application based on JavaVM. It is not installed with db server, you should install it manually. Usage is self-explanatory.
Connection types in SQL Developer
There are a few connection types in SQL Developer to select from:
1. Basic – you have to set server IP, port, sid
2. TNS – you have to set network alias configured in tnsnames.ora file on the client machine (ORACLE_HOME\network\admin\tnsnames.ora). Simple TNS file can look like this:
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = CM6330)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )