wallet 使用出错解答


第一种错误:不能建立WALLET
现象:
15:11:53 SYS> alter system set encryption key authenticated by "topsecrect" ;
alter system set encryption key authenticated by "topsecrect"
*
ERROR at line 1:
ORA-28368: cannot auto-create wallet
原因:缺少相关路径,默认位置是 $oracle_baseadmin$ora_SIDwallet,
可能通过SQLNET.ORA 加入相关参数修改。
ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=D:oradatawallet)))

第一种错误:不能打开WALLET
现象:
15:36:33 SYS> alter system set encryption key authenticated by "topsecrect" ;
alter system set encryption key authenticated by "topsecrect"
*
ERROR at line 1:
ORA-28353: failed to open wallet
原因:已经存在了一个旧的WALLET文件,因此如果要建立新的WALLET,须先重命名或删除旧的WALLET。

---解决以上两个小问题后,就可以成功建立WALLET了
15:48:54 SYS> alter system set encryption key authenticated by "topsecrect" ;

System altered.

---- 补充, 不能创建WALLET的第三种原因:

the Listener is not start . So you maybe start the TNS listener BEFORE create a wallet. Becuase SQLNET.ORA file is a network security relation configuration file which rely on the TNS network.

[@more@]

附:相关参考资料:


概念:
1, wallet 是数据库级别的,也就是说,在一个会话中打开后,所有的会话都可以使用wallet的TDE属性建立加密字段,和RMAN备份加密了。一但建立后,默认就打开了。关掉之后,就无法建立和访问加密的列和备份数据了。
2,对于RMAN备份时加密的备份集,恢复时,仍需要打开WALLET的。这对异机(异地)恢复来说会有障碍。所以异机恢复
最好用密码加密:
3, 注意:ORACLE 10g 没有锁定WALLET证书,所以在证书打开的时候仍然可以删除。删除后,当前用户仍然可以查看
加密的字段,但是,关闭WALLET后,再开启就会失败。


可以用如下的方法打开加密备份方式:
1)RMAN> set encryption on identified by 'password' only;
2)RMAN> set encryption on identified by 'password';
3)RMAN> configure encryption for database on;
RMAN> set encryption on; 
3, 最重要的,wallet是一次性的,即便使用相同的密码和文件路径,每次建立的证书都是不一样的,经过试验,
建立包含加密列的表,然后关闭WALLET,并删除WALLET证书文件,然后用相同的密码建立的wallet证书,
再打开WALLET,访问同一张表,系统报错"master key not found".将证书复原重新打开WALLET后恢复正常。
所以证书文件一定要备份。因为它是一次性的。
如果丢失证书文件(或者误删除),即便用相同的密码再生成一次证书也是无效的。一切都晚了。


例子:
在WINDOWS下建立钱夹,以便使用TDE(透明加密).

首先,这个目录默认位置是:$oracle_baseadmin$ora_SIDwallet ( C:oracleproduct10.2.0admincarwallet )

****ORACLE默认情况下不会创建 admincarwallet 这个目录树的,所以要手工的建立,
然后在数据库中设定钱夹密码才能成功,否则,由于没有这个目录,建立钱夹失败。

-- create wallet
alter system set encryption key authenticated by TopSecrect ;

■配置sqlnet.ora,设置加密方式与文件地址:
ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=D:oradatawallet)))

■创建wallet,包括设置密码、生成信任文件、并启动wallet:
SQL> alter system set encryption key authenticated BY "zrp123"; 

然后可以用如下的方式打开或关闭wallet,需要注意的是,以上的命令完成以后,wallet就自动启动了,不需要在启动。
SQL> alter system set wallet open identified by "zrp123";

SQL> alter system set encryption wallet close; 

file:///F:/Encyclopedia/Computer/doc/oracle/经验$/RMAN的备份加密%20-%20daimin's%20BLOG%20-%20CSDN博客.htm


-- use wallet to TDE.
create table accounts
(
acc_no number not null,
first_name varchar2(30) not null,
last_name varchar2(30) not null,
SSN varchar2(9) ENCRYPT USING 'AES128', --- tde on column.
acc_type varchar2(1) not null,
folio_id number ENCRYPT USING 'AES128',
sub_acc_type varchar2(30),
acc_open_dt date not null,
acc_mod_dt date,
acc_mgr_id number
);

-- TDE on external Table.
create table account_ext
organization external
(
type oracle_datapump
default directory dump_dir
location ('accounts_1_ext.dmp',
'accounts_2_ext.dmp',
'accounts_3_ext.dmp',
'accounts_4_ext.dmp')
)
parallel 4
as
select
ACC_NO,
FIRST_NAME,
LAST_NAME,
SSN ENCRYPT IDENTIFIED BY "topSecret",
ACC_TYPE,
FOLIO_ID ENCRYPT IDENTIFIED BY "topSecret",
SUB_ACC_TYPE,
ACC_OPEN_DT,
ACC_MOD_DT
from accounts;

--- views:

v$wallet
dba_encrypted_columns
all_encrypted_columns
user_encrypted_columns

---reference:

http://bbs.erp100.com/thread-33331-1-1.html

---11G new feature to wallet:

in oracle database 11G ,when you want to close a wallet , maybe you should supply the password . The command like :

alter system set wallet close identified by "password" ;

-- but in oracle 10.2G you just issue the following :

alter system set wallet close ;

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

转载于:http://blog.itpub.net/350519/viewspace-1034644/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值