SQL> select * from dba_tablespace_groups;

no rows selected


SQL> select tablespace_name from dba_tablespaces where contents = 'TEMPORARY';

TABLESPACE_NAME
----------------------------
TEMP

SQL> alter tablespace temp tablespace group tempgroup_a;

Tablespace altered.

SQL> select * from dba_tablespace_groups;

GROUP_NAME                  TABLESPACE_NAME
--------------------------- --------------------------------
TEMPGROUP_A                TEMP

SQL>
begin
for rec in (select username,temporary_tablespace from dba_users
where account_status = 'OPEN') loop
execute immediate 'alter user '||rec.username||' temporary tablespace tempgroup_a';
end loop;
end;
/

SQL> create temporary tablespace temp2 tempfile size 1000M autoextend on next 100M tablespace group tempgroup_a;


SQL> create temporary tablespace temp3 tempfile size 1000M autoextend on next 100M tablespace group tempgroup_a;


SQL> create temporary tablespace temp4 tempfile size 1000M autoextend on next 100M tablespace group tempgroup_a;

SQL> select * from dba_tablespace_groups;

GROUP_NAME                  TABLESPACE_NAME
--------------------------- --------------------------------
TEMPGROUP_A               TEMP
TEMPGROUP_A               TEMP2
TEMPGROUP_A               TEMP3
TEMPGROUP_A               TEMP4

arrow
arrow
    全站熱搜

    DanBrother 發表在 痞客邦 留言(0) 人氣()