记录下学习Oracle12c的过程中的点点滴滴。
Oracle12c新特性:http://www.cnblogs.com/kerrycode/p/3386917.html
--创建临时表空间
CREATE TEMPORARY TABLESPACE ADMIN_TEMP
TEMPFILE '文件的绝对路径'//如:'J:\software\myOracle\oradata\orcl\TEMP.DBF'
SIZE 50M
AUTOEXTEND ON
NEXT 50 MAXSIZE 100M
EXTENT MANAGEMENT LOCAL;
--创建数据表空间
CREATE TABLESPACE ADMIN_DATA
LOGGING DATAFILE '文件的绝对路径'
SIZE 50M
AUTOEXTEND ON
NEXT 50 MAXSIZE 100M
EXTENT MANAGEMENT LOCAL;
--创建用户并指定表空间
CREATE USER C##username IDENTIFIED BY password--12c 用户名前需加收C##
DEFAULT TABLESPACE ADMIN_DATA
TEMPORARY TABLESPACE ADMIN_TEMP;
--授予权限
GRANT CONNECT,RESOURCE,DBA TO C##username;
--删除用户
DROP USER C##username CASCADE;
--删除表空间
DROP TABLESPACE ADMIN_DATA INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE ADMIN_TEMP INCLUDING CONTENTS AND DATAFILES;
--查询用户和对应的表空间
SELECT USERNAME,DEFAULT_TABLESPACE from SYS.DBA_USERS;