select * from v$encryption_wallet; WRL_TYPE &..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Oracle Encrypted Tablespaces

發(fā)布時間:2020-08-17 05:21:27 來源:ITPUB博客 閱讀:165 作者:chenoracle 欄目:關(guān)系型數(shù)據(jù)庫
Oracle Encrypted Tablespaces


實驗:創(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í),共同成長?。?!

Oracle Encrypted Tablespaces

Oracle Encrypted Tablespaces



向AI問一下細節(jié)

免責聲明:本站發(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)容。

AI