oracle 创建用户指定表空间 删除用户删除表空间

--创建数据表空间

create tablespace CICI

logging

datafile '/usr/lib/oracle/xe/oradata/cici/CICI.DBF'

size 32m

autoextend on

extent management local;



--创建用户并指定表空间



CREATE USER cici IDENTIFIED BY cici

PROFILE DEFAULT

DEFAULT TABLESPACE CICI

ACCOUNT UNLOCK;



GRANT connect, resource TO cici;

grant create session to cici;

 

 

--登录oracle

#sqlplus

sql>conn system/system

-- 创建临时数据表空间

create temporary tablespace CICITEMP
tempfile 'D:\oraclexe\app\oracle\oradata\CICI\CICITEMP.DBF'
size 32m
autoextend on
extent management local;

--创建数据表空间
create tablespace CICI
logging
datafile 'D:\oraclexe\app\oracle\oradata\CICI\CICI.DBF'
size 32m
autoextend on

 


extent management local;

--创建用户并指定表空间

CREATE USER cici IDENTIFIED BY cici
PROFILE DEFAULT
DEFAULT TABLESPACE CICI
TEMPORARY TABLESPACE CICITEMP
ACCOUNT UNLOCK;

GRANT connect, resource TO cici;
grant create session to cici;

-- 级联删除用户 包含用户下所有对象

drop user dzysc  cascade;

-- 删除表空间

drop tablespace CICI including contents and datafiles;

你可能感兴趣的:(oracle)