Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2860
  • Last Modified:

SQLPlus syntax for looking at an Oracle DB schema.

How do I check the Schema of an Oracle Db in SQLPlus?
0
strtn
Asked:
strtn
2 Solutions
 
tschofiledCommented:
What exactly do you want to check?

Space available
Space used
extent sizes
number of extents
table names, other objects
object status
etc.....

All of this and more???

Tony
0
 
strtnAuthor Commented:
Trying to validate the differences between two different
versions of a third party Oracle DB.
0
 
vcdayaniCommented:
There are several views in the Oracle Dictionary that you can use to compare 2 schemas. These views are accessible from SQL*Plus. Example:

All objects in the database - ALL_OBJECTS
Tables - ALL_TABLES
Columns in a table - ALL_TAB_COLUMNS
Synonyms - ALL_SYNONYMS
Indexes - ALL_INDEXES
Columns in an index - ALL_IND_COLUMNS.

For more information on how the dictionary works, refer to the Oracle Documentation on dictionary views.

HTH
Vikram
0
 
tschofiledCommented:
If you just want to check existance (or not) of objects, I would suggest :-

Create a database link between the two and run :

Select object_name from all_objects where owner ='<SCHEMA_OWNER_NAME>'
minus
Select object_name from all_objects@<DB_LINK_NAME> where owner ='<SCHEMA_OWNER_NAME>'
/

This will show all on one but not on the other. Then complete the opposite :-

Select object_name from all_objects@<DB_LINK_NAME> where owner ='<SCHEMA_OWNER_NAME>'
minus
Select object_name from all_objects where owner ='<SCHEMA_OWNER_NAME>'
/

Tony
0
 
anand_2000vCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: vcdayani {http:#8123427} & tschofiled {http:#8126901}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

anand_2000v
EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now