Oracle System Queries for Retrieving Oracle Database Object Information
The following contains information on how to retrieve database information for Oracle objects such as tables, views, indexes, packages, procedures, functions, and triggers. The queries all query the Oracle system views located in the SYS schema.
Tables
This is a query to get all Oracle tables that can be viewed by the current user.
select TABLE_NAME, OWNER from SYS.ALL_TABLES order by OWNER, TABLE_NAME
The query can be filtered to return tables for a given schema by adding a where OWNER = ‘some_schema’ clause to the query.
Schemas
This is a query to get all Oracle schemas in an Oracle database instance.
select USERNAME from SYS.ALL_USERS order by USERNAME
Views
This is a query to get all Oracle views that can be viewed by the current user.
select VIEW_NAME, OWNER from SYS.ALL_VIEWS order by OWNER, VIEW_NAME
The query can be filtered to return views for a specific schema by adding a where OWNER = ‘some_schema’ clause to the query.
Packages
This is a query to get all Oracle packages that can be viewed by the current user.
select OBJECT_NAME, OWNER from SYS.ALL_OBJECTS where UPPER(OBJECT_TYPE) = ‘PACKAGE’ order by OWNER, OBJECT_NAME
To query for package bodies, substitute PACKAGE BODY for PACKAGE.
The query can be filtered to return packages for a specific schema by adding a where OWNER = ‘some_schema’ clause to the query.
Procedures
This is a query to get all Oracle procedures that can be viewed by the current user.
select OBJECT_NAME, OWNER from SYS.ALL_OBJECTS where upper(OBJECT_TYPE) = upper(‘PROCEDURE’) order by OWNER, OBJECT_NAME
The query can be filtered to return procedures for a specific schema by adding a where OWNER = ‘some_schema’ clause to the query.
Procedure Columns
This is a query to get the columns in an Oracle procedure.
select OWNER, OBJECT_NAME, ARGUMENT_NAME, DATA_TYPE, IN_OUT from SYS.ALL_ARGUMENTS order by OWNER, OBJECT_NAME, SEQUENCE
Functions
This is a query to get all Oracle functions for the current user.
select OBJECT_NAME, OWNER from SYS.ALL_OBJECTS where upper(OBJECT_TYPE) = upper(‘FUNCTION’) order by OWNER, OBJECT_NAME
The query can be filtered to return functions for a specific schema by adding a where OWNER = ‘some_schema’ clause to the query.
Triggers
This is a query to get all Oracle triggers for the current user.
select TRIGGER_NAME, OWNER from SYS.ALL_TRIGGERS order by OWNER, TRIGGER_NAME
The query can be filtered to return triggers for a specific schema by adding a where OWNER = ‘some_schema’ clause to the query.
Indexes
This is a query to get all Oracle indexes.
select INDEX_NAME, TABLE_NAME, TABLE_OWNER from SYS.ALL_INDEXES order by TABLE_OWNER, TABLE_NAME, INDEX_NAME
excellent post, very informative. I wonder why the opposite specialists of this sector do not understand this.
You should proceed your writing. I am sure, you have a great
readers’ base already!
You can certainly see your skills in the article you write.
The sector hopes for even more passionate writers such as
you who are not afraid to mention how they believe. At all times follow your heart.
There’s certainly a great deal to know about this issue.
I love all of the points you’ve made.
While you can certainly improve your site’s search rank yourself, the best
method may be to enlist the help of a company that specializes in search optimization.
Gone are the days of coding HTML coding by hand, unless
that is what you do 100% for a living AND it’s enterprise-level quality.
Because search engines can read variants on words, we will also use “bocce ball strategies”.
Hellо! I know this is somewhat off topic but Ι was wondеring which blog
platform are yoս uswing for this website? I’m getting fed up of WordPress because I’ve ɦad issues
wіth hackers and I’m looking ɑt options for
another platform. I would Ƅe great if you coսld point me in thе direction of a good platform.
My site … travel websites
I will right away snatch your rss feed as I can’t in finding your e-mail subscription link or e-newsletter service.
Do you’ve any? Kindly permit me realize in order that I may just subscribe.
Thanks.
Check out my web page: Las Vegas Kitchen Appliance Repairman