[Oracle]Dictionary 실습하기

jh5959·3일 전
0

SQL

목록 보기
4/8

Dictionary

  • 메타정보
  • 데이터의 데이터, 관리 데이터
  • 읽기 전용

Dictionary의 예

  • 오라클 서버 사용자명
  • 사용자에게 허가된 권한
  • 데이터베이스 객체명(table, sequence, view ,index 등)
  • 테이블 제약조건
  • 감사 정보(누가 언제 뭘 했는지)
desc dictionary; --테이블 구조

desc s_emp;

select *
from dictionary;

select count(*) --개수
from dictionary;

select *
from dictionary
where table_name like 'USER%'; --대문자로 써야 함

select object_name --사용자가 소유한 모든 테이블 조회
from user_objects
where object_type='SEQUENCE';

select table_name --사용자가 소유한 특정 테이블 조회
from user_tables
where table_name='COUNTRY';

select constraint_name, constraint_type,search_condition,r_constraint_name
from user_constraints --STUDENT의 테이블레벨 제한 검색
where table_name='STUDENT';
--제약조건 정보가 나옴 

select constraint_name,column_name
from user_cons_columns -- STUDENT의 컬럼레벌 제한 검색
where table_name='STUDENT';

--컬럼 정보 확인
select column_name, data_type,nullable
from user_tab_columns
where table_name='COUNTRY';

--인덱스 확인
select index_name, table_name
from user_indexes
where table_name='S_EMP';

--인덱스 컬럼 확인
SELECT index_name, column_name
FROM user_ind_columns
WHERE table_name = 'S_EMP';

0개의 댓글