From af1b40838a4fefbe570c10ccc25da421666a0fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ibhear=20=C3=93=20hAnluain?= Date: Tue, 11 Oct 2016 21:21:19 +0100 Subject: [PATCH] Adding some docs. They'll need updating and renaming if they are to be of any use --- docs/enode-oracle-objects.txt | 319 ++++++ docs/enode-pls-syntax.txt | 34 + docs/enode-sql.sql | 2037 +++++++++++++++++++++++++++++++++ 3 files changed, 2390 insertions(+) create mode 100755 docs/enode-oracle-objects.txt create mode 100755 docs/enode-pls-syntax.txt create mode 100755 docs/enode-sql.sql diff --git a/docs/enode-oracle-objects.txt b/docs/enode-oracle-objects.txt new file mode 100755 index 0000000..1dbfdba --- /dev/null +++ b/docs/enode-oracle-objects.txt @@ -0,0 +1,319 @@ +USER% +----- + TABLES + ------ + USER$ SYS + USER_ASTATUS_MAP SYS + USER_HISTORY$ SYS + USER_CS_SRS MDSYS + USER_TRANSFORM_MAP MDSYS + + SYNONYMS + -------- + USER_ALL_TABLES PUBLIC + Name Null? Type + ----------------------------------------- -------- -------------- + TABLE_NAME VARCHAR2(30) + TABLESPACE_NAME VARCHAR2(30) + CLUSTER_NAME VARCHAR2(30) + IOT_NAME VARCHAR2(30) + PCT_FREE NUMBER + PCT_USED NUMBER + INI_TRANS NUMBER + MAX_TRANS NUMBER + INITIAL_EXTENT NUMBER + NEXT_EXTENT NUMBER + MIN_EXTENTS NUMBER + MAX_EXTENTS NUMBER + PCT_INCREASE NUMBER + FREELISTS NUMBER + FREELIST_GROUPS NUMBER + LOGGING VARCHAR2(3) + BACKED_UP VARCHAR2(1) + NUM_ROWS NUMBER + BLOCKS NUMBER + EMPTY_BLOCKS NUMBER + AVG_SPACE NUMBER + CHAIN_CNT NUMBER + AVG_ROW_LEN NUMBER + AVG_SPACE_FREELIST_BLOCKS NUMBER + NUM_FREELIST_BLOCKS NUMBER + DEGREE VARCHAR2(10) + INSTANCES VARCHAR2(10) + CACHE VARCHAR2(5) + TABLE_LOCK VARCHAR2(8) + SAMPLE_SIZE NUMBER + LAST_ANALYZED DATE + PARTITIONED VARCHAR2(3) + IOT_TYPE VARCHAR2(12) + OBJECT_ID_TYPE VARCHAR2(16) + TABLE_TYPE_OWNER VARCHAR2(30) + TABLE_TYPE VARCHAR2(30) + TEMPORARY VARCHAR2(1) + SECONDARY VARCHAR2(1) + NESTED VARCHAR2(3) + BUFFER_POOL VARCHAR2(7) + ROW_MOVEMENT VARCHAR2(8) + GLOBAL_STATS VARCHAR2(3) + USER_STATS VARCHAR2(3) + DURATION VARCHAR2(15) + SKIP_CORRUPT VARCHAR2(8) + MONITORING VARCHAR2(3) + CLUSTER_OWNER VARCHAR2(30) + DEPENDENCIES VARCHAR2(8) + COMPRESSION VARCHAR2(8) + USER_APPLICATION_ROLES PUBLIC + Name Null? Type + -------------------------------- -------- ----------------------- + ROLE NOT NULL VARCHAR2(30) + SCHEMA NOT NULL VARCHAR2(30) + PACKAGE NOT NULL VARCHAR2(30) + USER_AQ_AGENT_PRIVS PUBLIC + USER_ARGUMENTS PUBLIC + USER_ASSOCIATIONS PUBLIC + USER_ATTRIBUTE_TRANSFORMATIONS PUBLIC + USER_AUDIT_OBJECT PUBLIC + USER_AUDIT_POLICIES PUBLIC + USER_AUDIT_SESSION PUBLIC + USER_AUDIT_STATEMENT PUBLIC + USER_AUDIT_TRAIL PUBLIC + USER_AWS PUBLIC + USER_AW_PS PUBLIC + USER_BASE_TABLE_MVIEWS PUBLIC + USER_CATALOG PUBLIC + USER_CLUSTERS PUBLIC + USER_CLUSTER_HASH_EXPRESSIONS PUBLIC + USER_CLU_COLUMNS PUBLIC + USER_COLL_TYPES PUBLIC + USER_COL_COMMENTS PUBLIC + USER_COL_PRIVS PUBLIC + USER_COL_PRIVS_MADE PUBLIC + USER_COL_PRIVS_RECD PUBLIC + USER_CONSTRAINTS PUBLIC + USER_CONS_COLUMNS PUBLIC + USER_CONS_OBJ_COLUMNS PUBLIC + USER_DB_LINKS PUBLIC + USER_DEPENDENCIES PUBLIC + USER_DIMENSIONS PUBLIC + USER_DIM_ATTRIBUTES PUBLIC + USER_DIM_CHILD_OF PUBLIC + USER_DIM_HIERARCHIES PUBLIC + USER_DIM_JOIN_KEY PUBLIC + USER_DIM_LEVELS PUBLIC + USER_DIM_LEVEL_KEY PUBLIC + USER_ERRORS PUBLIC + USER_EVALUATION_CONTEXTS PUBLIC + USER_EVALUATION_CONTEXT_TABLES PUBLIC + USER_EVALUATION_CONTEXT_VARS PUBLIC + USER_EXTENTS PUBLIC + USER_EXTERNAL_LOCATIONS PUBLIC + USER_EXTERNAL_TABLES PUBLIC + USER_FREE_SPACE PUBLIC + USER_GEOMETRY_COLUMNS PUBLIC + USER_HISTOGRAMS PUBLIC + USER_INDEXES PUBLIC + USER_INDEXTYPES PUBLIC + USER_INDEXTYPE_COMMENTS PUBLIC + USER_INDEXTYPE_OPERATORS PUBLIC + USER_IND_COLUMNS PUBLIC + USER_IND_EXPRESSIONS PUBLIC + USER_IND_PARTITIONS PUBLIC + USER_IND_SUBPARTITIONS PUBLIC + USER_INTERNAL_TRIGGERS PUBLIC + USER_JAVA_ARGUMENTS PUBLIC + USER_JAVA_CLASSES PUBLIC + USER_JAVA_DERIVATIONS PUBLIC + USER_JAVA_FIELDS PUBLIC + USER_JAVA_IMPLEMENTS PUBLIC + USER_JAVA_INNERS PUBLIC + USER_JAVA_LAYOUTS PUBLIC + USER_JAVA_METHODS PUBLIC + USER_JAVA_NCOMPS PUBLIC + USER_JAVA_POLICY PUBLIC + USER_JAVA_RESOLVERS PUBLIC + USER_JAVA_THROWS PUBLIC + USER_JOBS PUBLIC + USER_JOIN_IND_COLUMNS PUBLIC + USER_LIBRARIES PUBLIC + USER_LOBS PUBLIC + USER_LOB_PARTITIONS PUBLIC + USER_LOB_SUBPARTITIONS PUBLIC + USER_LOB_TEMPLATES PUBLIC + USER_LOG_GROUPS PUBLIC + USER_LOG_GROUP_COLUMNS PUBLIC + USER_METHOD_PARAMS PUBLIC + USER_METHOD_RESULTS PUBLIC + USER_MVIEWS PUBLIC + USER_MVIEW_AGGREGATES PUBLIC + USER_MVIEW_ANALYSIS PUBLIC + USER_MVIEW_DETAIL_RELATIONS PUBLIC + USER_MVIEW_JOINS PUBLIC + USER_MVIEW_KEYS PUBLIC + USER_MVIEW_LOGS PUBLIC + USER_MVIEW_REFRESH_TIMES PUBLIC + USER_NESTED_TABLES PUBLIC + USER_OBJECTS PUBLIC + USER_OBJECT_SIZE PUBLIC + USER_OBJECT_TABLES PUBLIC + USER_OBJ_AUDIT_OPTS PUBLIC + USER_OBJ_COLATTRS PUBLIC + USER_OPANCILLARY PUBLIC + USER_OPARGUMENTS PUBLIC + USER_OPBINDINGS PUBLIC + USER_OPERATORS PUBLIC + USER_OPERATOR_COMMENTS PUBLIC + USER_OUTLINES PUBLIC + USER_OUTLINE_HINTS PUBLIC + USER_PARTIAL_DROP_TABS PUBLIC + USER_PART_COL_STATISTICS PUBLIC + USER_PART_HISTOGRAMS PUBLIC + USER_PART_INDEXES PUBLIC + USER_PART_KEY_COLUMNS PUBLIC + USER_PART_LOBS PUBLIC + USER_PART_TABLES PUBLIC + USER_PASSWORD_LIMITS PUBLIC + USER_PENDING_CONV_TABLES PUBLIC + USER_POLICIES PUBLIC + USER_POLICY_CONTEXTS PUBLIC + USER_POLICY_GROUPS PUBLIC + USER_PROCEDURES PUBLIC + USER_PROXIES PUBLIC + USER_PUBLISHED_COLUMNS PUBLIC + USER_QUEUES PUBLIC + USER_QUEUE_PUBLISHERS PUBLIC + USER_QUEUE_SCHEDULES PUBLIC + USER_QUEUE_TABLES PUBLIC + USER_REFRESH PUBLIC + USER_REFRESH_CHILDREN PUBLIC + USER_REFS PUBLIC + USER_REGISTERED_MVIEWS PUBLIC + USER_REGISTERED_SNAPSHOTS PUBLIC + USER_REGISTRY PUBLIC + USER_REPAUDIT_ATTRIBUTE PUBLIC + USER_REPAUDIT_COLUMN PUBLIC + USER_REPCAT PUBLIC + USER_REPCATLOG PUBLIC + USER_REPCAT_REFRESH_TEMPLATES PUBLIC + USER_REPCAT_TEMPLATE_OBJECTS PUBLIC + USER_REPCAT_TEMPLATE_PARMS PUBLIC + USER_REPCAT_TEMPLATE_SITES PUBLIC + USER_REPCAT_USER_AUTHORIZATION PUBLIC + USER_REPCAT_USER_PARM_VALUES PUBLIC + USER_REPCOLUMN PUBLIC + USER_REPCOLUMN_GROUP PUBLIC + USER_REPCONFLICT PUBLIC + USER_REPDDL PUBLIC + USER_REPFLAVORS PUBLIC + USER_REPFLAVOR_COLUMNS PUBLIC + USER_REPFLAVOR_OBJECTS PUBLIC + USER_REPGENERATED PUBLIC + USER_REPGENOBJECTS PUBLIC + USER_REPGROUP PUBLIC + USER_REPGROUPED_COLUMN PUBLIC + USER_REPGROUP_PRIVILEGES PUBLIC + USER_REPKEY_COLUMNS PUBLIC + USER_REPOBJECT PUBLIC + USER_REPPARAMETER_COLUMN PUBLIC + USER_REPPRIORITY PUBLIC + USER_REPPRIORITY_GROUP PUBLIC + USER_REPPROP PUBLIC + USER_REPRESOLUTION PUBLIC + USER_REPRESOLUTION_METHOD PUBLIC + USER_REPRESOLUTION_STATISTICS PUBLIC + USER_REPRESOL_STATS_CONTROL PUBLIC + USER_REPSCHEMA PUBLIC + USER_REPSITES PUBLIC + USER_RESOURCE_LIMITS PUBLIC + USER_RESUMABLE PUBLIC + USER_ROLE_PRIVS PUBLIC + USER_RSRC_CONSUMER_GROUP_PRIVS PUBLIC + USER_RSRC_MANAGER_SYSTEM_PRIVS PUBLIC + USER_RULES PUBLIC + USER_RULESETS PUBLIC + USER_RULE_SETS PUBLIC + USER_RULE_SET_RULES PUBLIC + USER_SDO_GEOM_METADATA PUBLIC + USER_SDO_INDEX_INFO PUBLIC + USER_SDO_INDEX_METADATA PUBLIC + USER_SDO_LRS_METADATA PUBLIC + USER_SDO_MAPS PUBLIC + USER_SDO_STYLES PUBLIC + USER_SDO_THEMES PUBLIC + USER_SECONDARY_OBJECTS PUBLIC + USER_SEGMENTS PUBLIC + USER_SEQUENCES PUBLIC + USER_SNAPSHOTS PUBLIC + USER_SNAPSHOT_LOGS PUBLIC + USER_SNAPSHOT_REFRESH_TIMES PUBLIC + USER_SOURCE PUBLIC + USER_SOURCE_TABLES PUBLIC + USER_SOURCE_TAB_COLUMNS PUBLIC + USER_SQLJ_TYPES PUBLIC + USER_SQLJ_TYPE_ATTRS PUBLIC + USER_SQLJ_TYPE_METHODS PUBLIC + USER_STORED_SETTINGS PUBLIC + USER_SUBPARTITION_TEMPLATES PUBLIC + USER_SUBPART_COL_STATISTICS PUBLIC + USER_SUBPART_HISTOGRAMS PUBLIC + USER_SUBPART_KEY_COLUMNS PUBLIC + USER_SUBSCRIBED_COLUMNS PUBLIC + USER_SUBSCRIBED_TABLES PUBLIC + USER_SUBSCRIPTIONS PUBLIC + USER_SUMMARIES PUBLIC + USER_SUMMARY_AGGREGATES PUBLIC + USER_SUMMARY_DETAIL_TABLES PUBLIC + USER_SUMMARY_JOINS PUBLIC + USER_SUMMARY_KEYS PUBLIC + USER_SYNONYMS PUBLIC + USER_SYS_PRIVS PUBLIC + USER_TABLES PUBLIC + USER_TABLESPACES PUBLIC + USER_TAB_COLS PUBLIC + USER_TAB_COLUMNS PUBLIC + USER_TAB_COL_STATISTICS PUBLIC + USER_TAB_COMMENTS PUBLIC + USER_TAB_HISTOGRAMS PUBLIC + USER_TAB_MODIFICATIONS PUBLIC + USER_TAB_PARTITIONS PUBLIC + USER_TAB_PRIVS PUBLIC + USER_TAB_PRIVS_MADE PUBLIC + USER_TAB_PRIVS_RECD PUBLIC + USER_TAB_SUBPARTITIONS PUBLIC + USER_TRANSFORMATIONS PUBLIC + USER_TRIGGERS PUBLIC + USER_TRIGGER_COLS PUBLIC + USER_TS_QUOTAS PUBLIC + USER_TYPES PUBLIC + USER_TYPE_ATTRS PUBLIC + USER_TYPE_METHODS PUBLIC + USER_TYPE_VERSIONS PUBLIC + USER_UNUSED_COL_TABS PUBLIC + USER_UPDATABLE_COLUMNS PUBLIC + USER_USERS PUBLIC + USER_USTATS PUBLIC + USER_VARRAYS PUBLIC + USER_VIEWS PUBLIC + USER_WM_LOCKED_TABLES PUBLIC + USER_WM_MODIFIED_TABLES PUBLIC + USER_WM_PRIVS PUBLIC + USER_WM_RIC_INFO PUBLIC + USER_WM_TAB_TRIGGERS PUBLIC + USER_WM_VERSIONED_TABLES PUBLIC + USER_WM_VT_ERRORS PUBLIC + USER_WORKSPACES PUBLIC + USER_WORKSPACE_PRIVS PUBLIC + USER_WORKSPACE_SAVEPOINTS PUBLIC + USER_XML_SCHEMAS PUBLIC + USER_XML_TABLES PUBLIC + USER_XML_TAB_COLS PUBLIC + USER_XML_VIEWS PUBLIC + USER_XML_VIEW_COLS PUBLIC + + VIEWS + ----- + + SEQUENCES + --------- + USERHISTORY_SEQ WORKFLOW + USERID_SEQ WORKFLOW + \ No newline at end of file diff --git a/docs/enode-pls-syntax.txt b/docs/enode-pls-syntax.txt new file mode 100755 index 0000000..27fafb1 --- /dev/null +++ b/docs/enode-pls-syntax.txt @@ -0,0 +1,34 @@ +assignment_statement ::= + { collection_name [ (index) ] + | cursor_variable_name + | : host_cursor_variable_name + | : host_variable_name [ :indicator_name ] + | object_name [ .attribute_name ] + | parameter_name + | record_name [ .field_name ] + | variable_name + } := expression; + +plsql_block ::= + [ << label_name >> ] + [ DECLARE ] + [ { type_definition | item_definition } + [ type_definition | item_definition ] ... ] + [ {function_declaration | procedure_declaration } + [ function_declaration | procedure_declaration] ... ] + BEGIN statement [statement ...] + [ EXCEPTION exception_handler [exception_handler ...] ] + END [ label_name ] ; + +type_definition ::= + { record_type_definition + | ref_cursor_type_definition + | table_type_definition + | subtype_definition + | varray_type_definition + } + +subtype_definition ::= + subtype_definition ::= +SUBTYPE subtype_name IS base_type + [ (constraint) ] [ NOT NULL ]; \ No newline at end of file diff --git a/docs/enode-sql.sql b/docs/enode-sql.sql new file mode 100755 index 0000000..e78a752 --- /dev/null +++ b/docs/enode-sql.sql @@ -0,0 +1,2037 @@ +# This file contains all the SQL statements used by DBAComp +# for the version mentionned in the square brackets below +[9.2] +lock_holders1: select s.username, + s.osuser, + s.sid, + s.serial#, + l.type "Lock type", + decode ( l.lmode, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode held", + decode ( l.request, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode requested", + o.name "Object name", + decode ( o.type#, + null, null, + 0, 'NEXT OBJECT', + 1, 'INDEX', + 2, 'TABLE', + 3, 'CLUSTER', + 4, 'VIEW', + 5, 'SYNONYM', + 6, 'SEQUENCE', + 7, 'PROCEDURE', + 8, 'FUNCTION', + 9, 'PACKAGE', + 11, 'PACKAGE BODY', + 12, 'TRIGGER', + 13, 'TYPE', + 14, 'TYPE BODY', + 19, 'TABLE PARTITION', + /* 20, 'INDEX PARTITION', + 21, 'LOB', + 22, 'LIBRARY', + 23, 'DIRECTORY', + 24, 'QUEUE', + 28, 'JAVA SOURCE', + 29, 'JAVA CLASS', + 30, 'JAVA RESOURCE', + 32, 'INDEXTYPE', + 33, 'OPERATOR', + 34, 'TABLE SUBPARTITION', + 35, 'INDEX SUBPARTITION', + 39, 'LOB PARTITION', + 40, 'LOB SUBPARTITION', + 43, 'DIMENSION', + 44, 'CONTEXT', + 47, 'RESOURCE PLAN', */ + 48, 'CONSUMER GROUP', + 51, 'SUBSCRIPTION', + 52, 'LOCATION', + 56, 'JAVA DATA', + 'UNDEFINED' + ) "Object type", + u.name "Object owner", + s.row_wait_obj#, + s.row_wait_block#, + s.row_wait_row#, + s.row_wait_file#, + l.id1, + l.id2 + from v$lock l, + v$session s, + sys.obj$ o, + sys.user$ u + where l.sid = s.sid + and l.request = 0 + and s.row_wait_obj# = o.obj#(+) + and o.owner# = u.user# (+) + order by s.username, + s.sid, + l.type + +lock_holders: select ls.username, + ls.osuser, + ls.sid, + ls.serial#, + ls.type "Lock type", + decode ( ls.lmode, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode held", + decode ( ls.request, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode requested", + o.name "Object name", + o.type#, + decode ( o.type#, + null, null, + 0, 'NEXT OBJECT', + 1, 'INDEX', + 2, 'TABLE', + 3, 'CLUSTER', + 4, 'VIEW', + 5, 'SYNONYM', + 6, 'SEQUENCE', + 7, 'PROCEDURE', + 8, 'FUNCTION', + 9, 'PACKAGE', + 11, 'PACKAGE BODY', + 12, 'TRIGGER', + 13, 'TYPE', + 14, 'TYPE BODY', + 19, 'TABLE PARTITION', + 20, 'INDEX PARTITION', + 21, 'LOB', + 22, 'LIBRARY', + 23, 'DIRECTORY', + 24, 'QUEUE', + 28, 'JAVA SOURCE', + 29, 'JAVA CLASS', + 30, 'JAVA RESOURCE', + 32, 'INDEXTYPE', + 33, 'OPERATOR', + 34, 'TABLE SUBPARTITION', + 35, 'INDEX SUBPARTITION', + 39, 'LOB PARTITION', + 40, 'LOB SUBPARTITION', + 43, 'DIMENSION', + 44, 'CONTEXT', + 47, 'RESOURCE PLAN', + 48, 'CONSUMER GROUP', + 51, 'SUBSCRIPTION', + 52, 'LOCATION', + 56, 'JAVA DATA', + 'UNDEFINED' + ) "Object type", + u.name "Object owner", + ls.row_wait_obj#, + ls.row_wait_block#, + ls.row_wait_row#, + ls.row_wait_file#, + ls.id1, + ls.id2 + from ( select s.username, + s.osuser, + s.serial#, + s.row_wait_obj#, + s.row_wait_block#, + s.row_wait_row#, + s.row_wait_file#, + l.*, + decode ( s.row_wait_obj#, + -1, decode ( l.id2, + 0, l.id1, + null + ), + s.row_wait_obj# + ) objid + from v$lock l, + v$session s + where l.sid = s.sid + ) ls, + sys.obj$ o, + sys.user$ u + where ls.request = 0 + and ls.objid = o.obj#(+) + and o.owner# = u.user# (+) + order by ls.username, + ls.sid, + ls.type + + +lock_waiters: select ls.username, + ls.osuser, + ls.sid, + ls.serial#, + ls.type "Lock type", + decode ( ls.lmode, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode held", + decode ( ls.request, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode requested", + o.name "Object name", + o.type#, + decode ( o.type#, + null, null, + 0, 'NEXT OBJECT', + 1, 'INDEX', + 2, 'TABLE', + 3, 'CLUSTER', + 4, 'VIEW', + 5, 'SYNONYM', + 6, 'SEQUENCE', + 7, 'PROCEDURE', + 8, 'FUNCTION', + 9, 'PACKAGE', + 11, 'PACKAGE BODY', + 12, 'TRIGGER', + 13, 'TYPE', + 14, 'TYPE BODY', + 19, 'TABLE PARTITION', + 20, 'INDEX PARTITION', + 21, 'LOB', + 22, 'LIBRARY', + 23, 'DIRECTORY', + 24, 'QUEUE', + 28, 'JAVA SOURCE', + 29, 'JAVA CLASS', + 30, 'JAVA RESOURCE', + 32, 'INDEXTYPE', + 33, 'OPERATOR', + 34, 'TABLE SUBPARTITION', + 35, 'INDEX SUBPARTITION', + 39, 'LOB PARTITION', + 40, 'LOB SUBPARTITION', + 43, 'DIMENSION', + 44, 'CONTEXT', + 47, 'RESOURCE PLAN', + 48, 'CONSUMER GROUP', + 51, 'SUBSCRIPTION', + 52, 'LOCATION', + 56, 'JAVA DATA', + 'UNDEFINED' + ) "Object type", + u.name "Object owner", + ls.row_wait_obj#, + ls.row_wait_block#, + ls.row_wait_row#, + ls.row_wait_file#, + ls.id1, + ls.id2 + from ( select s.username, + s.osuser, + s.serial#, + s.row_wait_obj#, + s.row_wait_block#, + s.row_wait_row#, + s.row_wait_file#, + l.*, + decode ( s.row_wait_obj#, + -1, decode ( l.id2, + 0, l.id1, + null + ), + s.row_wait_obj# + ) objid + from v$lock l, + v$session s + where l.sid = s.sid + ) ls, + sys.obj$ o, + sys.user$ u + where ls.request != 0 + and ls.objid = o.obj#(+) + and o.owner# = u.user# (+) + order by ls.username desc, + ls.sid, + ls.type + +lock_waiters1: select s.username, + s.osuser, + s.sid, + s.serial#, + l.type "Lock type", + decode ( l.lmode, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode held", + decode ( l.request, + 0, 'NONE', + 1, 'NULL', + 2, 'ROW SHARE', + 3, 'ROW EXCLUSIVE', + 4, 'SHARE', + 5, 'SHARE ROW EXCLUSIVE', + 6, 'EXCLUSIVE', + '?' + ) "Mode requested", + o.name "Object name", + o.type#, + decode ( o.type#, + null, null, + 0, 'NEXT OBJECT', + 1, 'INDEX', + 2, 'TABLE', + 3, 'CLUSTER', + 4, 'VIEW', + 5, 'SYNONYM', + 6, 'SEQUENCE', + 7, 'PROCEDURE', + 8, 'FUNCTION', + 9, 'PACKAGE', + 11, 'PACKAGE BODY', + 12, 'TRIGGER', + 13, 'TYPE', + 14, 'TYPE BODY', + 19, 'TABLE PARTITION', +/* 20, 'INDEX PARTITION', + 21, 'LOB', + 22, 'LIBRARY', + 23, 'DIRECTORY', + 24, 'QUEUE', + 28, 'JAVA SOURCE', + 29, 'JAVA CLASS', + 30, 'JAVA RESOURCE', + 32, 'INDEXTYPE', + 33, 'OPERATOR', + 34, 'TABLE SUBPARTITION', + 35, 'INDEX SUBPARTITION', + 39, 'LOB PARTITION', + 40, 'LOB SUBPARTITION', + 43, 'DIMENSION', + 44, 'CONTEXT', + 47, 'RESOURCE PLAN', */ + 48, 'CONSUMER GROUP', + 51, 'SUBSCRIPTION', + 52, 'LOCATION', + 56, 'JAVA DATA', + 'UNDEFINED' + ) "Object type", + u.name "Object owner", + s.row_wait_obj#, + s.row_wait_block#, + s.row_wait_row#, + s.row_wait_file#, + l.id1, + l.id2 + from v$lock l, + v$session s, + sys.obj$ o, + sys.user$ u + where l.sid = s.sid + and l.request != 0 + and s.row_wait_obj# = o.obj#(+) + and o.owner# = u.user# (+) + order by s.username desc, + s.sid, + l.type + +register_application: begin + dbms_application_info.set_client_info ( + 'DBAComp V. '||:1 + ); + end; +dba_rollback_segs_per_rbs: select rs.optsize, + r.* + from v$rollstat rs, + dba_rollback_segs r + where r.segment_id = rs.usn (+) + and r.segment_name = :1 +dba_tablespaces_per_tablespace: select * + from dba_tablespaces + where tablespace_name = :1 +first_file: select file_name + from dba_data_files + where file_id = ( select min ( file_id ) + from dba_data_files + where tablespace_name = :1 + ) +v_parameter_per_parameter: select * + from v$parameter + where name = :1 +sys_props_per_prop: select value$ + from sys.props$ + where name = :1 +dba_constraints_per_view: select * + from dba_constraints + where owner = :1 + and table_name = :2 + and constraint_type = 'V' + order by constraint_name +dba_views_per_view: select * + from dba_views + where owner = :1 + and view_name = :2 +dba_triggers_per_trigger: select * + from dba_triggers + where owner = :1 + and trigger_name = :2 +dba_sequences_per_sequence: select * + from dba_sequences + where sequence_owner = :1 + and sequence_name = :2 +free_space_deficit: select nvl ( fs.max_fragment - s.next_extent, + 0 + ) "Space remaining", + nvl ( fs.max_fragment, 0 ) "Largest free fragment", + nvl ( fs.no_fragments, 0 ) "# of fragments", + s.tablespace_name, + s.next_extent "Largest next extent", + t.segment_name, + t.owner, + t.segment_type, + t.initial_extent, + t.next_extent, + t.pct_increase + from ( select max ( x.next_extent ) next_extent, + x.tablespace_name tablespace_name + from dba_segments x + group by tablespace_name + ) s, + dba_segments t, + ( select max ( bytes ) max_fragment, + tablespace_name fs_name, + count ( tablespace_name ) no_fragments + from dba_free_space + group by tablespace_name + ) fs + where s.tablespace_name = fs.fs_name (+) + and t.next_extent = s.next_extent + and t.tablespace_name = s.tablespace_name + order by 1 +dba_db_links_per_db_link: select u.name owner, + l.name db_link, + l.userid username, + l.password password, + l.host host + from sys.link$ l, + sys.user$ u + where l.owner# = u.user# + and u.name = :1 + and l.name = :2 +dba_synonyms_per_synonym: select * + from dba_synonyms + where owner = :1 + and synonym_name = :2 +free_space: select dbf.tbsd TABLESPACE_NAME, + dbf.filenum "#FILES", + round ( dbf.Tbs_Size, 2 ) "SIZE", + nvl ( round ( fsp.Free, 2 ), 0 ) FREE, + nvl ( round ( fsp.Free / dbf.Tbs_Size * 100, 1 ), + 0 ) "%FREE", + nvl ( fsp.Fragments, 0 ) "Free Space Fragments" + from ( ( select tablespace_name Tablespace, + sum ( bytes ) / 1024 / 1024 Free, + count ( bytes ) Fragments + from dba_free_space + group by tablespace_name + union + select h.tablespace_name Tablespace, + h.bytes_free / 1024 / 1024 Free, + ( select count(*) + from v$temp_extent_map + where tablespace_name = h.tablespace_name + ) Fragments + from v$temp_space_header h + ) + ) fsp, + ( select tablespace_name tbsd, + sum ( bytes ) / 1024 / 1024 Tbs_Size, + count(*) filenum + from ( select dba_data_files.* + from dba_data_files + union + select dba_temp_files.* + from dba_temp_files + ) + group by tablespace_name + ) dbf + where dbf.tbsd = fsp.Tablespace(+) + order by "%FREE" + +#free_space: select dbf.tbsd TABLESPACE_NAME, \ +# dbf.filenum "#FILES", \ +# round(dbf.Tbs_Size,2) "SIZE", \ +# nvl(round(fsp.Free,2),0) FREE, \ +# nvl(round(fsp.Free/dbf.Tbs_Size*100,1),0) "%FREE", \ +# nvl(fsp.Fragments,0) "Free Space Fragments" \ +# from ( select tablespace_name Tablespace, \ +# sum(bytes)/1024/1024 Free, \ +# count(bytes) Fragments \ +# from dba_free_space \ +# group by tablespace_name) fsp, \ +# ( select tablespace_name tbsd, \ +# sum(bytes)/1024/1024 Tbs_Size, \ +# count(*) filenum \ +# from dba_data_files \ +# group by tablespace_name) dbf \ +# where dbf.tbsd=fsp.Tablespace(+) \ +# order by "%FREE" +dba_indexes_per_index: select * + from dba_indexes + where owner = :1 + and index_name = :2 +dba_constraints_per_constraint: select CONSTRAINT_TYPE, + SEARCH_CONDITION, + R_OWNER, + R_CONSTRAINT_NAME, + DELETE_RULE, + table_name + from dba_constraints + where owner = :1 + and constraint_name = :2 +dba_tables_params: select pct_free, + pct_used, + ini_trans, + max_trans, + degree, + cluster_name, + tablespace_name + from dba_tables + where owner = :1 + and table_name = :2 +dba_segments_storage: select INITIAL_EXTENT, + NEXT_EXTENT, + MIN_EXTENTS, + MAX_EXTENTS, + PCT_INCREASE, + FREELISTS, + FREELIST_GROUPS + from dba_segments + where owner = :1 + and segment_name = :2 + and segment_type = :3 +v_archived_log: select * + from v$archived_log + order by recid +extents_left: select * + from ( select ( max_extents - extents ) "Extents left", + round ( ( max_extents-extents ) / + decode ( max_extents, + 0, extents, + max_extents + ) * + 100, + 2 + ) "Pct left", + extents, + max_extents, + owner, + segment_type, + segment_name, + tablespace_name, + initial_extent, + next_extent + from dba_segments + order by 1 + ) + where rownum < 11 +v_process_per_session: select p.* + from v$process p, + v$session s + where s.sid = :1 + and s.paddr = p.addr + +v_session_event_per_session: select * + from v$session_event + where sid = :1 + order by event +v_access_per_session: select * + from v$access + where sid = :1 + order by type, + object +prev_sql_per_session: select a.* + from v$sqlarea a, + v$session s + where a.address = s.prev_sql_addr + and s.sid = :1 +cur_sql_per_session: select a.* + from v$sqlarea a, + v$session s + where a.address = s.sql_address + and s.sid = :1 +v_transaction_per_session: select t.* + from v$transaction t, + v$session s + where t.ses_addr = s.saddr + and s.sid = :1 +v_session_connect_info_per_session: select * + from v$session_connect_info + where sid = :1 +v_session_wait_per_session: select * + from v$session_wait + where sid = :1 + order by seq# +v_sess_io_per_session: select * + from v$sess_io + where sid = :1 +v_open_cursor_per_session: SELECT V$SQLAREA.SQL_TEXT, + V$OPEN_CURSOR.HASH_VALUE, + rawtohex ( V$OPEN_CURSOR.address ) ADDRESS + FROM V$OPEN_CURSOR, + v$sqlarea, + v$session + WHERE V$OPEN_CURSOR.SADDR = v$session.saddr + and v$sqlarea.address = V$OPEN_CURSOR.address + and v$session.sid = :1 +v_sesstat_per_session: select n.name, + s.value + from v$statname n, + v$sesstat s + where n.statistic# = s.statistic# + and s.sid=:1 + order by n.name +v_logfile_per_redolog_group: select * + from v$logfile + where group# = :1 +v_filestat_per_data_file: select * + from v$filestat + where file# = :1 +v_rollstat_per_rbs: select * + from v$rollstat + where usn = :1 +dba_segments_per_rbs: select seg.* + from dba_segments seg, + dba_rollback_segs rbs + where seg.segment_name = rbs.segment_name + and rbs.segment_id = :1 + and seg.segment_type = 'ROLLBACK' +v_session_per_rbs: SELECT V$LOCK.SID, + serial#, + V$SESSION.USERNAME, + V$SESSION.COMMAND, + V$SESSION.LOCKWAIT, + V$SESSION.STATUS, + V$SESSION.SCHEMANAME, + V$SESSION.SERVER, + V$SESSION.OSUSER, + V$SESSION.PROCESS, + V$SESSION.MACHINE, + V$SESSION.TERMINAL, + V$SESSION.PROGRAM, V$SESSION.TYPE + FROM V$LOCK, + V$SESSION + WHERE ( V$LOCK.SID = V$SESSION.SID ) + and ( V$LOCK.TYPE = 'TX' ) + AND ( trunc ( V$LOCK.ID1 / 65536 ) = :1 ) + ORDER BY V$SESSION.USERNAME ASC +dba_extents_per_rbs: select ext.* + from dba_extents ext, + dba_rollback_segs rbs + where ext.segment_name = rbs.segment_name + and rbs.segment_id=:1 + and ext.segment_type='ROLLBACK' + order by ext.extent_id + +dba_role_privs_per_role: select * + from dba_role_privs + where granted_role = :1 + order by grantee +dba_sys_privs_per_role: select * + from dba_sys_privs + where grantee = :1 + order by privilege +dba_tab_privs_per_role: select * + from dba_tab_privs + where grantee = :1 + order by owner, + table_name +dba_col_privs_per_role: select * + from dba_col_privs + where grantee = :1 + order by owner, + table_name, + column_name +tbs_no: select count ( tablespace_name ) + from dba_tablespaces +rbs_no: select count ( segment_name ) + from dba_rollback_segs +file_no_dbsize: select count ( file_name ), + sum ( bytes ) / ( 1024 * 1024 ) + from dba_data_files +redo_no: select count ( member ), + count ( distinct group# ) + from v$logfile t +user_no: select count ( username ) + from dba_users t +tbs_size_per_tbs: select sum ( bytes ) / 1024 / 1024 tbs_size + from dba_data_files + where tablespace_name = :1 +tbs_sizes: select dbf.tbsd TABLESPACE_NAME, + dbf.filenum "#FILES", + round ( dbf.Tbs_Size, 2 ) "SIZE", + nvl ( round ( fsp.Free, 2 ), 0 ) FREE, + nvl ( round ( fsp.Free / dbf.Tbs_Size * 100, 1 ), + 0 ) "%FREE", + nvl ( fsp.Fragments, 0 ) "Free Space Fragments" + from ( ( select tablespace_name Tablespace, + sum ( bytes ) / 1024 / 1024 Free, + count ( bytes ) Fragments + from dba_free_space + group by tablespace_name + union + select h.tablespace_name Tablespace, + h.bytes_free / 1024 / 1024 Free, + ( select count(*) + from v$temp_extent_map + where tablespace_name = h.tablespace_name + ) Fragments + from v$temp_space_header h + ) + ) fsp, + ( select tablespace_name tbsd, + sum ( bytes ) / 1024 / 1024 Tbs_Size, + count(*) filenum + from ( select dba_data_files.* + from dba_data_files + union + select dba_temp_files.* + from dba_temp_files + ) + group by tablespace_name + ) dbf + where dbf.tbsd = fsp.Tablespace(+) +#tbs_sizes: select dbf.tbsd TABLESPACE_NAME, +# dbf.filenum "#FILES", \ +# round(dbf.Tbs_Size,2) "SIZE", \ +# nvl(round(fsp.Free,2),0) FREE, \ +# nvl(round(fsp.Free/dbf.Tbs_Size*100,1),0) "%FREE", \ +# nvl(fsp.Fragments,0) "Free Space Fragments" \ +# from ( select tablespace_name Tablespace, \ +# sum(bytes)/1024/1024 Free, \ +# count(bytes) Fragments \ +# from dba_free_space \ +# group by tablespace_name) fsp, \ +# ( select tablespace_name tbsd, \ +# sum(bytes)/1024/1024 Tbs_Size, \ +# count(*) filenum \ +# from dba_data_files \ +# group by tablespace_name) dbf \ +# where dbf.tbsd=fsp.Tablespace(+) \ +# order by TABLESPACE_NAME +v_instance: select * + from v$instance +v_thread: select * + from v$thread +v_sga: select * + from v$sga +v_sgastat: select * + from v$sgastat + order by pool, + name +v_sqlarea: select * + from v$sqlarea + order by sql_text +v_rowcache: select * + from v$rowcache + order by cache# +v_librarycache: select * + from v$librarycache +v_db_object_cache: select * + from v$db_object_cache + order by owner, + name +v_session_v_process: select s.*, + p.* + from v$session s, + v$process p + where s.paddr=p.addr +v_session_v_transaction: select s.*, + t.* + from v$session s, + v$transaction t + where s.saddr = t.ses_addr +locks: select v$lock.sid, + v$lock.type, + serial#, + v$session.username, + v$lock.id1, + dba_objects.object_name, + dba_objects.object_type, + dba_objects.owner, + v$lock.id2, + v$lock.lmode, + v$lock.request, + v$session.command, + v$session.osuser, + v$session.machine, + v$session.terminal, + v$session.program + from v$lock, + v$session, + dba_objects + where ( v$lock.id1 = dba_objects.object_id (+) ) + and ( v$lock.sid = v$session.sid ) + and ( ( v$lock.type in ('RW','TM','TX','UL') ) ) + order by v$lock.sid +dba_obj_audit_opts: select * + from dba_obj_audit_opts + order by owner, + object_name +all_def_audit_opts: select * + from all_def_audit_opts +dba_stmt_audit_opts: select * + from dba_stmt_audit_opts +dba_audit_trail: select * + from dba_audit_trail + order by timestamp +dba_audit_session: select * + from dba_audit_session + order by timestamp +dba_audit_object: select * + from dba_audit_object + order by timestamp +v_mts: select * + from v$mts +v_dispatcher: select * + from v$dispatcher +v_shared_server: select * + from v$shared_server +v_queue: select * + from v$queue +v_recover_file: select * + from v$recover_file +v_recovery_log: select * + from v$recovery_log +datafile_recovery_status: select r.*, + d.* + from v$recover_file r, + v$datafile d + where r.file# = d.file# +v_recovery_file_status: select * + from v$recovery_file_status +v_recovery_status: select * + from v$recovery_status +v_backup_v_datafile: select b.*, + d.* + from v$backup b, + v$datafile d + where b.file# = d.file# +v_backup: select * + from v$backup +v_backup_corruption: select * + from v$backup_corruption +v_backup_datafile: select * + from v$backup_datafile +v_backup_device: select * + from v$backup_device +v_backup_piece: select * + from v$backup_piece +v_backup_redolog: select * + from v$backup_redolog +v_backup_set: select * + from v$backup_set +dba_clusters: select * + from dba_clusters + order by owner, + cluster_name +dba_db_links: select * + from dba_db_links + order by owner, + db_link +dba_functions: select distinct owner, + name + from dba_source + where type = 'FUNCTION' + order by owner, + name +dba_jobs: select * + from dba_jobs + order by priv_user, + job +dba_libraries: select * + from dba_libraries + order by owner, + library_name +dba_packages: select distinct owner, + name + from dba_source + where type = 'PACKAGE' + order by owner, + name +dba_procedures: select distinct owner, + name + from dba_source + where type='PROCEDURE' + order by owner, + name +dba_snapshot_logs: select * + from dba_snapshot_logs + order by log_owner, + master +dba_snapshots: select * + from dba_snapshots + order by owner, + name +dba_synonyms: select * + from dba_synonyms + order by owner, + synonym_name +dba_triggers: select * + from dba_triggers + order by owner, + table_name, + trigger_name +dba_types: select * + from dba_types + order by owner, + type_name +dba_tables: select * + from dba_tables + order by owner, + table_name +dba_views: select OWNER, + VIEW_NAME, + TEXT_LENGTH, + TYPE_TEXT_LENGTH, + TYPE_TEXT, + OID_TEXT_LENGTH, + OID_TEXT, + VIEW_TYPE_OWNER, + VIEW_TYPE + from dba_views + order by owner, + view_name +dba_indexes: select OWNER, + TABLE_NAME, + INDEX_NAME, + INDEX_TYPE, + TABLE_OWNER, + TABLE_TYPE, + UNIQUENESS, + COMPRESSION, + PREFIX_LENGTH, + TABLESPACE_NAME, + INI_TRANS, + MAX_TRANS, + INITIAL_EXTENT, + NEXT_EXTENT, + MIN_EXTENTS, + MAX_EXTENTS, + PCT_INCREASE, + PCT_THRESHOLD, + INCLUDE_COLUMN, + FREELISTS, + FREELIST_GROUPS, + PCT_FREE, + LOGGING, + BLEVEL, + LEAF_BLOCKS, + DISTINCT_KEYS, + AVG_LEAF_BLOCKS_PER_KEY, + AVG_DATA_BLOCKS_PER_KEY, + CLUSTERING_FACTOR, + STATUS, + NUM_ROWS, + SAMPLE_SIZE, + LAST_ANALYZED, + DEGREE, + INSTANCES, + PARTITIONED, + TEMPORARY, + GENERATED, + SECONDARY, + BUFFER_POOL, + USER_STATS, + DURATION, + PCT_DIRECT_ACCESS, + ITYP_OWNER, + ITYP_NAME, + PARAMETERS, + GLOBAL_STATS, + DOMIDX_STATUS, + DOMIDX_OPSTATUS, + FUNCIDX_STATUS + from dba_indexes + order by owner, + table_name, + index_name +invalid_objects: select * + from dba_objects + where status = 'INVALID' + order by owner, + object_type, + object_name +dba_objects: select * + from dba_objects + order by owner, + object_type, + object_name +dba_segments: select * + from dba_segments + order by owner, + segment_name +dba_sequences: select * + from dba_sequences + order by sequence_owner, + sequence_name +dba_constraints: select owner, + CONSTRAINT_NAME, + CONSTRAINT_TYPE, + table_name, + SEARCH_CONDITION, + R_OWNER, + R_CONSTRAINT_NAME, + DELETE_RULE, + STATUS, + DEFERRABLE, + DEFERRED, + VALIDATED, + GENERATED, + BAD, + RELY, + to_char ( LAST_CHANGE ) LAST_CHANGE + from dba_constraints + order by owner, + constraint_name +alter_session: alter session + set NLS_DATE_FORMAT = 'dd-mm-yy hh24:mi:ss' +v_database: select * + from v$database +sort_stats: select name, + value + from v$sysstat + where name like 'sorts%' +hot_files: select v$filestat.file#, + v$filestat.phyrds+v$filestat.phywrts TotalIO, + v$dbfile.name, + v$filestat.phyrds, + v$filestat.phywrts, + v$filestat.phyblkrd, + v$filestat.phyblkwrt, + v$filestat.readtim, + v$filestat.writetim + from v$dbfile, + v$filestat + where v$dbfile.file# = v$filestat.file# + order by TotalIO DESC +dba_users: select * + from dba_users + order by username +dba_roles: select * + from dba_roles + order by role +dba_profiles: select * + from dba_profiles + order by profile +dba_tablespaces: select * + from dba_tablespaces + order by tablespace_name +dba_data_files_per_tbs: select * + from ( select dba_data_files.*, + 'data file' FILE_TYPE + from dba_data_files + union + select dba_temp_files.*, + 'temp file' FILE_TYPE + from dba_temp_files + ) + where tablespace_name = :1 + order by file_name +dba_segments_per_tbs: select * + from dba_segments + where tablespace_name = :1 + order by segment_name +dba_users_def_per_tbs: select * + from dba_users + where default_tablespace = :1 + order by username +dba_users_temp_per_tbs: select * + from dba_users + where temporary_tablespace = :1 + order by username +extents_alloc_per_tbs: select count (*), + min ( bytes ), + max ( bytes ), + round ( sum ( bytes ) / ( 1024 * 1024 ), 3 ) + from dba_extents + where tablespace_name = :1 +tbs_size: select round ( sum ( bytes ) / ( 1024 * 1024 ), 3 ) + from dba_data_files + where tablespace_name = :1 +extents_free_per_tbs: select count(*), + min ( bytes ), + max ( bytes ), + round ( sum ( bytes ) / ( 1024 * 1024 ), 3 ) + from dba_free_space + where tablespace_name = :1 +v_access_per_tbs: select sg.*, + s.* + from v$access a, + v$session s, + dba_segments sg + where ( a.sid = s.sid ) + and ( a.owner = sg.owner ) + and ( a.object = sg.segment_name ) + and ( ( sg.tablespace_name = :1 ) ) + order by s.username, + s.osuser +tbs_map_org: select segment_name, + segment_type, + to_char ( extent_id ), + file_Id, + block_Id, + blocks, + owner + from dba_extents + where tablespace_name = :1 + UNION + select '***FREE SPACE***', + ' ', + ' ', + File_Id, + block_id, + blocks, + ' ' + from dba_free_space + where tablespace_Name = :1 + order by 4, + 5 +tbs_map: select * + from ( select segment_name, + segment_type, + to_char ( extent_id ), + file_Id, + block_Id, + blocks, + owner, + tablespace_name + from dba_extents + UNION + select '***FREE SPACE***', + ' ', + ' ', + File_Id, + block_id, + blocks, + ' ', + tablespace_name + from dba_free_space + ) + where tablespace_Name = :1 + order by 4, + 5 + +dba_free_space_per_tbs: select f.*, + df.* + from dba_free_space f, + dba_data_files df + where ( f.file_id = df.file_id ) + and ( ( f.tablespace_name = :1 ) ) + order by f.file_id, + f.block_id + +dba_rollback_segs: select rs.xacts, + r.* + from v$rollstat rs, + dba_rollback_segs r + where r.segment_id = rs.usn (+) + order by segment_name +dba_data_files: select * + from ( select dba_data_files.*, + 'data file' FILE_TYPE + from dba_data_files + union + select dba_temp_files.*, + 'temp file' FILE_TYPE + from dba_temp_files + ) + order by tablespace_name + +dba_data_files_per_df: select * + from dba_data_files + where file_name = :1 +v_log: select * + from v$log + order by group# +v_controlfile: select * + from v$controlfile + order by name +v_access: select * + from v$access + order by owner +v_archive: select * + from v$archive +v_bgprocess: select * + from v$bgprocess + order by name +v_compatibility_compatseg: select a.type_id, + a.release, + a.description, + b.release, + b.updated + from v$compatibility a, + v$compatseg b + order by a.release +v_datafile_header: select * + from v$datafile_header +v_dblink: select * + from v$dblink +v_db_pipes: select * + from v$db_pipes +v_event_name: select * + from v$event_name +v_license: select * + from v$license +v_lock: select * + from v$lock +v_locked_object: select * + from v$locked_object +v_log_history: select * + from v$log_history +v_nls_parameters: select * + from v$nls_parameters +v_nls_database_parameters: select * + from v$nls_database_parameters +v_nls_instance_parameters: select * + from v$nls_instance_parameters +v_nls_session_parameters: select * + from v$nls_session_parameters +v_nls_valid_values: select * + from v$nls_valid_values +v_option: select * + from v$option +v_parameter: select NAME, + VALUE, + DESCRIPTION, + TYPE, + ISDEFAULT, + ISSES_MODIFIABLE, + ISSYS_MODIFIABLE, + ISMODIFIED, + ISADJUSTED, + NUM + from v$parameter + order by name +v_pq_slave: select * + from v$pq_slave +v_pq_sysstat: select * + from v$sysstat +v_pwfile_users: select * + from v$pwfile_users +v_resource_limit: select * + from v$resource_limit +v_rollstat: select * + from v$rollstat +v_session_longops: select * + from v$session_longops +v_sesstat: select s.sid, + u.serial#, + u.username, + u.osuser, + n.class, + n.name, + s.value + from v$sesstat s, + v$statname n, + v$session u + where n.statistic# = s.statistic# + and s.sid = u.sid + order by u.username, + u.osuser, + n.name +v_session_wait: select * + from v$session_wait +v_sort_segment: select * + from v$sort_segment +v_sort_usage: select * + from v$sort_usage +v_sql_bind_data: select * + from v$sql_bind_data +v_sql_bind_metadata: select * + from v$sql_bind_metadata +v_sql_cursor: select * + from v$sql_cursor +v_sql_shared_memory: select * + from v$sql_shared_memory +v_subcache: select * + from v$subcache +v_sysstat: select * + from v$sysstat +v_system_event: select * + from v$system_event +v_transaction: select * + from v$transaction +v_waitstat: select * + from v$waitstat +v_parameter: select * + from v$parameter order by name +v_process: select * + from v$process order by pid +v_datafile: select * + from v$datafile order by file# +dba_sys_privs_per_user: select privilege, + admin_option + from dba_sys_privs + where grantee = :1 +dba_role_privs_per_user: select granted_role, + admin_option, + default_role + from dba_role_privs + where grantee = :1 +dba_tab_privs_per_user: select p.owner, + o.object_type, + p.table_name, + p.grantor, + p.privilege, + p.grantable + from dba_tab_privs p, + dba_objects o + where grantee = :1 + and p.owner = o.owner + and p.table_name = o.object_name +table_grants_per_user: select owner, + table_name, + grantee, + privilege, + grantable + from dba_tab_privs + where grantor = :1 +dba_col_privs_per_user: select owner, + table_name, + column_name, + grantor, + privilege, + grantable + from dba_col_privs + where grantee = :1 +col_grants_per_user: select owner, + table_name, + column_name, + grantee, + privilege, + grantable + from dba_col_privs + where grantor = :1 +dba_profiles_per_user: select p.PROFILE, + p.RESOURCE_NAME, + p.LIMIT + from dba_users u, + dba_profiles p + where u.username = :1 + and u.profile = p.profile +dba_ts_quotas_per_user: select tablespace_name, + bytes, + max_bytes, + blocks, + max_blocks + from dba_ts_quotas + where username=:1 +dba_errors_per_user: select name, + type, + text, + line, + position, + sequence + from dba_errors + where owner = :1 + order by name, + type, + sequence +dba_tables_per_user: select * + from dba_tables + where owner = :1 + order by table_name + +dba_objects_per_tab_partition: select * + from dba_objects + where owner = :1 + and object_name = :2 + and subobject_name = :3 + and object_type = 'TABLE PARTITION' + +dba_objects_per_table: select * + from dba_objects + where owner = :1 + and object_name = :2 + and object_type = 'TABLE' + +dba_segments_per_tab_partition: select * + from dba_segments + where owner = :1 + and segment_name = :2 + and partition_name = :3 + and segment_type = 'TABLE PARTITION' + +dba_segments_per_table: select * + from dba_segments + where owner = :1 + and segment_name = :2 + and segment_type = 'TABLE' + +dba_constraints_per_table: select CONSTRAINT_NAME, + CONSTRAINT_TYPE, + SEARCH_CONDITION, + R_OWNER, + R_CONSTRAINT_NAME, + DELETE_RULE, + STATUS, + DEFERRABLE, + DEFERRED, + VALIDATED, + GENERATED, + BAD, + RELY, + to_char ( LAST_CHANGE ) LAST_CHANGE + from dba_constraints + where owner = :1 + and table_name = :2 + order by constraint_name + +dba_constraints_per_table_p_r_c: select * + from dba_constraints + where owner = :1 + and table_name = :2 + and constraint_type in ('P','R','C') + order by constraint_name + +dba_indexes_per_table: select * + from dba_indexes + where table_owner = :1 + and table_name = :2 + order by owner, + index_name + + +dba_tab_partitions_per_table: select TABLE_OWNER, + TABLE_NAME, + COMPOSITE, + PARTITION_NAME, + SUBPARTITION_COUNT, + HIGH_VALUE, + HIGH_VALUE_LENGTH, + PARTITION_POSITION, + TABLESPACE_NAME, + PCT_FREE, + PCT_USED, + INI_TRANS, + MAX_TRANS, + INITIAL_EXTENT, + NEXT_EXTENT, + MIN_EXTENT, + MAX_EXTENT, + PCT_INCREASE, + FREELISTS, + FREELIST_GROUPS, + LOGGING, + NUM_ROWS, + BLOCKS, + EMPTY_BLOCKS, + AVG_SPACE, + CHAIN_CNT, + AVG_ROW_LEN, + SAMPLE_SIZE, + to_char ( LAST_ANALYZED ) LAST_ANALYZED, + BUFFER_POOL, + GLOBAL_STATS, + USER_STATS + from dba_tab_partitions + where table_owner = :1 + and table_name = :2 + order by partition_name +dba_tab_subpartitions_per_table: select * + from dba_tab_subpartitions + where table_owner = :1 + and table_name = :2 + order by partition_name, + subpartition_position + +dba_ind_partitions_per_index: select * + from dba_ind_partitions + where index_owner = :1 + and index_name = :2 + order by partition_name + +dba_ind_subpartitions_per_index: select * + from dba_ind_subpartitions + where index_owner = :1 + and index_name=:2 + order by partition_name, + subpartition_position + +dba_tab_columns_per_table: select OWNER, + TABLE_NAME, + COLUMN_NAME, + DATA_TYPE, + DATA_TYPE_MOD, + DATA_TYPE_OWNER, + DATA_LENGTH, + DATA_PRECISION, + DATA_SCALE, + NULLABLE, + COLUMN_ID, + DEFAULT_LENGTH, + DATA_DEFAULT, + NUM_DISTINCT, + LOW_VALUE, + HIGH_VALUE, + DENSITY, + NUM_NULLS, + NUM_BUCKETS, + to_char ( LAST_ANALYZED ) LAST_ANALYZED, + SAMPLE_SIZE, + CHARACTER_SET_NAME, + CHAR_COL_DECL_LENGTH, + GLOBAL_STATS, + USER_STATS, + AVG_COL_LEN + from dba_tab_columns + where owner = :1 + and table_name = :2 + order by column_id + +dba_triggers_per_table: select * + from dba_triggers + where table_owner = :1 + and table_name = :2 + order by owner, + trigger_name + +dba_tab_comments_per_table: select comments + from dba_tab_comments + where owner = :1 + and table_name = :2 + +dba_tab_privs_per_table: select * + from dba_tab_privs + where owner = :1 + and table_name = :2 + order by privilege + +dba_views_per_user: select view_name, + text_length, + type_text_length, + type_text, + oid_text_length, + oid_text, + view_type_owner, + view_type + from dba_views + where owner = :1 + order by view_name + +view_text: select text + from dba_views + where owner = :1 + and view_name = :2 + +dba_objects_per_view: select * + from dba_objects + where owner = :1 + and object_name = :2 + +dba_indexes_per_user: select * + from dba_indexes + where owner = :1 + order by index_name + +dba_objects_per_index: select * + from dba_objects + where owner = :1 + and object_name = :2 + +dba_segments_per_index: select * from dba_segments + where owner=:1 + and segment_name=:2 + +dba_ind_columns_per_index: select * from dba_ind_columns + where index_owner=:1 + and index_name=:2 + order by column_position + +dba_clusters_per_user: select * from dba_clusters + where owner=:1 + order by cluster_name + + +dba_objects_per_cluster: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_segments_per_cluster: select * from dba_segments + where owner=:1 + and segment_name=:2 + +dba_sequences_per_user: select * from dba_sequences + where sequence_owner=:1 + order by sequence_name + +dba_objects_per_sequence: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_objects_per_user: select object_name, status, object_type, + created, last_ddl_time, timestamp,object_id + from dba_objects + where owner=:1 + order by object_name +dba_segments_per_user: select * from dba_segments + where owner=:1 + order by segment_name + +dba_objects_per_segment: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_extents_per_segment: select * from dba_extents + where owner=:1 + and segment_name=:2 + order by extent_id + +dba_procedures_per_user: select distinct name from dba_source + where type='PROCEDURE' + and owner=:1 + order by name + +dba_source_per_procedure: select line,text from dba_source + where type='PROCEDURE' + and owner=:1 + and name=:2 + order by line + +dba_source_text_per_procedure: select text from dba_source + where type='PROCEDURE' + and owner=:1 + and name=:2 + order by line + +dba_objects_per_procedure: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_functions_per_user: select distinct name from dba_source + where type='FUNCTION' + and owner=:1 + order by name + +dba_source_per_function: select line,text from dba_source + where type='FUNCTION' + and owner=:1 + and name=:2 + order by line + +dba_source_text_per_function: select text from dba_source + where type='FUNCTION' + and owner=:1 + and name=:2 + order by line + +dba_objects_per_function: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_packages_per_user: select distinct name from dba_source + where type='PACKAGE' + and owner=:1 + order by name + +dba_source_per_package_header: select line,text from dba_source + where type='PACKAGE' + and owner=:1 + and name=:2 + order by line + +dba_source_per_package_body: select line,text from dba_source + where type='PACKAGE BODY' + and owner=:1 + and name=:2 + order by line + +dba_source_text_per_package_header: select text from dba_source + where type='PACKAGE' + and owner=:1 + and name=:2 + order by line + +dba_source_text_per_package_body: select text from dba_source + where type='PACKAGE BODY' + and owner=:1 + and name=:2 + order by line + +dba_objects_per_package_header: select * from dba_objects + where owner=:1 + and object_name=:2 + and object_type='PACKAGE' + +dba_objects_per_package_body: select * from dba_objects + where owner=:1 + and object_name=:2 + and object_type='PACKAGE BODY' + +dba_triggers_per_user: select TABLE_NAME, TRIGGER_NAME, TABLE_OWNER, + TRIGGER_TYPE, TRIGGERING_EVENT, REFERENCING_NAMES, + WHEN_CLAUSE, STATUS, DESCRIPTION \ + from dba_triggers + where owner=:1 + order by table_name, trigger_name + +dba_objects_per_trigger: select * from dba_objects + where owner=:1 + and object_name=:2 + +trigger_body: select trigger_body from dba_triggers + where owner=:1 + and trigger_name=:2 + +dba_synonyms_per_user: select * + from dba_synonyms + where owner=:1 + order by synonym_name + +dba_objects_per_synonym: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_objects_per_function: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_constraints_per_user: select OWNER, CONSTRAINT_NAME, + CONSTRAINT_TYPE, TABLE_NAME, + SEARCH_CONDITION, R_OWNER, R_CONSTRAINT_NAME, + DELETE_RULE, STATUS, DEFERRABLE, DEFERRED, + VALIDATED, GENERATED, BAD, RELY, + to_char(LAST_CHANGE) LAST_CHANGE + from dba_constraints + where owner=:1 + order by constraint_name + +dba_cons_columns_per_constraint: select position, table_name, + column_name + from dba_cons_columns + where owner=:1 + and constraint_name=:2 + order by position + +dba_objects_per_constraint: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_jobs_per_user: select * from dba_jobs + where priv_user=:1 + order by job + +dba_db_links_per_user: select * from dba_db_links + where owner=:1 + order by db_link + +dba_objects_per_db_link: select * from dba_objects + where owner=:1 + and object_name=:2 + +dba_snapshots_per_user: select * from dba_snapshots + where owner=:1 + order by name + +dba_snapshot_logs_per_user: select * from dba_snapshot_logs + where log_owner=:1 + order by master + +dba_libraries_per_user: select * from dba_libraries + where owner=:1 + order by library_name + +dba_types_per_user: select * From dba_types + where owner=:1 + order by type_name + +v_session: select username, osuser, SADDR, SID, SERIAL#, AUDSID, + PADDR, USER#, + COMMAND, TADDR, LOCKWAIT, STATUS, SERVER, SCHEMA#, + SCHEMANAME, PROCESS, MACHINE, TERMINAL, PROGRAM, TYPE, + SQL_ADDRESS, SQL_HASH_VALUE, PREV_SQL_ADDR, PREV_HASH_VALUE, + MODULE, MODULE_HASH, ACTION, ACTION_HASH, CLIENT_INFO, + FIXED_TABLE_SEQUENCE, ROW_WAIT_OBJ#, ROW_WAIT_FILE#, + ROW_WAIT_BLOCK#, ROW_WAIT_ROW#, to_char(LOGON_TIME) LOGON_TIME, LAST_CALL_ET + from v$session + order by username,osuser + +ddcache_ratio: select round(sum(getmisses)/sum(gets)*100,2) + from v$rowcache +libcache_ratio: select round(sum(reloads)/sum(pins)*100,2) + from v$librarycache +db_block_gets: select value from v$sysstat where name = 'db block gets' +consistent_gets: select value from v$sysstat where name = 'consistent gets' + +phys_reads: select value from v$sysstat where name = 'physical reads' + +redo_log_space_req: select value + from v$sysstat + where name='redo log space requests' + +sys_rbs_header: select round(count/(:consistent_gets+:db_block_gets)*100,2) + from v$waitstat + where class = 'system undo header' + +sys_rbs_block: select round(count/(:consistent_gets+:db_block_gets)*100,2) + from v$waitstat + where class = 'system undo block' + +rbs_header: select round(count/(:consistent_gets+:db_block_gets)*100,2) + from v$waitstat + where class = 'undo header' + +rbs_block: select round(count/(:consistent_gets+:db_block_gets)*100,2) + from v$waitstat + where class = 'undo block' + +total_rbs_waits: select round(sum(waits)/sum(gets)*100,2) from v$rollstat + +disp_busy: select round(sum(busy)/(sum(busy)+sum(idle))*100,2) + from v$dispatcher + +disp_resp_waits: select decode (sum(totalq),0, 'No responses', + round(sum(wait)/sum(totalq),3)) + from v$queue + where type='DISPATCHER' + +server_waits: select decode (sum(totalq),0, 'No requests', + round(sum(wait)/sum(totalq),3)) + from v$queue + where type='COMMON' +calc_table_number: select count(*) from dba_tables +calc_table_number_per_user: select count(*) from dba_tables where owner=:1 +calc_view_number: select count(*) from dba_views +calc_view_number_per_user: select count(*) from dba_views where owner=:1 +calc_index_number: select count(*) from dba_indexes +calc_index_number_per_user: select count(*) from dba_indexes where owner=:1 +calc_object_number: select count(*) from dba_objects +calc_object_number_per_user: select count(*) from dba_objects where owner=:1 +calc_segment_number: select count(*) from dba_segments +calc_segment_number_per_user: select count(*) from dba_segments where owner=:1 +calc_sequence_number: select count(*) from dba_sequences +calc_sequence_number_per_user: select count(*) from dba_sequences where sequence_owner=:1 +calc_constraint_number: select count(*) from dba_constraints +calc_constraint_number_per_user: select count(*) from dba_constraints where owner=:1 +calc_cluster_number: select count(*) from dba_clusters +calc_cluster_number_per_user: select count(*) from dba_clusters where owner=:1 +calc_procedure_number: select count(distinct name) from dba_source + where type='PROCEDURE' +calc_procedure_number_per_user: select count(distinct name) from dba_source + where owner = :1 and type='PROCEDURE' +calc_function_number: select count(distinct name) from dba_source + where type='FUNCTION' +calc_function_number_per_user: select count(distinct name) from dba_source + where owner = :1 and type='FUNCTION' +calc_package_number: select count(distinct name) from dba_source + where type='PACKAGE' +calc_package_number_per_user: select count(distinct name) from dba_source + where owner = :1 and type='PACKAGE' +calc_trigger_number: select count(*) from dba_triggers +calc_trigger_number_per_user: select count(*) from dba_triggers where owner=:1 +calc_synonym_number: select count(*) from dba_synonyms +calc_synonym_number_per_user: select count(*) from dba_synonyms where owner=:1 +calc_job_number: select count(*) from dba_jobs +calc_job_number_per_user: select count(*) from dba_jobs where priv_user=:1 +calc_dblink_number: select count(*) from dba_db_links +calc_dblink_number_per_user: select count(*) from dba_db_links where owner=:1 +calc_snapshot_number: select count(*) from dba_snapshots +calc_snapshot_number_per_user: select count(*) from dba_snapshots where owner=:1 +calc_snapshot_log_number: select count(*) from dba_snapshot_logs +calc_snapshot_log_number_per_user: select count(*) from dba_snapshot_logs \ + where log_owner=:1 +calc_type_number: select count(*) from dba_types +calc_type_number_per_user: select count(*) from dba_types where owner=:1 +calc_library_number: select count(*) from dba_libraries +calc_library_number_per_user: select count(*) from dba_libraries where owner=:1 +calc_column_number: select count(*) from dba_tab_columns +calc_column_number_per_user: select count(*) from dba_tab_columns where owner=:1 +calc_extent_number: select count(*) from dba_extents +calc_extent_number_per_user: select count(*) from dba_extents where owner=:1 +calc_source_line_number: select count(*) from dba_source +calc_source_line_number_per_user: select count(*) from dba_source + where owner=:1 +calc_block_number: select sum(blocks) from dba_extents +calc_block_number_per_user: select sum(blocks) from dba_extents where owner=:1 + +calc_segment_size: select nvl(round(sum(bytes)/(1024*1024),3),0) + from dba_segments + where segment_type like :1 + +calc_segment_size_per_user: select nvl(round(sum(bytes)/(1024*1024),3),0) + from dba_segments + where owner=:1 + and segment_type like :2 + +all_tables: select object_name + from dba_objects + where object_type in ('TABLE', 'VIEW') + order by object_name + +child_tables: select c.owner, c.table_name, c.constraint_name + from dba_constraints m, dba_constraints c + where m.owner= :1 + and m.table_name=:2 + and m.CONSTRAINT_TYPE='P' + and c.r_owner=m.owner + and c.r_constraint_name=m.constraint_name + order by c.owner, c.table_name, c.constraint_name +v_shared_pool_reserved: select * from v$shared_pool_reserved +v_controlfile_record_section: select * from v$controlfile_record_section +dba_users_per_user: select * from dba_users + where username=:1 +outline_sql_text: select sql_text from dba_outlines + where owner=:1 + and name=:2 +dba_outlines: select NAME, OWNER, CATEGORY, USED, + to_char(TIMESTAMP) TIMESTAMP, VERSION, SQL_TEXT + from dba_outlines + order by owner, name +dba_outlines_per_user: select NAME, OWNER, CATEGORY, USED, + to_char(TIMESTAMP) TIMESTAMP, VERSION, SQL_TEXT + from dba_outlines + where owner=:1 + order by owner, name +dba_tab_partitions: select * from dba_tab_partitions + order by table_owner, table_name, partition_name +dba_tab_partitions_per_user: select * from dba_tab_partitions + where table_owner=:1 + order by table_name, partition_name +calc_tab_partition_number: select count(*) from dba_tab_partitions +calc_tab_partition_number_per_user: select count(*) from dba_tab_partitions + where table_owner=:1 +calc_outline_number: select count(*) from dba_outlines +calc_outline_number_per_user: select count(*) from dba_outlines where owner=:1 +dba_outline_hints: select * from dba_outline_hints + where owner=:1 + and name=:2 + order by node, stage, join_pos +sys_props: select * from sys.props$ order by name +v_instance_recovery: select * from v$instance_recovery +v_latch: select * from v$latch order by name +v_access_per_object: select a.*,s.username, s.osuser + from v$access a, v$session s + where a.owner=:1 + and a.object=:2 + and a.sid=s.sid +v_sort_segment_per_tbs: select * from v$sort_segment + where tablespace_name=:1 +v_sort_usage_per_tbs: select * from v$sort_usage + where tablespace=:1 +v_buffer_pool: select * from v$buffer_pool +v_bh: select * from v$bh +v_tablespace: select * from v$tablespace +dba_jobs_running: select s.username, j.* + from dba_jobs_running j, v$session s + where s.sid=j.sid + order by s.username +v_object_dependency: select * from v$object_dependency +v_obsolete_parameter: select * from v$obsolete_parameter +v_reserved_words: select * from v$reserved_words +v_rowcache_parent: select * from v$rowcache_parent +v_rowcache_subordinate: select * from v$rowcache_subordinate +v_tempfile: select * from v$tempfile +dba_errors_per_object: select sequence, line, position, text + from dba_errors + where owner=:1 + and name=:2 + and type = :3 + order by sequence +dba_errors_per_package_header: select sequence, line, position, text + from dba_errors + where owner=:1 + and name=:2 + and type = 'PACKAGE' + order by sequence +dba_errors_per_package_body: select sequence, line, position, text + from dba_errors + where owner=:1 + and name=:2 + and type = 'PACKAGE BODY' + order by sequence +dba_objects_per_lob: select * from dba_objects + where owner=:1 + and object_name=:2 + and object_type='LOB' + +dba_segments_per_lob: select * from dba_segments + where owner=:1 + and segment_name=:2 + and segment_type='LOBSEGMENT' + +dba_lobs: select * from dba_lobs + +dba_lobs_per_user: select * from dba_lobs + where owner=:1 + +calc_lob_number: select count(*) from dba_lobs +calc_lob_number_per_user: select count(*) from dba_lobs where owner=:1 +dba_lobs_per_table: select * from dba_lobs + where owner=:1 + and table_name=:2 + order by column_name +top_sql: select round(buffer_gets/executions,2) "avg. buffer gets", + round(disk_reads/executions,2) "avg. disk reads", + round(parse_calls/executions,2) "avg. parse calls", + EXECUTIONS, SQL_TEXT, SHARABLE_MEM, PERSISTENT_MEM, RUNTIME_MEM, SORTS, + VERSION_COUNT, LOADED_VERSIONS, OPEN_VERSIONS, USERS_OPENING, USERS_EXECUTING, + LOADS, FIRST_LOAD_TIME, INVALIDATIONS, PARSE_CALLS, DISK_READS, BUFFER_GETS, + ROWS_PROCESSED, COMMAND_TYPE, OPTIMIZER_MODE, PARSING_USER_ID, PARSING_SCHEMA_ID, + KEPT_VERSIONS, ADDRESS, HASH_VALUE, MODULE, MODULE_HASH, ACTION, ACTION_HASH, + SERIALIZABLE_ABORTS + from v$sqlarea + where executions > 0 + order by "avg. buffer gets" DESC +v_complete_list: select synonym_name "V$ VIEW" + from dba_synonyms + where table_owner='SYS' + and synonym_name like 'V$%' + and synonym_name not like 'V$\_%' escape '\' + order by 1 + + + +