select * from v$encryption_wallet; WRL_TYPE &..."/>
您好,登錄后才能下訂單哦!
實驗:創(chuàng)建加密表空間,并插入測試數(shù)據(jù)
一:查看現(xiàn)有wallet
SQL> select * from v$encryption_wallet;
WRL_TYPE WRL_PARAMETER STATUS
-------------------- ----------------------------------- ------------------
file
/u01/app/oracle/admin/orcl/wallet
CLOSED
二:創(chuàng)建目錄
SQL> ho mkdir /u01/app/oracle/admin/orcl/wallet
三:創(chuàng)建加密KEY
SQL> alter system set encryption key identified by oracle;
四:查看現(xiàn)有wallet狀態(tài)
SQL> select * from v$encryption_wallet;
WRL_TYPE WRL_PARAMETER STATUS
-------------------- ----------------------------------- ------------------
file /u01/app/oracle/admin/orcl/wallet
OPEN
五:創(chuàng)建加密表空間
SQL> create tablespace test_encrypt datafile '/u01/app/oracle/oradata/orcl/test_encrypt01.dbf' size 10M encryption default storage(encrypt);
Tablespace created.
SQL> SELECT TABLESPACE_NAME, ENCRYPTED FROM DBA_TABLESPACES;
TABLESPACE_NAME ENC
------------------------------ ---
SYSTEM NO
SYSAUX NO
UNDOTBS1 NO
TEMP NO
USERS NO
TEST_ENCRYPT YES
6 rows selected.
SQL> SELECT NAME, ENCRYPTIONALG ENCRYPTEDTS
FROM V$ENCRYPTED_TABLESPACES, V$TABLESPACE
WHERE V$ENCRYPTED_TABLESPACES.TS# = V$TABLESPACE.TS#;
NAME ENCRYPT
------------------------------ -------
TEST_ENCRYPT AES128
六:創(chuàng)建測試數(shù)據(jù)
SQL> create table t1(id number,name varchar2(20)) tablespace
test_encrypt;
SQL> create table t2(id number,name varchar2(20)) tablespace users;
SQL> insert into t1 values(1,'a');
SQL> commit;
SQL> insert into t2 values(2,'b');
SQL> commit;
七:重啟數(shù)據(jù)庫后,錢包自動關(guān)閉,并且無法查詢加密表空間里的數(shù)據(jù)
SQL> shutdown immediate
SQL> startup
SQL> select * from t1;
select * from t1
*
ERROR at line 1:
ORA-28365: wallet is not open
---數(shù)據(jù)庫重啟后,錢包會自動關(guān)閉
SQL> select * from v$encryption_wallet;
WRL_TYPE WRL_PARAMETER STATUS
-------------------- ----------------------------------- ------------------
file /u01/app/oracle/admin/orcl/wallet
CLOSED
八:打開錢包
SQL>
alter system set wallet open identified by oracle;
System altered.
---SQL> alter system set wallet close identified by oracle;(關(guān)閉錢包)
SQL> select * from t1;
ID NAME
---------- --------------------
1 a
九:將t2表移動到加密表空間中
SQL>
alter table t2 move tablespace test_encrypt;
System altered.
歡迎關(guān)注我的微信公眾號"IT小Chen",共同學(xué)習(xí),共同成長?。?!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。