»ùÓÚOCCI·ÃÎÊOracleµÄ¼Ç¼
ÎÒÔÚoracle 9iµÄ»·¾³Ï¿ª·¢ÁËocciµÄÓ¦Ó㬽á¹û·Åµ½10g(10.2.0.3)·þÎñÆ÷ÉÏÔËÐв»ÁË(Ö»×°ÁËwindows °æµÄ10g·þÎñ¶Ë)£¬Ö»ºÃ°ÑËùÓÐÒÀÀµµÄ9iµÄdll¿½¹ýÈ¥£¬½á¹ûÁ¬½Óocci±¨´í£º
Error while trying to retrieve text for error ORA-32101
µ½http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/index.htmlÏÂÔØÒ»¸ö¼´Ê±¿Í»§¶Ë10g(10.2.0.3)
°²×°²¢ÉèÖÃinstantclient£¨½âѹËõµ½CÅÌ£¬ÉèÖÃpathºÍTMS_ADMINµÈ»·¾³±äÁ¿)£¬»¹ÊÇORA-32101´íÎ󣨶øÇÒµ¼ÖÂÔÀ´ÆäËû»ùÓÚODBC·ÃÎÊoracleµÄÓ¦ÓÃÒ²»á±¨´íÁË£ºinternal error -
unable to initialize NLS during driver load.£©
GoogleÖ®£¬ËµÒªÉèÖû·¾³±äÁ¿£¬Ìí¼ÓORACLE_HOME=c:\oracle\product\10.1.0\em_1£¬±¨´í¸Ä±ä£ºORA-12538: TNS:no such protocol adapter
ÔÙGoogleÖ®£¬ÓиßÈËÌáµ½£º
10gµÄocci¿â¶ÔÓ¦²»Í¬µÄvcÓв»Í¬µÄ¿âÎļþ£¨ÔÚhttp://www.oracle.com/technology/tech/oci/occi/occidownloads.html¿ÉÏÂÔØvc8µÄ¿â£¬ÔÚinstantclient sdk°üÀïÓÐvc7,vc71µÄ
¿â£¬oracle·þÎñ¶Ë°²×°ºóÒ²ÓÐĬÈϵÄociµÄ¿â£©£¬µ«ÎÒÏÂÔÚµÄ10g(10.2.0.3) instantclientÀïÃæÖ»ÓÐvc7,vc71µÄ¿â£¬¾ÍÊÇûÓÐvc6µÄ£¡£¡
Èç¹ûÖ±½ÓÓÃoracle 10g(10.2.0.3)·þÎñ¶Ë×Ô´øµÄocci¿â£¨ÔÚC:\oracle\product\10.1.0\db_1\OCI\lib\MSVC\)£¬½á¹ûÔËÐÐʱ
try{
env = Environment::createEnvironment (Environment::DEFAULT);
conn = env->createConnection (user, passwd, db);
}catch(SQLException ex)
{
errS = (ex.getMessage()).c_str();
errCode = ex.getErrorCode();
}
ÔËÐе½ÕâÒ»¾äerrS = ex.getMessage();»áÒì³££¡ÕâÓ¦¸ÃÊÇÓÉÓÚ10g occiÓõÄstringºÍvc6 µÄ string²»¼æÈÝÔì³ÉµÄ¡£
¸Ä³ÉerrS = ex.getMessage().c_str();ºó¿ÉÒÔ¿´¼û»ñµÃµÄ´íÎóÃèÊö£º
ORA-24960: ÊôÐÔ OCI_ATTR_USERNAME µÄ³¤¶È´óÓÚ×î´óÔÊÐí³¤¶È 255
ºóÀ´²Å·¢ÏÖ10.1.0.5°æ±¾µÄ10gµÄinstantclient sdk²ÅÓÐÖ§³Övc6µÄ¿â£¨10.2.0.3ÒÔºó¾ÍûÓÐÁË£©£¬ÓÃÕâ¸öÌæ»»10.2.0.3µÄ¿â£¬±àÒëÍê³É£¬ÔÙ½«instantclientÀïÃæµÄoci.dll¼°vc6
ÏÂÃæµÄoraocci10.dll·Åµ½Ö´ÐÐÎļþ
Ïà¹ØÎĵµ£º
ÈçºÎʹexpµÄ°ïÖúÒÔ²»Í¬µÄ×Ö·û¼¯ÏÔʾ:
ÖÐÎÄÏÔʾ£ºset nls_lang=simplified chinese_china.zhs16gbk
Ó¢ÎÄÏÔʾ£ºset nls_lang=American_america
EXPµÄËùÓвÎÊý£¨À¨ºÅÖÐΪ²ÎÊýµÄĬÈÏÖµ£©£º
USERID Óû§Ãû/¿ÚÁî È磺 USERID=duanl/duanl &nbs ......
--µ±ÇëÇóÖ´Ðкó²»ÄÜ"²é¿´Êä³ö"µÄʱºò±íʾÓнø³ÌËÀËøÁË
--²éÕÒËÀËøµÄ½ø³Ì
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time
--ɾ³ýËÀËøµÄ½ø³Ì£¬É¾³ýµ±ÌìÇ°µÄ£¬²»ÄÜɾ³ýµ±ÌìµÄ£¬
--alter system kill session 't2.sid,t ......
Ç°ÑÔ£º
OracleµÄ¶Ô±í²Ù×÷ÖÐÓÐÒ»ÖÖÀàËÆÓÚDataSetµÄ¶ÔÏó²Ù×÷·½·¨CURSOR£¬Ëü¿ÉÒÔͨ¹ý½¨Á¢±íµÄ²Ù×÷¶ÔÏó»òÕß˵±íµÄÖ¸Õë¶ÔÏóÀ´´ïµ½´Ó±íÀïÃæÌáÈ¡Êý¾ÝµÄ²Ù×÷¡£
˵Ã÷£º
Ò»°ãͨ¹ýSQLÓïÑÔ¿ÉÒÔÕë¶Ôij¸ö±íµÄijһÐлò¶àÐÐÊý¾Ý½øÐвÙ×÷±ÈÈç˵SELECT£¬UPDATEµÈ¡£ÕâЩ²Ù×÷±ØÐëÒÔSQLÓï¾äµÄÓï·¨¸ñʽÀ´±»½âÊÍÆ÷½âÊͲ¢Ö´ÐС£ÔÚʵ¼ ......
Select to_char(sysdate,'ss') from dual;--È¡µ±Ç°Ê±¼äÃ벿·Ö
Select to_char(sysdate,'mi') from dual;--È¡µ±Ç°Ê±¼ä·ÖÖÓ²¿·Ö
Select to_char(sysdate,'HH24') from dual;--È¡µ±Ç°Ê±¼äÃëСʱ²¿·Ö
Select to_char(sysdate,'DD') from dual;--È¡µ±Ç°Ê±¼äÈÕÆÚ²¿·Ö
Select to_char(sysdate,'MM') from dual;--È¡µ±Ç°Ê±¼ ......
ÔÚÒ»±íorginfoÉϽ¨Á¢´¥·¢Æ÷£¬ÆäÖаüÀ¨ÒÔ϶¯×÷£º
Ôöɾ¸Ä´Ë±íµÄ¼Ç¼ʱ£¬ÐèÒª²éѯ´Ë±í£¬ÉõÖÁ¸Äд´Ë±íµÄÆäËû¼Ç¼¡£±¨¸æ“ora-04091:±íÒѾ±»Ð޸ģ¬¶ÔÓÚ´¥·¢Æ÷/º¯Êý²»¿É¼û”¡£
Cause: A trigger (or a user defined PL/SQL function that is referenced in this statement) attempted to look at (or modify) a tab ......