备份数据库的expdp语句_Oracle DBA必会备份和恢复介绍

05fabba9fc3ab645a7f5041883cdc0d7.gif

1 Introduction to Backup and Recovery

本章介绍了Oracle数据库备份和恢复,并总结了Oracle解决方案。本章包含以下主题:

This chapter explains Oracle Database backup and recovery and summarizes the Oracle solutions. This chapter contains the following topics:(1) Purpose of Backup and Recovery(2) Oracle Backup and Recovery Solutions(3) Oracle Flashback Technology(4) Data Recovery Advisor(5) Backup and Recovery Documentation Roadmap

一 备份和恢复目的

一 Purpose of Backup and Recovery

作为备份管理员,您的主要职责是设计、实施和管理备份和恢复策略。一般来说,备份和恢复策略的目的是保护数据库免受数据丢失,并在数据丢失后重建数据库。通常,备份管理任务包括:

As a backup administrator, your principal duty is to devise, implement, and manage a backup and recovery strategy. In general, the purpose of a backup and recovery strategy is to protect the database against data loss and reconstruct the database after data loss. Typically, backup administration tasks include the following:
(1) 计划和测试对不同类型故障的响应(2) 为备份和恢复配置数据库环境(3) 设置备份计划(4) 监视备份和恢复环境(5) 备份问题疑难解答(6) 在需要时从数据丢失中恢复作为备份管理员,您还可能被要求执行与备份和恢复相关的其他职责:(7) 数据保存,包括为长期存储创建一个数据库副本(8) 数据传输,包括将数据从一个数据库或一个主机移动到另一个。本手册的目的是解释如何执行上述任务。
(1) Planning and testing responses to different kinds of failures(2) Configuring the database environment for backup and recovery(3) Setting up a backup schedule(4) Monitoring the backup and recovery environment(5) Troubleshooting backup problems(6) Recovering from data loss if the need arisesAs a backup administrator, you may also be asked to perform other duties that are related to backup and recovery:(7) Data preservation, which involves creating a database copy for long-term storage(8) Data transfer, which involves moving data from one database or one host to another The purpose of this manual is to explain how to perform the preceding tasks.

1.1数据保护

1.1 Data Protection

作为备份管理员,您的主要工作是制作和监视备份以保护数据。备份是数据库数据的副本,可用于重建数据。备份可以是物理备份,也可以是逻辑备份。

As a backup administrator, your primary job is making and monitoring backups for data protection. A backup is a copy of data of a database that you can use to reconstruct data. A backup can be either a physical backup or a logical backup.

物理备份是用于存储和恢复数据库的物理文件的副本。这些文件包括数据文件、控制文件和归档日志文件。

Physical backups are copies of the physical files used in storing and recovering a database. These files include data files, control files, and archived redo logs.

最终,每个物理备份都是将数据库信息存储到另一个位置的文件的副本,无论是在磁盘上还是在脱机存储介质(如磁带)上。

Ultimately, every physical backup is a copy of files that store database information to another location, whether on disk or on offline storage media such as tape.

逻辑备份包含表和存储过程等逻辑数据。可以使用Oracle Data Pump将逻辑数据导出为二进制文件,稍后可以将这些文件导入数据库。数据泵命令行客户端expdp和impdp使用DBMS_DATAPUMP和DBMS_METADATA PL/SQL包。

Logical backups contain logical data such as tables and stored procedures. You can use Oracle Data Pump to export logical data to binary files, which you can later import into the database. The Data Pump command-line clients expdp and impdp use the DBMS_DATAPUMP and DBMS_METADATA PL/SQL packages.

物理备份是任何良好备份和恢复策略的基础。

在许多情况下,逻辑备份是物理备份的有用补充,但如果没有物理备份,就不能充分保护数据丢失。

Physical backups are the foundation of any sound backup and recovery strategy.Logical backups are a useful supplement to physical backups in many circumstances but are not sufficient protection against data loss without physical backups.

除非另有说明,备份和恢复文档中使用的术语备份是指物理备份。备份数据库是进行物理备份的行为。备份和恢复文档集中几乎只关注物理备份。

Unless otherwise specified, the term backup as used in the backup and recovery documentation refers to a physical backup. Backing up a database is the act of making a physical backup. The focus in the backup and recovery documentation set is almost exclusively on physical backups.

虽然有几个问题会导致Oracle数据库的正常操作中断或影响数据库I/O操作,但通常只有以下问题需要DBA干预和数据恢复:介质故障、用户错误和应用程序错误。其他故障可能需要DBA进行干预,而不会导致数据丢失或需要从备份中恢复。例如,您可能需要在实例失败后重新启动数据库,或者在语句失败后由于数据文件完整而分配更多磁盘空间。

While several problems can halt the normal operation of an Oracle database or affect database I/O operations, only the following typically require DBA intervention and data recovery: media failure, user errors, and application errors. Other failures may require DBA intervention without causing data loss or requiring recovery from backup. For example, you may need to restart the database after an instance failure or allocate more disk space after statement failure because of a full data file.

1.2 介质故障

1.2 Media Failures

介质故障是磁盘的物理问题,它导致对运行数据库所需的磁盘文件的读或写操作失败。任何数据库文件都可能容易受到介质故障的影响。介质故障后的适当恢复技术取决于受影响的文件和可用的备份类型。

A media failure is a physical problem with a disk that causes a failure of a read from or write to a disk file that is required to run the database. Any database file can be vulnerable to a media failure. The appropriate recovery technique following a media failure depends on the files affected and the types of backup available.

备份和恢复的一个特别重要的方面是开发灾难恢复策略,以防止灾难性数据丢失,例如,整个数据库主机的丢失。

One particularly important aspect of backup and recovery is developing a disaster recovery strategy to protect against catastrophic data loss, for example, the loss of an entire database host.

1.3 用户错误

1.3 User Errors

由于应用程序逻辑错误或手动错误,数据库中的数据被不正确地更改或删除时,就会发生用户错误。据估计,用户错误是导致数据库宕机的最大单一原因。

User errors occur when, either due to an error in application logic or a manual mistake, data in a database is changed or deleted incorrectly. User errors are estimated to be the greatest single cause of database downtime.

由于用户错误造成的数据丢失可能是局部的,也可能是广泛的。局部错误的一个示例是从employees表中删除错误的人员。这种类型的错误需要手动检测和修复。大范围破坏的一个例子是批处理作业删除了公司当月的订单。在这种情况下,需要大量的数据库停机时间。

Data loss due to user error can be either localized or widespread. An example of localized damage is deleting the wrong person from the employees table. This type of damage requires surgical detection and repair. An example of widespread damage is a batch job that deletes the company orders for the current month. In this case, drastic action is required to avoid a extensive database downtime.

虽然用户培训和对特权的仔细管理可以防止大多数用户错误,但备份策略决定了在用户错误导致数据丢失时如何优雅地恢复丢失的数据。

While user training and careful management of privileges can prevent most user errors, your backup strategy determines how gracefully you recover the lost data when user error does cause data loss.

1.4 应用错误

1.4 Application Errors

有时软件故障会损坏数据块。在物理损坏(也称为介质损坏)中,数据库根本无法识别块:校验和无效,块包含所有零,或块的页眉和页脚不匹配。如果损坏不是很严重,则通常可以通过块介质恢复轻松修复。

Sometimes a software malfunction can corrupt data blocks. In a physical corruption, which is also called a media corruption, the database does not recognize the block at all: the checksum is invalid, the block contains all zeros, or the header and footer of the block do not match. If the corruption is not extensive, then you can often repair it easily with block media recovery.

1.5 数据保存

1.5 Data Preservation

数据保存与数据保护有关,但目的不同。

例如,您可能需要保留一个数据库的副本,就像它在业务季度结束时存在一样。此备份不是灾难恢复策略的一部分。

备份完成后,写入这些备份的媒体通常不可用。

你可以把磁带送进fire存储器,或者把便携式硬盘送到测试设施。RMAN提供了一种方便的方法来创建备份并将其从备份保留策略中豁免。这种类型的备份称为归档备份。

Data preservation is related to data protection, but serves a different purpose.For example, you may need to preserve a copy of a database as it existed at the end of a business quarter. This backup is not part of the disaster recovery strategy.The media to which these backups are written are often unavailable after the backup is complete.You may send the tape into fire storage or ship a portable hard drive to a testing facility. RMAN provides a convenient way to create a backup and exempt it from your backup retention policy. This type of backup is known as an archival backup.

1.6 数据传输

1.6 Data Transfer

在某些情况下,您可能需要对数据库或数据库组件进行备份并将其移动到另一个位置。例如,可以使用Recovery Manager (RMAN)创建数据库副本、创建可以导入到另一个数据库的表空间副本,或者将整个数据库从一个平台移动到另一个平台。严格地说,这些任务不是备份和恢复策略的一部分,但它们确实需要使用数据库备份,因此可能包含在备份管理员的职责中。

In some situations you may need to take a backup of a database or database component and move it to another location. For example, you can use Recovery Manager (RMAN) to create a database copy, create a tablespace copy that can be imported into another database, or move an entire database from one platform to another. These tasks are not strictly speaking part of a backup and recovery strategy, but they do require the use of database backups, and so may be included in the duties of a backup administrator.

二 Oracle备份和恢复解决方案

二 Oracle Backup and Recovery Solutions

在执行备份和恢复策略时,您可以使用以下解决方案:

When implementing a backup and recovery strategy, you have the following solutions available:

2.1 RMAN

2.1 Recovery Manager (RMAN)

Recovery Manager与Oracle数据库完全集成,以执行一系列备份和恢复活动,包括维护关于备份的历史数据的RMAN存储库。可以通过命令行或Oracle Enterprise Manager访问RMAN。

Recovery Manager is fully integrated with the Oracle database to perform a range of backup and recovery activities, including maintaining an RMAN repository of historical data about backups. You can access RMAN through the command line or through Oracle Enterprise Manager.

2.2 用户管理的备份和恢复

2.2 User-managed backup and recovery

在这个解决方案中,您可以混合使用主机操作系统命令和SQL*Plus恢复来执行备份和恢复命令。你负责确定何时以及如何完成备份和恢复的所有方面。

In this solution, you perform backup and recovery with a mixture of host operating system commands and SQL*Plus recovery commands.You are responsible for determining all aspects of when and how backups and recovery are done.

这些解决方案受Oracle支持,并有完整的文档记录,但RMAN是数据库备份和恢复的首选解决方案。RMAN为跨不同主机操作系统的备份任务提供了一个通用接口,并提供了几种用户管理方法无法提供的备份技术。

These solutions are supported by Oracle and are fully documented, but RMAN is the preferred solution for database backup and recovery. RMAN provides a common interface for backup tasks across different host operating systems, and offers several backup techniques not available through user-managed methods.

本手册的大部分内容侧重于基于RMAN的备份和恢复。第八节“执行用户管理的备份和恢复”介绍了用户管理的备份和恢复技术。最值得注意的是:

Most of this manual focuses on RMAN-based backup and recovery. User-managed backup and recovery techniques are covered in Section VIII, "Performing User-Managed Backup and Recovery." The most noteworthy are the following:

(1)增量备份

增量备份只存储自上一次备份以来更改的块。

因此,它们提供了更紧凑的备份和更快的恢复,从而减少了在数据文件介质恢复期间应用重做的需要。如果启用块更改跟踪,则可以通过避免对每个输入数据文件进行完全扫描来提高性能。可以使用BACKUP INCREMENTAL命令执行增量备份。

(1)Incremental backupsAn incremental backup stores only blocks changed since a previous backup.Thus, they provide more compact backups and faster recovery, thereby reducing the need to apply redo during data file media recovery. If you enable block change tracking, then you can improve performance by avoiding full scans of every input data file. You use the BACKUP INCREMENTAL command to perform incremental backups.

(2)块介质恢复

(2)Block media recovery

您可以修复只有少量损坏数据块的数据文件,而无需使其脱机或从备份中还原。使用RECOVER BLOCK命令执行块介质恢复。

You can repair a data file with only a small number of corrupt data blocks without taking it offline or restoring it from backup. You use the RECOVER BLOCK command to perform block media recovery.

(3)二进制压缩

集成到Oracle数据库中的二进制压缩机制减少了备份的大小。

(3)Binary compressionA binary compression mechanism integrated into Oracle Database reduces the size of backups.

(4)加密备份

RMAN使用集成到Oracle数据库中的备份加密功能以加密格式存储备份集。要在磁盘上创建加密备份,数据库必须使用高级安全选项。要直接在磁带上创建加密备份,RMAN必须使用Oracle Secure Backup SBT接口,但不需要高级安全选项。

(4)Encrypted backupsRMAN uses backup encryption capabilities integrated into Oracle Database to store backup sets in an encrypted format. To create encrypted backups on disk, the database must use the Advanced Security Option. To create encrypted backups directly on tape, RMAN must use the Oracle Secure Backup SBT interface, but does not require the Advanced Security Option.

(5)自动化数据库复制

轻松创建数据库的副本,支持各种存储配置,包括ASM数据库之间的直接复制

(5)Automated database duplicationEasily create a copy of your database, supporting various storage configurations, including direct duplication between ASM databases.

(6)跨平台数据转换

无论使用RMAN还是用户管理的方法,都可以使用数据泵导出实用程序对架构对象进行逻辑备份来补充物理备份。

以后可以使用数据泵导入在恢复和恢复后重新创建数据。

逻辑备份大多超出了备份和恢复文档的范围。

(6)Cross-platform data conversionWhether you use RMAN or user-managed methods, you can supplement physical backups with logical backups of schema objects made with Data Pump Export utility.You can later use Data Pump Import to re-create data after restore and recovery.Logical backups are mostly beyond the scope of the backup and recovery documentation.

表1-1总结了不同备份技术的特点。

Table 1–1 summarizes the features of the different backup techniques.

23eb4d80e00ae4520544aa76fca9b8c9.png

70be2b902b15abb0702742d825ea4cff.png

三 Oracle 闪回技术

三 Oracle Flashback Technology

正如Oracle数据库概念中所解释的,Oracle闪回技术补充了您的物理备份和恢复策略。这组特性提供了一个额外的数据保护层。具体来说,您可以使用Oracle Flashback的各种特性来查看数据的过去状态,并在不恢复备份或执行时间点恢复的情况下倒回数据库。一般来说,在大多数情况下,闪回功能比媒体恢复功能更有效,破坏性更小。

As explained in Oracle Database Concepts, Oracle Flashback Technology complements your physical backup and recovery strategy. This set of features provides an additional layer of data protection. Specifically, you can use the various features of Oracle Flashback to view past states of data and rewind your database without restoring backups or performing point-in-time recovery. In general, flashback features are more efficient and less disruptive than media recovery in most situations in which they apply.

3.1逻辑闪回特征

Oracle的大多数闪回特性都在逻辑级别操作,使您能够查看和操作数据库对象。Oracle的逻辑级闪回功能不依赖于RMAN,并且无论RMAN是否是备份策略的一部分,它都是可用的。除了Oracle闪回拖放之外,逻辑闪回特性依赖于undo数据,这些数据记录了每次数据库更新的效果以及更新中覆盖的值。

3.1 Logical Flashback FeaturesMost of the flashback features of Oracle operate at the logical level, enabling you to view and manipulate database objects. The logical-level flashback features of Oracle do not depend on RMAN and are available whether or not RMAN is part of your backup strategy. Except for Oracle Flashback Drop, the logical flashback features rely on undo data, which are records of the effects of each database update and the values overwritten in the update.

Oracle数据库包括以下逻辑闪回功能:

Oracle Database includes the following logical flashback features:

3.2 Oracle闪回查询

您可以指定一个目标时间并对数据库运行查询,以在目标时间查看结果。要从不需要的更改(如对表的更新)中恢复,可以在出现错误之前选择一个目标时间,并运行查询来检索丢失的行的内容。Oracle Database Advanced Application Developer's Guide解释了如何使用这个特性。

3.2 Oracle Flashback QueryYou can specify a target time and run queries against a database, viewing results as they would have appeared at the target time. To recover from an unwanted change like an update to a table, you could choose a target time before the error and run a query to retrieve the contents of the lost rows. Oracle Database Advanced Application Developer's Guide explains how to use this feature.

3.3 Oracle闪回版本查询

您可以在指定的时间间隔内查看一个或多个表中曾经存在的所有行的所有版本。还可以检索关于行不同版本的元数据,包括创建版本的事务的开始和结束时间、操作和事务ID。可以使用此特性恢复丢失的数据值,并审核对查询的表的更改。Oracle Database Advanced Application Developer's Guide解释了如何使用这个特性。

3.3 Oracle Flashback Version QueryYou can view all versions of all rows that ever existed in one or more tables in a specified time interval. You can also retrieve metadata about the differing versions of the rows, including start and end time, operation, and transaction ID of the transaction that created the version. You can use this feature to recover lost data values and to audit changes to the tables queried. Oracle Database Advanced Application Developer's Guide explains how to use this feature.

3.4 Oracle闪回事务查询

您可以查看单个事务所做的更改,也可以查看特定时间段内所有事务所做的更改。Oracle Database Advanced Application Developer's Guide解释了如何使用这个特性。

3.4 Oracle Flashback Transaction QueryYou can view changes made by a single transaction, or by all the transactions during a specific time period. Oracle Database Advanced Application Developer's Guide explains how to use this feature.

3.5 Oracle闪回事务

您可以撤消一个事务。Oracle数据库确定依赖关系。

您可以撤消一个事务。Oracle数据库确定了事务之间的依赖关系,并实际上创建了一个补偿事务,以逆转不需要的更改。数据库回退到一个状态,就好像事务以及任何可能依赖于它的事务从未发生过一样。Oracle Database Advanced Application Developer's Guide解释了如何使用这个特性。

3.5 Oracle Flashback TransactionYou can reverse a transaction. Oracle Database determines the dependencies between transactions and in effect creates a compensating transaction that reverses the unwanted changes. The database rewinds to a state as if the transaction, and any transactions that could be dependent on it, had never happened. Oracle Database Advanced Application Developer's Guide explains how to use this feature.

3.6 Oracle闪回表

可以将一个或一组表恢复到过去的指定时间点,而不使数据库的任何部分脱机。在许多情况下,闪回表消除了执行更复杂的时间点恢复操作的需要。闪回表在自动维护关联属性(如当前索引、触发器和约束)的同时恢复表,并以这种方式使您能够避免查找和恢复数据库特定的属性。第18-4页的“用闪回表倒回表”解释了如何使用此功能。

3.6 Oracle Flashback TableYou can recover a table or set of tables to a specified point in time in the past without taking any part of the database offline. In many cases, Flashback Table eliminates the need to perform more complicated point-in-time recovery operations. Flashback Table restores tables while automatically maintaining associated attributes such as current indexes, triggers, and constraints, and in this way enabling you to avoid finding and restoring database-specific properties. "Rewinding a Table with Flashback Table" on page 18-4 explains how to use this feature.

3.7 Oracle闪回drop

您可以逆转DROP TABLE语句的效果。第18-7页的“用闪回拖放倒回一个拖放表操作”解释了如何使用这个特性。

3.7 Oracle Flashback DropYou can reverse the effects of a DROP TABLE statement. "Rewinding a DROP TABLE Operation with Flashback Drop" on page 18-7 explains how to use this feature.

3.8 闪回归档

闪回数据存档允许您使用一些逻辑闪回功能来访问来自很久以前的数据。闪回数据归档由一个或多个表空间或表空间的一部分组成。创建闪回数据归档时,需要指定名称、保留期限和表空间。还可以指定默认的闪回数据存档。数据库会在保留期结束后的第二天自动清除旧的历史数据。

您可以为各个表启用和关闭闪回归档。默认情况下,对每个表关闭闪回归档。

A flashback data archive enables you to use some logical flashback features to access data from far back in the past. A flashback data archive consists of one or more tablespaces or parts of tablespaces. When you create a flashback data archive, you specify the name, retention period, and tablespace. You can also specify a default flashback data archive. The database automatically purges old historical data the day after the retention period expires.You can turn flashback archiving on and off for individual tables. By default, flashback archiving is turned off for every table.

3.9闪回数据库

在物理层面上,Oracle闪回数据库提供了一种比数据库时间点恢复(DBPITR)更有效的数据保护方法。如果当前数据文件有不需要的更改,那么可以使用RMAN命令FLASHBACK DATABASE将数据文件还原为过去的内容。最终产品非常类似于DBPITR的结果,但通常速度要快得多,因为它不需要从备份中恢复数据文件,并且比介质恢复所需的重做更少。

3.9 Flashback DatabaseAt the physical level, Oracle Flashback Database provides a more efficient data protection alternative to database point-in-time recovery (DBPITR). If the current data files have unwanted changes, then you can use the RMAN command FLASHBACK DATABASE to revert the data files to their contents at a past time. The end product is much like the result of a DBPITR, but is generally much faster because it does not require restoring data files from backup and requires less redo than media recovery.

Flashback数据库使用Flashback日志访问数据块的过去版本和一些来自归档重做日志的信息。闪回数据库要求您为数据库配置一个快速恢复区域,因为闪回日志只能存储在那里。默认情况下不启用闪回日志记录。用于闪回日志的空间由数据库自动管理,并根据快速恢复区域中其他文件所需的空间进行平衡。

Flashback Database uses flashback logs to access past versions of data blocks and some information from archived redo logs. Flashback Database requires that you configure a fast recovery area for a database because the flashback logs can only be stored there. Flashback logging is not enabled by default. Space used for flashback logs is managed automatically by the database and balanced against space required for other files in the fast recovery area.

Oracle数据库还支持恢复点以及闪回数据库和备份和恢复。恢复点是与系统更改号(SCN)对应的别名。您可以在任何时候创建恢复点,如果您预期此时需要将数据库的一部分或全部返回到其内容。有保证的恢复点确保您可以使用闪回数据库返回数据库到恢复点的时间。

Oracle Database also supports restore points along with Flashback Database and backup and recovery. A restore point is an alias corresponding to a system change number (SCN). You can create a restore point at any time if you anticipate needing to return part or all of a database to its contents at that time. A guaranteed restore point ensures that you can use Flashback Database to return a database to the time of the restore point.

 数据恢复顾问

Oracle数据库包括一个数据恢复顾问工具,它可以自动诊断持久的数据故障,提供适当的修复选项,并根据您的请求执行修复。数据恢复顾问为Oracle备份和恢复解决方案提供单点入口。可以通过Enterprise Manager数据库控制或网格控制控制台或RMAN命令行客户端使用Data Recovery Advisor。

Oracle Database includes a Data Recovery Advisor tool that automatically diagnoses persistent data failures, presents appropriate repair options, and executes repairs at your request. Data Recovery Advisor provides a single point of entry for Oracle backup and recovery solutions. You can use Data Recovery Advisor through the Enterprise Manager Database Control or Grid Control console or through the RMAN command-line client.

数据库故障通常表现为一组症状:错误消息、警报、跟踪文件和转储,以及失败的数据完整性检查。数据恢复顾问会自动诊断并通知您这些故障。对于Data Recovery Advisor,故障是一种持久的数据损坏,可以直接映射到一组修复操作。每个失败都有打开或关闭的状态。每个失败都有一个关键的、高的或低的优先级。

A database failure usually manifests itself as a set of symptoms: error messages, alerts, trace files and dumps, and failed data integrity checks. Data Recovery Advisor automatically diagnoses and informs you of these failures. For Data Recovery Advisor, a failure is a persistent data corruption that can be directly mapped to a set of repair actions. Each failure has a status of open or closed. Each failure also has a priority of critical, high, or low.

故障由数据完整性检查检测,这是为评估数据库或其组件的健康状况而执行的诊断过程。如果数据完整性检查发现一个故障,那么data Recovery Advisor将自动评估一组故障的影响,并将其映射到一组修复选项。通常,数据恢复顾问提供自动和手动修复选项。

Failures are detected by data integrity checks, which are diagnostic procedures executed to assess the health of the database or its components. If a data integrity check reveals a failure, then Data Recovery Advisor automatically assesses the effect of a set of failures and maps it to a set of repair options. Usually, Data Recovery Advisor presents both automated and manual repair options.

Data Recovery Advisor确定最佳的自动修复选项及其对数据库的影响。修复选项可能包括诸如数据文件恢复和恢复、媒体恢复、数据库闪回等修复。在提供自动修复选项之前,Data Recovery Advisor将针对特定环境验证该选项以及完成建议修复所需的媒体组件的可用性。

Data Recovery Advisor determines the best automated repair option and its effect on the database. The repair option may include repairs such as data file restore and recovery, media recovery, Flashback Database, and so on. Before presenting an automated repair option, Data Recovery Advisor validates it for the specific environment and the availability of media components required to complete the proposed repair.

如果选择自动修复选项,则RMAN协调Oracle数据库上的会话来为您执行修复。数据恢复顾问工具验证修复成功并关闭适当的故障。

If you choose an automated repair option, then RMAN coordinates sessions on the Oracle database to perform the repair for you. The Data Recovery Advisor tool verifies the repair success and closes the appropriate failures.

五 备份和恢复文档路线图

图1-1说明了导航备份和恢复文档的推荐方法。路线图分为两个主要路径:RMAN和用户管理的备份和恢复。可选路径显示为分开然后重新加入每个主路径。

如果您是Oracle数据库的新手,并且想了解备份恢复,那么最好的入门点是Oracle Database 2 Day DBA。备份和恢复章节解释了如何使用Enterprise Manager执行基本操作。您还可以通过阅读Oracle数据库概念中的相关章节来扩展基本备份和恢复原则的知识。

五 Backup and Recovery Documentation RoadmapFigure 1–1 illustrates the recommended way to navigate the backup and recovery documentation. The roadmap is divided into two main paths: RMAN and user-managed backup and recovery. Optional paths are shown as splitting off and then rejoining each main path.If you are new to Oracle Database and want to learn about backup recovery, then the best entry point is Oracle Database 2 Day DBA. The backup and recovery chapter explains how to use Enterprise Manager to perform basic operations. Optionally, you can expand your knowledge of basic backup and recovery principles by reading the relevant chapter in Oracle Database Concepts.

c3b13512a4ac9c2f61e3ffc8c5ebb705.png

Recovery Manager文档路线图

如果您使用RMAN作为主要备份和恢复解决方案,那么请参阅第2-1页的“开始使用RMAN”。这个简短的章节解释了最基本的RMAN技术,可能足以满足您的需要。有关如何使用RMAN实现备份和恢复策略的更全面的解释,请按照以下顺序阅读章节(未列出可选章节):

Recovery Manager Documentation RoadmapIf you use RMAN as your principal backup and recovery solution, then begin by reading "Getting Started with RMAN" on page 2-1. This brief chapter, which explains the most basic RMAN techniques, may be adequate for your purposes. For a more comprehensive explanation of how to implement a backup and recovery strategy with RMAN, read the chapters in the following order (optional chapters are not listed):1. Read Chapter 4, "Starting and Interacting with the RMAN Client."This chapter explains how to start the RMAN client and connect to databases.2. Read Chapter 5, "Configuring the RMAN Environment."This chapter explains how to perform basic tasks such as configuring a fast recovery area, backup retention policy, and archived redo log deletion policy.3. Read Chapter 9, "Backing Up the Database."This chapter explains how to implement a basic backup strategy.4. Read Chapter 11, "Reporting on RMAN Operations."This chapter explains how to monitor RMAN backup and recovery operations.Specifically, the chapter explains how to use the reporting commands (LIST, REPORT, and SHOW) and the relevant V$ and recovery catalog views.5. Read Chapter 12, "Maintaining RMAN Backups and Repository Records."This chapter explains how to verify the existence of backups, change the repository status of backups, delete backups, and perform other maintenance tasks.6. Read Chapter 15, "Diagnosing and Repairing Failures with Data Recovery Advisor."This chapter explains how to use the Data Recovery Advisor tool. You can use it to list failures, obtain advice about to respond to these failures, and in some cases automatically repair the failures.7. Read Chapter 18, "Performing Flashback and Database Point-in-Time Recovery."This chapter explains how to use the FLASHBACK DATABASE command and perform point-in-time recovery with the RECOVER DATABASE command.8. Read Chapter 17, "Performing Complete Database Recovery."This chapter explains how to recover individual tablespaces or the database.

用户管理的备份和恢复文档路线图

如果不使用RMAN作为主要的备份和恢复解决方案,则必须使用第三方工具进行备份,并使用SQL或SQL*Plus命令执行恢复。按以下顺序阅读各章:

User-Managed Backup and Recovery Documentation RoadmapIf you do not use RMAN as your principal backup and recovery solution, then you must use third-party tools to make your backups and SQL or SQL*Plus commands to perform recovery. Read the chapters in the following order:1. Read Chapter 28, "Making User-Managed Database Backups."This chapter explains how to make backups with third-party tools.2. Read Chapter 29, "Performing User-Managed Database Flashback and Recovery."This chapter explains how to use the SQL statement FLASHBACK DATABASE and toperform recovery with the SQL*Plus RECOVER command.3. Read Chapter 30, "Performing User-Managed Recovery: Advanced Scenarios."This chapter explains various recovery scenarios.

更多数据库相关学习资料,可以查看我的ITPUB博客,网名chenoracle

http://blog.itpub.net/29785807/

bf9d943b8cae40e096d334d3e8a47d7c.gif

留言区

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Oracle数据库提供了expdp和impdp命令用于备份恢复数据库。这两个命令的使用方式如下: 1. expdp命令 expdp命令用于备份Oracle数据库,它能够将某个schema或整个数据库导出到一个二进制文件中。具体命令格式如下: ``` expdp username/password@connect_string DIRECTORY=directory_name DUMPFILE=dumpfile_name.dmp SCHEMAS=schema_name ``` 其中: - `username/password@connect_string`:指定连接Oracle数据库的用户名、密码和连接字符串。 - `DIRECTORY=directory_name`:指定备份文件的目录。 - `DUMPFILE=dumpfile_name.dmp`:指定备份文件的名称。 - `SCHEMAS=schema_name`:指定要备份的schema名称,多个schema可以用逗号分隔。 执行命令后,Oracle数据库会将指定的schema或整个数据库导出到一个二进制文件中。 2. impdp命令 impdp命令用于恢复Oracle数据库,它能够将之前导出的二进制文件导入到数据库中。具体命令格式如下: ``` impdp username/password@connect_string DIRECTORY=directory_name DUMPFILE=dumpfile_name.dmp SCHEMAS=schema_name ``` 其中: - `username/password@connect_string`:指定连接Oracle数据库的用户名、密码和连接字符串。 - `DIRECTORY=directory_name`:指定备份文件所在的目录。 - `DUMPFILE=dumpfile_name.dmp`:指定备份文件的名称。 - `SCHEMAS=schema_name`:指定要恢复的schema名称,多个schema可以用逗号分隔。 执行命令后,Oracle数据库会将指定的schema或整个数据库备份文件中恢复出来。 需要注意的是,expdp和impdp命令需要在Oracle数据库服务器上执行,而不是在客户端。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值