В этой главе описывается установка и настройка PL / SQL Developer
метод
1. Введение
Мы знаем, что для установленной базы данных обычно требуется выполнение команд SQL, но традиционный интерфейс cmd выглядит очень неудобно. В настоящее время нам необходимо программное обеспечение с графическим интерфейсом, которое поможет нам лучше управлять базой данных Oracle. Общими компонентами являются собственный компонент Oracle для разработки SQL, сторонние разработчики, такие как PL / SQL разработчик, Navicat для Oracle и так далее. Поэтому в этот раз основное внимание будет уделено установке и настройке pl / sql developer.
2. Этапы установки
1) Скачать установочный пакет на официальном сайте
Примечание: обычно мы выбираем 64-битную версию
2) Дважды щелкните установочный пакет, чтобы выполнить установку
Нажмите Готово, чтобы закрыть после установки
3. Этапы настройки
1) Когда вы в первый раз заходите в pl / sql developer, нажмите на кнопку Cancel, чтобы войти в интерфейс
2) Нажмите на значок, чтобы войти в конфигурацию настроек
3) Настроить oracle home и oci library
Примечание. Если вы установили сервер базы данных Oracle на компьютер, на котором установлен PL / SQL, вы можете выбрать эти две конфигурации в раскрывающемся списке.
Если вы не настраиваете сервер Oracle, то вам нужно настроить небольшой клиент Oracle. Давай поговорим позже.
Как показано на рисунке, моя конфигурация выбрана потому, что на моей машине установлен сервер базы данных Oracle.
Использование логина PL / SQL
1) Нажмите кнопку ключа, чтобы войти
2) Введите соответствующую информацию о соединении для входа
1. При использовании pl / sql developer, каждый раз, когда вы вводите опцию Database, вы должны вводить ip, номер порта и экземпляр. Есть ли простая конфигурация?
Примечание. В этом тесте компьютер с разработчиком pl / sql устанавливается с сервером Oracle, аналогично установке небольшого клиента.
1) Сначала найдите каталог с файлом конфигурации, подключенным к серверу Oracle.
2) Откройте файл tnsnames.ora для имитации и редактирования.
Примерный код каждого экземпляра выглядит следующим образом (ORCL выглядит следующим образом):
На данный момент вы можете написать свой собственный пример, а затем выбрать, когда разработчик pl / sql входит в систему:
2. Что делать при использовании pl / sql developer, если на этой машине не установлен сервер Oracle?
1) Скачать oracle Instant Client
2) Распакуйте загруженный файл в соответствующий каталог
3) Настроить oracle home и oci library
В этом случае pl / sql developer можно использовать как обычно.
There are two downloads available for Windows users.
Windows 64-bit with JDK 8 Included
This archive includes both SQL Developer and an embedded copy of the Java 8 Development Kit (JDK). Simply extract the zip to a fresh directory and run the sqldeveloper.exe in the top directory. The EXE is configured to run the embedded JDK by default.
Note: the Windows EXE requires a MSVCR100.dll to run. Most computers will already have this file and in the Windows PATH. However, if the first copy of the file found by the EXE is a 32-bit copy of the DLL, then SQL Developer will fail to start. You can fix this by copying a 64-bit version of the DLL into the BIN directory or updating your OS PATH such that a 64 bit copy of the DLL is found first.
Windows 32-bit/64-bit
This archive. will work on a 32 or 64 bit Windows OS. The bit level of the JDK you install will determine if it runs as a 32 or 64 bit application. This download does not include the required Oracle Java JDK. You will need to install it if it’s not already on your machine. We officially support Oracle JDK 8 or 11.
If SQL Developer cannot find Java on your machine, it will prompt you for the path for a JDK home. This only occurs the first time you launch SQL Developer. A valid Java Home on Windows will be similar to
Mac OS X Installation Notes
This download does not include the Oracle JDK. SQL Developer supports either Oracle JDK 8 or 11.
To install and run
(For 64-bit Intel Macs, download Java for Mac OS X 10.5, Update 1.
For the latest version of Mac OS, use the Software Update feature)
RPM for Linux Installation Notes
This download does not include the JDK. SQL Developer supports either Oracle JDK 8 or 11.
There are two downloads available for Windows users.
Windows 64-bit with JDK 8 Included
This archive includes both SQL Developer and an embedded copy of the Java 8 Development Kit (JDK). Simply extract the zip to a fresh directory and run the sqldeveloper.exe in the top directory. The EXE is configured to run the embedded JDK by default.
Note: the Windows EXE requires a MSVCR100.dll to run. Most computers will already have this file and in the Windows PATH. However, if the first copy of the file found by the EXE is a 32-bit copy of the DLL, then SQL Developer will fail to start. You can fix this by copying a 64-bit version of the DLL into the BIN directory or updating your OS PATH such that a 64 bit copy of the DLL is found first.
Windows 32-bit/64-bit
This archive. will work on a 32 or 64 bit Windows OS. The bit level of the JDK you install will determine if it runs as a 32 or 64 bit application. This download does not include the required Oracle Java JDK. You will need to install it if it’s not already on your machine. We officially support Oracle JDK 8 or 11.
If SQL Developer cannot find Java on your machine, it will prompt you for the path for a JDK home. This only occurs the first time you launch SQL Developer. A valid Java Home on Windows will be similar to
Mac OS X Installation Notes
This download does not include the Oracle JDK. SQL Developer supports either Oracle JDK 8 or 11.
To install and run
(For 64-bit Intel Macs, download Java for Mac OS X 10.5, Update 1.
For the latest version of Mac OS, use the Software Update feature)
RPM for Linux Installation Notes
This download does not include the JDK. SQL Developer supports either Oracle JDK 8 or 11.
Профилирование PL/SQL кода при помощи IDE PL/SQL Developer
Проблематика и назначение:
Периодически Oracle разработчики сталкиваются с проблемой производительности PL/SQL кода. Возникают проблемы с тем, чтобы найти место pl/sql кода, в котором возникают проблемы.
Обычно профилирование pl/sql кода используется, когда необходимо определить проблему производительности в очень большом методе, либо когда у метода много внутренних зависимостей с большим количеством логики, а также нет понимание в каком месте метод код тормозит.
Методы решения проблемы:
В решение проблем с производительность в БД Oracle нам помогут:
Метод(процедура) для профилирования:
В рамках данной статьи покажу всего лишь подход к профилированию, поэтому метод, который мы будем профилировать будет не большим.
Создадим метод для профилирования:
Профилирование через IDE PL/SQL Developer:
В pl/sql Developer запускаем Test Window:
Рисунок 1 — Запуск Test Window
В тестовом окне наберём код для запуска метода check_cycle_performance, заполним входную переменную l_cycle_size и нажмем кнопку для запуска профилирования:
Рисунок 2 — Запуск профилирования в PL/SQL Developer
После запуска выйдет диалоговое окно, которое предложит создать таблицу для профайлера, соглашаемся.
Далее по F8 запускаем метод, после его выполнения переходим во вкладку Profiler:
Рисунок 3 — Окно профайлера в PL/SQL.
Из рисунка 3 видно, что основная проблема по производительности состоит в строке 16.
Не трудно понять, что основная проблема производительности кроется в переключениях контекста SQL — PL/SQL.
При этом возведение в степень: строка 11, занимает гораздо меньше времени.
По мерам предотвращения переключения контекстов рассмотрим в рамках другой статьи.
This guide assumes that you plan to download SQL Developer and run it as a freestanding tool.
If you plan to use SQL Developer as part of an Oracle Database release installation, see the Oracle Database installation documentation. Starting with Oracle Database Release 19c, SQL Developer is no longer available with Oracle Database.
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.
SQL Developer requires JDK 8 or 9, which you can download from:
Table 1-1 Recommendations for Windows Systems
Resource
Recommended Minimum Value
Windows Server 2008
Windows Server 2012
CPU Type and Speed
Pentium IV 2 GHz MHz or faster
65536 colors, set to at least 1024 X 768 resolution
500 MB if you already have JDK 8
110 MB if you do not have JDK 8
Table 1-2 Recommendations for Linux Systems
Resource
Recommended Minimum Value
Red Hat Enterprise Linux 5.5
SUSE Linux Enterprise Server 10 SP2
CPU Type and Speed
Pentium IV 2 GHz or faster
65536 colors, set to at least 1024 X 768 resolution
Table 1-3 Recommendations for Mac OS X Systems
Resource
Recommended Minimum Value
Apple Mac OS X Version 10.8.3
CPU Type and Speed
Dual 1.25 GHz G4/G5 (1 GHz G4 minimum)
«Thousands» of colors
1.2 Installing and Starting SQL Developer
This section contains subsections with instructions for installing SQL Developer on all supported systems.
Also, do not install SQL Developer into an existing sqldeveloper folder or directory. Either delete the existing sqldeveloper folder or directory first, or ensure that the new SQL Developer version is installed into a different location.
If you are using a prerelease (Early Adopter ) version of SQL Developer, and if you want to be able to continue to use this prerelease version after installing the official release kit, you must unzip the official release kit into a different directory than the one used for the prerelease version.
Starting with Oracle Database Release 19c, SQL Developer is no longer available with Oracle Database.
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 Java SDK (JDK) release 7 or later installed:
For a Windows system with JDK release 8 or later installed, follow the instructions in Windows Systems.
For all other systems (Linux and Mac OS X systems, and Windows systems with no JDK release 8 or later installed), follow the instructions in Linux and Mac OS X Systems.
1.2.1 Windows Systems
If a Windows 64-bit SQL Developer file that includes JDK 8 is available, you can download and install that on a Windows 64-bit system, and SQL Developer will use the embedded JDK that is provided.
However, if you want to use a JDK on your Windows 64-bit system, you can install the JDK (if it is not already installed) and the Windows 32/64-bit SQL Developer file, and SQL Developer will use the JDK that is installed on your system. The bit level (32-bit or 64-bit) of the JDK that you install will determine if SQL Developer runs as a 32-bit or 64-bit application.
Do not install SQL Developer into an existing sqldeveloper folder. Either delete the existing sqldeveloper folder first, or ensure that the new SQL Developer version is installed into a different location.
To install on a Windows system, follow these steps:
If you do not need or want to install a suitable Java Development Kit (JDK 8 or 9), go to step 3. Otherwise, download and install the JDK as follows:
On the Java SE Development Kit 8 Downloads page ( http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ), in the table of Java SE Development Kits, accept the Oracle Binary Code License Agreement for Java SE.
Click the link for the download that you need (for example, the Windows x64 link for a Windows 64-bit system).
Save the file anywhere on your system (such as a «temp» folder).
Read and accept the license agreement.
Follow the instructions for downloading and installing SQL Developer.
1.2.2 Linux and Mac OS X Systems
Do not install SQL Developer into an existing sqldeveloper directory. Either delete the existing sqldeveloper directory first, or ensure that the new SQL Developer version is installed into a different location.
To install and start SQL Developer, follow these steps:
Unzipping the SQL Developer kit causes a directory named sqldeveloper to be created under the directory. It also causes many files and directories to be placed in and under that directory.
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.)
If you choose not to migrate your user settings and then later want to do so, go to the SQL Developer user preferences location, which is C:\Users\ \AppData\Roaming\SQL Developer\ systemn.n.n.n.n for Windows and
/.sqldeveloper/system n.n.n.n.n for Linux or Mac, and delete the system.n.n.n.n folder. Then restart SQL Developer, and you will be asked about migrating settings from the previous release.
To migrate user settings from a previous SQL Developer release:
Related Topics
1.4 Migrating Information from Previous Releases
If you want to use any user-defined reports or the SQL history from a previous version, see Location of User-Related Information 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.
To migrate the SQL Developer preferences (specified by clicking Tools and then Preferences) from a previous release, ensure that the previous installation of the software is available in the same system.
If you want to uninstall your prerelease version of SQL Developer before installing this release, see 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.
Table 1-4 Default Locations for User-Related Information
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 \ \AppData\SQL Developer folder under Users are not sharable; 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
Oracle 12c, 18c, 19c
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 DB2 release: db2jcc.jar and db2jcc_license_cu.jar files required; available from IBM.
Microsoft SQL Server
Sybase Adaptive Server
JDBC driver files tdgssconfig.jar and terajdbc4.jar required; included (along with a readme.txt file) in the TeraJDBC__indep_indep.12.00.00.110.zip or TeraJDBC__indep_indep.12.00.00.110.tar download.
If you need to use SQL Developer to migrate a Microsoft Access database. use the previous version of SQL Developer (4.0.3) and the 32-bit version of the Java 7 JDK.
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
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
Unless otherwise indicated, the information is this section also applies to Data Modeler and Data Miner.
To make the best use of our accessibility features, Oracle Corporation recommends the following minimum configuration:
Windows XP, Windows Vista
Follow these steps to set up a screen reader and Java Access Bridge.
Install the screen reader, if it is not already installed.
Refer to the documentation for your screen reader for more information about installation.
Install SQL Developer.
If you are using Java J2SE 1.6.0_24 or higher but before Java 7 Update 6, go to If You Need to Install Java Access Bridge and follow the instructions there.
Start your screen reader.
The preceding 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, after SQL Developer has started. Any messages that appear will not affect the functionality of SQL Developer.
1.9.1 If You Need to Install Java Access Bridge
If you are using Java J2SE 1.6.0_24 or later but before Java 7 Update 6, you must manually install Java Access Bridge 2.0.2 after you install the screen reader (if it is not already installed).
Refer to the Java Access Bridge documentation available from this website for more information about installation and the Java Access Bridge.
The installer first checks the JDK version for compatibility, then the Available Java virtual machines dialog displays.
Note that the system directory is required in the PATH system variable.
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 Migrating Information from Previous Releases 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 Location of User-Related Information.
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 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.
1.12 Oracle on the Web
Oracle provides a number of resources on the web. These are some sites you may find helpful: