[20140506]rman加密備份.txt
[20140506]rman加密備份.txt
--昨天跟別人討論,提到備份的安全性問題,需要預防別人拿到備份取出資料的問題.上午簡單看了一下如何加密備份的問題.做一些簡單測
--試.
SCOTT@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
1.先測試不加密的情況:
RMAN> show ENCRYPTION FOR DATABASE;
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
RMAN> backup spfile format '/tmp/spfile%U.bak';
Starting backup at 2014-05-06 09:02:23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=113 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2014-05-06 09:02:28
channel ORA_DISK_1: finished piece 1 at 2014-05-06 09:02:29
piece handle=/tmp/spfile05p7jf54_1_1.bak tag=TAG20140506T090227 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2014-05-06 09:02:29
# strings spfile05p7jf54_1_1.bak | tail -4
*.sessions=400
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'
/u01/app/oracle11g/product/11.2.0/db_2/dbs/spfiletest.ora
--不加密可以看到備份裡面的資訊.
2.測試加密的情況:
RMAN> set encryption on identified by '123456';
executing command: SET encryption
RMAN> backup spfile format '/tmp/spfile%U.bak';
Starting backup at 2014-05-06 09:05:04
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2014-05-06 09:05:06
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/06/2014 09:05:07
ORA-19914: unable to encrypt backup
ORA-28365: wallet is not open
-要建立wallet,比較麻煩,我看了一下文件,後面加入引數only,就可以備份.
RMAN> set encryption on identified by '123456' only;
executing command: SET encryption
RMAN> backup spfile format '/tmp/spfile%U.bak';
Starting backup at 2014-05-06 09:06:24
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2014-05-06 09:06:26
channel ORA_DISK_1: finished piece 1 at 2014-05-06 09:06:27
piece handle=/tmp/spfile07p7jfch_1_1.bak tag=TAG20140506T090625 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 2014-05-06 09:06:27
# strings /tmp/spfile07p7jfch_1_1.bak | tail -4
`thvQb
pFXB#
sq1Ha
tNH4
--可以發現加密後看不到備份的資訊.
3.測試如何取出備份:
RMAN> set decryption identified by '123456';
executing command: SET decryption
using target database control file instead of recovery catalog
RMAN> restore preview spfile from '/tmp/spfile07p7jfch_1_1.bak' ;
Starting restore at 2014-05-06 09:10:55
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=210 device type=DISK
Finished restore at 2014-05-06 09:10:58
RMAN> set decryption identified by 'a23456';
executing command: SET decryption
RMAN> restore preview spfile from '/tmp/spfile07p7jfch_1_1.bak' ;
Starting restore at 2014-05-06 09:11:45
using channel ORA_DISK_1
Finished restore at 2014-05-06 09:11:47
--昏密碼不對也能解開嗎?不過內容應該不正確.
4.真實解開測試看看.
RMAN> set decryption identified by 'a23456' ;
executing command: SET decryption
using target database control file instead of recovery catalog
RMAN> restore spfile to '/tmp/spfilea23456.ora' from '/tmp/spfile07p7jfch_1_1.bak';
Starting restore at 2014-05-06 09:16:06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=210 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /tmp/spfile07p7jfch_1_1.bak
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/06/2014 09:16:10
ORA-19870: error while restoring backup piece /tmp/spfile07p7jfch_1_1.bak
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open
--??難道要開啟wallet.
RMAN> set decryption identified by '123456' ;
executing command: SET decryption
using target database control file instead of recovery catalog
RMAN> restore spfile to '/tmp/spfilea23456.ora' from '/tmp/spfile07p7jfch_1_1.bak';
Starting restore at 2014-05-06 09:17:05
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=210 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /tmp/spfile07p7jfch_1_1.bak
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 2014-05-06 09:17:08
--密碼正確,可以restore.
--看看內容是否正確:
# strings spfilea23456.ora | tail -4
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=400
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'
--ok正確.不建立wallet,透過執行set encryption on identified by 'xxxxxx' only;也可以加密,僅僅需要記住加密密碼,備份指令碼要保
--存好.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1154736/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20190522]rman備份問題.txt
- RMAN加密備份的三種方式加密
- [20190515]熱備份模式與rman衝突.txt模式
- [20190510]rman備份的疑問8.txt
- [20190510]rman備份的疑問7.txt
- [20190509]rman備份的疑問5.txt
- [20210527]rman與undo表空間備份.txt
- 【RMAN】RMAN備份至ASMASM
- RMAN備份概述
- 【RMAN】RMAN的備份保留策略
- [20180423]關於rman備份的問題2.txt
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- [20221028]rman使用tape與增量備份測試2.txt
- RMAN備份進度
- rman 備份指令碼指令碼
- RMAN的備份原理
- rman 增量備份恢復
- Oracle RMAN備份實戰Oracle
- Oracle OCP(60):RMAN 備份Oracle
- RMAN備份恢復技巧
- 【rman備份策略】實驗
- 【RMAN】同時建立多個備份(建立多重備份)
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- RMAN備份詳解(轉載)
- RMAN 備份相關的概念
- 使用RMAN備份資料庫資料庫
- RMAN備份異機恢復
- [20211020]改變備庫的rman配置.txt
- oracle 12c rman備份pdbOracle
- 利用RMAN備份重建資料庫資料庫
- 分享Oracle Rman的備份指令碼Oracle指令碼
- RMAN備份恢復效能優化優化
- RMAN備份中發現壞塊
- RMAN備份與恢復測試
- RMAN自動備份任務新增
- 【備份】RMAN中對控制檔案的幾種備份方法
- rman開啟備份優化對備份歸檔的影響優化
- Oracle 備份恢復篇之RMAN catalogOracle
- 揭秘ORACLE備份之----RMAN之五(CATALOG)Oracle