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