工作中,需要现场返回所有表空间及用户信息
get_ddl_info.sql
spool get_ddl_info.log set pagesize 0 set linesize 1000 set feedback off set long 999999 set pagesize 1000 set heading off prompt select dbms_metadata.get_ddl('TABLESPACE',TS.tablespace_name) from DBA_TABLESPACES TS; select dbms_metadata.get_ddl('TABLESPACE',TS.tablespace_name) from DBA_TABLESPACES TS; prompt select dbms_metadata.get_ddl('USER',U.username) from DBA_USERS U; select dbms_metadata.get_ddl('USER',U.username) from DBA_USERS U; prompt select username from dba_users; select username from dba_users; spool off
?
?