Oracle Database

How to Connect to Oracle Database Server

Oracle Database Server has been a trusted solution for many years because of its scalability, security, and reliability. However, new users of the Oracle database find difficulties in connecting to a Local or Remote Oracle Database Server from their system. To address this problem, this procedural post will demonstrate the following points:

Connect to Local Oracle Database Server Using SQL PLUS

Open the Command Prompt, and use the following syntax to connect the local database server using SQL PLUS utility:

sqlplus <username>/<password>

 
Provide your local database username and password and execute this command:

sqlplus c##neem/neem123

 
The output indicates that the system has been connected to local database server successfully:


You have connected to the local database server. Let’s see the command for connecting to the database as a database administrator.

Connect to Local Oracle Database as DBA

To connect to the local database server with the system database administrator privileges, execute this command in the Command Prompt:

sqlplus sys as sysdba

 
The local database server has been successfully logged in with database administrator privileges:


You have successfully connected to the local database server using SQL PLUS. Let’s learn how to connect a remote database server using SQL PLUS.

Connect to Remote Oracle Database Server Using SQL PLUS

To connect to a remote database server, use this syntax:

sqlplus <username>/<password>@//<host>:<port>/<service_name>

 
Copy the details of the ‘host(endpoint)‘, ‘username’, ‘password’, ‘port’, and ‘service_name‘ of your remote database from its management portal. Open Command Prompt, provide the copied parameters in the syntax to form your command and execute it:

sqlplus root/root1234@//linuxhintdb.c6d50j4forkq.ap-southeast-1.rds.amazonaws.com:1521/ORCL

 
The output displays that the remote database server is connected successfully:


In addition to using the SQL PLUS utility, you can use the SQL Developer tool to connect local and remote database servers.

Connect to Local Oracle Database Server Using SQL Developer

To connect to the local database server using SQL Developer, open SQL Developer and click on “New Database Connection” from the drop-down list of “Connections”:


A new prompt will open, enter a name for the database connection and provide details of your local database server, such as “username” and “password”. Click on the “Test” button to check whether the connection will be successful or not:


The status will change to “Success”, click on the “Connect” button:


As a result, you will be connected to the local Oracle database server using SQL Developer:


Now the Oracle local database server is connected, let’s use SQL Developer to connect the remote Oracle database server.

Connect to Oracle Database Remote Server Using SQL Developer

To connect to the remote Oracle database server, open SQL Developer and click on “New Database Connection”:


Provide your Oracle Remote database server details and give it a name. Click on the “Test” button to check the connection status:


When the status changes to “Success”, click on the “Connect” button:


The remote Oracle database server is connected successfully:


This post demonstrated different methods to connect to Oracle Database Server.

Conclusion

To connect to local and remote Oracle database servers use “sqlplus <username>/<password>” and “sqlplus <username>/<password>@//<host>:<port>/<service_name>” commands, respectively. To utilize it, provide your database details in syntax and run these commands. SQL Developer can be used for the connection of servers even, by clicking on the “New Database Connection” option and providing database details, and clicking on the “Connect” button.

About the author

Nimrah Ch

I’m a technical writer with a Bachelor's in Software Engineering and Certification in Cyber Security. Through my research and writing, I strive to provide readers with in-depth, informative articles that can help them make informed decisions about their technological needs.