Last active
October 6, 2016 17:30
-
-
Save dotmaik1/b6e5e1ad5abdef1ead01a6b3f27cb5bc to your computer and use it in GitHub Desktop.
ddl gathering oracle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set long 1000 | |
| set pages 500 | |
| set lines 200 | |
| SELECT DBMS_METADATA.GET_DDL('DB_LINK',db.db_link,db.owner) from dba_db_links db; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set long 2000000 pagesize 0 head off verify off feedback off linesize 132 | |
| select name, password from sys.user$ where name like 'SCOTT'; | |
| SELECT dbms_metadata.get_ddl('USER','SCOTT') FROM dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','SCOTT') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','SCOTT') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','SCOTT') from dual; | |
| SELECT dbms_metadata.get_ddl('ROLE','RESOURCE') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','RESOURCE') from dual; | |
| set long 2000000 pagesize 0 head off verify off feedback off linesize 132 | |
| select name, password from sys.user$ where name like 'SCOTT'; | |
| SELECT dbms_metadata.get_ddl('USER','SCOTT') FROM dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','SCOTT') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('OBJECT_GRANT','SCOTT') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','SCOTT') from dual; | |
| SELECT dbms_metadata.get_ddl('ROLE','RESOURCE') from dual; | |
| SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','RESOURCE') from dual; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DBMS_METADATA.get_ddl ('TABLE', 'TABLE_NAME', 'USER_NAME') FROM DUAL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment