Extracting DDLs from Oracle
1. DBMS_METADATA
This example extracts DDLs of every table and index from scott, run it in sqlplus:
set pagesize 0 ---Does not display column names.
set long 90000 ---9000 bytes of cache in local machine for LONG datatype
set feedback off --Does not display messages like "PL/SQL procedure successfully completed"
set echo off --START command does not list each command in a script. as --the command is executed.
spool scott_schema.sql --Spool to a file
connect scott/tiger@orcl; --Connecting as scott
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name) FROM USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name) FROM USER_INDEXES u;
spool off; --Turn off spool來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-768902/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Recipe 6.7. Extracting Initials from a Name
- IMPSHOW2SQL - Extracting SQL from an EXPORT file (Doc ID 29765.1)SQLExport
- Extracting Data from a Corrupt Table using DBMS_REPAIR or Event 10231AI
- response from oracleOracle
- Oracle ERP From ItpubOracle
- Unload data from oracleOracle
- Oracle 建立PDB-from ScratchOracle
- oracle中copy from的用法Oracle
- How to migrate data from Oracle to MSSQLSERVEROracleSQLServer
- Result Sets from Stored Procedures In Oracle (轉)Oracle
- Spark Extracting,transforming,selecting featuresSparkORM
- Oracle 11GR2 Duplicate from BackupOracle
- Getting oracle agent installation from oemOracle
- How to get ORACLE_HOME from data dictionaryOracle
- Unload data to a flat file from Oracle databaseOracleDatabase
- Oracle 12c系列(八)|RMAN (FROM SERVICE)Oracle
- Upgrade Oracle Database from 10.2.0.1 to 11.2.0.4OracleDatabase
- Oracle11g RMAN Duplicate from Active DatabaseOracleDatabase
- DG vs Storage in High Availability -- From OracleAIOracle
- Migrate from SQL SERVER to Oracle 10GSQLServerOracle 10g
- External Tables: Querying Data From Flat Files in OracleOracle
- Oracle database 升級(文件)to 10.2.0.4 from 10.2.0.1OracleDatabase
- Migrate database from single instance to Oracle RACDatabaseOracle
- Oracle模擬MySQL的show index from table命令OracleMySqlIndex
- oracle sql hint提示_BITMAP CONVERSION FROM ROWIDSOracleSQL
- Oracle的SQL*Net more data from client 等待事件分析OracleSQLclient事件
- Oracle 11g Data Guard 使用duplicate from active databaseOracleDatabase
- WINNT: How to Remove Oracle Fail Safe From a Windows NT Cluster ServerREMOracleAIWindowsServer
- Oracle記憶體全面分析( from www.hellodba.com)Oracle記憶體
- Oracle 10g upgrade from 10.2.0.1 to 10.2.0.4Oracle 10g
- 靜默升級oracle(文件)to 10.2.0.4 from 10.2.0.1Oracle
- Oracle10.2.0.3 impdp 匯入資料包 ORA-39125 in KUPW$WORKER.PUT_DDLS LPX-00007問題解決Oracle
- Converting Oracle Database from Linux to Windows using RMANOracleDatabaseLinuxWindows
- Converting Oracle Database from Windows to Linux using RMANOracleDatabaseWindowsLinux
- Upgrading from Oracle Database 10g to 11gOracleDatabase
- Oracle資料庫實用指令碼(from Maclean.Liu)Oracle資料庫指令碼Mac
- 論文翻譯:Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism
- Oracle 12C RMAN transport tablespace from PDB of RAC CDB to remote PDBOracleREM