Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


System Tables in Oracle 10g


System Tables in Oracle 10g

Author
Message
Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24167 Visits: 37929
We all know that in SQL Server that there is a system table that tells you about all the columns in each table in a database, sys.columns (in SQL Server 2005/2008).

Is there an equivalent system table or view that provides the same information? I'm not having much luck finding one, but perhaps one of you out there that also are familiar with Oracle may be able to assist.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14931 Visits: 38919
there's a few suites of views of the objects: ALL_TABLES, DBA_TABLES and USER_TABLES;

i try to stick with USER_tables, which are filtered to the schema you belong to (well the oracle user)
USER_TABLES is ~sys.tables
user_tab_columns is ~ sys.columns

here's an example i use when getting tables in a FK hierarchy order:

WITH MyCommonTableExpression
AS
(
SELECT
a.table_name as child_table,
b.table_name parent_table,
colb.column_name as child_column

from user_constraints a
INNER JOIN user_constraints b ON a.r_constraint_name = b.constraint_name
INNER JOIN user_cons_columns conb ON conb.constraint_name = b.constraint_name
INNER JOIN user_tab_columns colb ON colb.table_name = conb.table_name
AND colb.column_name = conb.column_name
WHERE a.constraint_type = 'R'

)
SELECT
parent_table,
child_table,
child_column,
1 as lvl
FROM MyCommonTableExpression
WHERE parent_table='GMACT'
START WITH parent_table = 'GMACT'
CONNECT BY PRIOR child_table = parent_table



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14931 Visits: 38919
also this will really get you what you are after:

select * from all_views where LEFT(view_name,5) = 'USER_'



Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Lynn Pettis
Lynn Pettis
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24167 Visits: 37929
I also founf ALL_TAB_COLUMNS that provided me with the info I needed.

I will definately take a closer look and the code you provided when I have a little more time. Got some project stuff I need to work on right now.

Thanks Lowell.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3093 Visits: 4639
Lynn Pettis (10/8/2010)
We all know that in SQL Server that there is a system table that tells you about all the columns in each table in a database, sys.columns (in SQL Server 2005/2008).

Is there an equivalent system table or view that provides the same information? I'm not having much luck finding one, but perhaps one of you out there that also are familiar with Oracle may be able to assist.

check dba_tab_columns, you have to have dba privileges to have access to it.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search