티스토리 뷰

공부/SQL

Oracle-Query-Schema

감성윤 2016. 7. 19. 19:19

1.테이블
select object_name from user_objects where object_type = 'TABLE';


2.
select object_name from user_objects where object_type = 'VIEW';


3.시퀀스
select object_name from user_objects where object_type = 'SEQUENCE';


4.인덱스
select object_name from user_objects where object_type = 'INDEX';


5.프록시져
select object_name from USER_PROCEDURES;


6.트리거
select trigger_name from user_triggers;


7.패키지
select object_name from user_objects where object_type = 'PACKAGE';


8.
select GRANTED_ROLE from user_role_privs;


9.테이블스패이스
select DEFAULT_TABLESPACE, TEMPORARY_TABLESPACE from user_users;


10.시노늄
select * from user_synonyms where TABLE_OWNER = user;


11.함수
select object_name from user_objects where object_type = 'FUNCTION';


부가정보뷰에서정보를보여주기위한쿼리..


1.테이블
select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE from USER_TAB_COLUMNS where table_name = '%s';


2.
select VIEW_NAME, TEXT_LENGTH, VIEW_TYPE_OWNER from USER_VIEWS where VIEW_NAME = '%s';


3.시퀀스
select SEQUENCE_NAME, MIN_VALUE, MAX_VALUE, INCREMENT_BY, CYCLE_FLAG, ORDER_FLAG, CACHE_SIZE, LAST_NUMBER from USER_SEQUENCES where SEQUENCE_NAME = '%s';


4.인덱스
select INDEX_NAME, TABLE_NAME, COLUMN_NAME, COLUMN_POSITION, DESCEND from user_ind_columns where INDEX_NAME = '%s';


5.프로시져
select PROCEDURE_NAME, AGGREGATE, PIPELINED, PARALLEL, INTERFACE, DETERMINISTIC, AUTHID from USER_PROCEDURES where PROCEDURE_NAME = '%s';


6.트리거
select TRIGGER_NAME, TRIGGER_TYPE, TRIGGERING_EVENT, TABLE_OWNER, TABLE_NAME, COLUMN_NAME from USER_TRIGGERS where TRIGGER_NAME = '%s'


7.
select GRANTED_ROLE, ADMIN_OPTION, DEFAULT_ROLE, OS_GRANTED from user_role_privs;


8.시노늄
select SYNONYM_NAME, TABLE_OWNER, TABLE_NAME, DB_LINK from USER_SYNONYMS where SYNONYM_NAME = '%s'

'공부 > SQL' 카테고리의 다른 글

테이블 정의서출력용 sql  (0) 2017.01.19
DBObject  (0) 2016.08.08
오라클 With절  (0) 2016.05.02
오라클 sys , system 암호(패스워드) 분실시  (0) 2016.05.02
View에 Comment달기  (0) 2016.05.02
댓글