Oracle RAC创建表空间和用户

创建表空间:
create tablespace hr6_Data datafile
    '+DATA' size 5000M REUSE
autoextend on next 10M MAXSIZE Unlimited
extent management local autoallocate
permanent
online;

创建临时表空间:
create temporary tablespace hr6_TempData tempfile
    '+DATA' size 200M REUSE
autoextend on next 10M MAXSIZE Unlimited
extent management local uniform size 256K;

查看表空间情况:
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size 
FROM dba_tablespaces t, dba_data_files d 
WHERE t.tablespace_name = d.tablespace_name 
GROUP BY t.tablespace_name; 

创建用户:
SQL> create user wmwhse6 profile SCEUSER identified by "XXXX"
  default tablespace wmwhse6_Data temporary tablespace wmwhse6_TempData;


User created.


SQL> grant connect,resource to wmwhse6;


Grant succeeded.


SQL> grant dba to wmwhse6;


Grant succeeded.


SQL> create role r_wmwhse6 not identified;


Role created.


SQL> grant r_wmwhse6 to wmwhse6;


Grant succeeded.

删除临时表空间:
SQL> DROP TABLESPACE HR6_TEMPDATA INCLUDING CONTENTS AND DATAFILES;


Tablespace dropped.

删除表空间:
SQL> DROP TABLESPACE HR6_DATA INCLUDING CONTENTS AND DATAFILES;


Tablespace dropped.

请使用浏览器的分享功能分享到微信等