TDE從11g開始支援加密整個資料表空間,所有存放在資料表空間的對像都自動加密,不需要再對錶以下進行分割加密.
資料表空間加密不支援BFILE列的加密
oracle的列加密是從10gR2開始可以使用,資料表空間加密是從11gR1開始使用
資料表空間密碼編譯演算法
3DES168,AES128,AES192,AES256,預設是AES128
加密解密圖
舉例:和列加密類似,也要在sqlnet.ora檔案中加入ENCRYPTION_WALLET_LOCATION來指定wallet位置前面步驟和列加密一樣系統建立wallet目錄,指定wallet位置mkdir -p /opt/oracle/admin/skydb/wallet修改sqlnet.ora加入以下內容ENRYPTION_WALLET_LOCATION =(SOURCE=(METHOD=file)METHOD_DATA=(DIRECTORY=/opt/oracle/admin/skydb/wallet))資料庫裡建立wallet並且設定訪問密碼alter system set encryption key authenticated by "123456";開啟walletALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "123456";建立加密資料表空間CREATE TABLESPACE securespaceDATAFILE '/home/oracle/oracle3/product/11.1.0/db_1/secure01.dbf'SIZE 150MENCRYPTIONDEFAULT STORAGE(ENCRYPT);在加密資料表空間建立表CREATE TABLE customer_payment_info(first_name VARCHAR2(11),last_name VARCHAR2(10),order_number NUMBER(5),credit_card_number VARCHAR2(16),active_card VARCHAR2(3))TABLESPACE securespace;插入資料INSERT INTO cust_payment_info VALUES ('Jon', 'Oldfield', 10001, '5446959708812985','YES');INSERT INTO cust_payment_info VALUES ('Chris', 'White', 10002, '5122358046082560','YES'); INSERT INTO cust_payment_info VALUES ('Alan', 'Squire', 10003, '5595968943757920','YES');INSERT INTO cust_payment_info VALUES ('Mike', 'Anderson', 10004, '4929889576357400','YES');INSERT INTO cust_payment_info VALUES ('Annie', 'Schmidt', 10005, '4556988708236902','YES');INSERT INTO cust_payment_info VALUES ('Elliott', 'Meyer', 10006, '374366599711820','YES');INSERT INTO cust_payment_info VALUES ('Celine', 'Smith', 10007, '4716898533036','YES');INSERT INTO cust_payment_info VALUES ('Steve', 'Haslam', 10008, '340975900376858','YES');INSERT INTO cust_payment_info VALUES ('Albert', 'Einstein', 10009, '310654305412389','YES');可以通過V$ENCRYPTED_TABLESPACES視圖查看那些資料表空間加密了,以及密碼編譯演算法相關資料字典ALL_ENCRYPTED_COLUMNSDBA_ENCRYPTED_COLUMNSUSER_ENCRYPTED_COLUMNSV$WALLETV$ENCRYPTED_TABLESPACESV$ENCRYPTION_WALLET
參考:oracle11g TDE