В данном посте рассматривается установка Oracle SQL Developer 19.2.1 на Oracle Linux и подключение с его помощью к Oracle SQL Developer к Oracle Database 18c Express Edition. Oracle SQL Developer это бесплатный графический инструмент, который облегчает задачи разработчика и администратора баз данных. SQL Developer позволяет пользователю просматривать объекты базы данных (таблицы, представления, индексы, процедуры и т.п.), писать, редактировать и выполнять SQL- запросы, манипулировать данными и экспортировать их. Oracle SQL Developer имеет возможность подключаться не только к базам данных Oracle, но и к сторонним базам данных. Например, используя SQL Developer можно подключиться к MS SQL, PostgreSQL, Sybase и т.д. В одном из ближайших постов будет рассмотрено подключение к облачной базе Oracle – Oracle Autonomous Database с использованием SQL Developer.
Рассматриваются следующие шаги общей установки:
Установка JDK
Установка и запуск SQL Developer
Во время первичного запуска установленного SQL Developer система требует указать абсолютный путь к директории установки JDK (Type the full pathname of a JDK installation). Предварительно проверяется, установлена ли на операционной системе JDK и определяется директория установки. Приведенная команда показывает версию установленной JDK:
С помощью следующей команды определяется директория установки:
Как видно из результатов выполнения команд, имеется предустановленная OpenJDK версии 1.8.0_131 в директории /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64.
Но OpenJDK не позволяет запустить SQL Developer. При запуске с указанием директории OpenJDK имеет место следующая ошибка:
Требуется установка JDK. OpenJDK можно как удалить, так и оставить установленным. Наличие OpenJDK не препятствует запуску SQL Developer.
Установка JDK
Если на сервере (или на тестовой виртуальной машине) базы данных нет соединения к интернету, то JDK можно скачать с официального сайта Oracle – https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html и установить локально. Для данного поста загружен RPM пакет 8 версии для Linux ( jdk-8u241-linux-x64.rpm ). Полученный файл копируется на сервер базы данных.
В примере ниже скачанный RPM JDK пакет скопирован в директорию /tmp. Далее с помощью rpm устанавливается JDK.
Установка JDK успешно завершена. В системе работают OpenJDK и JDK. Если проверить версию, то команда возвращает только данные OpenJDK.
Используя команду alternatives можно сменить JDK по умолчанию. Ниже выполняется переключение с OpenJDK на JDK.
Далее проверяется версия JDK по умолчанию и директория его установки.
Как видно из результатов команд, теперь по умолчанию используется JDK версии 1.8.0_241 с директорией установки /usr/java/jdk1.8.0_241-amd64. Можно осуществить установку SQL Developer.
Установка и запуск SQL Developer
SQL Developer скачивается с официального сайта Oracle https://www.oracle.com/tools/downloads/sqldev-downloads.html и устанавливается локально (если отсутствует интернет соединение на сервере базы данных). В примере ниже RPM пакет SQL Developer версии 19.2.1 загружен с официального сайта и скопирован в директорию /tmp. Запускается установка пакета.
Установка SQL Developer успешно завершена.
Для запуска SQL Developer необходимо перейти в директорию установки ( /opt/sqldeveloper/ ) под пользователем oracle (пользователь операционной системы) и найти исполняемый файл sqldeveloper.sh
Запускается SQL Developer ( ./sqldeveloper.sh). При первом запуске система потребует указать абсолютный путь к директории установки JDK (Type the full pathname of a JDK installation). Указывается /usr/java/jdk1.8.0_241-amd64 и инициируется процесс начального запуска SQL Developer для работы.
Во время первой загрузки SQL Developer система запускает модальное окно «Confirm Import Preferences». При необходимости импортировать настройки из предыдущей установки SQL Developer используется значок Поиска и указывается предварительно экспортированный файл настроек. В противном случае нажимается «Нет» и система продолжит запуск SQL Developer.
Появление следующего окна (см. скриншот ниже) свидетельствует об успешном запуске SQL Developer и готовности его к работе. При первом запуске предлагается следующая опция «Allow automated usage reporting to Oracle». Выбор опции осуществляется установкой или снятием галочки. Выбранная опция никак не влияет на работу SQL Developer.
Для создания нового подключения к конкретной базе данных нажимается зеленый значок + в левом верхнем углу
и вводятся необходимые параметры подключения.
В данном примере подключение осуществляется к Oracle Database 18c Express Edition (Container Database) со следующими параметрами подключения:
Name: XE_18c Указывается имя соединения, которое позволяет однозначно идентифицировать базу данных при подключении.
IP: 192.168.0.1 IP адрес сервера БД
Port: 1539 Порт подключения к БД.
SID: xe SID БД
Username: sys Указывается имя пользователя для подключения к БД.
Role: SYSDBA Подключение к БД осуществляется пользователем sys. Данный пользователь может подключиться только с ролью SYSDBA.
Password: Пароль sys, который был назначен во время установки базы данных
Подключение к Container Database прошло успешно. В левой части окна под именем подключения можно в списке просмотреть объекты (Tables, Views, Indexes и т.д.) и их настройки. В правой части окна указан sql запрос для получения имени и состояния инстанции.
Кроме запуска из консоли, в дальнейшем SQL Developer можно запускать из графического меню Applications -> Programming -> SQL Developer.
Источник
1 Installing Oracle SQL Developer
This guide assumes that you plan to download the SQL Developer kit (.zip) file and install it as a freestanding tool.
If you plan to use SQL Developer as part of the Oracle Database release 11 installation, see the Oracle Database installation documentation.
Please read the information in this chapter before you install Oracle SQL Developer. This chapter contains the following major sections:
1.1 SQL Developer System Recommendations
This section describes the recommended minimum values for CPU, memory, display, disk storage, and other resources on the supported systems.
Table 1-1 Recommendations for Windows Systems
Resource
Recommended Minimum Value
Windows 2000-Service Pack 4
Windows XP-Service Pack 2
Windows 2003 R2
CPU Type and Speed
Pentium IV 2 GHz MHz or faster
65536 colors, set to at least 1024 X 768 resolution
Hard Drive Space
42 MB if you already have JDK 1.5
110 MB if you do not have JDK 1.5
JDK 5.0 Update 6 or later for Windows, available at: http://www.javasoft.com (If you do not have this SDK installed, you can use SQL Developer, but you must download and install the kit for Windows systems with no Java SDK or with a Sun Java SDK release lower than 5.0.)
Table 1-2 Recommendations for Linux Systems
Resource
Recommended Minimum Value
Red Hat Enterprise Linux 3.0
CPU Type and Speed
Pentium IV 2 GHz or faster
65536 colors, set to at least 1024 X 768 resolution
Hard Drive Space
JDK 5.0 Update 6 or later for Linux, available at: http://www.javasoft.com
Table 1-3 Recommendations for Mac OS X Systems
Resource
Recommended Minimum Value
Apple Mac OS X Version 10.4.x
CPU Type and Speed
Dual 1.25 GHz G4/G5 (1 GHz G4 minimum)
1.5 GB RAM (1 GB minimum)
«Thousands» of colors
Hard Drive Space
1.2 Installing and Starting SQL Developer
This section contains subsections with instructions for installing SQL Developer on all supported systems.
SQL Developer does not require an installer. To install SQL Developer, you will need an unzip tool. You can download a free, cross-platform unzip tool, Info-Zip, available at http://www.info-zip.org/ .
Do not install SQL Developer into any existing ORACLE_HOME . You will not be able to uninstall it using Oracle Universal Installer.
If you are using a pre-release (Early Adopter ) version of SQL Developer, and if you want to be able to continue to use this pre-release version after installing the official release kit, you must unzip the official release kit into a different directory than the one used for the pre-release version.
If Oracle Database (Release 11 or later) is also installed , a version of SQL Developer is also included and is accessible through the menu system under Oracle. This version of SQL Developer is separate from any SQL Developer kit that you download and unzip on your own, so do not confuse the two, and do not unzip a kit over the SQL Developer files that are included with Oracle Database. Suggestion: Create a shortcut for the SQL Developer executable file that you install, and always use it to start SQL Developer.
For Windows systems, there are two kits: one for systems on which the Sun Java SDK release 1.5.0_06 or later is installed, and another for systems with no Java SDK or a Sun Java SDK release earlier than 1.5.0_06. Be sure to download the appropriate kit.
Before you install SQL Developer, look at the remaining sections of this guide to see if you need to know or do anything else first.
The steps for installing SQL Developer depend on whether or not you will be using it on a Windows system that does not have the Sun Java SDK release 1.5.0_06 or later installed:
For a Windows system with the Sun Java release 1.5.0_06 or later installed, follow the instructions in Section 1.2.1.
For all other systems (Linux and Mac OS X systems, and Windows systems with no Java SDK or a Sun Java SDK release earlier than 1.5.0_06 or later installed), follow the instructions in Section 1.2.2.
1.2.1 Windows Systems with JDK5.0
To install and start SQL Developer on a Windows system on which the Sun Java J2SE JDK 5.0 (Update 6 or later) is installed, follow these steps:
Unzip the SQL Developer kit into a folder (directory) of your choice (for example, C:\Program Files ). This folder will be referred to as .
Unzipping the SQL Developer kit causes a folder named sqldeveloper to be created under the folder (for example, C:\Program Files\sqldeveloper ). It also causes many files and folders to be placed in and under that directory.
To start SQL Developer, go to \ sqldeveloper , and double-click sqldeveloper.exe .
If you are asked to enter the full pathname for java.exe, click Browse and find java.exe. For example, the path might have a name similar to C:\Program Files\Java\jdk1.5.0_06\bin\java.exe .
After SQL Developer starts, you can connect to any database by right-clicking the Connections node in the Connections Navigator and selecting New Connection . Alternatively, if you have any exported connections (see Section 1.4 or Section 1.10), you can import these connections and use them.
You can learn about SQL Developer by clicking Help , then Table of Contents , and reading the help topics under SQL Developer Concepts and Usage .
1.2.2 Linux and Mac OS X Systems, and Windows Systems without JDK 5.0
SQL Developer requires that the Sun Java J2SE JDK 5.0 (Update 6 or later) be installed on the system. If you need to install this JDK, go to http://java.sun.com/j2se/1.5.0/download.jsp and click the link for downloading JDK 5.0 Update 12 (or the most recent available update).
To install and start SQL Developer, follow these steps:
Unzip the SQL Developer kit into a directory (folder) of your choice. This directory location will be referred to as .
Unzipping the SQL Developer kit causes a directory named sqldeveloper to be created under the directory. It also causes many files and folders to be placed in and under that directory.
To start SQL Developer, go to the sqldeveloper directory under the directory, and do one of the following, as appropriate for your operating system:
On Linux and Mac OS X systems, run sh sqldeveloper.sh .
On Windows systems, double-click sqldeveloper.exe .
After SQL Developer starts, you can connect to any database by right-clicking the Connections node in the Connections Navigator and selecting New Connection . Alternatively, if you have any exported connections (see Section 1.4 or Section 1.10), you can import these connections and use them.
You can learn about SQL Developer by clicking Help , then Table of Contents , and reading the help topics under SQL Developer Concepts and Usage .
1.3 Migrating User Settings from a Previous Release
The first time you start SQL Developer after installing it or after adding any extensions, you are asked if you want to migrate your user settings from a previous release. (This occurs regardless of whether there was a previous release on your system.)
Migration of user settings is supported only from SQL Developer Release 1.1.3 or later to Release 1.5.
These settings refer to database connections, reports, and certain SQL Developer user preferences that you set in a previous version by clicking Tools and then Preferences . However, some user preferences are not saved, and you must re-specify these using the new release.
To migrate user settings from a previous SQL Developer release:
Unzip the Release 1.5 kit into an empty directory (folder). Do not delete or overwrite the directory into which you unzipped the kit for the previous SQL Developer release.
When you start SQL Developer Release 1.5, click Yes when asked if you want to migrate settings from a previous release.
In the dialog box that is displayed, do not accept the default location for the settings. Instead, specify the location of your settings for the previous release, which might be a folder whose path ends with sqldeveloper\sqldeveloper\system or Documents and Settings\ \Application Data\SQL Developer\system .
1.4 Migrating Information from Previous Releases
If you have used a previous release of SQL Developer, you may want to preserve database connections that you have been using. To preserve database connections, save your existing database connections in an XML file. To save the connections, right-click the Connections node in the Connections Navigator and select Export Connections . After you complete the installation described in this guide, you can use those connections by right-clicking the Connections node in the Connections Navigator and selecting Import Connections
If you want to use any user-defined reports or the SQL history from a previous version, see Section 1.5 for information about where these are located. If you have user-defined reports and SQL history from Release 1.0, they are modified by any later SQL Developer release to a format that is different from and incompatible with Release 1.0.
SQL Developer preferences (specified by clicking Tools and then Preferences) from a pre-release version of the current release cannot currently be saved and reused; you must re-specify any desired preferences.
If you want to uninstall your pre-release version of SQL Developer before installing this release, see Section 1.10, «Uninstalling SQL Developer».
1.5 Location of User-Related Information
SQL Developer stores user-related information in several places, with the specific location depending on the operating system and certain environment specifications. User-related information includes user-defined reports, user-defined snippets, SQL Worksheet history, code templates, and SQL Developer user preferences. In most cases, your user-related information is stored outside the SQL Developer installation directory hierarchy, so that it is preserved if you delete that directory and install a new version.
The user-related information is stored in or under the following location:
On Windows systems: the HOME environment variable location, if defined; otherwise the SQLDEVELOPER_USER_DIR location, if defined; otherwise as indicated in the following table
On Linux and Mac OS X systems: the SQLDEVELOPER_USER_DIR location, if defined; otherwise as indicated in the following table
The following table shows the typical default locations (under a directory or in a file) for specific types of resources on different operating systems. (Note the period in the name of any directory named .sqldeveloper .)
Table 1-4 Default Locations for User-Related Information
Resource Type
System (Windows, Linux, or Mac OS X)
Windows: C:\Documents and Settings\ \Application Data\SQL Developer\UserReports.xml
Linux or Mac OS X:
Windows: C:\Documents and Settings\ \Application Data\SQL Developer\UserSnippets.xml
Mac OS X: /Users/ /Library/Application Support/ SQLDeveloper/UserSnippets.xml
Windows: C:\Documents and Settings\ \Application Data\SQL Developer\SqlHistory.xml
Mac OS X: /Users/ /Library/Application Support/ SQLDeveloper/ SqlHistory.xml
Windows: C:\Documents and Settings\ \Application Data\SQL Developer\ CodeTemplate.xml
Mac OS X: /Users/ /Library/Application Support/ SQLDeveloper/ CodeTemplate.xml
SQL Developer user preferences
Windows: C:\Documents and Settings\ \Application Data\SQL Developer\system n.n.n.n.n
Linux or Mac OS X:
To specify a nondefault SQLDEVELOPER_USER_DIR location, do either of the following:
Set the SQLDEVELOPER_USER_DIR environment variable to specify another directory path.
Edit the \sqldeveloper\sqldeveloper\bin\sqldeveloper.conf file and substitute the desired directory path for SQLDEVELOPER_USER_DIR in the following line:
If you want to prevent other users from accessing your user-specific SQL Developer information, you must ensure that the appropriate permissions are set on the directory where that information is stored or on a directory above it in the path hierarchy. For example, on a Windows system you may want to ensure that the SQL Developer folder and the \ \Application Data\SQL Developer folder under Documents and Settings are not shareable; and on a Linux or Mac OS X system you may want to ensure that the
/.sqldeveloper directory is not world-readable.
1.6 Database Certification for SQL Developer (Oracle and Third-Party)
This section describes Oracle and non-Oracle (third-party) databases that are certified for use with SQL Developer.
Table 1-5 lists the Oracle database certifications.
Table 1-5 Oracle Database Certification for SQL Developer
Product
Releases
Oracle9 i (9.2.0.1 and later)
Oracle Database Express Edition
SQL Developer can be used to view metadata and data of several non-Oracle (third-party) databases. Table 1-6 lists the third-party database certifications.
Table 1-6 Non-Oracle (Third-Party) Database Certification for SQL Developer
Database
Releases
Notes
For any Access release: no JDBC driver needed, but you must ensure read access to system tables in the .mdb file.
Microsoft SQL Server
SQL Server 2000
SQL Server 2005
For any Microsoft SQL Server release: JDBC driver jtds-1.2.jar required; included in jtds-1.2-dist.zip available from sourceforge.net; also available through Help , Check for Updates .
For any MySQL release: JDBC driver required. For MySQL 5.x: mysql-connector-java-5.0.4-bin.jar, which is included in mysql-connector-java-5.0.4.zip; also available through Help , Check for Updates . (Do not use the latest MySQL driver 5.1.)
Sybase Adaptive Server
For any Sybase Adaptive Server release: JDBC driver jtds-1.2.jar required; included in jtds-1.2-dist.zip available from sourceforge.net; also available through Help , Check for Updates .
For information about creating and using connections to third-party databases, see the information about database connections in the SQL Developer online help or Oracle Database SQL Developer User’s Guide .
1.7 Advanced Security for JDBC Connection to the Database
You are encouraged to use Oracle Advanced Security to secure a JDBC connection to the database. Both the JDBC OCI and the JDBC Thin drivers support at least some of the Oracle Advanced Security features. If you are using the OCI driver, you can set relevant parameters in the same way that you would in any Oracle client setting. The JDBC Thin driver supports the Oracle Advanced Security features through a set of Java classes included with the JDBC classes in a Java Archive (JAR) file and supports security parameter settings through Java properties objects.
1.8 Finding SQL Developer Accessibility Information
For the latest configuration information or for information on addressing accessibility and assistive technology issues, see the Oracle Accessibility FAQ at http://www.oracle.com/accessibility/faq.html .
Also, check the SQL Developer release notes ( readme.txt file) to see if there are any currently known issues regarding accessibility.
1.9 Using a Screen Reader and Java Access Bridge with SQL Developer
To make the best use of our accessibility features, Oracle Corporation recommends the following minimum technology stack:
Windows 2000 or Windows XP
Java Sun J2SE 1.5.0_05
Sun Java Access Bridge 1.1 or higher
JAWS 3.70.87, or 5.10 or higher
Follow these steps to set up a screen reader and Java Access Bridge. If you are using JAWS 3.70.87, see the additional configuration information provided after the procedure.
Install the screen reader, if it is not already installed. (See the documentation for your screen reader for more information about installation.)
Install SQL Developer.
Download Java Access Bridge for Windows version 1.1. The file you will download is accessbridge-1_1.zip . It is available from http://java.sun.com/products/accessbridge . (See the Java Access Bridge documentation available from this Web site for more information about installation and the Java Access Bridge.)
After downloading the file, extract (unzip) the contents to a folder, for example, accessbridge_home .
Install Java Access Bridge by running Install.exe from the \installer folder .
The installer first checks the SDK version for compatibility, then the Available Java virtual machines dialog displays.
Click Search disks . Then select to search only the drive that contains the SQL Developer build and the SDK version in the program files directory (if it exists).
The search process can take a long time on a large disk with many instances of SDK or SQL Developer, or when searching multiple disks. However, unless you complete an exhaustive search of your disk, Access Bridge will not be optimally configured, and will not be correctly installed to all of the Java VMs on your system. After selecting the disk to search, click Search .
Confirm that you want to install the Java Access Bridge into each of the Java virtual machines displayed in the dialog, by clicking Install in All .
Click OK when you see the Installation Completed message.
Confirm that the following files have been installed in the Winnt\System32 directory (or the equivalent Windows 2000 or XP directory), or copy them from \installer\installerFiles because they must be in the system path in order to work with SQL Developer:
Note that the system directory is required in the PATH system variable.
Confirm that the following files have been installed in the \jdk\jre\lib\ext directory, or copy them from \installer\installerFiles :
Confirm that the file accessibility.properties has been installed in the \jdk\jre\lib\ext directory, or copy it from \installer\installerFiles . Confirm that the file accessibility.properties includes the following lines:
Only if you are using JAWS version 3.7, do the following: modify the file sqldeveloper.conf located in the folder \sqldeveloper\bin to uncomment the AddVMOption line, as shown in the following:
Start your screen reader.
Start SQL Developer.
These steps assume you are running Windows and using a Windows-based screen reader. A console window that contains error information (if any) will open first and then the main SQL Developer window will appear, once SQL Developer has started. Any messages that appear will not affect the functionality of SQL Developer.
1.9.1 Configuring JAWS 3.70 and Access Bridge with SQL Developer
The following combinations of Access Bridge file versions are necessary to achieve optimal functionality with JAWS 3.70, since this version of the screen reader uses older Java technology than is used in SQL Developer. There are two stacks of software technology listed below for those who want to use either version 1.0.3 or 1.0.4 of the Access Bridge. Also required in the system32 directory is a copy of the latest version of the Access Bridge jar file.
Access Bridge v. 1.0.3 Configuration for SQL Developer
Place the following files in the \jdk\jre\lib\ext directory:
Place the following file in the \jdk\jre\lib directory:
Place the following files in the Windows system32 directory:
Access Bridge v. 1.0.4 Configuration for SQL Developer
Place the following files in the \jdk\jre\lib\ext directory:
Place the following file in the \jdk\jre\lib directory:
Place the following files in the Windows system32 directory:
1.10 Uninstalling SQL Developer
Before you uninstall SQL Developer, if you plan to install SQL Developer (the same or an updated version) later, you may want to save your existing database connections; and if so, see Section 1.4 before uninstalling.
To uninstall SQL Developer, remove the entire SQL Developer installation directory (that is, the directory named sqldeveloper and all directories and files under it in the hierarchy).
If you also want to remove all user-specific SQL Developer information, you should also delete the directory under which that information is stored (that is, the SQL Developer user information directory). For the location of this directory, see Section 1.5.
If you have created a shortcut for SQL Developer, and if you do not plan to install SQL Developer into the same location again, you should remove that shortcut or modify the shortcut properties to reflect the new location.
1.11 SQL Developer Documentation
SQL Developer provides user documentation in the Oracle Database SQL Developer User’s Guide and in the online help. To see the help, click the Help menu, or click the Help button or press the F1 key in relevant contexts while you are using SQL Developer.
In addition to the user’s guide and installation guide, the following migration-related guides are available:
Oracle Database SQL Developer Supplementary Information for Microsoft Access Migrations
Oracle Database SQL Developer Supplementary Information for MySQL Migrations
Oracle Database SQL Developer Supplementary Information for Microsoft SQL Server and Sybase Adaptive Server Migrations
1.12 Oracle on the Web
Oracle provides a number of resources on the Web. These are some sites you may find helpful: