OracleÖдò¿ªÓα곬³ö×î´óÖµ
ÏòOracleÊý¾Ý¿â±íÖвåÈëÊ®¼¸ÍòÌõÊý¾Ý£¬¿ÉÊǵ±²åÈë3Íò¶àÌõºó£¬³ÌÐò¾ÍÅ×
Java´úÂë
ORA-01000 maximum open cursors exceeded
ORA-01000 maximum open cursors exceeded
Òì³£ÐÅÏ¢¡£GoogleÁËÒì³£ÐÅÏ¢£¬µÃÖªÕâÑùµÄ´íÎóºÜÈÝÒ׳öÏÖÔÚJava´úÂëÖеÄÖ÷ÒªÔÒòÊÇ£ºJava´úÂëÔÚÖ´ÐÐconn.createStatement()ºÍconn.prepareStatement()µÄʱºò£¬Êµ¼ÊÉ϶¼ÊÇÏ൱ÓÚÔÚÊý¾Ý¿âÖдò¿ªÁËÒ»¸öcursor¡£ÓÈÆäÊÇ£¬Èç¹ûÄãµÄcreateStatementºÍprepareStatementÊÇÔÚÒ»¸öÑ»·ÀïÃæµÄ»°£¬¾Í»á·Ç³£ÈÝÒ׳öÏÖÕâ¸öÎÊÌâ¡£ÒòΪÓαêÒ»Ö±ÔÚ²»Í£µÄ´ò¿ª£¬¶øÇÒûÓйرա£
Ò»°ãÀ´Ëµ£¬ÎÒÃÇÔÚдJava´úÂëµÄʱºò£¬createStatementºÍprepareStatement¶¼Ó¦¸ÃÒª·ÅÔÚÑ»·ÍâÃæ£¬¶øÇÒʹÓÃÁËÕâЩStatmentºó£¬¼°Ê±¹Ø±Õ¡£×îºÃÊÇÔÚÖ´ÐÐÁËÒ»´ÎexecuteQuery¡¢executeUpdateµÈÖ®ºó£¬Èç¹û²»ÐèҪʹÓýá¹û¼¯£¨ResultSet£©µÄÊý¾Ý£¬¾ÍÂíÉϽ«Statment¹Ø±Õ£¨statementName.close()£©¡£
ÏÂÃæ½«´úÂ븽ÉÏ
Å×Òì³£´úÂ룺
Java´úÂë
Connection conn = DBUtils.getConnection();//»ñÈ¡Êý¾Ý¿âÁ¬½Ó
PreparedStatement pstmt = conn.prepareStatement("select statement...");
ResultSet rset = pstmt.executeQuery();
while (rset.next()) {
PreparedStatement pst=conn.prepareStatement("insert statement...");//¿ªÆôÒ»¸öÓαê
//pst.setXXX()...;
pst.executeUpdate();
pst=conn.prepareStatement("another insert statement");//ÔÙ¿ªÆôÒ»¸öÓαê
//pst.setXXX()...;
pst.executeUpdate();
pst=conn.prepareStatement("third insert statement");//¿ªÆôÒ»¸öÓαê
//pst.setXXX()...;
&
Ïà¹ØÎĵµ£º
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.5.0
This problem can occur on any platform.
Symptoms:
The issue is that the following error was raised :
ORA-00600: internal error code, arguments: [kesutlGetBindValue-2], [], [], [], [], [], [], []
The recent changes ......
SQL> show user
USER is "SYS"
SQL> create user t1 identified by t1;
create user t1 identified by t1
*
ERROR at line 1:
ORA-01920: user name 'T1' conflicts with another user or role name
SQL> drop user t1 cascade;
User dropped.
SQL> create user t1 identified by t1;
Us ......
3oracleÊý¾Ý¿âµÄ×Ö·û¼¯¸ü¸Ä
A¡¢oracle server ¶Ë ×Ö·û¼¯²éѯ
select userenv(‘language’) from dual
ÆäÖÐNLS_CHARACTERSET Ϊserver¶Ë×Ö·û¼¯
NLS_LANGUAGE Ϊ server¶Ë×Ö·ûÏÔʾÐÎʽ
B¡¢²éѯoracle client¶ËµÄ×Ö·û¼¯
$echo $NLS_LANG
Èç¹û·¢ÏÖÄãselect ³öÀ´µÄÊý¾ÝÊÇÂÒÂ룬Çë°Ñclient¶ËµÄ×Ö· ......
¶ÔÓÚx$µÄÇé¿ö
SQL> grant select on sys.x$bh to t1;
grant select on sys.x$bh to t1
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
¶ÔÓÚfixed tables/viewsÖ»ÄÜselect
Èç¹ûÏë°Ñx$bhµÄselectȨÏÞgrant¸øÆäËûÓû§Ôõô°ìÄØ,¿ÉÒÔ±äͨһÏÂ
SQL> create view xbh as select * from sys.x$ ......
µ¼³öOracleÊý¾Ý¿â½á¹¹
1.·½·¨Ò»£ºÖ±½ÓдsqlÓï¾ä
//»ñȡһ¸öSCHEMAϵÄËùÓн¨±íºÍ½¨Ë÷ÒýµÄÓï·¨£¬ÒÔscottΪÀý£º
spool portal_schema.sql
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
from USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)
from USER_INDEXES u;
spool off;
2. ......