[Oracle] 유저 생성 시 상세 옵션들

·2025년 9월 3일

오라클 관리

목록 보기
79/163


[실습1] king이라는 유저를 위 슬라이드의 조건대로 생성하시오

create tablespace ts300
 datafile '/u01/app/oracle/oradata/ORA19/ts300.dbf' size 10m;

create user king
 identified by tiger
 default tablespace ts300
 temporary tablespace temp
 profile default -- db에서 사용할 수 있는 자원을 제한하는 기능
 account lock;

-- king 유저에 연결 권한 부여
grant connect to king;
-- king 유저에서 테이블 생성 권한 부여
grant create table to king;

-- 잠긴 계정 lock 풀기
alter user king account unlock;

king 유저에서 다음과 같이 합니다.

KING @ ORA19 > create table emp500
  2          ( empno  number(10),
  3            ename  varchar2(20) );
create table emp500
*
1행에 오류:
ORA-01031: 권한이 불충분합니다


KING @ ORA19 > /

테이블이 생성되었습니다.

KING @ ORA19 > select table_name, tablespace_name
                from user_tables;

TABLE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
EMP500
TS300

문제1. ts7000 이라는 테이블 스페이스를 사이즈 10m 로 생성하고 ts7000 테이블 스페이스를 default tablespace 로 하는 유져를 생성하는데 유져명은 king2, 패스워드는 tiger로 설정하고 잠금을 해제하면서 생성하시오

orange에서

create tablespace ts7000
 datafile '/u01/app/oracle/oradata/ORA19/ts7000.dbf' size 10m;

create user king2
 identified by tiger
 default tablespace ts7000
 temporary tablespace temp
 profile default -- db에서 사용할 수 있는 자원을 제한하는 기능
 account lock;
 
grant connect to king2;
grant create table to king2;

-- lock 된 계정 풀기
alter user king2 account unlock;

putty에서

[oracle@ora19c ~]$ sqlplus king2/tiger

SQL*Plus: Release 19.0.0.0.0 - Production on93 10:16:10 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

KING2 @ ORA19 > create table emp500
  2  			( empno number(10),
  3  			  ename varchar2(20) );

테이블이 생성되었습니다.

KING2 @ ORA19 > select table_name, tablespace_name
  2  			 from user_tables;

TABLE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
EMP500
TS7000


KING2 @ ORA19 >

0개의 댓글