Oracle用户与表空间的创建

3 篇文章 1 订阅
1 篇文章 0 订阅

一、测试环境

-- 测试环境表空间创建
CREATE TABLESPACE "PROJECT_DATA_DF" DATAFILE 
'D:/app/PROJECT_DATA_DF_01.dbf' SIZE 100M REUSE autoextend on next 100M  maxsize 1000M,
'D:/app/PROJECT_DATA_DF_02.dbf' SIZE 100M REUSE autoextend on next 100M  maxsize 1000M
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
extent management local autoallocate segment space management auto; 

-- 临时表空间
CREATE TEMPORARY TABLESPACE "PROJECT_TEMP_DF" TEMPFILE 
'D:/app/PROJECT_TEMP_DF.dbf' SIZE 100M REUSE autoextend on next 100M  maxsize 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10M ;

-- project用户创建
CREATE USER "PROJECT" IDENTIFIED BY "project" DEFAULT TABLESPACE "PROJECT_DATA_DF" TEMPORARY TABLESPACE "PROJECT_TEMP_DF";
GRANT "CONNECT", "DBA", "RESOURCE" TO "PROJECT";
ALTER USER "PROJECT" DEFAULT ROLE "CONNECT", "DBA", "RESOURCE";
GRANT UNLIMITED TABLESPACE TO "PROJECT";

-- project_sys用户创建
CREATE USER "PROJECT_SYS" IDENTIFIED BY "project_sys" DEFAULT TABLESPACE "PROJECT_DATA_DF" TEMPORARY TABLESPACE "PROJECT_TEMP_DF";
GRANT "CONNECT", "DBA", "RESOURCE" TO "PROJECT_SYS";
ALTER USER "PROJECT_SYS" DEFAULT ROLE "CONNECT", "DBA", "RESOURCE";
GRANT UNLIMITED TABLESPACE TO "PROJECT_SYS";

二、生产环境

-- 生产环境表空间创建
CREATE TABLESPACE "PROJECT_DATA_DF" DATAFILE 
'/home/oracle/PROJECT_DATA_DF_01.dbf' SIZE 1024M REUSE autoextend on next 100M  maxsize 10000M,
'/home/oracle/PROJECT_DATA_DF_02.dbf' SIZE 1024M REUSE autoextend on next 100M  maxsize 10000M
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
extent management local autoallocate segment space management auto; 

-- 临时表空间
CREATE TEMPORARY TABLESPACE "PROJECT_TEMP_DF" TEMPFILE 
'/home/oracle/PROJECT_TEMP_DF.dbf' SIZE 1024M REUSE autoextend on next 100M  maxsize 10000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10M ;

-- project用户创建
CREATE USER "PROJECT" IDENTIFIED BY "project" DEFAULT TABLESPACE "PROJECT_DATA_DF" TEMPORARY TABLESPACE "PROJECT_TEMP_DF";
GRANT "CONNECT", "DBA", "RESOURCE" TO "PROJECT";
ALTER USER "PROJECT" DEFAULT ROLE "CONNECT", "DBA", "RESOURCE";
GRANT UNLIMITED TABLESPACE TO "PROJECT";

-- project_sys用户创建
CREATE USER "PROJECT_SYS" IDENTIFIED BY "project_sys" DEFAULT TABLESPACE "PROJECT_DATA_DF" TEMPORARY TABLESPACE "PROJECT_TEMP_DF";
GRANT "CONNECT", "DBA", "RESOURCE" TO "PROJECT_SYS";
ALTER USER "PROJECT_SYS" DEFAULT ROLE "CONNECT", "DBA", "RESOURCE";
GRANT UNLIMITED TABLESPACE TO "PROJECT_SYS";
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值