Script to Generate and Spool DDL / SQL statements for Tablespaces in Oracle 10g 11g Database

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World


As a DBA sometimes we need to spool the scripts for the tablespace for creating the new databases. For that you can use DBMS_METADATA package to extract the DDL script for the tablespace easily.

Below mentioned script you can use for the same purpose.
set heading off
set long 10000
set pages 0
set feedback off
spool tbs.sql
select dbms_metadata.get_ddl('TABLESPACE',tablespace_name)||';' from dba_tablespaces;

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (580) General (60) Unix (47) Script (41) Blog (23) OCI (3) SQL* Loader (3) Datapump (2) Software (1)
DBA Tips
 

acehints.com Copyright 2011-21 All Rights Reserved | Site Map | Contact | Disclaimer