Oracle创建表空间、创建用户并指定该用户的表空间、授权

来源:互联网 发布:男士围巾织法 知乎 编辑:程序博客网 时间:2024/05/23 23:15

参考链接:http://www.osyunwei.com/archives/5943.html

Oralce中表空间概念、分类、操作,参考本人博文:http://blog.csdn.net/btt2013/article/details/50931665

使用SQL Developer连接到ebankdb数据库。

1、在SQL Developer工具中,执行该语句

create temporary tablespace ebank_temptempfile 'ebank_temp.dbf' size 2G extent management local; 


2、查看创建的表空间


3、依次执行以下语句,分别是:

创建表空间、创建用户并指定该用户的表空间、授予用户对表空间以及临时表空间的操作权限

--/ebank/oradata/data--ebank_tempcreate temporary tablespace ebank_temptempfile 'ebank_temp.dbf' size 2G extent management local; --ecifcreate tablespace ecif_datalogging datafile 'ecif_data01.dbf' size 10Gautoextend on next 50M maxsize unlimited extent management local; create tablespace ecif_indexdatafile 'ecif_index01.dbf' size 10Gautoextend on next 50M maxsize unlimited extent management local; --ecifcreate user ecif  identified by "ecif"  default tablespace ecif_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to ecif;grant dba to ecif;grant unlimited tablespace to ecif;--eipcreate tablespace eip_datalogging datafile 'eip_data01.dbf' size 10Gautoextend on next 50M maxsize unlimited extent management local; create tablespace eip_indexdatafile 'eip_index01.dbf' size 10Gautoextend on next 50M maxsize unlimited extent management local; --eipcreate user eip  identified by "eip"  default tablespace eip_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to eip;grant dba to eip;grant unlimited tablespace to eip;--eibscreate tablespace eibs_dataloggingdatafile 'eibs_data01.dbf'size 5Gautoextend onnext 50M maxsize unlimitedextent management local; create tablespace eibs_indexdatafile 'eibs_index01.dbf' size 2Gautoextend on next 50M maxsize unlimited extent management local; --eibscreate user eibs  identified by "eibs"  default tablespace eibs_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to eibs;grant dba to eibs;grant unlimited tablespace to eibs;--pibscreate tablespace pibs_datalogging datafile 'pibs_data01.dbf' size 5Gautoextend on next 50M maxsize unlimited extent management local; --alter database datafile'pibs_index01.dbf' RESIZEcreate tablespace pibs_indexdatafile 'pibs_index01.dbf' size 2Gautoextend on next 50M maxsize unlimited extent management local; --pibscreate user pibs  identified by "pibs"  default tablespace pibs_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to pibs;grant dba to pibs;grant unlimited tablespace to pibs;--bocreate tablespace bo_datalogging datafile 'bo_data01.dbf' size 1Gautoextend on next 50M maxsize unlimited extent management local; create tablespace bo_indexdatafile 'bo_index01.dbf' size 500Mautoextend on next 50M maxsize unlimited extent management local; --bocreate user bo  identified by "bo"  default tablespace bo_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to bo;grant dba to bo;grant unlimited tablespace to bo;--pmbscreate tablespace pmbs_datalogging datafile 'pmbs_data01.dbf' size 5Gautoextend on next 50M maxsize unlimited extent management local; create tablespace pmbs_indexdatafile 'pmbs_index01.dbf' size 2Gautoextend on next 50M maxsize unlimited extent management local; --pmbscreate user pmbs  identified by "pmbs"  default tablespace pmbs_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to pmbs;grant dba to pmbs;grant unlimited tablespace to pmbs;--rptcreate tablespace rpt_datalogging datafile 'rpt_data01.dbf' size 2Gautoextend on next 50M maxsize unlimited extent management local; create tablespace rpt_indexdatafile 'rpt_index01.dbf' size 1Gautoextend on next 50M maxsize unlimited extent management local; --rptcreate user rpt  identified by "rpt"  default tablespace rpt_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to rpt;grant dba to rpt;grant unlimited tablespace to rpt;--weixincreate tablespace weixin_datalogging datafile 'weixin_data01.dbf' size 1Gautoextend on next 50M maxsize unlimited extent management local; create tablespace weixin_indexdatafile 'weixin_index01.dbf' size 500Mautoextend on next 50M maxsize unlimited extent management local; --weixincreate user weixin  identified by "weixin"  default tablespace weixin_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to weixin;grant dba to weixin;grant unlimited tablespace to weixin;--wbscreate tablespace wbs_datalogging datafile 'wbs_data01.dbf' size 1Gautoextend on next 50M maxsize unlimited extent management local; create tablespace wbs_indexdatafile 'wbs_index01.dbf' size 500Mautoextend on next 50M maxsize unlimited extent management local; --wbscreate user wbs  identified by "wbs"  default tablespace wbs_data  temporary tablespace ebank_temp  profile DEFAULT;grant connect to wbs;grant dba to wbs;grant unlimited tablespace to wbs;

执行日志:

temporary TABLESPACE 已创建。tablespace ECIF_DATA 已创建。tablespace ECIF_INDEX 已创建。user ECIF 已创建。grant 成功。grant 成功。grant 成功。tablespace EIP_DATA 已创建。tablespace EIP_INDEX 已创建。user EIP 已创建。grant 成功。grant 成功。grant 成功。tablespace EIBS_DATA 已创建。tablespace EIBS_INDEX 已创建。user EIBS 已创建。grant 成功。grant 成功。grant 成功。tablespace PIBS_DATA 已创建。tablespace PIBS_INDEX 已创建。user PIBS 已创建。grant 成功。grant 成功。grant 成功。tablespace BO_DATA 已创建。tablespace BO_INDEX 已创建。user BO 已创建。grant 成功。grant 成功。grant 成功。tablespace PMBS_DATA 已创建。tablespace PMBS_INDEX 已创建。user PMBS 已创建。grant 成功。grant 成功。grant 成功。tablespace RPT_DATA 已创建。tablespace RPT_INDEX 已创建。user RPT 已创建。grant 成功。grant 成功。grant 成功。tablespace WEIXIN_DATA 已创建。tablespace WEIXIN_INDEX 已创建。user WEIXIN 已创建。grant 成功。grant 成功。grant 成功。

操作结果:


查看创建的用户



阅读全文
0 0
原创粉丝点击