Oracle 10G:透明数据加密技术(TDE)
2. 接下来,您需要打开钱夹并创建功能较多加密密钥。从终端窗口中,输入以下命令:
connect / as sysdbaalter system set key identified by "welcome1";
此命令的作用为:
l 如果指定的目录中不存在加密钱夹,则将创建加密钱夹 (ewallet.p12)、打开此钱夹并创建/重新创建 TDE 的功能较多密钥。
l 如果指定目录中存在加密钱夹,则将打开此钱夹并创建/重新创建 TDE 的功能较多密钥。
之后,就可以测试数据了。
下面是实验记录:
alter system set key identified by "welcome1";
SQL> conn dodd/dodd123
create table test (id number,credit_card_number varchar2(16) ENCRYPT NO SALT);
![]()
SQL> insert into test values(1,'1231243242');
![]()
1 row created.
SQL> insert into test values(2,'33245235');
SQL> commit;
Commit complete.
![]()
SQL> select * from test;
![]()
ID CREDIT_CARD_NUMB
---------- ----------------
1 1231243242
2 33245235
![]()
可见,数据查看是明文,因为这个时候,加密钱夹已经打开,数据可以解密。
这时,停止数据库,再打开:
SQL> shutdown immediate
![]()
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL> startup
ORACLE instance started.
![]()
Total System Global Area 524288000 bytes
Fixed Size 1979968 bytes
Variable Size 138414528 bytes
Database Buffers 377487360 bytes
Redo Buffers 6406144 bytes
Database mounted.
Database opened.
![]()
SQL> select * from dodd.test;
select * from dodd.test
*
ERROR at line 1:
ORA-28365: wallet is not open
![]()
![]()
SQL> select id from dodd.test;
![]()
ID
----------
1
2
![]()
可以看到,因为数据库重启后,加密钱夹处于关闭状态,这时只要查询到加密的列,会提示加密钱夹没有打开。
0
相关文章
