main monitor ddl objects dml stato e configurazione rman & dpump pl/sql cluster ASM
main config start-shut process memory monitor diag
user rman & dpump pl/sql cluster ASM
Get User
undef user
select dbms_metadata.get_ddl('USER',username) || '/' usercreate 
     FROM dba_users 
     WHERE USERNAME = upper('&&user');
Get Profile
set long 20000 longchunksize 20000 pagesize 0 linesize 1000 feedback off verify off trimspool on
column ddl format a1000

   dbms_metadata.set_transform_param (dbms_metadata.session_transform, 'SQLTERMINATOR', true);
   dbms_metadata.set_transform_param (dbms_metadata.session_transform, 'PRETTY', true);

select dbms_metadata.get_ddl('PROFILE', profile) as profile_ddl
from   (select distinct profile
        from   dba_profiles)
where  profile like upper('%&profilename%');

set linesize 200 pagesize 5000 feedback on verify on
Get Procedure
SELECT dbms_metadata.get_ddl('PROCEDURE','Proc_Name','Proc_Owner') txt from dual;
Get Table grants
SELECT dbms_metadata.get_dependent_ddl('OBJECT_GRANT','Tab_Name','Tab_Owner') grants FROM  dual;
Get Synonym
SELECT DBMS_METADATA.get_ddl ('SYNONYM', 'Syn_Name', 'Syn_Owner') from dual;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License