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ÖеĶ¨ÒåÈç
Ïà¹ØÎĵµ£º
³éÏóÊý¾ÝÀàÐÍ
1¡¢´´½¨ÀàÐÍ
--µØÖ·ÀàÐÍ
CREATE OR REPLACE TYPE AddressType AS OBJECT
(
Country varchar2(15),
City varchar2(20),
Street varchar2(30)
);
2¡¢ÀàÐÍǶÌ×
--´´½¨»ùÓÚÇ°Ò»¸öÀàÐ͵ÄеijéÏóÊý¾ÝÀàÐÍ£º¾ÞÐÇÀàÐÍ
CREATE OR REPLACE TYPE SuperStarType AS OBJECT
(
StarName varchar2(30),
Addres ......
Oracle group by¼°ÆäÈô¸ÉÏà¹Øº¯ÊýµÄһЩ˵Ã÷
http://blog.csdn.net/roland_wg/archive/2009/07/03/4319323.aspx
OracleµÄgroup by³ýÁË»ù±¾Ó÷¨ÒÔÍ⣬»¹ÓÐ3ÖÖÀ©Õ¹Ó÷¨£¬·Ö±ðÊÇrollup¡¢cube¡¢grouping sets¡£
¼ÙÉèÓÐÒ»¸ö±ítest£¬ÓÐA¡¢B¡¢C¡¢D¡¢E5ÁС£
1£© Èç¹ûʹÓÃgroup by rollup(A,B,C)£¬Ê×ÏÈ»á¶Ô(A¡¢B¡¢C)½øÐÐGROUP BY ......
´¥·¢Æ÷µÄÀàÐÍÓÐ:
¡¡¡¡´¥·¢Æ÷ÀàÐÍ£º
¡¡¡¡1¡¢ Óï¾ä´¥·¢Æ÷
¡¡¡¡2¡¢ Ðд¥·¢Æ÷
¡¡¡¡3¡¢INSTEAD OF´¥·¢
¡¡¡¡4¡¢ ϵͳÌõ¼þ´¥·¢Æ÷
¡¡¡¡5¡¢ Óû§Ê¼þ´¥·¢Æ÷
Óï¾ä¼¶´¥·¢Æ÷.(Óï¾ä¼¶´¥·¢Æ÷¶Ôÿ¸öDMLÓï¾äÖ´ÐÐÒ»´Î)
ÊÇÔÚ±íÉÏ»òÕßijЩÇé¿öϵÄÊÓͼÉÏÖ´Ð ......
¿Í»§ÐèÇó·ÖÎö£º
¡¡¡¡±ÊÕß×î½ü½Óµ½Ò»¼Ò¿Í»§µÄÒ»¸öÐèÇó¡£ËûÃDz¿ÊðÁËÒ»¸öERPϵͳ£¬ÏÖÔÚ²ÉÓõľÍÊÇOracleÊý¾Ý¿â¡£ÏÖÔÚÓÉÓÚÆóҵͳ¼Æ·ÖÎöµÄÐèÒª£¬ÒªÊµÏÖÈçϵÄÐèÇó¡£
¡¡¡¡1¡¢°´Ô·ÝÀ´Í³¼Æ2009ÄêµÚÒ»¼¾¶Èÿ¸ö¹©Ó¦É̵IJɹº½ð¶î¡£Ò²¾ÍÊÇ˵£¬ÔÚ±¨±íÖÐÒªÄܹ»ÏÔʾ³ö2009Äê1Ô·ݡ¢2Ô·ݡ¢3Ô·ݹ©Ó¦É̵IJɹº½ð¶îºÏ¼Æ£¬²»ÐèÒªÃ÷ϸ¡£
¡¡¡ ......