Tuesday, June 11, 2013

Useful Queries

 Below are simple but useful queries of Oracle .
  • Query to find out all column names in table
              Select * from all_tab_columns;
  • Query to find all column names in index.
               Select * from all_ind_columns;

  • Query to find all Functional index details.
               Select * from All_ind_expressons;
   
  • Query to find all Functional index details.
               Select * from All_ind_expressons;
           
  •      Query to get all Oracle indexes. 
              Select  INDEX_NAME, TABLE_NAME, TABLE_OWNER from ALL_INDEXES
              order by  TABLE_OWNER, TABLE_NAME, INDEX_NAME
  •   Query to get all Oracle views that can be viewed by the current user. 
              Select VIEW_NAME, OWNER from ALL_VIEWS order by OWNER, VIEW_NAME
  
  •     Query to get all Oracle triggers for the current user.  
               Select TRIGGER_NAME, OWNER from SYS.ALL_TRIGGERS order by OWNER,  
               TRIGGER_NAME
  •     Query to get all sequences for the current user
               Select * from all_sequences;
  •      Query to get db objects based  (procedures,functions,trigger,view etc. )on table.
                 Select * from all_dependencies where referenced_type ='TABLE'
                  and referenced_name  =<Tablename>
   
  •      Query to get source code
                Select * from all_source where name =<objectname>





No comments:

Post a Comment