ORA10922 Temporary tablespace group is empty错误

错误--练习查询,发现报错;

SQL>  select * from range_list_part_tab where id=100000
Execution Plan
----------------------------------------------------------
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-10922: Temporary tablespace group is empty
SP2-0612: Error generating AUTOTRACE EXPLAIN report
误差:
ora-00604:错误发生在递归SQL 1级
ora-10922:临时表空间组是空的
sp2-0612:错误产生AUTOTRACE解释报告

--查询数据库默认临时表空间;
SQL> select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE'; 
TEMP

---查询临时表空间的使用情况
SELECT temp_used.tablespace_name, 
       total - used as "Free", 
       total as "Total", 
       round(nvl(total - used, 0) * 100 / total, 3) "Free percent" 
  FROM (SELECT tablespace_name, SUM(bytes_used) / 1024 / 1024 used 
          FROM GV_$TEMP_SPACE_HEADER 
         GROUP BY tablespace_name) temp_used, 
       (SELECT tablespace_name, SUM(bytes) / 1024 / 1024 total 
          FROM dba_temp_files 
         GROUP BY tablespace_name) temp_total 

 WHERE temp_used.tablespace_name = temp_total.tablespace_name 
                                                    ---空闲大小M --总大小  --空闲率
TABLESPACE_NAME                      Free      Total Free percent
TEMP                                                 38        680        5.588


--查询临时表空间的数据文件;
SQL> select file_name,file_id,tablespace_name,bytes/1024/1024 from dba_temp_files;
---------- ------------------------------ ---------------
/picclife/app/oracle/oradata/jx/temp01.dbf
         1 TEMP                                       640
/picclife/app/oracle/oradata/jx/temp02.dbf
        2 TEMP                                      20
--增加数据文件大小;
alter database tempfile '/picclife/app/oracle/oradata/jx/temp01.dbf' resize 100M;


---发现还是报错,错误未解决;临时表空间组;   ???
SQL> select * from dba_tablespace_groups;
GROUP_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
TMP_GRP                        TEMP


---数据库默认临时表空间TEMP,TEMP归属于TMP_GRP组;
但是增加TEMP数据文件后还是报错;
查询相关报错用户对应使用的临时表空间;
SQL> select username,default_tablespace,temporary_tablespace from dba_users where username='YANG';


USERNAME                       DEFAULT_TABLESPACE  TEMPORARY_TABLESPACE
------------------------------ ------------------------------
YANG                                 USERS                               TEMP_GRP1

---根本就没有这个组;  --修改用户对应的临时表空间;
SQL> alter user yang temporary tablespace temp;  **(如果需要使用临时表空间组,将temp换成TMP_GRP=>OK);

---验证,被删除的临时表空间组是否还有用户在使用,如果有,替换;
SQL> select username,default_tablespace,temporary_tablespace from dba_users where temporary_tablespace='TEMP_GRP1';
no rows selected


方法二、
***当然也可以创建一个删除的临时表空间组;
创建临时表空间: 
 create temporary tablespace temp1 tempfile ‘/u01/app/oracle/oradata/orcl/temp11.dbf’ size 10M; 

创建临时表空间组: 
create temporary tablespace tempts1 tempfile '/home/oracle/temp1_02.dbf' size 2M tablespace group group1; 

  
查询临时表空间组:dba_tablespace_groups视图 
select * from dba_tablespace_groups; 
GROUP_NAME                     TABLESPACE_NAME 
------------------------------ ------------------------------ 
GROUP1                         TEMPTS1 


为一个临时表空间指定一个临时表空间组(     ----临时表空间组移动到另外一个临时表空间组): 
alter tablespace tempts1 tablespace group GROUP2 ; 


小结:根据报错信息,多看多想,上来就是干,把自己绕进去了;
原文地址:https://www.cnblogs.com/lvcha001/p/7663584.html