Как установить sqlplus на ubuntu

Обновлено: 03.07.2024

Once the connection is made between the client and the server using sqlplus, we can perform many database administration, query, user management and so on.

Steps to Install SQLplus on Windows 10

Step 1. Install Oracle Instant Client

Before we can install and run the sqlplus utility, we need to configure the Oracle Instant Client Utility first. So, I would suggest you to read this article to Install Oracle Instant Client 19.5 on Windows 10.

Step 2. Download SQLplus software package

So this is the sqlplus software package for Windows 10 64 bit edition.

Step 3. Install the Package

From the previous step, you should have a zip file called : instantclient-sqlplus-windows.zip. Now extract the file to your instant client directory you created on the Step 1. Here is the screenshot of my instant client folder looks like:

Notice that there is sqlplus application in this instant client folder. Now we are ready to go.

How to Connect to Oracle Database via SQLplus Command

In the following example, I will show you how to connect to remote oracle database via sqlplus command. Before we connect, we need to configure the user in the Oracle database. Skip the user creating step if you already have a database user that can connect to the pluggable database.

Create a new user

In the database server host, we need to connect to the database using sqlplus in order to create a new user for the pluggable database. In this case, my container database called cdb1 and the pluggable database is called pdb1.

Login as oracle user and then execute this command.

As you can see now we are connected to the root database. We need to switch to the pluggable database (pdb1).

Now check again using show command

As you can see, now we are connected to PDB1, the pluggable database. Next, we need to open the database so we can create a new user for it.

Then, we can create a new user

Done. Please note that this new user only exist in the pluggable database. So, to connect, we need to specify the username as manjaro@pdb1 in the Connect command.

Connect to the Database

From the other computer (in this case Windows 10 where sqlplus is installed using above steps), open command prompt and execute the following command:

  • 192.168.100.50 is the Oracle database host IP address
  • pdb1.griyaku.lan is the Oracle database service

You can check your Oracle database services and instances with the following command. Make sure you execute this command on the database host as oracle user.

Thank you for reading this how to install sqlplus 19.5 on Windows 10. I hope you enjoy it and leave us comments for any queries. Cheers.

How to install the client in Ubuntu 18.04 for Oracle 18c DB.
in my environment i need to connect sqlplus through Ubuntu machine.
The Oracle server runs on CentOS 8.
Is it possible ?


15.6k 9 9 gold badges 40 40 silver badges 70 70 bronze badges


So, you want to be able, on an Ubuntu 18.04 PC, to query with sqlplus, the Oracle database which runs on a CentOS 8 server, correct? And, you want to use an Oracle 18 client in Ubuntu to do that?

1 Answer 1

Download the desired Instant Client ZIP files. All installations require a Basic or Basic Light package.

Unzip the packages into a single directory such as /opt/oracle/instantclient_19_3 that is accessible to your application. For example:

The various packages install into subdirectories of /usr/lib/oracle, /usr/include/oracle, and /usr/share/oracle.

Install the operating system libaio package. For example, in Ubuntu, do sudo apt update && sudo apt install libaio This is called libaio1 on some Linux distributions.

If Instant Client is the only Oracle Software installed on this system then update the runtime link path, for example:

Alternatively, set the LD_LIBRARY_PATH environment variable prior to running applications. For example:

The variable can optionally be added to configuration files such as

If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.ora, ldap.ora, or oraaccess.xml with Instant Client, put them in the network/admin subdirectory. This needs to be created for 12.2 and earlier, for example:

This is the default Oracle configuration directory for applications linked with this Instant Client.

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMIN to that directory name.

To use binaries such as sqlplus from the SQL*Plus package, unzip the package to the same directory as the Basic package and then update your PATH environment variable, for example:

I am working on AWS services. I have an ec2 ( centos ) instance. I need to configure SQL*Plus client on this centos machine.

The server with whom I want to connect is at some remote area. The server version is oracle-se(11.2.0.2)

Kindly help me getting the client installed on the centos machine.

Thanks in advance.

3,246 1 1 gold badge 20 20 silver badges 34 34 bronze badges 2,045 8 8 gold badges 25 25 silver badges 31 31 bronze badges

6 Answers 6

Download the matching client

Set environment variables in your

Reload your .bash_profile by simply typing source

/.bash_profile (suggested by jbass) or Log-out user and log-in again.

Now you're ready to use SQL*Plus and connect your server. Type in :


5,205 9 9 gold badges 38 38 silver badges 56 56 bronze badges Hi I have installed it now when I am trying to connect to the server it is givig me an error : -bash: sqlplus: command not found I have done everything but now getting this error : ERROR: ORA-12154: TNS:could not resolve the connect identifier specified I cant find the TNSNAMES.ORA in the home directory of oracle the admin/network directory is also not there. Also the bin dir contains only adrci genezi sqlplus. I am not able to import the dump

The solution by @ChamaraKeragala is good, but it is unnecessary to logout/login. Instead type:

this should not be an answer but a comment, also is already integrated in the @ChamaraKeragala aswer ( accepted )

For everyone still getting the following error:

The original post refers to a set of environment variables, the most important of which is ORACLE_HOME . This is the parent directory where the oracle binaries get installed.

Depending on what version of oracle you downloaded you'll have to change the ORACLE_HOME accordingly. For example, the original question's ORACLE_HOME was set to:

Обычно батарея ноутбука помечена BAT0. Вы пытались запустить:

Также вы попытались добавить acpi=force в свою командную строку GRUB?

Откройте терминал и запустите следующие команды:

sudo gedit /etc/default/grub Перейти к строке GRUB_CMDLINE_LINUX_DEFAULT="" Заменить его с помощью GRUB_CMDLINE_LINUX_DEFAULT="acpi=force" Сохранить изменения. Запустите sudo update-grub и перезагрузитесь.

(Если в шаге 2 есть что-то уже в "", просто добавьте пробел после него и добавьте acpi=force)

Конечно, правильная установка выполняется из официальных пакетов, как указано выше ( загрузить Instant Client Downloads ), но вы можете получить полную рабочую sqlplus, просто скопировав эти файлы (вы можете найти его на любом компьютере с установленным клиентом oracle), и некоторые msb являются необязательными:

В качестве дополнительной зависимости я включил libaio.so -его можно установить с помощью sudo apt-get install libaio1

Итак, пример использования может быть таким:

Чужой не работал из-за:

Ошибка: невозможно открыть индекс имен с помощью db5 - Permission denied (13)

К счастью, есть более естественное решение:

Загрузите файлы zip из Oracle , вам потребуется

  • Базовый пакет (ZIP) (или Базовый легкий пакет (ZIP) )
  • Пакет SQL * Plus (ZIP)

Архивы извлекаются в ту же корневую папку. Поместите эту папку, в которую вы помещаете файлы программы (например, / usr / share ).

Затем создайте сценарий, который запускает исполняемый файл после установки переменной LD_LIBRARY_PATH , чтобы найти библиотеки :

Назовите его sqlplus , сделайте его исполняемым ( chmod 755 sqlplus ) и поместите его в каталог на ПУТЬ (например, / usr / bin / ), чтобы bash его нашел.

Вот и все, теперь вы можете запустить sqlplus, например:

ошибку при загрузке разделяемых библиотек: libaio.so.1: не удается открыть файл общих объектов: нет такого файла или каталога

, вам необходимо установить недостающую библиотеку с помощью sudo apt-get install libaio1

Читайте также: