• Home
  • About
  • Links
MemoSoup

MemoSoup

Mix of the things I always forget

CommentsPosts
 
 
  • Scripts
    • Unix
    • Windows & DOS
    • Perl
    • JavaScript
    • VB
  • Tips & Tricks
    • MS Office
    • Photo
    • Documents
  • SQL
    • Sybase
    • Oracle
    • mysql
    • MS SQL
  • Web
  • Programming
    • c++
    • Java
  • System
    • Linux
 

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Oracle: using DBMS_METADATA for getting table structure

SET LONG 5000

SELECT dbms_metadata.get_ddl(’TABLE’,'EMP’,'SCOTT’)
FROM dual;

Some other values of the type field for dbms_metadata.get_ddl function:

INDEX
DB_LINK
PACKAGE

(See also “Oracle® Database PL/SQL Packages and [...]

December 29th, 2009 | Tags: dbms_metadata, table | Category: Oracle | Leave a comment

Oracle: source text for the view, package and other objects

The best method is to use dbms_metadata package:

SELECT dbms_metadata.get_ddl(UPPER(’&OBJ_TYPE’),UPPER(’&OBJ_NAME’),UPPER(’&OWNER’))
FROM dual;

Additional methods could be also used:
Source text of the package

SELECT text
FROM dba_source
WHERE upper(name) LIKE upper(’&which_object’)
ORDER BY line ;

Use $ORACLE_HOME/bin/wrap utility to encrypt the package (there is no unwrap)
(Well, actually, there is unwrap – just look in the search machine for the words unwrap10 or rewrap…)

Source [...]

October 26th, 2009 | Tags: dbms_metadata, Oracle, source | Category: Oracle | Leave a comment

Copyright © 2010 MemoSoup - All Rights Reserved
Powered by WordPress & the Atahualpa Theme by BytesForAll. Discuss on our WP Forum