游标溢出问题

SQL> set serveroutput on
SQL> DECLARE
  CURSOR cur IS
    SELECT DATA_DATE,
  ACCT_NO       ,
  ACCT_ORD     ,
  ACCT_NO_PK    ,
  CARD_CODE     ,
  CUST_NO       ,
  BANK_CORP_CODE,
  MGR_CODE      ,
  BRAN_CODE     ,
  SUB_CODE      ,
  CUR_CODE      ,
  TERM          ,
  TERM_FLAG     ,
  ACCT_BAL      ,
  OPEN_DATE     ,
  START_INT_DATE,
  DUE_DATE      ,
  CANCEL_DATE   ,
  NOR_INT_RATE  ,
  ACCT_ATTR_NAME,
  BUSI_NAME     ,
  ACCT_STATUS   ,
  FLAG           
  from T_PM_DEPOSIT_HIS;
BEGIN
  FOR row IN cur LOOP
    DBMS_OUTPUT.PUT_LINE('last name: ' || row.ACCT_NO || '--' ||row.OPEN_DATE);
  END LOOP;
END;  2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   


25   26   27   28   29   30   31  
 32  /
DECLARE
*
ERROR at line 1:
ORA-04030: out of process memory when trying to allocate 16328 bytes (koh-kghu
sessi,pl/sql vc2)




This is caused by a shortage of RAM on a dedicated (non shared server) environment.  Depending on your release of 


Oracle, you have several options:




Increase pga_aggregate_target


Decrease sort_area_size and/or hash_area_size


Move to multi-threaded server (a.k.a. MTS or shared servers)




游标(CURSOR)是指向一个称为上下文相关区的局域的指针,这个区域在服务器的处理过程在PGA内执行。

你可能感兴趣的:(游标溢出问题)