ORACLE创建数据库表空间和用户的过程

创建脚本如下,本例中数据库实例为RTT,用户名为rtt,密码为123。

创建大表空间,大表空间在oracle10以后出现的新概念:

create BIGFILE tablespace "USER_BIG" datafile '/database/oracle_11/app/oradata/rtt/users_big.dbf' 
size 10240M autoextend on next 1310720 maxsize 32767M LOGGING ONLINE PERMANENT BLOCKSIZE 8192 
EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT AUTO;


创建普通表空间:
create tablespace "USER_DAT" datafile '/database/oracle_11/app/oradata/rtt/USER_dat.DBF' 
size 10240M autoextend on next 1310720 maxsize 32767M 
logging online permanent blocksize 8192 extent management local autoallocate segment space management auto;

创建索引表空间:

create tablespace "USER_INDEX" datafile '/database/oracle_11/app/oradata/rtt/USER_INDEX.DBF' 
size 5129M autoextend on next 1310720 maxsize 32767M logging online permanent blocksize 8192 
extent management local autoallocate segment space management auto;

创建临时表空间:

create temporary tablespace "USER_TEMP" tempfile '/database/oracle_11/app/oradata/rtt/user_temp.dbf' 
SIZE 4096M AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576;

创建用户:

CREATE USER rtt IDENTIFIED BY 123 DEFAULT TABLESPACE "USER_DAT" TEMPORARY TABLESPACE "USER_TEMP";

设定用户密码超时限制:

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

授权用户:

GRANT CONNECT, CREATE SEQUENCE,RESOURCE,DBA TO rtt;


你可能感兴趣的:(ORACLE)