select distinct 'select to_char(dbms_metadata.get_ddl(''TABLESPACE'','''||tablespace_name||''')) from dual;' from dba_tables;