Skip to content

sqlplus - To connect and manage the Oracle RDBMS

SQL Plus is a command-line tool that provides access to the Oracle RDBMS. SQLPlus enables you to:

  • Enter SQLPlus commands to configure the SQLPlus environment.
  • Startup and shutdown an Oracle database.
  • Connect to an Oracle database.
  • Enter and execute SQL commands and PL/SQL blocks.
  • Format and print query results.

Connect to Oracle database

If we manage to get some credentials we can connect to the Oracle TNS service with sqlplus.

sqlplus <username>/<password>@$ip/XE;

In case of this error message ( sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory), there might be an issue with libraries. Possible solution:

sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf";sudo ldconfig

Basic commands

All commands from Oracle's documentation.

# List all available tables in the current database
select table_name from all_tables;

# Show the privileges of the current user
select * from user_role_privs;
Last update: 2023-07-01
Created: June 29, 2023 14:54:11