Common Summary of RMAN.
1 backup
RMAN target sys/sys @ demo nocataglog
RMAN> run {
Configure Channel Device Type disk maxpiecesize 400 m;
Configure device type disk parallelism 3; (3 channels)
Backup database format = 'd: \ XXXX \ XXX \ % d _ % S _ % P. Pak ';
}
List backup;
RMAN> report Schema; (view solution)
Backup tablespace:
Backup tablespace users format = 'd: \ backup \ RMAN \ % N _ % S. Bak ';
List:
List backup of tablespace users;
Show backup configuration
Show all;
Back up data files and control files:
Backup datafile 5 format = 'd: \ XXX. dbf' include current controlfile;
Compressed backup:
Backup as compressed backupset tablespace users format = 'd: \ XXXX. dbf ';
2 Recovery
In fact, the number of recovered routes is similar to that without RMAN. Join Oracle study summary 7, for example:
A. Restore the database
Startup force Mount
Run
{
Restore database;
Recover Databse;
SQL 'alter database open ';
}
If the disk is faulty, each data file in the database will be used
Set newname for datafile 1 to 'C: \ XXXX. dbf ';
.........
Restore database;
Switch datafile all;
Recover Databse;
SQL 'alter database open ';
}
B. Restore System
If deleted
Run
{
Restore datafile 1;
Recover datafile 1;
SQL 'alter database open ';
}
If the media is broken
Startup force Mount
Run
{
Set newname for datafile 1 to 'C: \ XXXX. dbf ';
Restore datafile 1;
Switch datafile 1;
Recover datafile 1;
SQL 'alter database open ';
}
C. Data Files in other tablespaces are damaged.
If deleted
Startup force Mount
Run
{
SQL 'alter database datafile 1 offline'
SQL 'alter database open ';
Restore datafile 1;
Recover datafile 1;
SQL 'alter database datafile 1 online ';
}
If the media is broken
Startup force Mount
Run
{
SQL 'alter database datafile 1 offline'
SQL 'alter database open ';
Set newname for datafile 1 to 'C: \ XXXX. dbf ';
Restore datafile 1;
Switch datafile 1;
Recover datafile 1;
SQL 'alter database datafile 1 online ';
}
If the tablespace is deleted or the media is damaged, the principle is similar to the previous one.
Change to SQL 'alter tablespace users offline for recover ';
3. Common Operations
List backup of controlfile;
List backup of archivelog all;
List backup of spfile;
Check all backup Sets
Crosscheck backup;
List backupset backup Set ID;
Check all data file backup sets:
Crosscheck backup of database;
Crosscheck backup of tablespace users;
Crosscheck backup of datafile 4;
Crosscheck backup of controlfile;
Delete old backup:
Delete Obsolete;