1. Ranking explanation:
Restore: Restore
Recover: Recovery
Backup set: similar to tablespace
Backup slice: a data file can be used across multiple backup slices, but in a backup set
2. Principles:
A. When a file is restored, the file cannot be used by the database instance.
B. Only if the incremental level is 0 or full backup, the image copy can be restored. Other levels of Incremental backup and archive logs are used for restoration.
1. Configure RMAN backup
1. Switch the backup mode and start the archiving process at Oracle9i.
2. Adjust redolog Group
SQL> select * from V $ logfile
SQL> alter database add logfile Group 4 ('/u01/oradata/yang/redo04a. rdo ','/u01/oradata/yang/redo04b. rdo ') size 50 m; // Add a new log group. The group number is 4 and there are two group members. The size is 50 MB.
SQL> alter database add logfile member '/u01/oradata/yang/redo01.rdo' to group 1; // Add a new member to log Group 1
3. Configure the archivelog destination
4. Configure the RMAN backup script and recovery policy
The key is online redo logs and Control Files
Language Environment nls_lang
I. RMAN backup
Check logical
Set maxcompute upt
RMAN> connect target sys/sys @ cttest
{
Allocate channel D1 type disk;
Backup
Incremental level = 0 cumulative
Database
Format '/oradata/cttest/backup/db0 _ % d _ % S _ % P _ % t'
Tag = "whole_inc0 ';
Release channel D1;
}
{
Allocate channel D1 type disk;
Backup archivelog
From time 'sysdate-2'
Format '/oradata/cttest/backup/ar0 _ % d _ % S _ % P _ % T ';
Release channel D1;
}
{
Allocate channel D1 type disk;
Backup archivelog
From time 'sysdate-3 'until time 'sysdate-2'
Format '/oradata/cttest/backup/ar0 _ % d _ % S _ % P _ % T ';
Delete input;
Release channel D1;
}
II. RMAN recovery
1. Restore-> recover incremental backup-> recover archive on disk-> recover archive on backupset
The control file is restore and cannot be completely recovered.
Oracle_sid;
Oracle_base;
ORACLE_HOME;
Oracle_data;
Oracle_admin
Mkdir $ oracle_admin/pfile
Mkdir $ oracle_admin/bdump
Mkdir $ oracle_admin/cdump
Mkdir $ oracle_admin/udump
Mkdir $ oracle_admin/create
Mkdir-p $ oracle_data/archive
2. If you change the name
Run {
Allocate channel D1 type disk;
Restore database;
Recover database;
}
3. RMAN monitoring
Select Sid, serial #, context, SOFAR, totalwork,
Round (SOFAR/totalwork * 100,2) "% complete", opname
From v $ session_longops;
Select * from V $ backup_partition uption
Iv. Producer uard creation and Synchronization
A. Create
Connect target sys/practice @ Test
Connect auxiliary sys/sys @ standby
Run {
SET command ID to 'standby creation ';
Allocate auxiliary channel D1 type disk;
Duplicate target database for standby dorecover;
B. restore archived logs
SQL> set logsource/oradata/practice/archive
SQL> recover standby database;
C. View
SQL> alter database open read only;
SQL> select * from device;
SQL> shutdown immediate;
SQL> startup nomount;
SQL> alter database Mount standby database;
D. Configuration Management recovery
Log_archive_dest_1 for manual recovery
Standby_archive_dest_1 is used to manage recovery
Instance_name and SERVICE_NAME can be different, and db_name must be the same
The archive process of the master Server communicates with the Rfs of the slave server through net8, and stores the logs in standby_arch_dest_1.
Directory.
Start management recovery on the standby database:
SQL> recover managed standby database;
SQL> recover managed standby dtabase cancel;
Set net8 on the primary database
SQL> alter system set log_archive_dest_2 = "mandatory service = standby reopen = 30" -- must be successful, retry time
SQL> alter system set log_archive_dest_state_2 = Enable | defer;
Read-only access:
SQL> recover managed standby database cancel;
SQL> alter database open read only;
Return recovery mode:
SQL> shutdown immediate
SQL> startup nomount;
SQL> alter database Mount standby database;
SQL> recover managed standby database;
Activate Database
SQL> recover managed standby database cancel;
SQL> alter database Activate standby database;
SQL> shutdown;
SQL> startup
1) sqlloader direct feature cannot be copied
2) adding data files cannot be copied.