Sql developer oracle restoring windows

11 Backing Up and Recovering

This section discusses backing up and restoring the entire database and recovering data from individual schema objects. It includes the following topics:

Backing Up and Restoring the Database

This section includes the following topics:

About Backing Up and Re storing the Database

Backing up and restoring Oracle Database XE is based on protecting the physical files that make up the database: the datafiles, the control file, the server parameter file ( SPFILE ), and, if in ARCHIVELOG mode, the redo log files.

In Oracle Database XE, the database backup and recovery facility is based upon the Recovery Manager ( RMAN ) utility that is integrated into the database. Although there is an RMAN command line client similar to the SQL Command Line, you do not need to interact with it directly to back up or restore your database. Oracle Database XE includes backup and restore scripts that you access using menu choices on your desktop. These scripts perform a full backup and restore of the entire database, and store backup files in the flash recovery area.

Automatic Manag ement of Backup Storage

Oracle Database XE implements a backup re tention policy that dictates that two complete backups of the database must be retained, to provide a level of redundant protection for the database. In ARCHIVELOG mode, all archived logs required for media recovery from either backup are also retained. The database automatically manages backups and archived logs in the flash recovery area, deleting any that are obsolete (no longer needed to satisfy the retention policy) as space is needed for new files. The backup script provided with Oracle Database XE also deletes obsolete backups and archived logs at the end of each backup job.

The provided backup script performs online backups of a database that is in ARCHIVELOG mode and offline backups of a database that is in NOARCHIVELOG mode. Online backups are backups that can run while the database is running. Offline backups are backups that run when the database is in the mounted (but not open) state. For offline backups, the backup script automatically puts the database in the proper state. During offline backups, the database is unavailable to your applications.

You run the backup script by running the Backup Database command from the desktop.

Resto re Script

The provided restore script restores the database differently depending on whether log archiving is on or off:

Log archiving on ( ARCHIVELOG mode)—The restore script restores the backed up database files, and then uses the online and archived redo log files to recover the database to the state it was in before the software or media failure occurred. All committed transactions that took place after the last backup are recovered, and any uncommitted transactions that were under way when the failure took place are rolled back (using undo data from the restored undo tablespace).

Log archiving off ( NOARCHIVELOG mode)—The restore script restores the database to its state at the last backup. Any transactions that took place after the last backup are lost.

You run the restore script by running the Restore Database command from the desktop.

Oracle Database Backup and Recovery User’s Guide for more information on Oracle database backup and recovery with RMAN

Enabling ARCHIV ELOG Mode for Media Failure Protection

This section describes how to turn on ARCHIVELOG mode so that your database is fully protected not only against operating system and Oracle instance failure, but also against media (disk) failure. The following topics are covered:

Viewing the Current ARCH IVELOG Mode Setting

To view the current ARCHIVELOG mode setting:

Using the SQL Command Line, log in to the database and connect as SYSDBA , as described in «Logging In and Connecting to the Database as SYSDBA».

Enter the following command:

The LOG_MODE value will be either ARCHIVELOG (that is, on) or NOARCHIVELOG (that is, off).

Turning on ARCH IVELOG Mode

Turning on ARCHIVELOG mode is a one-time operation. After it is turned on, it remains on until you turn it off. Restarting the database does not change the ARCHIVELOG mode setting.

If you turn on ARCHIVELOG mode, you must perform regular backups of the database to avoid completely filling the flash recovery area. A completely filled flash recovery area can lead to database failure.

Читайте также:  C windows syswow64 inetsrv w3wp exe

To turn on ARCHIVELOG mode:

Using the SQL Command Line, log in to the database and connect as SYSDBA , as described in «Logging In and Connecting to the Database as SYSDBA».

At the SQL Command Line prompt, enter the following command:

If the command is successful, it displays the following output.

At the SQL Command Line prompt, enter the following command:

If the command is successful, it displays the following output. (System global area sizes will vary depending on the amount of physical memory in your Oracle Database XE host computer.)

Enter the following command:

If the command is successful, it displays the following output:

Enter the following command:

If the command is successful, it displays the following output:

The database is now running with the new ARCHIVELOG mode setting.

Change the size of the flash recovery area to at least 15 gigabytes to allow for the extra space required for archived log files.

For example, to set the flash recovery area size to 20 gigabytes, enter the following command:

To turn off ARCHIVELOG mode (that is, to set NOARCHIVELOG mode), follow the previous steps 1 through 5, but enter the following command in Step 4:

When you change the ARCHIVELOG mode setting for your database, all of your existing backups become unusable. You must immediately perform a backup after changing the ARCHIVELOG mode, as described in «Backing Up the Database».

«Shutting Down the Database Using the SQL Command Line» for information on how to handle a failed SHUTDOWN IMMEDIATE command.

Backing Up the Database

If ARCHIVELOG mode is on, the script performs an online backup. The database is available during the backup.

If ARCHIVELOG mode is off, the script performs an offline backup. The database is shut down during the backup and restarted afterwards. Your applications are unavailable during the backup.

To back up the database:

Do one of the following:

On Windows: Log in to the Oracle Database XE host computer as a user who is a member of the ORA_DBA user group. This is typically the user that installed Oracle Database XE.

On Linux: Log in to the Oracle Database XE host computer as a user who is a member of the dba user group. This is typically the oracle user.

Do one of the following:

On Windows: Click Start , point to Programs (or All Programs) , point to Oracle Database 11g Express Edition , and then select Backup Database .

On Linux with Gnome: In the Applications menu, point to Oracle Database 11g Express Edition , and then select Backup Database .

On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 11g Express Edition , and then select Backup Database .

A console window opens so that you can interact with the backup script.

If running in ARCHIVELOG mode, the script displays the following output:

If running in NOARCHIVELOG mode, the script displays the following output:

If prompted, enter y and press Enter to confirm the database shutdown and begin the backup.

After the backup is complete, the script displays the following output:

where location is the location of the log file.

Press Enter to close the Backup Database window.

Logs containing the output from the last two backups are stored in the locations listed in Table 11-1.

Table 11-1 Backup Script Output Log Locations

You can review the output of the two most recent backup attempts in the files OXE_BACKUP_CURRENT.LOG and OXE_BACKUP_PREVIOUS.LOG .

Scheduling Automatic Backups

To schedule automatic backups, use any operating system or third party task scheduling software to run the supplied backup script for your platform. Table 11-2 shows the name and path of this script for each platform.

Table 11-2 Name and Path of the Backup Script for Each Platform

Platform Location

Restoring and Recovering the Database

You restore and recover the database with the supplied restore script. The instructions in this section are based on the following assumptions:

A software failure, media (disk) failure, or operator error caused the loss or corruption of one or more database files, rendering the database unusable.

In the flash recovery area, the backup sets and, if in ARCHIVELOG mode, archived logs, are intact and available.

If in ARCHIVELOG mode, the online redo logs are intact and available.

If they are not available, the database is restored to the point of the last transaction included in an archived log. See Oracle Database Backup and Recovery User’s Guide for more information.

The Oracle Database XE host computer and operating system are operational.

The Oracle Database XE installed software (binaries) are intact and operational.

In situations where not all of these assumptions are true, before proceeding with the following steps to restore and recover the database, you may first have to complete one or more of the following tasks: repair or replace computer hardware, reinstall operating system software, or reinstall Oracle Database XE. After reinstalling Oracle Database XE, if your flash recovery area was previously on a separate disk from your Oracle Database XE installation and is still available, you must specify the location of the flash recovery area so that the restore script can find the required files. See «Setting Flash Recovery Area Location and Size» for instructions.

To restore the database:

Do one of the following:

On Windows: Log in to the Oracle Database XE host computer as a user who is a member of the ORA_DBA user group. This is typically the user that installed Oracle Database XE.

On Linux: Log in to the Oracle Database XE host computer as a user who is a member of the dba user group. This is typically the oracle user.

Do one of the following:

On Windows: Click Start , point to Programs (or All Programs) , point to Oracle Database 11g Express Edition , and then select Restore Database .

On Linux with Gnome: In the Applications menu, point to Oracle Database 11g Express Edition , and then select Restore Database .

On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 11g Express Edition , and then select Restore Database .

A console window opens so that you can interact with the restore script. The script displays the following output:

Enter y and press Enter to confirm the database restore.

The database is shut down, and the script runs RMAN to restore the database and, if running in ARCHIVELOG mode, recover all changes since the last backup.

In some situations, such as when you run the Restore Database command in a new Oracle Database XE installation before having backed up, the restore script may prompt you for the location of the flash recovery area:

If so prompted, enter the complete path to the location of the flash recovery area. (The default location for each platform is listed in Table 6-2.) The restore script then restores the database from the backup files in this location.

If the restore and recovery process is completed successfully, the database is opened again. The script then displays the following output:

where location is the location of the log file.

If the restore and recovery process fails, messages describing the error are displayed.

Refer to the log file for details on the cause of the error.

Press Enter to close the Restore Database window.

Sql developer oracle restoring windows

Your search did not match any results.

We suggest you try the following to help find what you’re looking for:

  • Check the spelling of your keyword search.
  • Use synonyms for the keyword you typed, for example, try “application” instead of “software.”
  • Try one of the popular searches shown below.
  • Start a new search.

Oracle SQL Developer

Oracle SQL Developer is a free, integrated development environment that simplifies the development and management of Oracle Database in both traditional and Cloud deployments. SQL Developer offers complete end-to-end development of your PL/SQL applications, a worksheet for running queries and scripts, a DBA console for managing the database, a reports interface, a complete data modeling solution, and a migration platform for moving your 3rd party databases to Oracle.

The World’s #1 Tool for Managing your Oracle Database

Oracle SQL Developer provides users with three interfaces: Desktop, Browser, and Command Line.

SQL Developer

Java powered application for Windows, OS X, and Linux.

  • 5+ million users
  • Full featured PL/SQL IDE
  • Database administration
  • Complete Data Modeling Solution
  • 3rd party DBMS migrations to Oracle
  • Migrate Oracle On-Premises to Oracle Cloud

Установка Oracle SQL Developer 4.0.3 и настройка подключения с сервером

Продолжаем осваивать СУБД от Oracle и сейчас давайте рассмотрим инструмент разработки и администрирования баз данных SQL Developer, мы узнаем, для чего нужен данный инструмент, затем установим его и настроим на работу с базой данных.

Как помните, в прошлом материале мы рассмотрели бесплатную СУБД от Oracle, а именно Oracle Database Express Edition 11g Release 2. И теперь для того чтобы разрабатывать базы данных и приложения на PL/SQL, необходимо установить соответствующий инструмент, и я, конечно же, для этих целей предлагаю использовать, также бесплатную программу SQL Developer, которую компания Oracle выпускает специально для разработки и управления баз данных на СУБД Oracle Database.

Для чего нужен SQL Developer?

Oracle SQL Developer — это бесплатная графическая среда управления базами данных и разработки приложений на языках программирования SQL и PL/SQL, разработанная специально для СУБД Oracle Database.

Данная среда написана на языке программирование Java и она работает на всех платформах где есть Java SE.

SQL Developer, позволяет просматривать объекты базы данных, запускать различные SQL инструкции, создавать и редактировать объекты базы данных, импортировать и экспортировать данные, а также создавать всевозможные отчеты.

Oracle SQL Developer помимо Oracle Database может подключаться и к другим базам данных, например, Microsoft SQL Server, MySQL и другим, но для этого необходимы специальные плагины, хотя возможность подключения к базе Access (mdb файл) есть по умолчанию.

На момент написания статьи доступна версия Oracle SQL Developer 4.0.3 (4.0.3.16.84) поэтому именно ее мы и будем устанавливать.

Где скачать Oracle SQL Developer?

Так как это продукт компании Oracle соответственно его можно скачать на официальном сайте компании, на данный момент доступна страница

После перехода на страницу мы соглашаемся с лицензионным соглашением путем выбора переключателя Accept License Agreement, затем выбираем платформу, на которую мы будем устанавливать, я хочу устанавливать на Windows 7 x32, соответственно выбираю:

Windows 32/64-bit — Installation Notes Download 226 M

Жму Download, потом, как и при скачивании Oracle Database Express Edition необходимо указать учетные данные от Oracle если они есть, а если нет, то соответственно необходимо завести учетную запись на Oracle (нажать «Создать учетную запись»). После чего загрузится файл sqldeveloper-4.0.3.16.84-no-jre.zip размером почти 226 мегабайт (это архив его можно разархивировать, например программой 7-zip).

Установка SQL Developer

Как было сказано, для работы среды SQL Developer требуется Java SE, поэтому у Вас на компьютере должен быть установлен Java Development Kit (JDK) это разработанный компанией Oracle, бесплатный комплект разработчика на языке Java, который включает стандартный компилятор, библиотеки классов Java и исполнительную среду JRE.

Если у Вас не установлен пакет JDK, и Вы выбрали тот же файл что и я Windows 32/64-bit — Installation Notes то, нам еще необходимо установить JDK, так как в данную сборку этот пакет не включен, если бы мы выбрали, например платформу Windows 64-bit — zip file includes the JDK 7, то, как видите из названия, комплект JDK включен в сам дистрибутив SQL Developer. (А если у Вас уже установлен JDK, то можете переходить сразу к пункту «Запуск SQL Developer».)

Поэтому нам сначала необходимо скачать и установить JDK, скачать его можно также на официальном сайте. Например, я буду скачивать, и устанавливать 7 версию JDK (кстати, доступна уже 8 версия, но я захотел именно эту). 7 версия JDK на сегодняшний день доступна на странице

я перехожу на эту страницу, и у пункта Java SE Development Kit 7u72 снова соглашаюсь с лицензионным соглашением, путем выбора переключателя Accept License Agreement и выбираю файл для 32 разрядных операционных систем Windows, а конкретно jdk-7u72-windows-i586.exe.

Установка Java SE Development Kit 7u72 (JDK)

У нас загрузился файл jdk-7u72-windows-i586.exe мы соответственно его и запускаем.

После запуска появится стартовое окно установщика JDK, мы жмем «Next»

Затем советую оставить все по умолчанию, жмем «Next»

И в процессе установке появится окно для запроса на установку JRE, жмем «Next»

Далее соответственно будет производиться установка JRE

После появления следующего окна установка будет завершена, жмем «Close»

Запуск SQL Developer 4.0.3

После распаковки архива sqldeveloper-4.0.3.16.84-no-jre.zip и установки JDK, переходим в распакованный каталог, открываем папку sqldeveloper и запускаем программу sqldeveloper.exe.

И при первом запуске SQL Developer попросит указать путь к комплекту JDK, и если Вы не меняли путь при установке JDK, то программа сама его подставит, нам останется нажать «OK», а если все же Вы изменили путь, то его необходимо будет указать.

И вот сейчас мы сможем наблюдать, как у нас будет открываться программа SQL Developer

После чего она соответственно откроется, и мы увидим стартовую страницу

Настраиваем подключение с сервером и базой данных

Так как в прошлом материале мы установили Oracle Database Express Edition, соответственно именно с этим сервером мы и будем соединяться.

Для этого жмем плюсик «New Connection»

После чего у Вас откроется окно настройки подключения, Вы соответственно вводите название Вашего подключения (Connection Name), имя пользователя (Username) и пароль (Password), если Oracle Database установлен на этом же компьютере, то в поле Hostname так и оставляем Localhost, порт 1521 (Port), SID, т.е. название базы данных, в случае с Express Edition это XE. (Если помните, я говорил что sql developer можно настроить на работу с базой Access mdb, для этого перейдите на вкладку Access). После ввода советую сначала нажать Test и если Вы получили ответ в строке состояния «Успех», т.е. Status: Success

То это означает что все хорошо, можем нажимать «Connect»

В случае если Вы получили в ответ следующую ошибку:

То, это означает, что в связи с языковыми настройками операционной системы Windows, Вы не можете подключиться, но, это можно исправить, если в конфигурационной файл, он расположен по следующему пути

в конец добавить две строки

затем перезапустить SQL Developer

После подключения к базе Вы увидите название своего подключения в списке подключений

Если плюсиком открыть подключение мы увидим все типы объектов в базе данных

Заметка! Начинающим программистам рекомендую почитать мою книгу «SQL код», которая поможет Вам изучить язык SQL как стандарт, в ней рассматриваются все базовые конструкции языка SQL, приводится много примеров и скриншотов.

Вот и все теперь можно писать запросы, разрабатывать функции, процедуры на языке PL/SQL, но об этом в следующем материале. Удачи!

Читайте также:  Lsblk linux что это
Оцените статью
Platform Backup Script Name and Path