Obtain DDL for objects/users in oracle
I recently came across situation where I needed to recreate a public database link in a non-prod database environment and application team didn't know the password required for this particular user being used for the db link. I did the following to obtain the DDL out of production: set long 999999 select dbms_metadata.get_ddl('DB_LINK', 'LINKNAME', 'PUBLIC') from dual; I had to do the same for a user that didn't get created that I wanted to quickly create myself without using exp/imp. select dbms_metadata.get_ddl('USER','&USERNAME') from dual;