ORACLEµÄÈý¸öÅäÖÃÎļþ½éÉÜ
¸ÅÊö
ÔÚoracle°²×°Ä¿Â¼$HOME/network/adminÏÂ,£¬¾³£¿´µ½sqlnet.ora tnsnames.ora listener.oraÕâÈý¸öÎļþ£¬³ýÁËtnsnames.ora£¬ÆäËûÁ½¸öÎļþÏêϸµÄÓÃ;ºÜ¶àÈ˶¼²»Ì«Á˽⡣
sqlnet.ora ÓÃÔÚoracle client¶Ë£¬ÓÃÓÚÅäÖÃÁ¬½Ó·þÎñ¶ËoracleµÄÏà¹Ø²ÎÊý.
tnsnames.ora ÓÃÔÚoracle client¶Ë£¬Óû§ÅäÖÃÁ¬½ÓÊý¾Ý¿âµÄ±ðÃû²ÎÊý,¾ÍÏñϵͳÖеÄhostsÎļþÒ»Ñù¡£listener.ora ÓÃÔÚoracle server¶Ë£¬ÅäÖÃoracle·þÎñ¶Ë³ÌÐòµÄ¼àÌý°ì·¨£¬±ÈÈçÏÞÖÆijЩipµÈ²ÎÊý¡£
ÔÚ°²×°Ä¿Â¼$HOME/network/admin/samplesÏ£¬»á¿´µ½ÈçÉÏÉϸöÎļþµÄʾÀýÎļþ£¬ÀïÃæ»áÓÐÏà¹Ø²ÎÊýµÄ˵Ã÷ºÍÓ÷¨£¬Èç¹ûÓöµ½Ê²Ã´ÎÊÌ⣬´ó¼Ò¿ÉÒÔ¶ÔÕÕÕâЩʾÀýÎļþÖÐÏà¹Ø²ÎÊýµÄ˵Ã÷½øÐнâ¾ö¡£
Èç¹ûÁ¬½ÓÊý¾Ý¿â³öÁËʲôÎÊÌ⣬ÔÚ±£Ö¤ÍøÂç³öÕý³££¬Ã»ÓзÀ»ðǽ¸ÉÈŵÄÇé¿öÏ£¬²éÕÒÎÊÌâµÄ²½ÖèÊÇ:
1)ÔÚ¿Í»§¶Ë˳Ðò¼ì²ésqlnet.ora£¬tnsnames.oraÊÇÓÐÎÊÌâ¡£
2)ÔÚ·þÎñÆ÷¶Ë¼ì²élistener.oraÅäÖ㬲¢ÇÒ±£Ö¤¼àÌý³ÌÐòÆô¶¯£¬Êý¾Ý¿â·þÎñ¼ÓÔØ¡£
ÈÏʶsqlnet.ora
ÏÂÃæÖ»½²Êö¼¸¸ö³£ÓòÎÊýÅäÖã¬ÏêϸµÄ×ÊÁÏ£¬´ó¼Ò¿ÉÒԲ鿴ʾÀýsqlnet.oraµÃµ½¡£
sqlnet.ora¿ÉÒÔɾ³ý£¬ÕâÑùÔÚoracle¿Í»§¶ËÁ¬½ÓÊý¾Ý¿âµÄʱºò£¬Ä¬ÈϲÉÓÃtnsnames.oraÖеÄÅäÖá£
1).NAMES.DEFAULT_DOMAIN
ÓòÃûdomain¶¨Ò壬ÔÚÄãÓÃsqlplus·ÃÎÊÊý¾Ý¿âµÄʱºò,»áÔÚtns±ðÃûºóÃæ¼ÓÉÏ".domain"
ʾÀý:
sqlnet.oraÖÐ:
NAMES.DEFAULT_DOMAIN=com
tnsnames.oraÖеÄtns¶¨ÒåÈçÏÂ:
local_dev =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.111)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = linuxdb)
)
)
ÔÚ¿Í»§¶ËÖ´ÐÐÃüÁî:sqlplus [email=username/password@local_dev]username/password@local_dev[/email]µÄʱºò£¬»á³öÏÖÈçÏ´íÎóÐÅÏ¢:
"ORA-12154: TNS: ÎÞ·¨´¦Àí·þÎñÃû"»òÕß"ORA-12154: TNS:could not resolve service name"ÕâÑùµÄ´íÎóÐÅÏ¢¡£
ÒòΪsqlplus [email=username/password@local_dev]username/password@local_dev[/email]µÄʱºò£¬½«tns±ðÃû“local_dev”ת»»³ÉÁË“local_dev.com”£¬ËùÒÔlocal_dev.comÔÚtnsnames.oraÖÐÕÒ²»µ½£¬¾Í±¨´íÁË¡£
ÐÞ¸Ätnsnames.oraÖеĶ¨ÒåÈçÏÂ:
local_dev.com =
(DESCRIPTION =
&
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
Oracle´´½¨±íʱ£¬³£Óöµ½ÏÈɾ³ýºó´´½¨µÄÇé¿ö£¬¶øËüÓÖûÓÐdrop table... if existsÓï·¨¡£Îª´Ë¿ÉÒÔʹÓÃuser_objectsÊý¾Ý×ÖµäºÍ¶¯Ì¬sqlÓï¾äʵÏÖÀàËƵŦÄÜ£¬ÈçÏÂËùʾ£º
create or replace procedure proc_dropifexists(
p_table in varchar2
) is
v_count number(10);
begin
&nbs ......
ɾ³ýAIXϵÄORACLE
===========================================================
×÷Õß: wmlm(http://wmlm.itpub.net)
·¢±íÓÚ:2008.12.02 18:17
·ÖÀà: oracle
³ö´¦£ºhttp://wmlm.itpub.net/post/12871/474762
---------------------------------------------------------------
rm -Rf /etc/oratab
rm -Rf /et ......
oracle ĬÈϸôÀëµÈ¼¶ÊÇ£º¶ÁÒÑÌá½»¡£
²éѯËø¶¨£¬·ÀÖ¹ÁíÍâÓû§¸üУº
select * from books for update;
µ±Ç°Óû§¸üÐÂÖ®ºó£¬ÁíÍâÓû§¿ÉÒÔ¸ü¸Ä¡£
01¡¢±íÁ¬½Ó
¼Ù¶¨from×Ó¾äÖдÓ×óµ½ÓÒÁ½¸ö±í·Ö±ðΪA£¬B±í¡£
ÄÚÁ¬½Ó£ºÑ¡È¡A¡¢B±íµÄÍêÈ«Æ¥ÅäµÄ¼¯ºÏ£¬Á½±í½»¼¯£º
select empno,ename,emp.deptno A,dept.deptno B,dname from emp ......
¡¡·ÏòÃÜÂëÎļþÖÐÔö¼Ó¡¢É¾³ýÓû§:
¡¡¡¡µ±³õʼ»¯²ÎÊýREMOTE_LOGIN_PASSWORDFILEÉèÖÃΪEXCLUSIVEʱ£¬ÏµÍ³ÔÊÐí³ýINTERNAL/SYSÒÔÍâµÄÆäËûÓû§ÒÔ¹ÜÀíÔ±Éí·Ý´ÓÔ¶¶Ë»ò±¾»úµÇ¼µ½OracleÊý¾Ý¿âϵͳ£¬Ö´ÐÐÊý¾Ý¿â¹ÜÀí¹¤×÷;ÕâЩÓû§Ãû±ØÐë´æÔÚÓÚÃÜÂëÎļþÖУ¬ÏµÍ³²ÅÄÜʶ±ðËûÃÇ¡£ÓÉÓÚ²»¹ÜÊÇÔÚ´´½¨Êý¾Ý¿âʵÀýʱ×Ô¶¯´´½¨µÄÃÜÂëÎļþ£¬ ......