Solved

Oracle script

Posted on 2008-10-28
4
513 Views
Last Modified: 2013-12-19
Hello Oracle experts;

In Oracle RDB you have commends like:

SQL> attach 'filename stl_rdb';
SQL> sho tables
User tables in database with filename stl_rdb
     BIN_INVENTORY
     CASTER
     CHARGE_MATERIAL
     CREW
     
and

SQL> sho table scrap_weights
Information for table SCRAP_WEIGHTS
 
Comment on table SCRAP_WEIGHTS:
Scrap charge information for this heat.
 
Columns for table SCRAP_WEIGHTS:
Column Name                     Data Type        Domain
-----------                     ---------        ------
HEAT_ID                         CHAR(5)          HEAT_ID
 Oracle Rdb default: ' '
MATERIAL_NAME                   CHAR(16)         MATERIAL_NAME
 Oracle Rdb default: ' '
SORT_ORDER                      INTEGER          SORT_ORDER
 Oracle Rdb default: 0
STD_WT                          REAL             STD_WT
 Oracle Rdb default: -123456789012345678.0
MAN_DMND_WT                     REAL             MAN_DMND_WT
 Oracle Rdb default: -123456789012345678.0
CALC_DMND_WT                    REAL             CALC_DMND_WT
 Oracle Rdb default: -123456789012345678.0
ORIG_LOG_WT                     REAL             ORIG_LOG_WT
 Oracle Rdb default: -123456789012345678.0
CHRGD_MAN_LOG_WT                REAL             CHRGD_MAN_LOG_WT
 Oracle Rdb default: -123456789012345678.0
CHRGD_RS_LOG_WT                 REAL             CHRGD_RS_LOG_WT
 Oracle Rdb default: -123456789012345678.0
CHRGD_COMP_LOG_WT               REAL             CHRGD_COMP_LOG_WT
 Oracle Rdb default: -123456789012345678.0
TIME_STAMP                      DATE VMS         TIME_STAMP
 Oracle Rdb default: CURRENT_TIMESTAMP
ORIG_CALC_DMND_WT               REAL             CALC_DMND_WT
 Oracle Rdb default: -123456789012345678.0
 
Table constraints for SCRAP_WEIGHTS:
 No Constraints found
 
Constraints referencing table SCRAP_WEIGHTS:
 No Constraints found
 
Indexes on table SCRAP_WEIGHTS:
SCRAP_WEIGHTS_KEY               with column HEAT_ID
                                and column MATERIAL_NAME
  No Duplicates allowed
  Type is Sorted
  Key suffix compression is DISABLED
  Node size  610
  Percent fill  90
 Store clause:          STORE IN SCRAP_WEIG_IDX
           (THRESHOLDS ARE ( 68,  68,  68 ))
 
 Partition information for index:
  Partition: (1) SYS_P00077
   Storage Area: SCRAP_WEIG_IDX
         Thresholds are (68, 68, 68)
 
Storage Map for table SCRAP_WEIGHTS:
     SCRAP_WEIG_MAP
 
Triggers on table SCRAP_WEIGHTS:
No triggers found
 
SQL>

My question to you today is there a simple query in Oracle that will give you the same information as

SQL> sho table scrap_weights
and
SQL> sho tables

Can you please get back to me I need this ASAP

Thank you so much for your time




0
Comment
Question by:algotube
  • 2
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 500 total points
ID: 22824552

Here:

PS: Wherever a view is prefixed by 'user_{view}', you can also query 'all_{view}' and 'dba_{view}'.


--

-- sho tables

--

select * from tab;

-- or --

select * from user_tables;

--

-- sho SCRAP_WEIGHTS

--

desc SCRAP_WEIGHTS

--

-- Table constraints for SCRAP_WEIGHTS:

--

select * from user_constraints

 where table_name='SCRAP_WEIGHTS';

-- 

-- Constraints referencing table SCRAP_WEIGHTS:

-- 

select * from user_constraints a

 where exists (

  select 'T' from user_constraints b

   where b.table_name='SCRAP_WEIGHTS'

     and b.constraint_name = a.r_constraint_name);

-- 

-- Indexes on table SCRAP_WEIGHTS:

-- 

select * from user_indexes

 where table_name='SCRAP_WEIGHTS';

--

-- Triggers on table SCRAP_WEIGHTS:

--

Select * from user_triggers

 where table_name='SCRAP_WEIGHTS';

--

-- Additional information in:

--

select * from user_tables

 where table_name='SCRAP_WEIGHTS';

Open in new window

0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 22824567

An easier way is to installl the EM dbconsole and view the information there.

0
 

Author Comment

by:algotube
ID: 22825394
Excellent MikeOM_DBA thank you so much.............. great stuff.........................
0
 

Author Closing Comment

by:algotube
ID: 31510804
Thank you for the fast response, very much appreciated.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle query help 36 82
alter database link to change the password 2 45
Oracle -- identify blocking session 24 41
oracle 11g 23 46
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now