?
Solved

SQLPlus syntax for looking at an Oracle DB schema.

Posted on 2003-03-12
6
Medium Priority
?
2,852 Views
Last Modified: 2012-08-13
How do I check the Schema of an Oracle Db in SQLPlus?
0
Comment
Question by:strtn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:tschofiled
ID: 8119905
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
 

Author Comment

by:strtn
ID: 8120000
Trying to validate the differences between two different
versions of a third party Oracle DB.
0
 

Accepted Solution

by:
vcdayani earned 100 total points
ID: 8123427
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
 
LVL 2

Assisted Solution

by:tschofiled
tschofiled earned 100 total points
ID: 8126901
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
 
LVL 13

Expert Comment

by:anand_2000v
ID: 10093964
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question