ORACLE retrieves existing TABPLESPACE and INDEX creation scripts from the database

Time:2019-10-7

Table space scripts:
SELECT TS.TABLESPACE_NAME,
TO_CHAR(DBMS_METADATA.get_ddl(‘TABLESPACE’,TS.TABLESPACE_NAME))
FROM DBA_TABLESPACES TS;

INDEX index script: SELECT DBMS_METADATA.get_ddl(‘INDEX’, U.index_name) FROM USER_INDEXES U