Oracle 10046ʼþ
ºÜ¶àʱºò£¬¶ÔÊý¾Ý¿â½øÐÐÐÔÄÜÕï¶Ï¿ÉÒÔʹÓÃSQL¸ú×ٵķ½·¨£¬°ÑһЩÐÅÏ¢¼Ç¼ÔÚtraceÎļþÀïÒÔºó·ÖÎö¡£Ò»°ãÇé¿öÏÂÎÒÃÇ¿ÉÒÔͨ¹ý³õʼ»¯²ÎÊýSQL_TRACE=TRUEÀ´ÉèÖÃSQL¸ú×Ù¡£
ÎÒÃÇÒ²¿ÉÒÔͨ¹ýÉèÖÃ10046ʼþÀ´½øÐÐSQL¸ú×Ù£¬²¢ÇÒ¿ÉÒÔÉèÖò»Í¬µÄ¸ú×Ù¼¶±ð£¬±ÈʹÓÃSQL_TRACE»ñµÃ¸ü¶àµÄÐÅÏ¢¡£
Level 0 Í£ÓÃSQL¸ú×Ù£¬Ï൱ÓÚSQL_TRACE=FALSE
Level 1 ±ê×¼SQL¸ú×Ù£¬Ï൱ÓÚSQL_TRACE=TRUE
Level 4 ÔÚlevel 1µÄ»ù´¡ÉÏÔö¼Ó°ó¶¨±äÁ¿µÄÐÅÏ¢
Level 8 ÔÚlevel 1µÄ»ù´¡ÉÏÔö¼ÓµÈ´ýʼþµÄÐÅÏ¢
Level 12 ÔÚlevel 1µÄ»ù´¡ÉÏÔö¼Ó°ó¶¨±äÁ¿ºÍµÈ´ýʼþµÄÐÅÏ¢
10046ʼþ²»µ«¿ÉÒÔ¸ú×ÙÓû§»á»°(traceÎļþλÓÚUSER_DUMP_DEST )£¬Ò²¿ÉÒÔ¸ú×Ùbackground½ø³Ì(traceÎļþλÓÚBACKGROUND_DUMP_DEST )¡£traceÎļþµÄ´óС¾ö¶¨ÓÚ4¸öÒòËØ£º¸ú×Ù¼¶±ð£¬¸ú×Ùʱ³¤£¬»á»°µÄ»î¶¯¼¶±ðºÍMAX_DUMP_FILE_SIZE²ÎÊý¡£
ÆôÓøú×Ùʼþ10046
1.ÔÚÈ«¾ÖÉèÖÃ
Ð޸ijõʼ»¯²ÎÊý
EVENT = "10046 trace name context forever, level 8"
2.ÔÚµ±Ç°sessionÉèÖÃ
alter session set events '10046 trace name context forever, level 8';
alter session set events '10046 trace name context off';
3.¶ÔÆäËûÓû§sessionÉèÖÃ
Ê×ÏÈ»ñµÃÒª¸ú×ÙµÄsessionµÄsession idºÍserial number
select sid,serial#,username from v$session where username='TRACE_USERNAME';
exec dbms_support.start_trace_in_session(sid => 1234,serial# => 56789,waits => true,binds => true);
exec dbms_support.stop_trace_in_session(sid => 1234,serial# => 56789);
»òÕß
exec dbms_system.set_ev( 1234, 56789, 10046, 8, '');
exec dbms_system.set_ev( 1234, 56789, 10046, 0, '');
»òÕß
exec dbms_monitor.session_trace_enable(session_id => 1234,serial_num => 56789,waits => true,binds => true);
exec dbms_monitor.session_trace_disable(session_id => 1234,serial_num => 56789);
Ò²¿ÉÒÔͨ¹ýʹÓÃoradebug¹¤¾ßÀ´ÉèÖÃ10046ʼþ
Ê×ÏÈͨ¹ýV$PROCESS»ñµÃ¸ÃsessionµÄos process id¡£
select s.username, p.spid os_process_id, p.pid oracle_process_id
from v$session s, v$process p
where s.paddr = p.addr and s.username = upper('TRACE_USERNAME');
oradebug setospid 12345;
oradebug unlimit;
oradebug event 10046 t
Ïà¹ØÎĵµ£º
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
-- ²éѯij±íµÄÊý¾Ý×Öµä
SELECT A.TABLE_NAME AS "±íÃû",A.COLUMN_NAME AS "×Ö¶ÎÃû",
DECODE(A.CHAR_LENGTH,0,DECODE(A.DATA_SCALE,NULL,A.DATA_TYPE,A.DATA_TYPE||'('||A.DATA_PRECISION||','||A.DATA_SCALE||')'),
A.DATA_TYPE||'('||A.CHAR_LENGTH||')') as "×Ö¶ÎÀàÐÍ1",A.DATA_TYPE AS "×ֶΠ......
Ò»¡¢ oracle»ù´¡ÖªÊ¶
a¡¢ CRUD²Ù×÷ create read update delete
b¡¢ Êý¾Ý¿â¶ÔÏó
c¡¢ Êý¾Ý¿âÉè¼Æ
d¡¢ Êý¾Ý¿â½á¹¹ÌåϵÓÅ»¯£¨DBA£©
oracleÖдæÔÚËÄÕÅÁ·Ï°±í emp dept slmgad bonus ÕâËÄÕÅ±í£¬»¹ÓÐÒ»ÕÅdual±íÁ·Ï°±í±íÖÐÖ»ÓÐÒ»¸ö×Ö¶ÎÒ»¸öÊý ......
˵µ½Èí½âÎö£¨soft prase
£©ºÍÓ²½âÎö£¨
hard prase
£©£¬¾Í²»Äܲ»ËµÒ»ÏÂ
Oracle
¶Ô
sql
µÄ´¦Àí¹ý³Ì¡£µ±Äã·¢³öÒ»Ìõ
sql
Óï¾ä½»¸¶
Oracle
£¬ÔÚÖ´ÐкͻñÈ¡½á¹ûÇ°£¬
Oracle
¶Ô´Ë
sql
½«½øÐм¸¸ö²½ÖèµÄ´¦Àí¹ý³Ì£º
1¡¢Óï·¨¼ì²é£¨
syntax check
£©
&nb ......