linux wallet 扫描,51CTO博客-专业IT技术博客创作平台-技术成就梦想

043securitywallet

three type wallets in the oracle database

1)first: simplify_wallet

1@@@@create a wallet directory

[oracle@station60 orcl]$ pwd

/u01/app/oracle/admin/orcl

[oracle@station60 orcl]$ mkdir wallet

2@@@@create a wallet key in the sqlplus.

SQL> conn /as sysdba;

Connected.

SQL> alter system set encryption key identified by "oracle456";

System altered.

SQL> alter system set encryption wallet open identified by "oracle456";

alter system set encryption wallet open identified by "oracle456"

*

ERROR at line 1:

ORA-28354: wallet already open

3@@@@the wallet directory wolud be produce the file autoly

[oracle@station60 wallet]$ ls

ewallet.p12

[oracle@station60 orcl]$ ls

adump  bdump  cdump  dpdump  pfile  udump  wallet

4@@@@create a encrypt table

SQL> conn /as sysdba;

Connected.

SQL> create table t04315_b(a number, b varchar2(20) encrypt);

Table created.

SQL> insert into t04315_b values(1,'success');

1 row created.

SQL> commit;

Commit complete.

5@@@@check the wallet encryption function

SQL> conn /as sysdba;

Connected.

SQL> alter system set encryption wallet close;

System altered.

SQL> conn hr/hr

Connected.

SQL> select * from t04315_b;

select * from t04315_b

*

ERROR at line 1:

ORA-28365: wallet is not open

6@@@@encryption crash stuation

@@@if you delete the ewallet.p12 in the wallet,then the encrypt table would

@@@be disappear forever.therefore, dba must be careful.

SQL> conn /as sysdba;

Connected.

SQL> alter system set encryption wallet open identified by "oracle456";

alter system set encryption wallet open identified by "oracle456"

*

ERROR at line 1:

ORA-28367: wallet does not exist

SQL> select * from hr.t04315_b;

select * from hr.t04315_b

*

ERROR at line 1:

ORA-28365: wallet is not open

2)second: global wallet

1@@@@create the wallet directory

[oracle@station60 orcl]$ pwd

/u01/app/oracle/wallet/orcl

2@@@@create wallet file by Graphical User Interface(GUI)

[root@station60 ~]# xhost +

access control disabled, clients can connect from any host

[root@station60 ~]# su - oracle

[oracle@station60 ~]$ owm

#####input the password and select the place to save. no certificate.

Done.

[oracle@station60 ~]$ cd /u01/app/oracle/wallet/orcl

[oracle@station60 orcl]$ ls

ewallet.p12

3@@@@modify the sqlnet.ora

[oracle@station60 orcl]$ cd $TNS_ADMIN

[oracle@station60 admin]$ cat sqlnet.ora

sqlnet.wallet_override=true

encryption_wallet_location=(source=(method=file)(method_data=(directory=/u01/app/oracle/wallet/orcl)))

#####it is a raw without 'enter'

SQL> shutdown immediate

SQL> startup

#####startup force is danager,use it carefully

4@@@@check the wallet

SQL> conn /as sysdba;

Connected.

SQL> alter system set encryption key identified by "oracle456";

System altered.

SQL> alter system set encryption wallet open identified by "oracle456";

System altered.

SQL> conn hr/hr

Connected.

SQL> create table t04315_a1(a number);

Table created.

SQL> alter table hr.t04315_a1 modify(a encrypt);

Table altered.

SQL> alter table hr.t04315_a1 modify(a decrypt);

Table altered.

SQL> select * from dba_encrypted_columns

3)third: connectwallet remote login with the user hr

1@@@@create the directory to save the wallet

[oracle@station3 orcl]$ ls

cwallet.sso  ewallet.p12

[oracle@station3 orcl]$ pwd

/u01/app/oracle/connectwallet/orcl

[oracle@station3 u01]$ ll /u01

total 20

drwxr-xr-x 3 oracle oinstall  4096 Sep 10 00:33 app

@@@the directory'own must be the user oracle.

2@@@@generate the hruser connection

[oracle@station3 orcl]$ cat /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora

HRUSER =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE = DEDICATED)

(SERVICE_NAME = orcl.oracle.com)

)

[oracle@station3 orcl]$ tnsping hruser

@@@it must be a successful link.

3@@@@edit the sqlnet.ora

[oracle@station3 orcl]$ cd $TNS_ADMIN

[oracle@station3 admin]$ pwd

/u01/app/oracle/product/10.2.0/db_1/network/admin

[oracle@station3 admin]$ cat sqlnet.ora

sqlnet.wallet_override=true

wallet_location=(source=(method=file)(method_data=(directory=/u01/app/oracle/connectwallet/orcl/)))

@@@that file control user to login.

4)create the wallet key and make the scurity connection

[oracle@station3 admin]$ mkstore -create -wrl /u01/app/oracle/connectwallet/orcl

Enter password:

Enter password again:

[oracle@station3 admin]$ mkstore -wrl /u01/app/oracle/connectwallet/orcl -createCredential HRUSER hr hr;

Enter password:

Create credential oracle.security.client.connect_string1

[oracle@station3 admin]$ sqlplus /nolog

SQL> conn /@hruser

Connected.

SQL> show user

USER is "HR"

SQL> select salary from employees where employee_id=100;

SALARY

----------

24000

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值