
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
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 on 수 9월 3 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 >