RMAN中常用的命令(一)
1、連線到目標資料庫(不用恢復目錄資料庫):
Rman nocatalog target sys/change_on_isntall@testdb
Rman catalog rman_user/rman_user@ora9rc target sys/change_on_install@testdb
2、SHOW命令:
顯示rman配置: RMAN> show all;
[@more@]3、REPORT命令:
1、RMAN> report schema 報告目標資料庫的物理結構;
2、RMAN>report need backup days=3; 報告最近3天沒有被備份的資料檔案;
3、RMAN> report need backup days 3 tablespace users; 在USERS表空間上3天未備份的資料檔案;
4、RMAN> report need backup incremental 3;
報告恢復資料檔案需要的增量備份個數超過3次的資料檔案;
5、RMAN> report need backup redundancy 2 database; 報告備份檔案低於2份的所有資料檔案;
RMAN>report need backup redundancy=2;
6、RMAN> report need backup recovery window of 6 days;
報告檔案報表的恢復需要超過6天的歸檔日誌的資料檔案;
7、RMAN> report unrecoverable; 報告資料庫所有不可恢復的資料檔案;
8、RMAN> report obsolete redunndancy 2; 報告備份次數超過2次的陳舊備份;
9、RMAN>report obsolete; 報告丟棄的備份;
4、LIST命令:列出備份資訊
1、列出資料檔案備份集
RMAN>list backup 列出詳細備份;
RMAN>list expired backup 列出過期備份;
RMAN> list backup of database; 列出所有資料檔案的備份集;
RMAN> list backup of tablespace user01; 列出特定表空間的所有資料檔案備份集;
2、RMAN> list backup of controlfile 列出控制檔案備份集;
3、RMAN> list backup of archivelog all 列出歸檔日誌備份集詳細資訊;
RMAN>list archivelog all;列出歸檔日誌備份集簡要資訊
4、RMAN> list backup of spfile 列出SPFILE備份集;
5、RMAN> list copy of datafile 5 列出資料檔案映像副本;
6、RMAN> list copy of controlfile 列出控制檔案映像副本;
7、RMAN> list copy of archivelog all 列出歸檔日誌映像副本;
8、RMAN> list incarnation of database 列出對應物/列出資料庫副本;
9、RMAN>list backup summary; 概述可用的備份;
B表示backup
F表示FULL
A表示archive log
0 1表示incremental backup
S說明備份狀態(AAVAILABLEX EXPIRED )
10、RMAN>list backup by file 按備份型別列出備份;
按照資料檔案備份,歸檔日誌備份,控制檔案備份,伺服器引數檔案備份 列出
5、CROSSCHECK命令:校驗備份資訊
1、RMAN> crosscheck backup 核對所有備份集;
2、RMAN> crosscheck backup of database 核對所有資料檔案的備份集;
3、RMAN> crosscheck backup of tablespace users 核對特定表空間的備份集;
4、RMAN> crosscheck backup of datafile 4 核對特定資料檔案的備份集;
5、RMAN> crosscheck backup of controlfile 核對控制檔案的備份集;
6、RMAN> crosscheck backup of spfile 核對SPFILE的備份集;
7、RMAN> crosscheck backup of archivelog sequence 3 核對歸檔日誌的備份集;
8、RMAN> crosscheck copy 核對所有映像副本;
9、RMAN> crosscheck copy of database 核對所有資料檔案的映像副本;
10、RMAN> crosscheck copy of tablespace users 核對特定表空間的映像副本;
11、RMAN> crosscheck copy of datafile 6 核對特定資料檔案的映像副本;
12、RMAN> crosscheck copy of archivelog sequence 4 核對歸檔日誌的映像副本;
13、RMAN> crosscheck copy of controlfile 核對控制檔案的映像副本;
14、RMAN> crosscheck backup tag='SAT_BACKUP';
15、RMAN> crosscheck backup completed after 'sysdate - 2'
16、RMAN> crosscheck backup completed between 'sysdate - 5' and 'sysdate -2 '
17、RMAN> crosscheck backup device type sBT;
18、RMAN> crosscheck archivelog all;
19、RMAN> crosscheck archivelog like '%ARC00012.001'
20、RMAN> crosscheck archivelog from sequence 12;
21、RMAN> crosscheck archivelog until sequence 522;
6、DELETE:刪除備份
1、RMAN> delete obsolete; 刪除陳舊備份;
2、RMAN> delete expired backup; 刪除EXPIRED備份
3、RMAN> delete expired copy; 刪除EXPIRED副本;
4、RMAN> delete backupset 19; 刪除特定備份集;
5、RMAN> delete backuppiece ''d:backupDEMO_19.bak'' 刪除特定備份片;
6、RMAN> delete backup 刪除所有備份集;
7、RMAN> delete datafilecopy ''d:backupDEMO_19.bak'' 刪除特定映像副本;
8、RMAN> delete copy 刪除所有映像副本;
9、RMAN> delete archivelog all delete input;
RMAN> delete backupset 22 format = ''d:backup%u.bak'' delete input
在備份後刪除輸入物件;
10、RMAN> delete backupset id;
7、CHANGE命令: 改變備份集的狀態
1、RMAN> change backupset 22 unavailable 改變備份集狀態;
2、RMAN> change datafilecopy ''d:backupdemo_37.bak'' unavailable 改變映像副本狀態;
3、RMAN> change backupset 156 keep forever logs 使備份集156永久保留;
4、RMAN> change backupset 198 keep until ''sysdate+60'' logs 使備份集198保留60天;
5、RMAN> change backupset 156 nokeep 免除備份集156的保留期限;
6、change backupset 117,118 delete;
7、change backuppiece 1304 delete;
8、change archivelog until logseq =544 delete;
8、CONFIGURE命令
1顯示當前的配置資訊
1.01 RMAN> show all;
1.02查詢RMAN設定中非預設值:
SQL> select name,value from v$rman_configuration;
2.常用的configure選項
2.01儲存策略(retention policy)
configure retention policy to recovery window of 3 days;
configure retention policy to redundancy 3;
configure retention policy clear;
2.02備份最佳化backup optimization
configure backup optimization on;
configure backup optimization off;
configure backup optimization clear;
2.03預設裝置default device type
configure default device type to disk;
configure default device type to stb;
configure default device type clear;
2.04控制檔案controlfile
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/cfs01/backup/conf/conf_%F';
configure controlfile autobackup clear;
configrue controlfile autobackup format for device type disk clear;
configrue snapshot controlfile name to '/cfs01/backup/snapcf/scontrofile.snp';
configrue snapshot controlfile name clear;
2.05並行數(通道數) device type disk|stb parallelism n;
configure device type disk|stb parallelism 2;
configure device type disk|stb clear;
configure channel device type disk format 'e/:rmanback_%U';
configure channel device type disk maxpiecesize 100m
configure channel device type disk rate 1200K
configure channel 1 device type disk format 'e/:rmanback_%U';
configure channel 1 device type disk maxpiecesize 100m
2.06生成備份副本datafile|archivelog backup copies
configure datafile backup copies for device type disk|stb to 3;
configure archivelog backup copies for device type disk|stb to 3;
configure datafile|archivelog backup copies for device type disk|stb clear
backup device type disk database
format '/disk1/backup/%U', '/disk2/backup/%U', '/disk3/backup/%U';
2.07排除選項exclude
configure exclude for tablespace 'users';
configrue exclude clear;
2.08備份集大小maxsetsize
configure maxsetsize to 1G|1000M|1000000K|unlimited;
configure maxsetsize clear;
2.09其它選項auxiliary
CONFIGURE AUXNAME FOR DATAFILE 1 TO '/oracle/auxfiles/aux_1.f';
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/oracle/auxfiles/aux_2.f';
CONFIGURE AUXNAME FOR DATAFILE 3 TO '/oracle/auxfiles/aux_3.f';
CONFIGURE AUXNAME FOR DATAFILE 4 TO '/oracle/auxfiles/aux_4.f';
CONFIGURE AUXNAME FOR DATAFILE 1 CLEAR;
源文件 <http://blog.chinaunix.net/u/25176/showart_1329962.html>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1052536/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN常用的命令和操作
- RMAN常用的命令和操作:
- RMAN常用命令——不斷整理中
- RMAN常用命令
- RMAN 常用命令
- 常用RMAN 備份命令
- 【RMAN】Oracle rman 常用命令參考Oracle
- Oracle rman 常用命令Oracle
- RMAN常用命令11
- rman的常用命令和asm檢視的命令ASM
- rman中的catalog命令!
- rman的一些命令
- RMAN 常用命令 3 [final]
- RMAN 常用命令 2 [final]
- RMAN 常用命令 1 [final]
- RMAN說,我能備份(7)--RMAN常用命令
- RMAN說,我能備份(8)--RMAN常用命令續
- RMAN 常用操作命令二(備份保留策略)
- RMAN說,我能備份(16)--RMAN中的SET命令
- RMAN中的 debug調式命令
- 命令列中的常用操作命令列
- RMAN : set newname for命令的一點研究
- centos7 中的一些常用命令CentOS
- tcpdump 命令的常用選項:一TCP
- Mac 常用的終端命令 《一》Mac
- DataWorks中MaxCompute的常用操作命令
- window中nginx的常用命令Nginx
- rman 命令
- RMAN命令
- RMAN中SET命令的常見用法的小結 (ZT)
- 測試工作中經常用到的一丟Linux命令Linux
- tcpdump 命令的個常用選項:一TCP
- 一些常用的linux命令Linux
- 一些常用的LVM命令LVM
- RMAN 異機遷移實戰操作-附加常用命令
- RMAN命令大全
- rman(2)--命令
- RMAN命令整理