Skip to main content

Posts

Showing posts from November, 2014

Useful Oracle Queries

Sometimes we need to find the indexes present for a table or the table structure or db links present etc. To find these details we have some standard DB queries which gives us the required results. The following queries are applicable to only Oracle database. SELECT * FROM ALL_TABLES   The following query lists out all the tables present in the database. If you want search a particular table we can use it in the following way SELECT * FROM ALL_TABLES WHERE TABLE_NAME LIKE '%emp%' SELECT * FROM ALL_TAB_COLUMNS This query list out all the columns. If we want to know a particular column is present in which all tables we can frame the query in the following way SELECT * FROM ALL_TAB_COLUMNS WHERE COLUMN_NAME='ID'; SELECT * FROM ALL_DB_LINKS This query will return the list of db links present in the database SELECT * FROM ALL_INDEXES This query will list out all the indexes present in the database.If we want to find the indexes present for a particular t