Home Database Mysql Tutorial RMAN 各种情况下恢复

RMAN 各种情况下恢复

Jun 07, 2016 pm 05:28 PM
o database

完全恢复是指当数据文件出现介质失败时,使用RESTORE命令转储备份(到原存放地或可用的设备),然后再使用RECOVER命令将数据文件

一.RMAN 完全恢复

完全恢复是指当数据文件出现介质失败时,使用RESTORE命令转储备份(到原存放地或可用的设备),然后再使用RECOVER命令将数据文件恢复到失败点的状态。

SYSTEM表空间数据文件恢复要求数据库必须在mount状态进行,其他数据文件恢复既可以使数据库在mount状态,也可以是open状态进行;

当需要恢复所有数据文件或者要求在数据库级别恢复时,应该使用完全恢复,这时数据库需启动到mount状态;恢复至原存放地脚本如下(在open状态下运行此脚本):

 

RMAN> run{
2> startup force mount
3> restore database;
4> recover database;
5> alter database open;
6> }


Oracle 实例已启动
数据库已装载

系统全局区域总计 838860800 字节

Fixed Size 1293384 字节
Variable Size 742392760 字节
Database Buffers 88080384 字节
Redo Buffers 7094272 字节

启动 restore 于 13-5月 -13
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=157 devtype=DISK

通道 ORA_DISK_1: 正在恢复数据文件00007
输入数据文件副本 recid=36 stamp=815324562 文件名=D:\BACKUP\ORCL_124.BAK
数据文件 00007 的恢复目标: D:\RMAN.DBF
通道 ORA_DISK_1: 已复制数据文件 00007 的数据文件副本
输出文件名=D:\RMAN.DBF recid=37 stamp=815324790
通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00002恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
正将数据文件00003恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
正将数据文件00004恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
正将数据文件00005恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
通道 ORA_DISK_1: 正在读取备份段 D:\ORCL_1318810635_112
通道 ORA_DISK_1: 已恢复备份段 1
段句柄 = D:\ORCL_1318810635_112 标记 = TAG20130513T144801
通道 ORA_DISK_1: 恢复完成, 用时: 00:01:36
通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
通道 ORA_DISK_1: 正在读取备份段 D:\BACKUP\ORCL_116.BAK
通道 ORA_DISK_1: 已恢复备份段 1
段句柄 = D:\BACKUP\ORCL_116.BAK 标记 = TAG20130513T145621
通道 ORA_DISK_1: 恢复完成, 用时: 00:00:46
完成 restore 于 13-5月 -13

启动 recover 于 13-5月 -13
使用通道 ORA_DISK_1

正在开始介质的恢复
介质恢复完成, 用时: 00:00:10

完成 recover 于 13-5月 -13
数据库已打开

恢复系统表空间至原存放地脚本如下

RMAN> run{
2> startup force mount
3> restore tablespace system;
4> recover tablespace system;
5> alter database open;
6> }


Oracle 实例已启动
数据库已装载


系统全局区域总计 838860800 字节


Fixed Size 1293384 字节
Variable Size 750781368 字节
Database Buffers 79691776 字节
Redo Buffers 7094272 字节


启动 restore 于 13-5月 -13
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=156 devtype=DISK


通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
通道 ORA_DISK_1: 正在读取备份段 D:\BACKUP\ORCL_116.BAK
通道 ORA_DISK_1: 已恢复备份段 1
段句柄 = D:\BACKUP\ORCL_116.BAK 标记 = TAG20130513T145621
通道 ORA_DISK_1: 恢复完成, 用时: 00:00:55
完成 restore 于 13-5月 -13


启动 recover 于 13-5月 -13
使用通道 ORA_DISK_1


正在开始介质的恢复


存档日志线程 1 序列 661 已作为文件 F:\RMANBACKUP\ORCL\ARCHIVELOG\2013_05_13\O1_MF_1_661_8S13VN1G_.ARC 存在于磁盘上
存档日志线程 1 序列 662 已作为文件 F:\RMANBACKUP\ORCL\ARCHIVELOG\2013_05_13\O1_MF_1_662_8S14DQ98_.ARC 存在于磁盘上
存档日志线程 1 序列 663 已作为文件 F:\RMANBACKUP\ORCL\ARCHIVELOG\2013_05_13\O1_MF_1_663_8S14XX0Z_.ARC 存在于磁盘上
存档日志文件名 =F:\RMANBACKUP\ORCL\ARCHIVELOG\2013_05_13\O1_MF_1_661_8S13VN1G_.ARC 线程 =1 序列 =661
介质恢复完成, 用时: 00:00:04
完成 recover 于 13-5月 -13

数据库已打开

恢复系统表空间数据至其他可用设备

RMAN> run{
2> startup force mount
3> set newname for datafile 1 to 'd:\system01.dbf';
4> restore datafile 1;
5> switch datafile 1;
6> recover datafile 1;
7> alter database open;
8> }


Oracle 实例已启动
数据库已装载


系统全局区域总计 838860800 字节


Fixed Size 1293384 字节
Variable Size 754975672 字节
Database Buffers 75497472 字节
Redo Buffers 7094272 字节


正在执行命令: SET NEWNAME

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to save JSON data to database in Golang? How to save JSON data to database in Golang? Jun 06, 2024 am 11:24 AM

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

PHP Database Connection Pitfalls: Avoid Common Mistakes and Misunderstandings PHP Database Connection Pitfalls: Avoid Common Mistakes and Misunderstandings Jun 05, 2024 pm 10:21 PM

To avoid PHP database connection errors, follow best practices: check for connection errors and match variable names with credentials. Use secure storage or environment variables to avoid hardcoding credentials. Close the connection after use to prevent SQL injection and use prepared statements or bound parameters.

How to install and register the btc trading app? How to install and register the btc trading app? Feb 21, 2025 pm 07:09 PM

This article will provide a detailed introduction to how to install and register a Bitcoin trading application. The Bitcoin trading app allows users to manage and trade cryptocurrencies such as Bitcoin. The article guides users through the installation and registration process step by step, including downloading applications, creating accounts, performing identity verification, and first deposit. The goal of the article is to provide beginners with clear and easy-to-understand guidelines to help them easily enter the world of Bitcoin trading.

Top 10 global digital currency trading apps recommended (2025 currency trading software ranking) Top 10 global digital currency trading apps recommended (2025 currency trading software ranking) Mar 12, 2025 pm 05:48 PM

This article recommends the top ten digital currency trading apps in the world, including Binance, OKX, Huobi Global, Coinbase, Kraken, Gate.io, KuCoin, Bitfinex, Gemini and Bitstamp. These platforms have their own characteristics in terms of transaction pair quantity, transaction speed, security, compliance, user experience, etc. For example, Binance is known for its high transaction speed and extensive services, while Coinbase is more suitable for novices. Choosing a platform that suits you requires comprehensive consideration of your own needs and risk tolerance. Learn about the world's mainstream digital currency trading platforms to help you conduct digital asset trading safely and efficiently.

How does Go WebSocket integrate with databases? How does Go WebSocket integrate with databases? Jun 05, 2024 pm 03:18 PM

How to integrate GoWebSocket with a database: Set up a database connection: Use the database/sql package to connect to the database. Store WebSocket messages to the database: Use the INSERT statement to insert the message into the database. Retrieve WebSocket messages from the database: Use the SELECT statement to retrieve messages from the database.

See all articles