# HG changeset patch # User Oleksandr Gavenko # Date 1366902425 -10800 # Node ID db9fb38505e190242435bd67e005ade5a7dfcb06 # Parent 01eecd0d108e951be2883645ec0389506d50dd3a# Parent 1668fc8198e109f991d21836cfb158539a1d69bb merged diff -r 01eecd0d108e -r db9fb38505e1 oracle.rst --- a/oracle.rst Sun Mar 24 11:06:16 2013 +0200 +++ b/oracle.rst Thu Apr 25 18:07:05 2013 +0300 @@ -60,3 +60,60 @@ select distinct tablespace_name from user_tables; +Profiling. +========== + +Timing info about last queries:: + + select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql + order by LAST_LOAD_TIME desc + +Improved version of above code:: + + column LAST_LOAD_TIME format a20; + column TIME format a20; + column MODULE format a10; + column SQL_TEXT format a60; + + set autotrace off; + set timing off; + + select * from ( + select LAST_LOAD_TIME, to_char(ELAPSED_TIME/1000, '999,999,999.000') || ' ms' as TIME, MODULE, SQL_TEXT from SYS."V_\$SQL" + where SQL_TEXT like '%BATCH_BRANCHES%' + order by LAST_LOAD_TIME desc + ) where ROWNUM <= 5; + +In SQL/Plus:: + + SET TIMING ON; + -- do stuff + SET TIMING OFF; + +or:: + + set serveroutput on + variable n number + exec :n := dbms_utility.get_time; + select ...... + exec dbms_output.put_line( (dbms_utility.get_time-:n)/100) || ' seconds....' ); + +See: + + http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2113.htm + $SQL lists statistics on shared SQL area without the GROUP BY + clause. + +Last table modification time. +============================= +:: + + select max(scn_to_timestamp(ora_rowscn)) from TBL; + + select timestamp from all_tab_modifications where table_owner = 'OWNER'; + select timestamp from all_tab_modifications where table_name = 'TABLE'; + +List of Oracle Reserved Words. +============================== + + * http://docs.oracle.com/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm diff -r 01eecd0d108e -r db9fb38505e1 xml.rst --- a/xml.rst Sun Mar 24 11:06:16 2013 +0200 +++ b/xml.rst Thu Apr 25 18:07:05 2013 +0300 @@ -78,6 +78,12 @@ Validation of xml files. ======================== +:: + + $ jing schema.rng in.xml + $ xmllint --relaxng schema.rng in.xml + +See: http://infohost.nmt.edu/tcc/help/xml/lint.html xmllint: A validator for XML files