ÈçÐeתÔØ£¬Çe×¢Ã÷³o´¦£¡£¨µo²oÔÚ´ËÏÈл¹ýÁË¡¡£(C)
Oracle TAFµÄÅaÖÃ
TAFΪTransparent Application FailOverµÄËoд£¬Ò»°aÓ¦ÓÃTAF¶¼ÊÇÔÚOPS/RAC»¾³ÖС£´Ó8i¿ªÊ¼ÓеÄÕaÒ»¹¦ÄÜ£¬Ä¿µÄºÍÏe¨¶¼ÊǺܺõģ¬µ«Ä¿Ç°Ó¦Óû¹ºÜÓÐÏÞ£¬±¾ÎĽ«Õe¶ÔTAFÏa¹ØÎÊÌa×÷¸oÏeϸ̽ÌÖ¡£
±¾ÎĵIJaÊÔ»*¾³ÊÇTru64 V5.1+ Oracle9.2.0.1 RAC¡£
Ò»¡¢Ïa¹Ø²ÎÊýµÄ˵Ã÷
˵ʵ»°oracle¹ØÓÚÍøÂçµÄ¼¸¸oÅaÖòÎÊýÕaeµÄÊÇÌ«ÂÒÁË£¬ºÜ¶aÈ˶¼Åª²»Çaµ½µ×ÊÇÔoô»ØÊ£¬³£¼uµÄ´iÎoΪ£º
"ORA-12514 :TNS:listener could not resolve SERVICE_NAME given in connect descriptor" ºÍ
"ORA-12154 :TNS: Could not resolve service name"
ʵÖʶ¼ÊÇÒ»ÑuµÄ£¬Òª½a¾oÕaÑuµÄÎÊÌaÐeÒªÎÒÃÇŪÇe¼¸¸o²ÎÊý£º
initsid.oraÖеļ¸¸o²ÎÊý£º
DB_NAME --- database name,¼´½¨Êý¾Ý¿aʱËuÌa¹(C)µÄÃu³Æ¡£
GLOBAL_NAMES --- True/false£¬Ée¶¨ÊÇñʹÓÃÊý¾Ý¿aÓoÃu¡£
DB_DOMAIN --- Êý¾Ý¿aÓoÃu,Èç¹uGLOBAL_NAMES=TrueÔoÒªÇoÌa¹(C)Õa¸o²ÎÊý¡£
SERVICE_NAMES --- service names list£¬þÎñÃu³Æ£¬¿ÉÒÔÓжa¸o¡£
INSTANCE_NAME --- instance name£¬ºÍSERVICE_NAMESÒ»Ñu´Ó817¿ªÊ¼Ö§³Ö£¬¼´´Ó817¿ªÊ¼¿ÉÒÔ½«Êý¾Ý¿a¡¢ÊµÀýºÍþÎñÃu³ÆÖ¿ª¡£Ä¬ÈÏinstance_nameµÄֵΪinstanceµÄSID£¬¼´»¾³±aÁ¿ORACLE_SIDËu¶ÔÓ¦µÄÖµ¡£ÔÚ817ÒÔǰûÓÐinstance_name²ÎÊýʱ£¬²»Í¬µÄinstanceÊÇÒÔSIDÀ´Çøֵġ£°´ÕÕoracle817ÒÔºoµÄÎĵµ½aÊÍ£ºSIDÊÇΪÁËÇø±ðͬһÖ÷»uÉϸ÷instanceµÄ¹²ÏiÄÚ´ae£¬²¢²»ÊÇinstanceµÄΨһÇø±ð±eʾ£¬¶øinstance_nameÔoÊÇÇø±ð¸÷¸oinstanceµÄ¡£
»¾³±aÁ¿£º
ORACLE_SID --- ÔÚ817ÒÔǰûÓÐinstance_name²ÎÊýʱ£¬²»Í¬µÄinstanceÊÇÒÔSIDÀ´Çøֵģ¨Ïeϸ˵Ã÷¼uÉÏÃaeµÄinitsid.ora²ÎÊý½aÊÍ£(C)¡£
listener.oraÖеļ¸¸o²ÎÊý£º
GLOBAL_DBNAME --- È«¾ÖÊý¾Ý¿aÃu³Æ£¬ÔÚÖ²¼Ê½»¾³ÖÐΨһȶ¨²»Í¬µÄÊý¾Ý¿a¡£ËuµÄֵΪinitsid.oraÖÐDB_NAMEºÍDB_DOMAINµÄ×eºÏ£¬¼´GLOBAL_DBNAME=DB_NAME.DB_DOMAIN£¬ÆaÖÐDB_DOMAINÈç¹uûÓÐÉe´Ë´¦Ò²¾Í²»ÐeÒªÁË¡£Õa¸o²ÎÊýÔÚÖ²¼Ê½»¾³Öн¨ÒeÃ÷ÈÖ¸¶¨¡£
SERVICE_NAME --- þÎñÃu³Æ£¬È¡initsid.oraÖÐservice_names listÖÁÒ»¼´¿É¡£
SID_NAME --- ¶ÔÓ¦»¾³±aÁ¿ORACLE_SIDµÄÖµ¡£
INSTANCE_NAME ---¶ÔÓ¦³oʼ»¯²ÎÊýinstance_name¡£
tnsnames.oraÖеļ¸¸o²ÎÊý£º
service_name --- þÎñÃu³Æ£¬È¡initsid.oraÖÐservice_names listÖÁÒ»¼´¿É¡£
sid_name --- ¿ÉÒÔ¼oд³É£ºsid£¬¶ÔÓ¦ORACLE_SID£¬Ò²¿ÉÒÔÊdzoʼ»¯²ÎÊýinstance_name£¬µ±µÈÓÚinstance_nameÇÒinstance_name²»µÈÓÚORACLE_SIDʱ£¬oracle»a×Ô¶¯×¢²aÒ»¸o¼aÌý½ø³Ì£¬´ËÓÃÒÔÇøÖ²»Í¬µÄinstance¡£
instance_name --- ´Ó817¿ªÊ¼ÓÐÁËÕa¸oеIJÎÊý¿ÉÒÔʹÓ㬶ÔÓ¦³oʼ»¯²ÎÊýinstance_name¡£
ÕaÑuÒ»À´£¬²ÎÊý¾ÍºÜ¸´ÔÓÁË£¬²»¹ýÎÒÃÇʵ¼ÊʹÓò¢²»»aÓõ±È»Ê®Ô¼oµ¥Ô½ºÃÁË¡£
¶þ¡¢Ïa¹Ø²ÎÊýÉeÖÃ
ÏÂÃaeÎÒ½«¾ÙÀý˵Ã÷Ïa¹Ø²ÎÊýµÄÉeÖãº
1¡¢»*¾³±aÁ¿£ºORACLE_SID=rac1/2
2¡¢initsid.ora£º
db_name=ora92
service_names = ora92
instance_name=rac1/2
global_names=false
db_domain=""
3¡¢listener.ora£º
SID_LIST_RAC1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora92)
(ORACLE_HOME = /oracle/oracle9/app/oracle/product/9.2.0)
(SERVICE_NAME=ora92)(SID_NAME = rac1)
)
)
SID_LIST_RAC2 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora92)
(ORACLE_HOME = /oracle/oracle9/app/oracle/product/9.2.0)
(SERVICE_NAME=ora92)(SID_NAME = rac2)
)
)
RAC1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.3.1)(PORT = 1522))
)
)
)
RAC2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.3.2)(PORT = 1522))
)
)
)
2¡¢Ö¸Ã÷instance backup*½Ê½£º===============================================
rac1 =
(description=
(load_balance=on)
(failover=on)
(address= (protocol=tcp)(host=10.1.3.1)(port=1522))
(connect_data= (service_name=ora92)
(failover_mode=(type=select)(method=basic)
(backup=rac2)(retries=20)(delay=20))
)
)
ËÄ¡¢TAF²aÊÔ½¨
Ò»°a¿ÉÒÔ½«µ±Ç°Á¬½ÓµÄinstance downÏÂÀ´£¬client¶Ë½«²»»a¶Ï¿ª£¬²¢×Ô¶¯Çл»µ½backup½ÚµaÉÏ¡£Ïa*´Ò²»a×Ô¶¯Çл»»ØÀ´¡£
µ±È»Ò²ÓÐÈËÌa³oÓÃpost_transactionµÄ*½Ê½À´²aÊÔTAF£¬ÆaʵÕaÑuÓÐʱÊǵò»µ½Ô¤ÆÚ½a¹uµÄ£¬ÔÒoÔÚÓÚOracleÁ¬½Óµ½Ò»¸oinstanceÉϺo£¬´ËºoËu»aÓÅÏȳ¢ÊÔ¶Ô¸ÃinstanceµÄÁ¬½Ó£¬µ±Äadisconnectºo£¬client¶ËÒ»ÓÐеÄÇeÇo¾Í»a×Ô¶¯³¢ÊÔ¶Ô×i½uÁ¬½ÓµÄinstance½øÐÐÁ¬½Ó£¬Èç¹u²»³É¹¦²Å»a³¢ÊÔ¶Ôbackup instance½øÐÐÁ¬½Ó¡£