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

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

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

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

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


 
 
  1. create temporary tablespace ebank_temp
  2. tempfile 'ebank_temp.dbf'
  3. size 2G
  4. extent management local;


2、查看创建的表空间


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

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


 
 
  1. --/ebank/oradata/data
  2. --ebank_temp
  3. create temporary tablespace ebank_temp
  4. tempfile 'ebank_temp.dbf'
  5. size 2G
  6. extent management local;
  7. --ecif
  8. create tablespace ecif_data
  9. logging
  10. datafile 'ecif_data01.dbf'
  11. size 10G
  12. autoextend on
  13. next 50M maxsize unlimited
  14. extent management local;
  15. create tablespace ecif_index
  16. datafile 'ecif_index01.dbf'
  17. size 10G
  18. autoextend on
  19. next 50M maxsize unlimited
  20. extent management local;
  21. --ecif
  22. create user ecif
  23. identified by "ecif"
  24. default tablespace ecif_data
  25. temporary tablespace ebank_temp
  26. profile DEFAULT;
  27. grant connect to ecif;
  28. grant dba to ecif;
  29. grant unlimited tablespace to ecif;
  30. --eip
  31. create tablespace eip_data
  32. logging
  33. datafile 'eip_data01.dbf'
  34. size 10G
  35. autoextend on
  36. next 50M maxsize unlimited
  37. extent management local;
  38. create tablespace eip_index
  39. datafile 'eip_index01.dbf'
  40. size 10G
  41. autoextend on
  42. next 50M maxsize unlimited
  43. extent management local;
  44. --eip
  45. create user eip
  46. identified by "eip"
  47. default tablespace eip_data
  48. temporary tablespace ebank_temp
  49. profile DEFAULT;
  50. grant connect to eip;
  51. grant dba to eip;
  52. grant unlimited tablespace to eip;
  53. --eibs
  54. create tablespace eibs_data
  55. logging
  56. datafile 'eibs_data01.dbf'
  57. size 5G
  58. autoextend on
  59. next 50M maxsize unlimited
  60. extent management local;
  61. create tablespace eibs_index
  62. datafile 'eibs_index01.dbf'
  63. size 2G
  64. autoextend on
  65. next 50M maxsize unlimited
  66. extent management local;
  67. --eibs
  68. create user eibs
  69. identified by "eibs"
  70. default tablespace eibs_data
  71. temporary tablespace ebank_temp
  72. profile DEFAULT;
  73. grant connect to eibs;
  74. grant dba to eibs;
  75. grant unlimited tablespace to eibs;
  76. --pibs
  77. create tablespace pibs_data
  78. logging
  79. datafile 'pibs_data01.dbf'
  80. size 5G
  81. autoextend on
  82. next 50M maxsize unlimited
  83. extent management local;
  84. --alter database datafile'pibs_index01.dbf' RESIZE
  85. create tablespace pibs_index
  86. datafile 'pibs_index01.dbf'
  87. size 2G
  88. autoextend on
  89. next 50M maxsize unlimited
  90. extent management local;
  91. --pibs
  92. create user pibs
  93. identified by "pibs"
  94. default tablespace pibs_data
  95. temporary tablespace ebank_temp
  96. profile DEFAULT;
  97. grant connect to pibs;
  98. grant dba to pibs;
  99. grant unlimited tablespace to pibs;
  100. --bo
  101. create tablespace bo_data
  102. logging
  103. datafile 'bo_data01.dbf'
  104. size 1G
  105. autoextend on
  106. next 50M maxsize unlimited
  107. extent management local;
  108. create tablespace bo_index
  109. datafile 'bo_index01.dbf'
  110. size 500M
  111. autoextend on
  112. next 50M maxsize unlimited
  113. extent management local;
  114. --bo
  115. create user bo
  116. identified by "bo"
  117. default tablespace bo_data
  118. temporary tablespace ebank_temp
  119. profile DEFAULT;
  120. grant connect to bo;
  121. grant dba to bo;
  122. grant unlimited tablespace to bo;
  123. --pmbs
  124. create tablespace pmbs_data
  125. logging
  126. datafile 'pmbs_data01.dbf'
  127. size 5G
  128. autoextend on
  129. next 50M maxsize unlimited
  130. extent management local;
  131. create tablespace pmbs_index
  132. datafile 'pmbs_index01.dbf'
  133. size 2G
  134. autoextend on
  135. next 50M maxsize unlimited
  136. extent management local;
  137. --pmbs
  138. create user pmbs
  139. identified by "pmbs"
  140. default tablespace pmbs_data
  141. temporary tablespace ebank_temp
  142. profile DEFAULT;
  143. grant connect to pmbs;
  144. grant dba to pmbs;
  145. grant unlimited tablespace to pmbs;
  146. --rpt
  147. create tablespace rpt_data
  148. logging
  149. datafile 'rpt_data01.dbf'
  150. size 2G
  151. autoextend on
  152. next 50M maxsize unlimited
  153. extent management local;
  154. create tablespace rpt_index
  155. datafile 'rpt_index01.dbf'
  156. size 1G
  157. autoextend on
  158. next 50M maxsize unlimited
  159. extent management local;
  160. --rpt
  161. create user rpt
  162. identified by "rpt"
  163. default tablespace rpt_data
  164. temporary tablespace ebank_temp
  165. profile DEFAULT;
  166. grant connect to rpt;
  167. grant dba to rpt;
  168. grant unlimited tablespace to rpt;
  169. --weixin
  170. create tablespace weixin_data
  171. logging
  172. datafile 'weixin_data01.dbf'
  173. size 1G
  174. autoextend on
  175. next 50M maxsize unlimited
  176. extent management local;
  177. create tablespace weixin_index
  178. datafile 'weixin_index01.dbf'
  179. size 500M
  180. autoextend on
  181. next 50M maxsize unlimited
  182. extent management local;
  183. --weixin
  184. create user weixin
  185. identified by "weixin"
  186. default tablespace weixin_data
  187. temporary tablespace ebank_temp
  188. profile DEFAULT;
  189. grant connect to weixin;
  190. grant dba to weixin;
  191. grant unlimited tablespace to weixin;
  192. --wbs
  193. create tablespace wbs_data
  194. logging
  195. datafile 'wbs_data01.dbf'
  196. size 1G
  197. autoextend on
  198. next 50M maxsize unlimited
  199. extent management local;
  200. create tablespace wbs_index
  201. datafile 'wbs_index01.dbf'
  202. size 500M
  203. autoextend on
  204. next 50M maxsize unlimited
  205. extent management local;
  206. --wbs
  207. create user wbs
  208. identified by "wbs"
  209. default tablespace wbs_data
  210. temporary tablespace ebank_temp
  211. profile DEFAULT;
  212. grant connect to wbs;
  213. grant dba to wbs;
  214. 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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值