[20131030]ORA-29275与toad 12.txt

[20131030]ORA-29275与toad 12.txt

$ oerr ora 29275
29275, 00000, "partial multibyte character"
// *Cause:  The requested read operation could not complete because a partial
//          multibyte character was found at the end of the input.
// *Action: Ensure that the complete multibyte character is sent from the
//          remote server and retry the operation. Or read the partial
//          multibyte character as RAW.

今天使用toad 12 (64位版本),遇到一个问题,在使用session browser模块时,出现提示:
ORA-29275: 部分多字节字符

跟踪确定在执行以下语句出错。
SELECT round(bitand(s.ownerid, 65535)) parent_session_sid, round(bitand(s.ownerid, 16711680)/65536) parent_session_instid, rawtohex(SADDR) as saddr, s.SID, s.SERIAL#,
       s.AUDSID, rawtohex(PADDR) as paddr, s.USER#, s.USERNAME, s.COMMAND, s.OWNERID, s.TADDR, s.LOCKWAIT, s.STATUS, s.SERVER, s.SCHEMA#, s.SCHEMANAME, s.OSUSER, s.PROCESS,
       s.MACHINE, s.TERMINAL, UPPER(s.PROGRAM) PROGRAM, s.TYPE, s.SQL_ADDRESS, s.SQL_HASH_VALUE, s.SQL_ID, s.SQL_CHILD_NUMBER, s.PREV_SQL_ADDR, s.PREV_HASH_VALUE,
       s.PREV_SQL_ID, s.PREV_CHILD_NUMBER, s.PLSQL_ENTRY_OBJECT_ID, s.PLSQL_ENTRY_SUBPROGRAM_ID, s.PLSQL_OBJECT_ID, s.PLSQL_SUBPROGRAM_ID, s.MODULE, s.MODULE_HASH, s.ACTION,
       s.ACTION_HASH, s.CLIENT_INFO, s.FIXED_TABLE_SEQUENCE, s.ROW_WAIT_OBJ#, s.ROW_WAIT_FILE#, s.ROW_WAIT_BLOCK#, s.ROW_WAIT_ROW#, s.LOGON_TIME, s.LAST_CALL_ET,
       s.PDML_ENABLED, s.FAILOVER_TYPE, s.FAILOVER_METHOD, s.FAILED_OVER, s.RESOURCE_CONSUMER_GROUP, s.PDML_STATUS, s.PDDL_STATUS, s.PQ_STATUS, s.CURRENT_QUEUE_DURATION,
       s.CLIENT_IDENTIFIER, s.BLOCKING_SESSION_STATUS, s.BLOCKING_INSTANCE, s.BLOCKING_SESSION, s.SEQ#, s.EVENT#, s.EVENT, s.P1TEXT, s.P1, s.P1RAW, s.P2TEXT, s.P2, s.P2RAW,
       s.P3TEXT, s.P3, s.P3RAW, s.WAIT_CLASS_ID, s.WAIT_CLASS#, s.WAIT_CLASS, s.WAIT_TIME, s.SECONDS_IN_WAIT, s.STATE, s.SERVICE_NAME, s.SQL_TRACE, s.SQL_TRACE_WAITS,
       s.SQL_TRACE_BINDS
  FROM V$SESSION S
 WHERE ( (s.USERNAME is not null)
   AND (NVL(s.osuser,'x') 'SYSTEM')
   AND (s.type            'BACKGROUND') );

我一点一点注释字段,最后确定是v$session.action字段注解后单独执行正常。

SQL> select module,action from v$session where action is not null;
MODULE               ACTION
-------------------- --------------------------------
PL/SQL Developer     Main session
PL/SQL Developer     Main session
PL/SQL Developer     SQL Window - New
PL/SQL Developer     SQL Window - New
PL/SQL Developer     SQL Window - New
PL/SQL Developer     SQL Window - 将pd_dlb中垃圾数据

--很明显,这个是使用工具PL/SQL Developer时调用DBMS_APPLICATION_INFO.set_action模块设置的。

desc v$session
Name          Null?    Type
------------- -------- ----------------------------------------------------------------------------

....
ACTION        VARCHAR2(32)
ACTION_HASH   NUMBER
...

生产系统10g版本,我与我的测试环境做了对比发现11G
ACTION   VARCHAR2(64)

--但是如果在11g下执行:

SCOTT@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
SCOTT@test> exec DBMS_APPLICATION_INFO.set_action('1234567890123456789012345678901234567890123456789012345678901文化');
PL/SQL procedure successfully completed.
SCOTT@test> select module,action from v$session where action is not null;
MODULE       ACTION
------------ ----------------------------------------------------------------
Streams      QMON Coordinator
KTSJ         KTSJ Slave
SQL*Plus     12345678901234567890123456789012
KTSJ         KTSJ Coordinator
Streams      QMON Slave
KTSJ         KTSJ Slave
KTSJ         KTSJ Slave
Streams      QMON Slave
8 rows selected.

--可以发现仅仅显示32宽度,后面的信息被截断了。如果执行如下语句,在视图v$session将显示字段action的'文'的一半进入,另外一半
--丢失。
SCOTT@test> exec DBMS_APPLICATION_INFO.set_action('1234567890123456789012345678901文化');
PL/SQL procedure successfully completed.
-- 成功!

SCOTT@test> select module,action from v$session where action is not null;
MODULE       ACTION
------------ ----------------------------------------------------------------
Streams      QMON Coordinator
KTSJ         KTSJ Slave
KTSJ         KTSJ Coordinator
Streams      QMON Slave
KTSJ         KTSJ Slave
KTSJ         KTSJ Slave
Streams      QMON Slave
SP2-0784: Invalid or incomplete character beginning 0xCE returned

8 rows selected.

--出现SP2-0784.

$ oerr SP2 0784
00784,0, "Invalid or incomplete character beginning 0x%02X returned\n"
// *Cause:  Attempted to return a string from the database that contained
//          an invalid or incomplete character.
// *Action: Replace the invalid or incomplete string in the database with
//          a valid or complete string.

--再在toad 12下查询就会出现如上错误。
ORA-29275: 部分多字节字符

--而在toad 11下这个问题不存在。

--而且很奇怪,与client有关。
使用12c的client:
16:09:50 SQL> select module,action from v$session where substr(action,1,2)='12';
未选定行

16:10:28 SQL> exec DBMS_APPLICATION_INFO.set_action('1234567890123456789012345678901文化');
PL/SQL 过程已成功完成。

16:10:31 SQL> select module,action from v$session where substr(action,1,2)='12';
MODULE                                                           ACTION
---------------------------------------------------------------- ---------------------------------------
SQL*Plus                                                         1234567890123456789012345678901

--正常!

而11g的client:
SCOTT@test> select module,action from v$session where substr(action,1,2)='12';

no rows selected

SCOTT@test> exec DBMS_APPLICATION_INFO.set_action('1234567890123456789012345678901文化');

PL/SQL procedure successfully completed.

SCOTT@test> select module,action from v$session where substr(action,1,2)='12';
MODULE       ACTION
------------ ----------------------------------------------------------------
SP2-0784: Invalid or incomplete character beginning 0xCE returned

SCOTT@test> select module,substr(action,1,31),dump(action) c60 from v$session where substr(action,1,2)='12';
MODULE       SUBSTR(ACTION,1,31)                                            C60
------------ -------------------------------------------------------------- ------------------------------------------------------------
SQL*Plus     1234567890123456789012345678901                                Typ=1 Len=32: 49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,5
                                                                            4,55,56,57,48,49,50,51,52,53,54,55,56,57,48,49,206
时间: 2024-09-21 04:25:12

[20131030]ORA-29275与toad 12.txt的相关文章

[20140327]toad 12的缺陷.txt

[20140327]toad 12的缺陷.txt 我现在使用的toad版本是12.0.0.61,64位版本.我发现使用SGA trace存在一些问题.使用自带SQL TRACKER的跟踪发现: -------------------------------------------------------------------------------- Timestamp: 2014/3/27 11:47:39 Select * from v$sql_plan Where hash_value

[20140311]toad 12 alert log viewer.txt

[20140311]toad 12 alert log viewer.txt 今天使用toad 12版本,无意中发现有一个新功能alert log viewer. database => diagnose => alert log viewer. 支持几种查看方式: entire file,Since instance starup ,today,yesterday+today,last 7days,last 1000 lines. 有了这个无需在登录服务器期查看alert*.log文件. 而

[20150924]tnsnames.ora是否可以带斜线.txt

[20150924]tnsnames.ora是否可以带斜线.txt --10g开始oracle支持ezconnect简单连接方式建立与数据库的连接. d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40:1521/test.com SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:32:43 2015 Copyright (c) 1982, 2013, Oracle.  All r

[20170307]dg环境下在线日志损坏12.txt

[20170307]dg环境下在线日志损坏12.txt http://blog.itpub.net/267265/viewspace-2134665/ http://blog.itpub.net/267265/viewspace-2134481/ --//前面的链接我测试了如果日志实时传输与应用的情况下,主库的崩溃并且在线日志删除的情况下(包括主机的备用日志)情况下, --//利用备库接收日志来恢复主库的情况.做一点点总结: 1.将备用日志拷贝过来,必须执行如下命令,加入最后应用的scn号. r

[20130217]11GR2 adrci的学习.txt

[20130217]11GR2 adrci的学习.txt 春节放假,学习一下adrci的使用.adrci (Automatic Diagnostic Repository Command Interpreter). ADRCI: Release 11.2.0.1.0 - Production on Tue Aug 21 16:35:06 2012Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved

[20140422]使用dgmgrl管理dataguard(12)

[20140422]使用dgmgrl管理dataguard(12).txt 参考链接: http://blog.itpub.net/267265/viewspace-1142649/ http://blog.itpub.net/267265/viewspace-1143027/ http://blog.itpub.net/267265/viewspace-1143058/ http://blog.itpub.net/267265/viewspace-1143126/ http://blog.it

hamsterdb Embedded Storage 1.1.12发布

hamsterdb Embedded Storage 1.1.12这个版本是1.1.11修正版,解决高速缓存清除程序的问题.他们已知该问题,但从来没有成功的解决,从而导致内存消耗增长.现在修正内存消耗变得更加稳定.来源,变更记录,并预编译的Win32库可供下载. hamsterdb Embedded Storage是一个嵌入式数据库引擎使用ANSI-C语言编写.它包含可变长度的密钥,并记录B+Trees.它支持内存数据库和尾数无关的文件,数据库游标,多个数据库在一个文件中,"record num

php 去除txt文本重复数据

 因为是  13503594262 13503594262 13243694429 13503594262 13880561750 13404776999 15675167006 这种格式,所有我们就用file把文本直接载入到数组 $array = file($file); 用print_r输出 Array (     [0] => 13688179054     [1] => 13652179481     [2] => 13545684587     [3] => 137870

[20140226]tnsnames.ora别名之间使用逗号

[20140226]tnsname.ora别名之间使用逗号.txt 前几天看到别人在tnsnames.ora中定义中出现如下的定义: 40,40test =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.XXX.40)(PORT = 1521))     )     (CONNECT_DATA =       (SERVER = DEDICATED)       (SER