Home Database Mysql Tutorial RMAN 备份基础知识

RMAN 备份基础知识

Jun 07, 2016 pm 05:28 PM
or database

rman(recovery manager,被称为恢复管理器),用来管理备份,转储和恢复操作,当执行rman命令时,oracle会将这些命令解析为PL/S

一、rman备份基础理论知识

rman(recovery manager,被称为恢复管理器),,用来管理备份,转储和恢复操作,当执行rman命令时,Oracle会将这些命令解析为PL/SQL块,并且由服务器进程执行这些PL/SQL块,最终完成备份,转储,恢复以及其他操作。

因为rman备份,转储和恢复操作都是有服务器进程来执行的,所以rman所进行的备份和恢复操作也被称为“服务器管理备份”

二、Rman备份的特点:

RMAN是块级别的备份与恢复
自动的备份与恢复·方便的备份归档日志
·自动检测新的数据文件
·支持增量备份
·最大限度的减少备份与恢复的错误
·减少恢复的时间
·在热备份中不会产生额外的redo日志
·坏块的自动检测·并行的备份与恢复操作
·在线备份时,表空间不用置于备份模式

三、基本命令结构
1、单命令
backup database
2、批量命令
由多条单命令组成

  Rman>run{
    Allocate channel cha1 type disk;
    backup format ‘/oracle/ora10g/rmanback/full_%u_%T“
    tag full_backup_wolf
    database;
    release channel cha1;
    }
 3、default 参数
 
RMAN 配置参数为:
 RMAN> show all; 
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default 
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default 
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default 
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default 
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default 
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default 
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default 
CONFIGURE MAXSETSIZE TO UNLIMITED; # default     
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default 
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default 
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default 
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFORCL.ORA'; # default
 注释:#default表示该配置仍然是初始的默认值。回到默认配置configure..clear。
 
1)configure retention policy to ..
  用来决定哪些备份不在需要,共有三个可选项:
 a)redundancy 5
 表示某个数据文件的备份集存在的个数,此处为5份
 b)recovery window of 7 days
 表示你希望数据库最早能恢复到几天前
 c)none
 表示不需要采用保留策略
 注释:a)和b)是互斥关系
 
2)CONFIGURE BACKUP OPTIMIZATION ..
 理论上,备份优化仅对于只读表空间或offline表空间起作用。当然,对于已经备份过的归档日志文件也会跳过。
 缺省为off 

3)CONFIGURE DEFAULT DEVICE TYPE TO ..
 指定i/o操作的设备类型:SBT or DISK.缺省是disk。
 
4)CONFIGURE CONTROLFILE AUTOBACKUP ..
 当autobackup别置为on时,rman做任何备份操作,都会自动对控制文件进行备份。
 
5)CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'
 配置控制文件的备份片的路径和格式
 比如:configure controlfile autobackup format for device type disk to 'e:\backupcontrol\%F'
 
6)CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET
 配置数据库设备类型的并行度。并行的数目决定了开启通道的个数
 
7)CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1
 CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1
 是否启动复合备份,向指定的i/o设备中指定的位置生成指定的份数。缺省为1.
 这个配置仅用于数据文件和归档文件,并且,只有在自动分配通道时才会生效!
 
8)CONFIGURE MAXSETSIZE TO UNLIMITED
 配置备份集的大小。一般是配置maxpiecesize,对备份片进行限制。
 
9)CONFIGURE ENCRYPTION FOR DATABASE OFF
 配置加密备份集。可以具体到某个表空间:
 configure encryption for tablespace users on;
 如果我们执行set encryption on indentified by think only,紧接其后所创建的备份就需要该密码才能进行正常的恢复
 
10)CONFIGURE ENCRYPTION ALGORITHM 'AES128'
 指定加密算法,还有一个是 ‘AES256'
 
11)  CONFIGURE ARCHIVELOG DELETION POLICY TO NONE
 指定归档文件的删除策略,缺省是none,即:归档备份完之后就可以被删除
 但是,在DG环境,DBA要保证归档文件在standby端成功接收并且应用之前,primary端始终保存该文件 
so,DG环境当设为:applied on standby
 
12)CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFORCL.ORA'
 配置控制文件的快照文件的存放路径和文件名,这个快照文件是在备份期间产生的,用于控制文件的读一致性
 
13)另外,CONFIGURE EXCLUDE FOR TABLESPACE [CLEAR];此命令用于将指定的表空间不备份到备份集中, 此命令对只读表空间是非常有用的。
 
--------------------------------
 配置通道格式
 configure channel device type disk2 format '/disk1/rman_bak/cuug/%d_5s_%p.bak';

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)

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

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 does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

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.

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

How to connect to remote database using Golang? How to connect to remote database using Golang? Jun 01, 2024 pm 08:31 PM

Through the Go standard library database/sql package, you can connect to remote databases such as MySQL, PostgreSQL or SQLite: create a connection string containing database connection information. Use the sql.Open() function to open a database connection. Perform database operations such as SQL queries and insert operations. Use defer to close the database connection to release resources.

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

See all articles