반응형

oracle DB 를 설치하고, instance 를 만들어서 start 를 했다면 이제 유저를 생성할 차례..
(oracle 11g 에서 테스트 해봄)

1. tablespace 를 생성
SQL> create tablespace 테이블스페이스_네임 datafile '데이타파일위치(절대경로)' size 용량;
SQL> create tablespace test_ts01 datafile '/data1/oradata/test_ts01_data01.dbf' size 1024M;

-> 인덱스용 테이블 스페이스도 미리 생성하자
SQL> create tablespace test_ti01 datafile '/data1/oradata/test_ti01_indx01.dbf' size 1024M;

2. 유저 생성
SQL> create user 아이디 identified by 패스워드 default tablespace 테이블스페이스_네임 temporary tablespace temp;
SQL> create user test identified by testpassword default tablespace test_ts01 temporary tablespace temp;

3. 권한 부여
SQL> grant connect, resource to 아이디;
SQL> grant connect, resource to test;

ps. 참고로 각 내용들의 조회 방법

유저 조회
select username, default_tablespace, temporary_tablespace, account_status, profile from dba_users order by 1;

테이블스페이스 상태 조회
select tablespace_name, status, contents, extent_management, segment_space_management from dba_tablespaces order by 1;

데이터파일 상태 조회
select tablespace_name, bytes, file_name from dba_data_files order by 1;

사용자에게 할당된 시스템 권한 조회
select grantee, privilege from dba_sys_privs where lower(grantee) in ('아이디') order by 1;

권한의 묶음인 롤 확인
select grantee, granted_role from dba_role_privs where lower(grantee) in ('아이디') order by 1;

반응형

'데이터베이스 > Oracle' 카테고리의 다른 글

Orange for Oracle 단축키  (0) 2019.01.28
[oracle]GREATEST, LEAST 함수  (0) 2018.06.22
Oracle 달력 쿼리  (0) 2016.10.13
[오라클]그룹별 순번 만들기  (0) 2013.06.21
행을 열로 표시하기  (0) 2011.10.14

+ Recent posts