Oracle RAC建立表空間和使用者

ywxj_001發表於2017-12-25
建立表空間:
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.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22996654/viewspace-2149189/,如需轉載,請註明出處,否則將追究法律責任。

相關文章