⇤ ← Revision 1 as of 2014-05-26 20:44:18
Size: 743
Comment:
|
Size: 879
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 28: | Line 28: |
== Show schema and table == {{{#!highlight sql SELECT distinct owner,table_name FROM all_tables ORDER BY owner,table_name; }}} |
Oracle
http://docs.oracle.com/cd/B19306_01/index.htm
Get schemas in DB
Toggle line numbers
1 SELECT DISTINCT USERNAME FROM DBA_USERS;
Get columns from table
Toggle line numbers
1 SELECT * FROM ALL_IND_COLUMNS WHERE TABLE_NAME='XYZ';
Get indexes from table
http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_1069.htm
Toggle line numbers
1 SELECT index_name, table_owner, table_name, uniqueness FROM USER_INDEXES WHERE table_name = 'XYZ';
2 SELECT index_name, table_owner, table_name, uniqueness FROM ALL_INDEXES WHERE table_name = 'XYZ';
Get code from stored procedure
Toggle line numbers
1 SELECT * FROM all_source WHERE name = 'myprocedure'
2 ORDER BY owner,name,line
Show schema and table
Toggle line numbers
1 SELECT distinct owner,table_name
2 FROM all_tables
3 ORDER BY owner,table_name;