首页 > Linux操作系统 > Linux操作系统 > DG学习笔记(9)_备份与RAC
DG学习笔记(9)_备份与RAC
1 Using a Standby Database to Back Up the Primary Database
1.1 Outline
Backups of data files and archived redo logs are fully interchangeable
Control file backups are not interchangeable
Primary database and standby database must use the same recovery catalog
Do not need to register the standby database
1.2 Restrictions and Usage Notes
Must be a physical standby
Must be connected to the recovery catalog when backing up
使用CatalogDB,只有这样Primary才能知道备库的备份情况
Cannot backup the standby control file
控制文件不能交叉使用
Connect to the physical standby database with the TARGET keyword
2 Logical Database Backup
先不学习
3 Deploy DG in RAC
两种部署方式
Can ship logs to another RAC
– Each node ships its redo information to a corresponding node
– Shipping and receiving is spread across nodes
– Apply services are done on one node
– Switchover or failover to like system
Can ship logs to a single instance system for standby
– May impede performance
Switchover or failover to a smaller system
Make sure the number of Standby redo logs on the standby equal to the total number of online redo logs in all the instances of the RAC system.(Standby redo log的个数应等于Primary RAC中两个节点的个数总和)
RAC + DG Architecture 架构
Switchover with RAC
For a database using RAC, only one primary instance and one standby instance can perform. the switchover operation. Shut down all other instance before the switchover operation.(SwitchOver只在一个节点上做,其余节点要关闭)
RAC环境下DG 的部署过段时间做个实验.
4 Using a Standby Database to Back Up the Primary Database 基本步骤
Step 1 Back up the standby database.
1.1 % rman target sys/change_on_install@stby nocatalog
1.2 RMAN> run {
allocate channel c1 type disk;
backup database;
}
1.3 Back up the archived redo logs.
For example, suppose there is only one thread and the sequence number at the time of the database backup is 15.
即在Backup Database后,还生成有Archivelog. Backup database时的Log Sequence号为15,所以只备份15之后的.
RMAN> run {
allocate channel c1 type disk;
backup archivelog from logseq 15;
}
Step 2 Restore the backup at the primary site.
1. Set up a recovery catalog database on the primary site.
2. Ensure that the primary database is in the mounted state
3. Move the standby control file and the backup pieces to the primary site
If the backup is on disk, the backup pieces must reside under the same directory at the primary site as they do at the standby site.
Backup Piece的路径应与原路径一致
4. Resynchronize the catalog database with the standby control file.
这样,Primary就知道备份集的东西了
% rman target sys/change_on_install@prmy catalog rman/rman@rcat
RMAN> resync catalog from controlfilecopy ’scf3.ctl’;
5. List the backup set obtained by the catalog database after the resynchronization:
RMAN> list backup;
查看有没有同步成功.
6 Restore the primary database:
RMAN> run {
allocate channel c1 type disk;
restore database;
}
7. Restore the archived log.
SQL> RECOVER DATABASE;
Step 3 open database
SQL> Alter database open;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10248702/viewspace-629928/ ,如需转载,请注明出处,否则将追究法律责任。