DataBase/Oracle
Data Dictionary
H_Develop
2022. 6. 13. 18:44
Oracle DBMS가 관리하는 모든 객체의 정보를 가지고 있는 파일.
사용자가 소유한 객체 정보를 가지고 있는 USER,
스키마 정보의 ALL,
데이터베이스 관리를 위한 정보를 가지고 있는 DBA 세가지 종류.
TABLE 확인, GRANT
HR 사용자 로그인
select table_name from all_tables
// Oracle이 만든 table에서 HR사용자가 만든 table 것 까지
select * from tabs
// HR 사용자가 만든 table 나와랏
grant select on departments1 to scott;
// departments1의 select 할 권한을 scott 사용자에게 준다.
SCOTT 사용자 로그인
select * from hr.departments1
SQL> conn sys/rootoor as sysdba;
연결되었습니다.
SQL> show user;
USER은 "SYS"입니다
SQL> select username from dba_users;
USERNAME
------------------------------
TESTER2
MGMT_VIEW
SYS
...
36 개의 행이 선택되었습니다.
// 최상위 관리자 SYS, 가지고 있는 user 확인.
select count(table_name) from dictionary;
COUNT(TABLE_NAME)
-----------------
1873
// 모든 table 개수
select comments from dictionary
where table_name = 'USER_TABLES';
COMMENTS
-----------------------------------------------------
Description of the user's own relational tables
// USER_TABLES에 대한 comments 가 있나 확인. relational tables 이다, 확인
// 별 필요없는 기능