If you face this error when querying v$session just create a a view like below:
############################################################
create view my_gv$session as
select "INST_ID",
"SADDR",
"SID",
"SERIAL#",
"AUDSID",
"PADDR",
"USER#",
"USERNAME",
"COMMAND",
"OWNERID",
"TADDR",
"LOCKWAIT",
"STATUS",
"SERVER",
"SCHEMA#",
"SCHEMANAME",
"OSUSER",
"PROCESS",
"MACHINE",
"TERMINAL",
"PROGRAM",
"TYPE",
"SQL_ADDRESS",
"SQL_HASH_VALUE",
"SQL_ID",
"SQL_CHILD_NUMBER",
"PREV_SQL_ADDR",
"PREV_HASH_VALUE",
"PREV_SQL_ID",
"PREV_CHILD_NUMBER",
"PLSQL_ENTRY_OBJECT_ID",
"PLSQL_ENTRY_SUBPROGRAM_ID",
"PLSQL_OBJECT_ID",
"PLSQL_SUBPROGRAM_ID",
"MODULE",
"MODULE_HASH",
convert(action,'utf8','utf8') "ACTION",
"ACTION_HASH",
"CLIENT_INFO",
"FIXED_TABLE_SEQUENCE",
"ROW_WAIT_OBJ#",
"ROW_WAIT_FILE#",
"ROW_WAIT_BLOCK#",
"ROW_WAIT_ROW#",
"LOGON_TIME",
"LAST_CALL_ET",
"PDML_ENABLED",
"FAILOVER_TYPE",
"FAILOVER_METHOD",
"FAILED_OVER",
"RESOURCE_CONSUMER_GROUP",
"PDML_STATUS",
"PDDL_STATUS",
"PQ_STATUS",
"CURRENT_QUEUE_DURATION",
"CLIENT_IDENTIFIER",
"BLOCKING_SESSION_STATUS",
"BLOCKING_INSTANCE",
"BLOCKING_SESSION",
"SEQ#",
"EVENT#",
"EVENT",
"P1TEXT",
"P1",
"P1RAW",
"P2TEXT",
"P2",
"P2RAW",
"P3TEXT",
"P3",
"P3RAW",
"WAIT_CLASS_ID",
"WAIT_CLASS#",
"WAIT_CLASS",
"WAIT_TIME",
"SECONDS_IN_WAIT",
"STATE",
"SERVICE_NAME",
"SQL_TRACE",
"SQL_TRACE_WAITS",
"SQL_TRACE_BINDS"
from gv$session;
############################################################
Note that the problem is when you are using UTF8 character set. You need to convert action column as below:
---
convert(action,'utf8','utf8') "ACTION",
---
Best Regards,
Paulo Portugal
No comments:
Post a Comment