PK
9Aoa, mimetypeapplication/epub+zipPK 9A iTunesMetadata.plist?
2 Day DBA
11g Release 2 (11.2)
E10897-10
August 2012
Oracle Database 2 Day DBA 11g Release 2 (11.2)
E10897-10
Copyright © 2004, 2012, Oracle and/or its affiliates. All rights reserved.
Primary Author: Bert Rich
Contributing Author: Kathy Rich, Janet Stern, Steve Fogel, Colin McGregor, Lance Ashdown, Eric Belden, Craig Foch, Sushil Kumar, Roza Leyderman, Paul Needham, and Douglas Williams
Contributor: Bharat Baddepudi, Prasad Bagal, Timothy Chien, Benoit Dageville, Sudip Datta, Kakali Das, Mark Dilman, Prabhaker Gongloor, Shivani Gupta, Pat Huey, Chaitanya Koratamaddi, Balaji Krishnan, Vasudha Krishnaswamy, Rich Long, Venkat Maddali, Matthew McKerley, Ed Miner, Mughees Minhas, Saurabh Pandey, Kant Patel, Hanlin Chien, Mark Townsend, Xiaofang Wang, Kat Weill, and Mike Zampiceni
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
As a database administrator (DBA), you are responsible for the overall operation of Oracle Database. This introductory chapter is intended to help orient you to many common DBA tasks, to the tools available to you, and to this guide. The chapter contains the following sections:
Oracle Database 2 Day DBA is a database administration quick start guide that teaches you how to perform day-to-day database administrative tasks. The goal of this guide is to help you understand the concepts behind Oracle Database, and to help you learn how to perform all common administrative tasks needed to keep the database operational. These tasks include configuring the database, managing memory and storage, managing users, managing database objects such as tables, performing basic troubleshooting, creating backups for your database, performance monitoring activities, and more.
The primary administrative interface used in this guide is Oracle Enterprise Manager Database Control, featuring all the self-management capabilities introduced in Oracle Database.
Oracle Database 2 Day DBA is task-oriented. The objective is to describe why and when administrative tasks must be performed. Where appropriate, it describes the concepts necessary to understand and complete a task, assuming the reader has no prior knowledge of the database. This guide is not an exhaustive discussion of all Oracle Database concepts. For this type of information, see Oracle Database Concepts.
Additionally, for a complete discussion of administrative tasks, see Oracle Database Administrator's Guide.
This guide is part of a comprehensive set of learning material for administering Oracle Database, which includes a 2 Day DBA Oracle By Example (OBE) series, available on the Web, and in an Oracle University instructor-led class.
Every chapter in Oracle Database 2 Day DBA has an associated Oracle By Example lesson. The OBE steps through all tasks in the chapter and includes annotated screenshots. In some cases, the OBE provides additional information to help you complete the task.
At the end of each chapter, you can find the link to its associated OBE lesson. The home page for the 2 Day DBA Oracle By Example series is as follows:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r2/2day_dba/index.html
In addition, Oracle University provides a related instructor-led course called Oracle Database 11g: 2 Day DBA. Contact Oracle University for more information.
Oracle Database is a relational database with object and Extensible Markup Language (XML) capabilities. In a relational database, all data is stored in two-dimensional tables that are composed of rows and columns. Oracle Database enables you to store data, update it, and efficiently retrieve it, with a high degree of performance, reliability, and scalability.
Oracle Database is composed of the following elements:
The Oracle software that you install on your host computer
The database, which is a collection of physical files on one or more disks
The database contains user data, metadata, and control structures. Metadata, or data about the data, is the collection of information on disk that permits Oracle software to manage user data. An example of metadata is the data dictionary. Control structures (such as the control file and online redo log files) ensure the integrity, availability, and recoverability of user data.
The Oracle instance, which is composed of the following:
Server processes that perform work on behalf of connected users and applications, and the memory and temporary storage used by these processes
Server processes parse and execute SQL statements, and retrieve and return results to the user or application.
Oracle Net, which is a software layer that enables client applications and Oracle Database to communicate over a network, and the Oracle Net listener, which is a process that listens for connection requests from the network.
See Also:
|
As an Oracle DBA, you can expect to be involved in the following tasks:
Installing Oracle software
Creating Oracle databases
Performing upgrades of the database and software to new release levels
Starting and shutting down the database instance
Managing the storage structures of the database
Managing users and security
Managing database objects, such as tables, indexes, and views
Backing up the database and performing recovery operations when necessary
Monitoring the state of the database and taking preventive or corrective action as required
Monitoring and tuning database performance
Diagnosing and reporting critical errors to Oracle Support Services
In a small to medium-sized database environment, you might be the sole person performing these tasks. In large, enterprise environments, the job is often divided among several DBAs, each of whom has a specialty, such as database security or database tuning.
The goal of this guide is to enable you to quickly and efficiently create an Oracle database, and to provide guidance in basic database administration.
The following are some products, tools, and utilities you can use to achieve your goals as a database administrator:
Oracle Universal Installer
Oracle Universal Installer (OUI) is a utility that installs your Oracle software and options. It can automatically start Oracle Database Configuration Assistant to install a database.
Oracle Database Configuration Assistant
Oracle Database Configuration Assistant (DBCA) is a utility that creates a database from templates that are supplied by Oracle, or you can create your own. It enables you to copy a preconfigured seed database, thus saving the time and effort of generating and customizing a new database.
Database Upgrade Assistant
The Database Upgrade Assistant is a tool that guides you through the upgrade of your existing database to a new Oracle Database release.
Net Configuration Assistant
Net Configuration Assistant (NETCA) is a utility that enables you to configure listeners and naming methods, which are critical components of the Oracle Database network.
Oracle Enterprise Manager Database Control
The primary product for managing your database is Oracle Enterprise Manager Database Control (Database Control), a Web-based interface. After you have installed the Oracle Database software, created or upgraded a database, and configured the network, you can use Database Control to manage your database. Database Control also provides an interface for performance advisors and for Oracle utilities such as SQL*Loader and Recovery Manager (RMAN).
Oracle also offers separately licensed Oracle Enterprise Manager management packs, management plug-ins, and other products you can purchase to enhance the capabilities of Oracle Enterprise Manager in specific environments.
This chapter introduces you to Oracle Database backup and recovery with Oracle Enterprise Manager Database Control. After reading this chapter, you should be familiar with the basic concepts of Oracle Database backup and recovery operations, know how to implement a disk-based backup strategy, and perform simple repairs to database files.
This chapter contains the following sections:
See Also:
|
The focus in Oracle Database backup and recovery is on the physical backup of database files, which permits you to reconstruct your database. The files protected by the backup and recovery facilities built into Oracle Enterprise Manager Database Control (Database Control) include data files, control files, server parameter files, and archived redo log files. With these files you can reconstruct your database. The backup mechanisms work at the physical level to protect against file damage, such as the accidental deletion of a data file or the failure of a disk drive.
Oracle Recovery Manager (RMAN), a command-line and Enterprise Manager-based tool, is the method preferred by Oracle for efficiently backing up and recovering your Oracle database. RMAN is designed to work intimately with the server, providing block-level corruption detection during backup and restore. RMAN optimizes performance and space consumption during backup with file multiplexing and backup set compression, and integrates with leading tape and storage media products.
Logical backups, such as exporting database objects such as tables or tablespaces, are a useful supplement to physical backups, but cannot protect your whole database. An effective backup strategy must be based on physical backups.
The Oracle Database flashback features provide a range of physical and logical data recovery tools as efficient, easy-to-use alternatives to physical and logical backups. The flashback features enable you to reverse the effects of unwanted database changes without restoring data files from backup or performing media recovery.
This section introduces the following flashback features:
Oracle Flashback Table, which enables you to revert a table to its contents at a time in the recent past
Oracle Flashback Drop, which enables you to retrieve deleted (dropped) database tables
Oracle Flashback Database, which enables you to revert the entire database to a past point in time
The first two features operate at the logical level, whereas the last feature operates at the physical level. None of the preceding features requires advance preparation such as creating logical exports to allow for retrieval of your lost data. You can use all of the features while your database is available. Oracle Database Backup and Recovery User's Guide discusses the flashback features of Oracle Database at greater length.
The Oracle Enterprise Manager physical backup and recovery features are built on the Recovery Manager (RMAN) command-line client. Database Control makes available many of the RMAN features, and provides wizards and automatic strategies to simplify and further automate RMAN-based backup and recovery.
To back up your database means to make copies of your data files, control file, and archived redo log files (if your database runs in ARCHIVELOG
mode). Restoring a database means copying the physical files that comprise the database from a backup medium, typically disk or tape, to their original or to new locations. Database recovery is the process of updating database files restored from a backup with the changes made to the database after the backup, typically using online redo log files.
A backup is either consistent or inconsistent. To make a consistent backup, your database must have been shut down cleanly and remain closed for the duration of the backup. All committed changes in the online redo log files are written to the data files during the shut down process, so the data files are in a transaction-consistent state. When you restore your data files from a consistent backup, you can open the database immediately.
If the database is in ARCHIVELOG
mode, then you can make inconsistent backups that are recoverable using archived redo log files. Open database backups are inconsistent because the online redo log files contain changes not yet applied to the data files. The online redo log files must be archived and then backed up with the data files to ensure recoverability.
Despite the name, an inconsistent backup is as robust a form of backup as a consistent backup. The advantage of making inconsistent backups is that you can back up your database while the database is open for updates.
See Also:
|
If you restore the archived redo log files and data files, then you must perform media recovery before you can open the database. Any database transactions in the archived redo log files not reflected in the data files are applied to the data files, bringing them to a transaction-consistent state before the database is opened.
Media recovery requires a control file, data files (typically restored from backup), and online and archived redo log files containing changes since the time the data files were backed up. Media recovery is most often used to recover from media failure, such as the loss of a file or disk, or a user error, such as the deletion of the contents of a table.
Media recovery can be a complete recovery or a point-in-time recovery. In a complete recovery, you restore backup data files and apply all changes from the archived and online redo log files to the data files. The database is returned to its state at the time of failure and can be opened with no loss of data.
In a point-in-time recovery, you return a database to its contents at a user-selected time in the past. You restore a backup of data files created before the target time and a complete set of archived redo log files from backup creation through the target time. Recovery applies changes between the backup time and the target time to the data files. All changes after the target time are discarded.
Oracle Enterprise Manager Database Control (Database Control) provides an interface to both a complete and a point-in-time recovery in the form of a Recovery wizard. However, this documentation focuses on complete recovery.
See Also:
|
To simplify the management of backup and recovery files, you can create a fast recovery area for your database. The fast recovery area is an Oracle-managed directory, file system, or Oracle Automatic Storage Management disk group that provides a centralized disk location for backup and recovery files. Oracle creates archived logs and flashback logs in the fast recovery area. RMAN can store its backup sets and image copies in the fast recovery area, and it uses it when restoring files during media recovery. The fast recovery area also acts as a disk cache for tape.
Oracle Database automatically manages this storage, deleting files that are no longer needed. Periodically copying backups to tape frees space in the fast recovery area for other files. Oracle recommends that you enable a recovery area to simplify backup management. Except as noted, this documentation assumes the use of a recovery area.
See Also:
|
RMAN maintains a record of database files and backups for each database on which it performs operations. This metadata is called the RMAN repository.
If you back up a file without using RMAN, such as by copying the file at the host operating system level, then you can add metadata about the copy to the RMAN repository. If you later use a command such as RESTORE DATABASE
, then RMAN uses the records in the repository to select backups needed for the recovery.
The primary location for the RMAN repository for a database is its control file. The importance of this metadata for RMAN is one more reason why protecting your control file is a vital part of your backup strategy. In some installations, a second copy of the RMAN repository is stored in a schema called the recovery catalog. The recovery catalog is located in a separate database and can store metadata for multiple databases. Use of a recovery catalog is optional and is beyond the scope of this documentation.
See Also:
|
This section explains how to set up your database to take advantage of Oracle suggested backup strategies. If you configured the database for automated backups with the Oracle Database Configuration Assistant (DBCA), then skip this section.
To take maximum advantage of Oracle Database features that automatically manage backup and recovery files and operations, configure your database as follows:
Use a fast recovery area, which automates storage management for most backup-related files, and specify it as an archived redo log file destination.
Run the database in ARCHIVELOG
mode so you can perform online backups and have data recovery options such as complete and point-in-time media recovery.
You must also set several policies governing which files are backed up, what format is used to store backups on disk, and when files become eligible for deletion.
This section contains the following topics:
Specifying Credentials for Backup and Recovery Using Database Control
Planning Space Usage and Location for the Fast Recovery Area
You must have the proper credentials to perform some configuration tasks for backup and recovery, and to schedule backup jobs and perform recovery. The following credentials may be required:
The Oracle Database user you specify when you log in to Oracle Enterprise Manager Database Control (Database Control)
The host operating system user whose credentials you provide when performing backup and recovery tasks
To enter credentials for backup and recovery tasks:
Log in to Database Control as a database user with SYSDBA
privileges, or provide host operating system credentials for a user in the dba
group on UNIX or Linux, or the ora_dba
group on Microsoft Windows.
The host operating system user must also have execute permission for the RMAN command-line client.
Note: The host user may require certain host privileges to run background jobs such as database backups. For example, on UNIX and Linux, the host user must belong to the OSDBA group (typicallydba ), and on Windows, the host user must be a member of the Administrators group and must be granted the Log on as batch job logon right. See your platform documentation for more information. |
For tasks requiring host operating system credentials, a Host Credentials form appears at the bottom of the page used to perform the task. Enterprise Manager uses the credentials when it starts RMAN jobs that you requested or scheduled.
Optionally, in the Host Credentials form, select Save as Preferred Credential.
If you select this option before performing your action, then the provided credentials are stored persistently for the currently logged-in Oracle Database user. The preferred credentials are reused by default whenever you log in as that user and perform operations requiring host credentials.
Note: In situations in which the database is shut down, you may still be prompted for host credentials even if you have saved the preferred credentials. |
You should place the fast recovery area on a separate disk from the working set of database files. Otherwise, the disk becomes a single point of failure for your database.
The amount of disk space to allocate for the fast recovery area depends on the size and activity levels of your database, which determine the size of your data files and online redo log files in addition to your recovery objectives. Your objectives dictate what kinds of backups you use, when you make them, and how long to keep them.
Space management in the fast recovery area is governed by a backup retention policy. A retention policy determines when files are obsolete, meaning that they are no longer needed to meet your data recovery objectives.
Retention policies can be based on redundancy of backups or on a recovery window (period of time). When using a policy based on redundancy, the fast recovery area considers a backup of a file obsolete only when the RMAN repository has records of a specified number of more recent backups of that file. When using a recovery policy based on a period of time (or window), you specify a time interval in days. Files are obsolete only when they are no longer needed for complete recovery or point-in-time recovery to a system change number (SCN) within the window. Therefore, a recovery retention policy based on a window is recommended.
Even after files in the fast recovery area are obsolete, they are typically not deleted until space is needed for new files. If space permits, files recently moved to tape remain on disk to avoid restoring them from tape for a recovery. The automatic deletion of obsolete files and files moved to tape from the fast recovery area makes it a convenient archiving destination. Other destinations require manual deletion of logs.
Oracle Database Backup and Recovery User's Guide explains how to size the fast recovery area. As a general rule, the larger the fast recovery area, the more useful it is. Ideally, the fast recovery area should be large enough for copies of the data files, control files, online redo log files, and archived redo log files needed to recover the database, and also the copies of these backup files that are kept based on the retention policy.
If your backup strategy includes incremental backups, which are described in "Incremental Backups of Data Files", then add enough space to the fast recovery area for these files. If you can move some backups to tape, then you can reduce the size of the fast recovery area. Note that retrieving files from tape causes longer database restore operations and recovery times.
In the Recovery Settings page, you can configure settings for instance recovery, media recovery, and fast recovery. In this section, you configure the fast recovery area and enable archiving for the database.
You can configure a fast recovery area when first creating the database. If you did not perform this task at database creation time, however, then you can create a fast recovery area for your database now.
To configure a fast recovery area and put the database in ARCHIVELOG
mode:
On the host operating system, create a directory to hold the fast recovery area. If you are using Oracle ASM for your storage, then create a new disk group.
Make sure that the operating system permissions for the directory or disk devices allow the database to create files.
Log in to Enterprise Manager Database Control as user SYS
.
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section, click Recovery Settings.
The Recovery Settings page appears.
Complete the following steps:
In the Media Recovery section, select ARCHIVELOG Mode.
If USE_DB_RECOVERY_FILE_DEST
is not set as an archiving destination, then set it.
This initialization parameter indicates that the fast recovery area should be an archiving destination.
For ease of database management, the best practice is to use the fast recovery area as your only archiving destination.
In the Fast Recovery section, enter the path to the fast recovery area created in Step 1 in Fast Recovery Area Location, and select a value for Fast Recovery Area Size.
Select Enable Flashback Database.
This option specifies that the database should generate flashback logs in the fast recovery area, enabling you to use Flashback Database. During usual operation, the database occasionally logs images of data blocks to the flashback logs. The database automatically creates, deletes, and resizes flashback logs.
Ensure that the Apply initialization parameter changes to SPFILE only box is not selected.
Click Apply to save your changes.
A message prompts you to restart the database.
Click Yes.
The Restart Database: Specify Host and Target Database Credentials page appears.
Enter your host and database credentials, and then click OK.
See "Specifying Credentials for Backup and Recovery Using Database Control" for information about credentials.
On the Restart Database: Confirmation page, click Yes to begin the restart operations.
You can click Refresh periodically to monitor the progress of the operation.
Make a consistent (that is, offline) backup of your entire database immediately after switching your database to ARCHIVELOG
mode.
Caution: You cannot use backups from before the switch toARCHIVELOG mode to restore and recover the database to a point in time after the switch. Thus, if you do not immediately make a backup after switching, then you are running your database without a valid backup. See "Performing and Scheduling Backups Using Database Control" to learn how to make database backups. |
See Also:
|
It is important to monitor space usage in the fast recovery area to ensure that it is large enough to contain backups and other recovery-related files.
To monitor available space in the fast recovery area:
In the High Availability section of the Database Home page, click the link next to Usable Fast Recovery Area (%).
The Recovery Settings page appears.
The Reclaimable Recovery Area (GB) and Free Recovery Area (GB) settings indicate how much space is available.
You can configure several backup-related settings and policies. For example, you can determine how backups are stored, which data is backed up, and how long backups are retained. You can also configure settings to optimize backup performance.
This section explains the concepts behind the available settings and also explains how to change them using the Backup Settings page in Database Control. The settings on the Device subpage affect how RMAN writes backups to disk and to tape.
Database backups created by RMAN are stored as image copies or backup sets.
Image copies are exact byte-for-byte copies of files. You can create an image copy by copying a file at the operating system level. Unlike copying files at the operating system level, however, image copies created through RMAN or Database Control are recorded in the RMAN repository so that RMAN can use these copies during database restore operations and recovery. RMAN can restore files only if they are recorded in the RMAN repository. RMAN can create image copies only on disk.
Backup sets are logical entities produced by the RMAN BACKUP
command. This command can produce one or more backup sets on disk or media management devices. RMAN can write backup sets only to a media manager.
Each backup set contains several physical files called backup pieces. A backup piece stores the backup of one or more database files in a compact RMAN-specific format. One advantage of backup sets is that RMAN uses unused block compression to save space in backing up data files. Only those blocks in the data files that have been used to store data are included in the backup set.
RMAN depends on server sessions, processes that run on the database server, to create backups and restore them. Each server session, in turn, corresponds to an RMAN channel, representing one stream of data to or from a backup device. Channels are either of type disk or type SBT (tape).
RMAN supports parallelism, which is the use of multiple channels and server sessions to perform the work of one backup or recovery task. Proper use of parallelism can greatly increase performance on backup and recovery tasks.
See Also:
|
For disk-based backups, you can configure the default format for backups, the location on disk where backups are stored, and whether backup tasks run in parallel.
For tape backups, you can configure settings such as the number of tape drives and whether backups are compressed. On most platforms, you must integrate a media manager with the Oracle database to use sequential media for storage.
You can use Oracle Secure Backup, which supports both database and file system backups to tape, as your media manager. Oracle Secure Backup provides the same services for RMAN as other third-party SBT interfaces, but is better integrated with Database Control. This section assumes that you make only disk backups.
To configure backup settings for disk:
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section, click Backup Settings.
The Backup Settings page appears.
At the top of the page, click Device.
The Device subpage of Backup Settings appears.
Complete the following steps:
In Parallelism, enter 1
.
Later, when you have had time to review the information in Oracle Database Backup and Recovery User's Guide about parallelism and performance in RMAN, you may want to change this value.
Leave the Disk Backup Location field blank so that RMAN directs backups to the fast recovery area.
In the Disk Backup Type section, select Backup Set.
One advantage of backup sets is that RMAN uses unused block compression to save space when backing up data files. Only those blocks in the data files that have been used to store data are included in the backup set.
In Host Credentials section at the bottom of the page, enter values in the Username and Password fields.
Host credentials are described in "Specifying Credentials for Backup and Recovery Using Database Control".
Click Test Disk Backup (near the top of the page) to ensure the credentials and backup location are correct.
A message appears that states whether the test was successful.
In this example you do not change the settings on the Backup Set subpages.
See Also:
|
You can set the backup policies that govern control file and server parameter file backups, tablespaces to exclude from an entire database backup, and the backup retention policy.
To configure the backup policy settings:
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section, click Backup Settings.
The Backup Settings page appears.
At the top of the page, click Policy.
The Backup Policy subpage appears.
Perform the following actions:
Select the Automatically backup the control file and server parameter file (SPFILE) with every backup and database structural change option. Leave the Autobackup Disk Location field blank so that RMAN stores the automatic backups in the fast recovery area.
The server parameter file and control file are critical to the database and RMAN, and are also relatively small compared to typical data files. Backing them up frequently results in relatively little storage overhead.
Select the Optimize the whole database backup by skipping unchanged files such as read-only and offline data files that have been backed up option.
This option saves space in the fast recovery area.
Select the Enable block change tracking for faster incremental backups option. Either leave the Block Change Tracking File field blank (if you specified Oracle Managed Files when creating the database) or enter a file name (including path).
This option takes advantage of the block change tracking feature, which greatly improves incremental backup performance at a small cost of overhead.
In the Tablespaces Excluded From Whole Database Backup section, leave the settings as they are.
This feature enables you to specify a list of tablespaces to exclude from a backup. For example, you do not have to include read-only tablespaces in every backup.
In the Retention Policy section, select Retain backups that are necessary for a recovery to any time within the specified number of days (point-in-time recovery). In Days, enter 31
.
This setting enables a recovery policy with retention based on a period of time.
In the Archivelog Deletion Policy section, select None.
This option specifies that logs are eligible for automatic deletion only when they have been backed up to tape or are obsolete based on the retention policy.
At the bottom of the page, click OK to save your changes.
See Also:
|
This section describes how to back up your database with Oracle Enterprise Manager Database Control (Database Control). The Oracle suggested strategy for disk-only backups provides efficient daily backup of the database. This strategy enables you to quickly return your database to its state at any point during the previous 24 hours. For more flexible backup options, see Oracle Database Backup and Recovery User's Guide.
This section provides the concepts you need to understand the Oracle suggested backup strategy and other backup types provided through Database Control.
A full backup of a data file includes all used blocks of the data file. As explained in "About RMAN Backups", an RMAN backup can be either an image copy or backup set. An image copy is a bit-for-bit copy of the data file, and thus includes unused blocks.
RMAN incremental backups copy only those blocks in a data file that change between backups. A level 0 incremental backup, which copies all blocks in the data file, is used as a starting point for an incremental backup strategy.
Incremental backups at level 1 copy only images of blocks that have changed since a previous incremental backup. Level 1 backups can be cumulative, in which case all blocks changed since the most recent level 0 backup are included, or differential, in which case only blocks changed since the most recent level 0 or level 1 incremental backup are included. A typical incremental strategy makes level 1 backups at regular intervals such as once each day.
Recovering changed blocks from incremental backups can speed media recovery. Because an incremental level 1 backup copies the final contents of all data file blocks changed during the period covered by the incremental backup strategy, the recovery process can avoid reapplying updates from the archived redo log files of that period, and update each block with its final contents. The archived redo log files are used only for changes from the period not covered by level 1 backups.
RMAN enables you to apply level 1 incremental backups to an older image copy of your data files. You can roll forward the copy to the point in time of the most recent level 1 incremental backup. All blocks changed since the image copy was created are overwritten with their new contents as of the time of the last level 1 incremental backup. The effect is to roll forward the file in time, so that its contents are equivalent, for the purposes of database recovery, to an image copy of the data file made at the time of the last incremental level 1 backup.
Incorporating incrementally updated backups into your backup strategy shortens expected recovery times. Media recovery to the present time or to a point in time in the recent past can begin at the time of the last level 1 backup applied, rather than at the time of the last full database backup.
A tag is a text string that identifies that backup, either uniquely or as part of a group of backups. All RMAN backups, including incremental backups, are labeled with a tag. For example, if you performed a full database backup every Saturday, then you could use the tag FULL_SAT
to identify this backup.
You can use tags to refer to specific backups in RMAN commands. For example, you could issue a command to move the latest FULL_SAT
backup to tape. If you do not specify a tag, then RMAN creates a unique tag automatically.
Because you can use tags to refer to different groups of backups, you can create different routines in your backup strategy that do not interfere with each other. When you schedule a backup job and give the job a name, the job name is the tag.
Database Control enables you to perform RMAN backups and schedule backup jobs required by your backup strategy.
Whole backups of a database include the complete contents of all data files of the database, also the control file, archived redo log files, and server parameter file. With these files, you can perform a complete recovery.
While whole database backups can be an important element in your overall backup strategy, they are also a required step in some situations, such as when you enable or disable ARCHIVELOG
mode (see "Configuring Recovery Settings"). This section explains how to make whole database backups to disk.
To perform a whole database backup when the database is open:
On the Database Home page, click Availability to display the Availability subpage.
In the Manage section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Host Credentials section at the bottom of the page (not shown in the figure), enter values in the Username and Password fields if the Preferred Credentials are not set.
In the Customized Backup section, select Whole Database, and then click Schedule Customized Backup.
The Schedule Customized Backup: Options page appears.
In the Backup Type section, select Full Backup.
In the Backup Mode section, select either Online Backup or Offline Backup.
Typically, you want to perform online backups to maximize database availability.
Note: As explained in "Configuring Your Database for Basic Backup and Recovery", you can make online backups only if your database is running inARCHIVELOG mode. |
In the Advanced section, make the following selections, and then click Next:
If you are performing an online backup, then select Also back up all archived logs on disk.
You do not have to back up archived logs when performing an offline backup because the database is in a consistent state at the time of backup and does not require media recovery if you restore the database from this backup. However, you can choose to include archived logs in the backup.
If a fast recovery area is your only archiving destination, then do not select "Delete all archived logs from disk after they are successfully backed up".
In this case, archived redo log files that have been backed up are deleted automatically as space is needed. If you are using some other archiving destination, then it may be useful to select this option as part of managing your backup storage.
If the fast recovery area stores backups, then do not select the "Delete obsolete backups" option.
In this case, obsolete backups are deleted automatically as space is needed. If you use another destination for your backup files, then you can select this option.
Do not select "Use proxy copy supported by media management software to perform a backup" for now.
Do not enter a value in the Maximum Files per Backup Set field or the Section Size field.
The Schedule Customized Backup: Settings page appears.
Select Disk and then click Next.
Oracle recommends backing up to disk when possible to minimize recovery time by minimizing restore operations from tape. Later, you can move disk backups to tape.
The Schedule Customized Backup: Schedule page appears.
Complete the following steps:
In the Job section, leave the default values for Job Name and Job Description.
In the Job Name field, you can enter a user-specified tag for this backup. The job name is used as a prefix for the backup tag for backups created by this job.
Note: For recurring jobs, it is useful to set a Job Name so that the resulting backups are easy to identify as part of an ongoing series. Use a descriptive tag, such asWEEKLY_FULL_BACKUP . |
In the Job Description field, you can enter any descriptive text that is useful for your own reference.
In the Schedule section, select One Time (Immediately), and then click Next.
The Schedule Customized Backup: Review page appears.
Click Submit Job.
The Status page appears. This page should contain a message that indicates the job was successfully submitted.
Click View Job to monitor the progress of the backup.
The Execution page for your database appears. This page contains a Summary section describing the job. The table at the bottom of the page displays the progress of the various steps of the backup job. You can reload this page in your browser to monitor the ongoing progress of the job.
In the Name column of the table, you can see the current phase of the RMAN job. Clicking the name of the phase of the backup job displays a page containing the RMAN output for that part of the job. If you clicked on a job phase link, then from your current page, click the Execution: Database_name link at the top of the page to return to Execution page for your database.
To perform a whole database backup when the database is closed:
Follow the same steps as for an open database backup, except select Offline Backup in Step 5 and then continue with the steps that follow.
Database Control makes it easy to set up an Oracle suggested backup strategy for backups to disk that protects your data and provides efficient recoverability to any point in the user-specified recovery window (time period). The Oracle suggested strategy leverages the incremental backup and incrementally updated backup features to provide faster backups than whole database backups, and faster recoverability than is possible through applying database changes from the archive log to your data files.
The Oracle suggested strategy is based on creating an image copy of your database. The database rolls forward this copy by using incrementally updated backups. Oracle Enterprise Manager schedules RMAN backup jobs during the overnight hours.
For each data file, the strategy calls for backups as follows:
At the beginning of day 1 of the strategy (the time the first scheduled job actually runs), RMAN creates an incremental level 0 data file copy. It contains the data file contents at the beginning of day 1.
If a recovery is required, then the archived redo log files from day 1 can be used to recover to any point during day 1.
At the beginning of day 2, RMAN creates a differential incremental level 1 backup that contains the blocks changed during day 1.
If a recovery is required, then RMAN can apply this incremental level 1 to roll forward the level 0 backup to the beginning of day 2. RMAN can use archived redo log files to recover to any point during day 2.
At the beginning of each day n for day 3 and onward, RMAN applies the level 1 backup from the beginning of day n-1 to the level 0 backup. This action brings the data file copy to its state at the beginning of day n-1. Then, RMAN creates a new level 1 backup that contains the blocks changed during day n-1.
If a recovery is required, then RMAN can apply this incremental level 1 backup to the data file rolled forward on day n-1 to the beginning of day n. RMAN can use archived redo log files to recover the database to any point during day n.
In the Oracle suggested backup strategy, data file copies have the tag ORA$OEM_LEVEL_0
. The differential level 1 incremental backups in this strategy share the same tag. You can safely implement other backup strategies without interfering with the Oracle suggested backup strategy.
Oracle suggested backup strategies also use tape backups in addition to disk backups, but these are beyond the scope of this section.
The following procedure schedules daily database backups. The strategy uses incremental backups and incrementally applied backups to enable quick recovery to any time in the preceding 24 hours.
To backup your database using the Oracle-suggested disk backup strategy:
On the Database Home page, click Availability to display the Availability subpage.
In the Manage section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Oracle-Suggested Backup section, click Schedule Oracle-Suggested Backup.
The Schedule Oracle-Suggested Backup: Destination page appears. On this page, you select the destination media for the backup, which can be disk, tape, or both.
Select Disk and then click Next.
The Schedule Oracle-Suggested Backup: Setup page appears.
This page describes the backups that are performed each day as part of the disk-based strategy.
Review the information and then click Next.
The Schedule Oracle-Suggested Backup: Schedule page appears.
Choose a Start Date, Time Zone, and Daily Backup Time for the daily backups, and then click Next.
The Schedule Oracle-Suggested Backup: Review page appears.
Database Control displays the backup script that RMAN will run (although you cannot edit the script directly). The script should look similar to the following:
Daily Script: run { allocate channel oem_disk_backup device type disk; recover copy of database with tag 'ORA_OEM_LEVEL_0'; backup incremental level 1 copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database; }
Click Submit Job.
After taking some time to understand the full range of available backup options described in Oracle Database Backup and Recovery User's Guide you may decide to schedule backup tasks beyond those used to implement the Oracle suggested backup strategy.
To schedule miscellaneous backup tasks:
On the Database Home page, click Availability to display the Availability subpage.
In the Manage section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Customized Backup section, select the object to back up. For example, select Tablespaces or Archivelogs.
Make sure the host credentials have been filled in, then click Schedule Customized Backup to start the Schedule Customized Backup wizard.
On the following pages of the wizard, specify details such as objects to back up, and required options and settings. Click Next on each page to proceed to the next page.
The choices presented on these pages are determined by the type of objects being backed up. For example, to backup a tablespace, on the first page of the wizard you would click the Add button to specify the tablespaces you want to include in the backup job. On the following pages, you would select the backup options, location, and schedule.
For more information about using the wizard, click Help on any page.
Click Submit Job.
As part of your backup strategy, you should periodically check whether your backups are intact and can be used to meet your recoverability objectives. You can validate your backups in the following ways:
Select specific backup sets or image copies in Database Control and validate them. This technique indicates if a backup exists and can be restored. For this form of validation, use the Manage Current Backups pages as described in "Validating Selected Backups".
Specify database files and let RMAN select backups to use when restoring those files, as it would for an actual restore operation. This technique ensures that your available backups are sufficient to restore the database. For this form of validation, use the Perform Recovery pages as described in "Validating Backups for Restore Operations".
Note: Validating backups stored on tape can be time-consuming because the entire backup is read from tape. |
You can set up both forms of validation as scheduled tasks in Database Control. You should incorporate both forms of validation into your backup strategy to ensure that your recoverability goals are met by your available backups.
Validating specific backups checks whether these backups exist and can be restored. It does not test whether the set of available backups meet your recoverability goals. For example, image copies of data files for several tablespaces from your database may exist, each of which can be validated. If there are some tablespaces for which no valid backups exist, however, then you cannot restore and recover the database.
To validate selected backups:
On the Database Home page, click Availability to display the Availability subpage.
In the Availability page, in the Manage section, click Manage Current Backups.
The Manage Current Backups page appears.