С²ËÄñÎÊ£ºoracleÖеÄÒ»¸ö´¥·¢Æ÷ÎÊÌâ
ÎÊÌâ
£¨1£©±íemployeesºÍdepartment´æÔÚ²ÎÕÕÍêÕûÐÔÔ¼Êø£¬ÔÚ±íemployeesÖвåÈë¼Ç¼£¨‘70’£¬‘999’£©department_idΪ‘999’ʱ£¬department±íÖл¹²»´æÔÚdepartment_idΪ‘999’µÄ¼Ç¼£¬ËùÒÔÎ¥±³Á˲ÎÕÕÍêÕûÐÔÔ¼Êø,³öÏÖ“Integrity constraint violation error”ÌáʾÐÅÏ¢¡£
UPDATE employees SET department_id = 999 WHERE employee_id = 170;
-- Integrity constraint violation error
£¨2£©
CREATE OR REPLACE TRIGGER constr_emp_trig
AFTER UPDATE ON employees
FOR EACH ROW
BEGIN
INSERT INTO departments
VALUES (999, 'dept999', 140, 2400);
END;
/
½á¹û£ºInsert²Ù×÷ËäȻΥ·´Á˲ÎÕÕÍêÕûÐÔÔ¼Êø£¬µ«employees±íÖÐÒÀÈ»³É¹¦²åÈëÁËÒ»ÌõмǼ¡£
Ïà¹ØÎĵµ£º
À´×Ôhttp://www.inthirties.com/thread-239-1-1.html
ÔÚÕâÀï»á½éÉÜUNDO£¬REDOÊÇÈçºÎ²úÉúµÄ£¬¶ÔTRANSACTIONSµÄÓ°Ï죬ÒÔ¼°ËûÃÇÖ®¼äÈçºÎÐͬ¹¤×÷µÄ¡£
ʲôÊÇREDO
REDO¼Ç¼transaction logs£¬·ÖΪonlineºÍarchived¡£ÒÔ»Ö¸´ÎªÄ¿µÄ¡£
±ÈÈ磬»úÆ÷Í£µç£¬ÄÇôÔÚÖØÆðÖ®ºóÐèÒªonline redo logsÈ¥»Ö¸´ÏµÍ³µ ......
3oracleÊý¾Ý¿âµÄ×Ö·û¼¯¸ü¸Ä
A¡¢oracle server ¶Ë ×Ö·û¼¯²éѯ
select userenv(‘language’) from dual
ÆäÖÐNLS_CHARACTERSET Ϊserver¶Ë×Ö·û¼¯
NLS_LANGUAGE Ϊ server¶Ë×Ö·ûÏÔʾÐÎʽ
B¡¢²éѯoracle client¶ËµÄ×Ö·û¼¯
$echo $NLS_LANG
Èç¹û·¢ÏÖÄãselect ³öÀ´µÄÊý¾ÝÊÇÂÒÂ룬Çë°Ñclient¶ËµÄ×Ö· ......
½ñÌì¿´µ½Ò»Æª¹ØÓÚORCLEµÄÂß¼±¸·Ý£¬Àä¡¢Èȱ¸·ÝµÄÌû×Ó½²µÄͦºÃµÄ£¬²»¹ýÕâƪÎÄÕÂÊÇÒÔORACLE 7ΪÀý×Ó£¬ËäÈ»ÏÖÔÚÒѾÓкܺúÜÇ¿´óµÄRMAN£¬µ«»¹ÊǾõµÃÓбØҪת¹ýÀ´£¬²»ÄÜϲÐÂÑá¾ÉÂï¡£
==================================================================================
OracleÊý¾Ý¿âµÄ±¸·ÝÓë»Ö¸´
---- µ±ÎÒÃÇ ......
ÔÚSQLÓï¾äÓÅ»¯¹ý³ÌÖУ¬¾³£»áÓõ½hint,ÏÂÃæÎÒÃÇÀ´½éÉÜÒ»ÏÂÔÚSQLÓÅ»¯¹ý³ÌÖг£¼ûOracleÖÐ"HINT"µÄ30¸öÓ÷¨£º
¡¡¡¡1. /*+ALL_ROWS*/
¡¡¡¡±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯¡£
¡¡¡¡2. /*+FIRST_ROWS*/
¡¡¡¡±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÏìӦʱ¼ä,ʹ×ÊÔ´ÏûºÄ×îÐ ......
ÏòOracleÊý¾Ý¿â±íÖвåÈëÊ®¼¸ÍòÌõÊý¾Ý£¬¿ÉÊǵ±²åÈë3Íò¶àÌõºó£¬³ÌÐò¾ÍÅ×
Java´úÂë
ORA-01000 maximum open cursors exceeded
ORA-01000 maximum open cursors exceeded
Òì³£ÐÅÏ¢¡£GoogleÁËÒì³£ÐÅÏ¢£¬µÃÖªÕâÑùµÄ´íÎóºÜÈÝÒ׳öÏÖÔÚJava´úÂëÖеÄÖ÷ÒªÔÒòÊÇ£ºJava´úÂëÔÚÖ´ÐÐconn.crea ......