---
title: "Oracle Metadata"
author: "panlw"
date: "2008-11-04T10:04:04Z"
tags: []
slug: "oracle-metadata"
draft: false
lastmod: "2008-11-04T10:04:04Z"
id: 261944
url: "https://panlw.iteye.com/blog/261944"
---

# Oracle metadata

### From Wikipedia, the free encyclopedia

Jump to: [navigation](http://en.wikipedia.org/wiki/Oracle_metadata#column-one) , [search](http://en.wikipedia.org/wiki/Oracle_metadata#searchInput)

[![](http://upload.wikimedia.org/wikipedia/en/d/d6/Ambox_style.png)](http://en.wikipedia.org/wiki/Image:Ambox_style.png "Ambox style.png")

The introduction to this article provides **insufficient context** for those unfamiliar with the subject.  
Please help [improve the article](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit "http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp;action=edit") with a [good introductory style](http://en.wikipedia.org/wiki/Wikipedia:Writing_better_articles#Lead_section "Wikipedia:Writing better articles") .

The ORACLE application server and Oracle [relational database](http://en.wikipedia.org/wiki/Relational_database "Relational database") keep [metadata](http://en.wikipedia.org/wiki/Metadata "Metadata") in two areas: data dictionary tables (accessed by built-in functions) and a metadata registry.

The global built-in functions accessing Oracle [RDBMS](http://en.wikipedia.org/wiki/RDBMS "RDBMS") data dictionary tables are:

- ALL\_TABLES - list of all tables in the current database that are accessible to the current user
- ALL\_TAB\_COLUMNS - list of all columns in the database that are accessible to the current user
- ALL\_ARGUMENTS - lists the arguments of functions and procedures that are accessible to the current user
- ALL\_ERRORS - lists descriptions of errors on all stored objects (views, procedures, functions, packages, and package bodies) that are accessible to the current user
- ALL\_OBJECT\_SIZE - included for backward compatibility with Oracle version 5
- ALL\_PROCEDURES - (from Oracle 9 onwards) lists all functions and procedures (along with associated properties) that are accessible to the current user
- ALL\_SOURCE - describes the text (i.e. PL/SQL) source of the stored objects accessible to the current user

In addition there are equivalent functions prefixed "USER\_" which show only the objects owned by the current user (i.e. a more restricted view of metadata) and prefixed "DBA\_" which show all objects in the database (i.e. an unrestricted global view of metadata for the database instance). Naturally the "DBA\_" metadata functions require DBA privileges.

## Contents

\[[hide]() ]

- [1 Example 1: finding tables](http://en.wikipedia.org/wiki/Oracle_metadata#Example_1:_finding_tables)
- [2 Example 2: finding columns](http://en.wikipedia.org/wiki/Oracle_metadata#Example_2:_finding_columns)
- [3 Example 3: counting rows of columns](http://en.wikipedia.org/wiki/Oracle_metadata#Example_3:_counting_rows_of_columns)
- [4 Use of underscore in table and column names](http://en.wikipedia.org/wiki/Oracle_metadata#Use_of_underscore_in_table_and_column_names)
- [5 Oracle Metadata Registry](http://en.wikipedia.org/wiki/Oracle_metadata#Oracle_Metadata_Registry)
- [6 See also](http://en.wikipedia.org/wiki/Oracle_metadata#See_also)
- [7 External links](http://en.wikipedia.org/wiki/Oracle_metadata#External_links)

&lt;script type="text/javascript"&gt;&lt;/script&gt;

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=1 "Edit section: Example 1: finding tables") ] Example 1: finding tables

Find all Tables that have PATTERN in the table name and are not backup or temporary tables

```
  SELECT
     TABLE_NAME
  FROM
     ALL_TABLES
  WHERE
     TABLE_NAME LIKE '%PATTERN%'
  ORDER
     BY TABLE_NAME;
```

* * *

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=2 "Edit section: Example 2: finding columns") ] Example 2: finding columns

Find all tables that have at least one column that matches a specific PATTERN in the column name

```
  SELECT
     TABLE_NAME,
     COLUMN_NAME
  FROM
     ALL_TAB_COLUMNS
  WHERE
     COLUMN_NAME LIKE '%PATTERN%';
```

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=3 "Edit section: Example 3: counting rows of columns") ] Example 3: counting rows of columns

Count the total number of rows in all tables containing a column name that matches PATTERN ==

```
  COLUMN DUMMY NOPRINT
  COMPUTE SUM OF NUM_ROWS ON DUMMY
  BREAK ON DUMMY
  SELECT
     NULL DUMMY,
     T.TABLE_NAME,
     C.COLUMN_NAME,
     T.NUM_ROWS
  FROM
     ALL_TABLES T,
     ALL_TAB_COLUMNS C
  WHERE
     T.TABLE_NAME = C.TABLE_NAME
     AND C.COLUMN_NAME LIKE '%PATTERN%'
  ORDER BY T.TABLE_NAME;
```

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=4 "Edit section: Use of underscore in table and column names") ] Use of underscore in table and column names

The underscore is a special [SQL](http://en.wikipedia.org/wiki/SQL "SQL") pattern match to a single character and should be escaped if you are in fact looking for an underscore character in the LIKE clause of a query.

Just add the following after a LIKE statement:

```
  ESCAPE '_'
```

And then each literal underscore should be a double underscore: \__

Example

```
  LIKE '%__G' ESCAPE '_'
```

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=5 "Edit section: Oracle Metadata Registry") ] Oracle Metadata Registry

The Oracle product [Oracle Enterprise Metadata Manager](http://en.wikipedia.org/wiki/Oracle_Enterprise_Metadata_Manager "Oracle Enterprise Metadata Manager") (EMM) is an [ISO/IEC 11179](http://en.wikipedia.org/wiki/ISO/IEC_11179 "ISO/IEC 11179") compatible [metadata registry](http://en.wikipedia.org/wiki/Metadata_registry "Metadata registry") . It stores administered metadata in a consistent format that can be used for [metadata publishing](http://en.wikipedia.org/wiki/Metadata_publishing "Metadata publishing") . As of January 2006, EMM is available only through Oracle consulting services.

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=6 "Edit section: See also") ] See also

- [metadata](http://en.wikipedia.org/wiki/Metadata "Metadata")

[]()

[]()

## [\[]()[edit](http://en.wikipedia.org/w/index.php?title=Oracle_metadata&amp%3Baction=edit&amp%3Bsection=7 "Edit section: External links") ] External links

- [article on Oracle Metadata](http://www.oreillynet.com/pub/a/network/2002/10/28/data_dictionary.html "http://www.oreillynet.com/pub/a/network/2002/10/28/data_dictionary.html")

 

[![Comp Sci logo](http://upload.wikimedia.org/wikipedia/commons/thumb/9/91/LampFlowchart.svg/20px-LampFlowchart.svg.png)](http://en.wikipedia.org/wiki/Image:LampFlowchart.svg "Comp Sci logo")  *This [computer science](http://en.wikipedia.org/wiki/Computer_science "Computer science") -related article is a [stub](http://en.wikipedia.org/wiki/Wikipedia:Stub "Wikipedia:Stub") . You can [help](http://en.wikipedia.org/wiki/Wikipedia:Find_or_fix_a_stub "Wikipedia:Find or fix a stub") Wikipedia by [expanding it](http://en.wikipedia.org/w/index.php?stub&amp%3Btitle=Oracle_metadata&amp%3Baction=edit "http://en.wikipedia.org/w/index.php?stub&amp;title=Oracle_metadata&amp;action=edit")* .

Retrieved from "[http://en.wikipedia.org/wiki/Oracle\_metadata](http://en.wikipedia.org/wiki/Oracle_metadata) "

[Categories](http://en.wikipedia.org/wiki/Special:Categories "Special:Categories") : [Metadata](http://en.wikipedia.org/wiki/Category:Metadata "Category:Metadata") | [Oracle Corporation](http://en.wikipedia.org/wiki/Category:Oracle_Corporation "Category:Oracle Corporation") | [Computer science stubs](http://en.wikipedia.org/wiki/Category:Computer_science_stubs "Category:Computer science stubs")