创建表空间及数据库用户
  Bj5hMCbcxLzH 2023年11月13日 24 0
select * from dba_data_files ; ---查看用来导数据库的数据库数据文件路径信息
 
 ----创建顺德一体化项目的数据库的对应的表空间。该数据库文件最少需要2个
create tablespace sync_plus_1   datafile
  '/u01/app/oracle/oradata/orcl/sync_plus_1_01.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_02.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_03.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_04.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_05.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_06.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_07.dbf' size 500M  autoextend on next 100M
 , '/u01/app/oracle/oradata/orcl/sync_plus_1_08.dbf' size 500M  autoextend on next 100M maxsize unlimited logging extent management local autoallocate segment space management auto


/*
create tablespace SYNC_PLUS_1
datafile '/u01/app/oracle/oradata/orcl/SYNC_PLUS_1.DBF' size 100M --生成数据文件并定义文件大小
autoextend on next 100M maxsize unlimited logging    --设置自动扩展
extent management local autoallocate
segment space management auto;
*/


--创建用户 设置权限
create user SYNC_PLUS_1 identified by  SYNC_PLUS_1 default tablespace SYNC_PLUS_1 quota 500m on users;
----  这里第一个  TEST_SYNC  为用户名,第二个  TEST_SYNC  为密码,第三个  SYNC_PLUS_1 为表空间名。然后执行。
grant all privileges to   SYNC_PLUS_1;
--- 执行该语句给  TEST_SYNC  用户授权,此时  TEST_SYNC  用户就可以登录了。

---创建角色
create role  ALLINONE_JX ;
create role  ALLOUTSIDE ;
create role  ALLTAX ;
create role RDCX;

---给用户分配角色
grant ALLTAX  to sync_plus_1 ;
grant ALLINONE_JX  to sync_plus_1 ;
grant ALLOUTSIDE to sync_plus_1 ;
grant dba to sync_plus_1;
grant RDCX to sync_plus_1; 

---增加表空间的数据文件
alter tablespace  sync_plus_1 add   datafile
  'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_01.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_02.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_03.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_04.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_05.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_06.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_07.dbf' size 500M  autoextend on next 100M
 , 'D:\SOFT\DEVELOP\DATABASE\ORACLE\ORADATA\ORCL\sync_plus_1_08.dbf' size 500M  autoextend on next 100M
select  * from dba_data_files ;
select * from  dba_users;

-- 删除 用户
DROP USER SYNC_PLUS_1 cascade;
-- 删除表空间
 drop tablespace SYNC_PLUS_ORCLPDB1 including contents and datafiles ;

 

 

为人:谦逊、激情、博学、审问、慎思、明辨、 笃行
学问:纸上得来终觉浅,绝知此事要躬行
为事:工欲善其事,必先利其器。
态度:道阻且长,行则将至;行而不辍,未来可期
.....................................................................
------- 桃之夭夭,灼灼其华。之子于归,宜其室家。 ---------------
------- 桃之夭夭,有蕡其实。之子于归,宜其家室。 ---------------
------- 桃之夭夭,其叶蓁蓁。之子于归,宜其家人。 ---------------
=====================================================================
* 博客文章部分截图及内容来自于学习的书本及相应培训课程以及网络其他博客,仅做学习讨论之用,不做商业用途。


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  RdEelXhuDp09   2023年12月07日   29   0   0 oracleoracle
Bj5hMCbcxLzH