select *
  from (select a.deviceid,
   f.ZWCM,
   h.BWMC PORTNAME,
   t.cbbh,
   '正常' XINHAO,
   a.gpstime,
   '进港' state,
   t.ywbh,
   f.cbzldm,
   to_char(t.czsj, 'yyyy-mm-dd hh24:mi:ss') time
  from zxdb.DTYW_QZCY_JGORCG_SS t,
   zxdb.DTYW_CBJBXX         f,
   zxdb.DTXT_BW             h,
   gps.gpsinfo              a,
   gps.boatinfo             b
 where t.cbbh = f.cbbh(+)
   and t.bwdm = h.bwdm(+)
   and f.zwcm = b.boatname(+)
   and b.id = a.deviceid(+)
   and t.jg_cg = 'j'
   and t.czsj between to_date('2011-12-07 16', 'yyyy-mm-dd hh24') and
   to_date('2011-12-08 16', 'yyyy-mm-dd hh24')) c
 运行没有问题
在最外面加上 
where trunc((sysdate - c.gpstime) * 24 * 60) < 10之后 报错ORA-01652:无法通过128(在表空间TEMP)扩展TEMP段?

解决方案 »

  1.   

    不要光顾着增加temp空间,治标不治本的办法建议还是检查下,为什么导致temp使用了那么多,从根本上解决问题,最常见的是临时表,大量排序等
      

  2.   

    temp表空间设置成自动扩展吧。  
      

  3.   

    原因不多讲了,具体解决方法请参考:-- 首先查询你的表空间的临时表空间对应的数据文件名
    select file_id from dba_temp_files where tablespace_name=你的表空间名;-- 使用刚刚查询出来的file_id更改时间表空间的增长方式为自动增长
    alter database tempfile file_id autoextend on next 100M maxsize 1G;