ITPub博客

首页 > Linux操作系统 > Linux操作系统 > TDE 列级加密

TDE 列级加密

原创 Linux操作系统 作者:Anst_Alex_Yuan 时间:2012-07-19 15:39:16 0 删除 编辑
--configre the sqlnet.ora for wallet
ENCRYPTION_WALLET_LOCATION=
  (SOURCE=(METHOD=FILE)(METHOD_DATA=
    (DIRECTORY=D:\Oracle\11.2.0\NETWORK\ADMIN\)))
--create the wallet   
alter system set encryption key identified by foobar;
--open and close the wallet
alter system set encryption wallet close;
alter system set  wallet open  identified by foobar;

--在创建数据表时可以指定加密:
create table tde (id number(10),data varchar2(50) encrypt);
--insert data
insert into tde select user_id,username from user_users;
--access encrypted data
select * from tde
--the encrypted data can't be accessed afther close the wallet
alter system set encryption wallet close;
SQL> select * from hr.tde;
select * from hr.tde
                 *
ERROR at line 1:
ORA-28365: wallet is not open
--open the wallet for encrypted data access
alter system set  wallet open  identified by foobar;
select * from hr.tde;
        ID DATA
---------- --------------------------------------------------
        82 HR
       
--create index on salt encrypted column
SQL> create index idx01 on tde(data);
create index idx01 on tde(data)
                          *
ERROR at line 1:
ORA-28338: cannot encrypt indexed column(s) with salt
alter table tde modify  data encrypt no salt;
create index idx01 on tde(data);
---create new table without encrpt
create table tde_test
as
select * from departments   
alter table tde_test modify department_name encrypt;
select * from dba_encrypted_columns;
alter system set encryption wallet close;
SQL> select * from hr.tde_test;
select * from hr.tde_test
                 *
ERROR at line 1:
ORA-28365: wallet is not open
   

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24800471/viewspace-736032/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-03-19

  • 博文量
    14
  • 访问量
    49391