DM7使用DMRMAN工具執行加密備份與設定跟蹤日誌
使用DMRMAN工具執行加密備份與設定跟蹤日誌
下面介紹使用DMRMAN工具執行加密備份與設定跟蹤日誌
1.加密備份
DMRMAN同DIsql工具一樣可使用加密的方式備份資料庫,沒有許可權的使用者無法訪問加密的備份集。
DMRMAN備份命令中透過指定IDENTIFIED BY...WITH ENCRYPTION...ENCRYPT WITH...命令執行加密備份。
加密備份過程中引數IDENTIFIED BY必須指定,引數WITH ENCRYPTION和引數ENCRYPT WITH可不指定。加密備份時不指定WITH ENCRYPTION引數,該引數預設為1,不指定ENCRYPT WITH引數,該引數預設值為AES256_CFB。例如,以下兩種加密備份命令都是合法的:
RMAN> backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_01' identified by "abcd123456"; backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_01' identified by ******; checking if the database under system path [E:\dmdbms\data\jydm] is running...[4]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[3]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[2]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[1]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[0]. checking if the database under system path [E:\dmdbms\data\jydm] is running, write dmrman info. EP[0] max_lsn: 904411 BACKUP DATABASE [jydm], execute...... CMD CHECK LSN...... BACKUP DATABASE [jydm], collect dbf...... CMD CHECK ...... DBF BACKUP SUBS...... total 1 packages processed... total 2 packages processed... total 3 packages processed... total 4 packages processed... total 5 packages processed... total 6 packages processed... total 7 packages processed... total 8 packages processed... DBF BACKUP MAIN...... BACKUPSET [E:\dmdbms\backup\db_jydm_bak_for_encrypt_01] END, CODE [0]...... META GENERATING...... total 9 packages processed... total 9 packages processed! CMD END.CODE:[0] backup successfully! time used: 8271.759(ms) RMAN> backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_02' identified by "abcd123456" encrypt with rc4; backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_02' identified by ****** encrypt with ******; checking if the database under system path [E:\dmdbms\data\jydm] is running...[4]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[3]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[2]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[1]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[0]. checking if the database under system path [E:\dmdbms\data\jydm] is running, write dmrman info. EP[0] max_lsn: 904411 BACKUP DATABASE [jydm], execute...... CMD CHECK LSN...... BACKUP DATABASE [jydm], collect dbf...... CMD CHECK ...... DBF BACKUP SUBS...... total 1 packages processed... total 2 packages processed... total 3 packages processed... total 4 packages processed... total 5 packages processed... total 6 packages processed... total 7 packages processed... total 8 packages processed... DBF BACKUP MAIN...... BACKUPSET [E:\dmdbms\backup\db_jydm_bak_for_encrypt_02] END, CODE [0]...... META GENERATING...... total 9 packages processed... total 9 packages processed! CMD END.CODE:[0] backup successfully! time used: 7166.572(ms)
若指定了加密密碼,但加密型別WITH ENCRYPTION引數指定為0,則為非加密備份,如下所示:
RMAN> backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_03' identified by "abcd123456" with encryption 0; backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_03' identified by ****** with encryption *; checking if the database under system path [E:\dmdbms\data\jydm] is running...[4]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[3]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[2]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[1]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[0]. checking if the database under system path [E:\dmdbms\data\jydm] is running, write dmrman info. EP[0] max_lsn: 904411 BACKUP DATABASE [jydm], execute...... CMD CHECK LSN...... BACKUP DATABASE [jydm], collect dbf...... CMD CHECK ...... DBF BACKUP SUBS...... total 1 packages processed... total 2 packages processed... total 3 packages processed... total 4 packages processed... total 5 packages processed... total 6 packages processed... total 7 packages processed... total 8 packages processed... DBF BACKUP MAIN...... BACKUPSET [E:\dmdbms\backup\db_jydm_bak_for_encrypt_03] END, CODE [0]...... META GENERATING...... total 9 packages processed... total 9 packages processed! CMD END.CODE:[0] backup successfully! time used: 7278.945(ms)
下面以資料庫完全備份為例,建立加密密碼為“abcd123456”,加密演算法為“rc4”的複雜加密型別的資料庫加密備份,完整步驟如下:
1) 保證資料庫處於關閉狀態。
2) 備份資料庫。啟動DMRMAN工具並輸入以下命令。
RMAN> backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_04' identified by "abcd123456" with encryption 2 encrypt with rc4 backup database 'E:\dmdbms\data\jydm\dm.ini' full backupset 'E:\dmdbms\backup\db_jydm_bak_for_encrypt_04' identified by ****** with encryption * encrypt with ******; checking if the database under system path [E:\dmdbms\data\jydm] is running...[4]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[3]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[2]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[1]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[0]. checking if the database under system path [E:\dmdbms\data\jydm] is running, write dmrman info. EP[0] max_lsn: 904411 BACKUP DATABASE [jydm], execute...... CMD CHECK LSN...... BACKUP DATABASE [jydm], collect dbf...... CMD CHECK ...... DBF BACKUP SUBS...... total 1 packages processed... total 2 packages processed... total 3 packages processed... total 4 packages processed... total 5 packages processed... total 6 packages processed... total 7 packages processed... total 8 packages processed... DBF BACKUP MAIN...... BACKUPSET [E:\dmdbms\backup\db_jydm_bak_for_encrypt_04] END, CODE [0]...... META GENERATING...... total 9 packages processed... total 9 packages processed! CMD END.CODE:[0] backup successfully! time used: 7280.960(ms)
對於增量備份加密,如果基備份存在加密,則使用的加密演算法和加密密碼必須與基備份中一致;如果基備份未進行加密處理,則對增量備份使用的加密密碼和演算法沒有特殊要求。
RMAN> backup database 'E:\dmdbms\data\jydm\dm.ini' increment with backupdir 'E:\dmdbms\backup' backupset 'E:\dmdbms\backup\db_jydm_bak_incr_for_encrypt_01' identified by "abcd123456" with encryption 2 encrypt with rc4; backup database 'E:\dmdbms\data\jydm\dm.ini' increment with backupdir 'E:\dmdbms\backup' backupset 'E:\dmdbms\backup\db_jydm_bak_incr_for_encrypt_01' identified by ****** with encryption * encrypt with ******; checking if the database under system path [E:\dmdbms\data\jydm] is running...[4]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[3]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[2]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[1]. checking if the database under system path [E:\dmdbms\data\jydm] is running...[0]. checking if the database under system path [E:\dmdbms\data\jydm] is running, write dmrman info. EP[0] max_lsn: 904411 BACKUP DATABASE [jydm], execute...... CMD CHECK LSN...... BACKUP DATABASE [jydm], collect dbf...... CMD CHECK ...... DBF BACKUP SUBS...... total 1 packages processed... total 2 packages processed... total 3 packages processed... total 4 packages processed... total 5 packages processed... total 6 packages processed... total 7 packages processed... total 8 packages processed... DBF BACKUP MAIN...... BACKUPSET [E:\dmdbms\backup\db_jydm_bak_incr_for_encrypt_01] END, CODE [0]...... META GENERATING...... total 0 packages processed... total 9 packages processed! CMD END.CODE:[-8088],DESC:[無任何資料更新或者日誌產生,無需備份] [-8088]:無任何資料更新或者日誌產生,無需備份 RMAN>
2.設定跟蹤日誌檔案
DMRMAN備份時可選擇生成跟蹤日誌檔案,跟蹤日誌記錄了SBT介面的呼叫過程,使用者透過檢視日誌可跟蹤備份還原過程。
與生成跟蹤日誌檔案相關的引數有兩個,TRACE FILE和TRACE LEVEL。TRACE FILE用於指定生成的跟蹤日誌檔案路徑。與DIsql工具不同的是,DMRMAN不可在備份時指定引數生成跟蹤檔案,只能使用CONFIGURE命令進行事先配置。
使用CONFIGURE DEFAULT...TRACE FILE...TRACE LEVEL命令啟用TRACE功能並設TRACE檔案路徑,以下命令生成TRACE檔案到E:\dmdbms\trace目錄:
RMAN> configure configure THE DMRMAN DEFAULT SETTING: DEFAULT DEVICE: MEDIA : DISK DEFAULT TRACE : FILE : ..\dm_SBTTRACE_202005.log LEVEL : 1 DEFAULT BACKUP DIRECTORY: TOTAL COUNT :1 E:\dmdbms\backup DEFAULT ARCHIVE DIRECTORY: TOTAL COUNT :1 E:\dmdbms\data\arch time used: 37.758(ms) RMAN> configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 2; configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 2; configure default trace successfully! time used: 3.387(ms) RMAN> configure configure THE DMRMAN DEFAULT SETTING: DEFAULT DEVICE: MEDIA : DISK DEFAULT TRACE : FILE : E:\dmdbms\trace\db_jydm_trace.log LEVEL : 2 DEFAULT BACKUP DIRECTORY: TOTAL COUNT :1 E:\dmdbms\backup DEFAULT ARCHIVE DIRECTORY: TOTAL COUNT :1 E:\dmdbms\data\arch time used: 40.347(ms)
指定引數TRACE FILE但TRACE LEVEL值設定為1即不啟用TRACE功能,會生成TRACE檔案,但不會寫入TRACE資訊。如下所示:
RMAN> configure default trace clear; configure default trace clear; configure default trace clear successfully! time used: 2.183(ms) RMAN> configure configure THE DMRMAN DEFAULT SETTING: DEFAULT DEVICE: MEDIA : DISK DEFAULT TRACE : FILE : LEVEL : 1 DEFAULT BACKUP DIRECTORY: TOTAL COUNT :1 E:\dmdbms\backup DEFAULT ARCHIVE DIRECTORY: TOTAL COUNT :1 E:\dmdbms\data\arch time used: 46.771(ms) RMAN> configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 1; configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 1; configure default trace successfully! time used: 4.799(ms)
TRACE LEVEL值設定為2即啟用TRACE功能,但若TRACE FILE沒有指定,系統預設在執行碼路徑的log目錄下生成DM_SBTTRACE_年月.log檔案。
如下所示:
RMAN> configure default trace level 2; configure default trace level 2; configure default trace successfully! time used: 3.124(ms)
若TRACE FILE使用相對路徑,日誌檔案則生成在執行碼同級目錄下。
為資料庫離線備份設定跟蹤日誌檔案的操作步驟如下:
1) 保證資料庫處於關閉狀態。
2) 使用CONFIGURE命令配置生成跟蹤日誌檔案。
RMAN> configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 2; configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 2; configure default trace successfully! time used: 2.705(ms)
檢視E:\dmdbms\trace\db_jydm_trace.log檔案即可跟蹤本次備份的SBT介面呼叫過程。
如果指定的TRACE檔案已存在,伺服器不會覆蓋已存在的檔案而是在已有檔案基礎上繼續記錄日誌。
RMAN> configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 1; configure default trace file 'E:\dmdbms\trace\db_jydm_trace.log' trace level 1; [-8086]:無效的TRACE檔案[E:\dmdbms\trace\db_jydm_trace.log]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2717570/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DM7聯機執行SQL語句進行加密備份與設定跟蹤日誌SQL加密
- DM7使用DMRMAN執行歸檔備份
- DM7使用離線工具DMRMAN執行資料庫備份資料庫
- DM7使用DMRMAN工具刪除備份集
- DM7使用DMRMAN工具檢視備份集
- DM7使用DMRMAN工具匯入備份集
- DM7使用DMRMAN工具執行備份集對映檔案匯出
- DM7使用DMRMAN執行歸檔還原
- DM7使用DMRMAN執行歸檔修復
- DM7使用DMRMAN執行表空間還原
- DM7使用DMRMAN執行RAC資料庫恢復資料庫
- 日誌傳送事務日誌備份設定
- DM7使用DMRAMN執行備份集恢復
- DM7使用DMRMAN執行資料庫還原和恢復資料庫
- 達夢DMRMAN備份還原工具的介紹與配置
- DM7使用聯機執行SQL語句進行備份還原SQL
- DM7使用DMRMAN對資料庫執行指定對映檔案還原資料庫
- 將跟蹤與Windows效能日誌資料關聯Windows
- 使用sqltrace跟蹤session執行的sqlSQLSession
- DM7使用dmrestore工具利用歸檔日誌還原REST
- 【YashanDB知識庫】windows配置ODBC跟蹤日誌, 使用日誌定位問題Windows
- DM7聯機執行SQL語句進行表備份SQL
- DM7使用disql管理備份SQL
- SAP CRM One Order跟蹤和日誌工具CRMD_TRACE_SET
- Windows下用命令列工具ADRCI跟蹤日誌檔案Windows命令列
- 跟蹤執行命令T
- 呼叫鏈與日誌的關聯式跟蹤查詢
- MySQL 日誌管理、備份與恢復MySql
- DM7聯機執行SQL語句進行歸檔備份SQL
- rman通過設定口令加密備份!加密
- sql server關於跟蹤日誌查詢使用說明SQLServer
- 歸檔日誌大小 與使用rman 備份後的歸檔日誌產生的備份集大小的關係
- mysql多執行緒備份與還原工具mydumperMySql執行緒
- DM7聯機執行SQL語句進行表空間備份SQL
- FreeBSD系統日誌與備份(轉)
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- 備份之歸檔重做日誌備份
- 備份歸檔日誌