今天在查询一个视图的时候一直报ora-600错误
ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [18446744073709551603], [], [], [], [], [], []
这个视图是通过一个私有同义词创建的,然后授权给其他用户访问。
道理这样是没有问题的。可以正常访问。
SQL> show user; User is "dbmgr" SQL> CREATE DATABASE LINK TO_T1.WORLD CONNECT TO DBMGR IDENTIFIED BY values '05335FAF8E10D85743EDFF0053DE3669D5E1F31A3759113D92' using '(description=(address=(protocol=tcp)(host=10.31.9.12)(port=1529))(connect_data=(sid=t1trsn)))'; CREATE DATABASE LINK TO_T1.WORLD CONNECT TO DBMGR IDENTIFIED BY values '05335FAF8E10D85743EDFF0053DE3669D5E1F31A3759113D92' using '(description=(address=(protocol=tcp)(host=10.31.9.12)(port=1529))(connect_data=(sid=t1trsn)))' ORA-02011: duplicate database link name SQL> drop DATABASE LINK TO_T1.WORLD; Database link dropped SQL> CREATE DATABASE LINK TO_T1.WORLD CONNECT TO DBMGR IDENTIFIED BY values '05335FAF8E10D85743EDFF0053DE3669D5E1F31A3759113D92' using '(description=(address=(protocol=tcp)(host=10.31.9.12)(port=1529))(connect_data=(sid=t1trsn)))'; Database link created SQL> create table test_dblink as select * from STAT_BAK@TO_T1; Table created SQL> SQL> create user xl_test identified by paic1234; User created SQL> grant create session ,resource to xl_test; Grant succeeded SQL> grant all on test_dblink to xl_test; Grant succeeded
SQL> show user; User is "xl_test" SQL> select * from dbmgr.test_dblink; STATID TYPE VERSION FLAGS C1 C2 C3 C4 C5 N1 N2 N3 N4 N5 N6 N7 N8 N9 N10 N11 N12 D1 R1 R2 CH1 ------------------------------------------------------------ ---- ---------- ---------- ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ---------------------------------------------------------------- ---------------------------------------------------------------- -------------------------------------------------------------------------------- TT123 I 4 2 IDX_CONTRACT_BASE_INFO_CN TADATA 66729 332 66717 1 1 58616 1 66729 2013/6/30 1 TT123 C 4 2 CONTRACT_BASE_INFO ID_CONTRACT_BASE_INFO TADATA 66320 1.50784077 5692 5692 0 3.54499936 3.59246096 33 2013/6/30 1 4446324235464332344538373433333845303434414331363244393138303943 4530333637384636343335453546453645303434303032313238463343423845 TT123 C 4 2 CONTRACT_BASE_INFO CONTRACT_NO TADATA 66717 1.49886835 66717 66729 0 2.60592218 4.37759698 16 2013/6/30 1 323030372D3130312D5854303031 544F383034303130333031303831 TT123 T 4 2 DEAL_RATE_TERM_TBL
那这是什么原因呢?突然想起这个问题是下午才出现的,这个db_link是上午才创建的。问题应该是创建的问题。但是创建的时候又没有问题啊!!显示是创建成功了的。
但是找不到其他的原因。把db_link重新创建了一次就可以了。实在是太奇怪了。
在metlink上搜索了一下。
Oracle Database - Enterprise Edition - Version 10.2.0.2 to 11.2.0.3 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 09-Apr-2013***
Symptoms
An attempt to use a database link fails with ORA-600, arguments: [kzdlk_zt2err]
Example of how this exception can be reproduced :
SQL> create database link MPuat connect to MPWH identified by values '8F35681C5152E6B7' using 'mpuat';
Statement processed.
SQL> select count(*) FROM SC_BASE.TO_DO_HISTORY@MPUAT;
ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [4294967283], [], [], [], [], [], []
The trace file will have the following call stack :
*** 2007-05-03 12:57:44.482
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [4294967283], [], [], [], [], [], []
Current SQL statement for this session:
select count(*) FROM SC_BASE.TO_DO_HISTORY@MPUAT
----- Call Stack Trace -----
_kzdlkdbde
_npigdn0
_npicon0
_kpndbcon
_OCIKDBLinkConn2
_OCIKDBLinkConn
_ddfnet2Normal
_kkmfcbrm
kkmpfcbk
_qcsprfro
_qcsprfro_tree
Changes
The database has been recently updated to Oracle 10g and the database link used to work in previous versions.
Cause
The exception is caused by the unpublished below :
Bug:5576894 - Abstract: GET ORA-600 [KZDLK_ZT2_ERR] WHEN LINK CREATED WITH 'IDENTIFIED BY VALUES'
In Oracle 10.2, dblink passwords are now stored in a special encrypted form to improve database link security. The "IDENTIFIED BY VALUES" clause is only intended for use by Oracle internal utilities (EXPORT/IMPORT), and it's not documented in the Oracle user documentation.
The only valid value to be passed in the "IDENTIFIED BY VALUES" clause is an encrypted dblink password identifier (note - this is different from the user password identifier stored in the PASSWORD column of USER$). The internal error in this bug is raised when we attempt to access the db link and materialize the plain text password from the encrypted dblink password identifier - because the value passed to the "IDENTIFIED BY VALUES" clause was not a valid encrypted dblink password identifier we raise an internal error. This is expected behavoiur in this case.
Solution
The only possible fix for this bug is to raise a user error rather than an internal error in this case. This won't make the error go away but it might be more informative to the user, however, seeing as this functionality is only intended to be used by internal Oracle utilities it seems that an internal error may be more appropriate.
Therefore this exception is not a bug.
这个上面说的是不能用密文创建db_link,但是上面的测试很清楚。可以创建而且还可以正常使用。难道是密码的问题?
做了个测试,确实是密码有问题,会报这个错误。但是oracle写的是这个意思么?哎英文水平太差了。。
SQL> show user;
User is "dbmgr"
SQL> drop DATABASE LINK TO_T1.WORLD;
Database link dropped
SQL> CREATE DATABASE LINK TO_T1.WORLD CONNECT TO DBMGR IDENTIFIED BY values '05335FAF8E10D85743EDFF0053DE3669D5E1F31A3759113D93' using '(description=(address=(protocol=tcp)(host=10.31.9.12)(port=1529))(connect_data=(sid=t1trsn)))';--改了一下密码
Database link created
SQL> select * from dual@to_t1.world;
select * from dual@to_t1.world
ORA-00600: internal error code, arguments: [kzdlk_zt2 err], [18446744073709550603], [], [], [], [], [], []
还请英文好的兄弟指点一二。。
谢谢