Oracle Faq(Oracle TAFµÄÅäÖÃ)

5年以前  |  阅读数:797 次  |  编程语言:PHP 

ÈçÐ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))
)
)
)

Èý¡¢TAFµÄÉeÖÃ
ÆaʵTAFÉeÖúܼoµ¥£¬ÔÚtnsnames.oraÖÐÌi¼Ófailover=on¼´¿É£¬ÓÐÁ½ÖÖ²»Í¬µÄÉeÖý¨£º
1¡¢¹«ÓÃÒ»¸otns name*½Ê½£º==================================================
myrac =
(description=
(load_balance=on)
(failover=on)
(address= (protocol=tcp)(host=10.1.3.1)(port=1522))
(address= (protocol=tcp)(host=10.1.3.2)(port=1522))
(connect_data= (service_name=ora92)
(failover_mode=(type=select)(method=basic)(retries=20)(delay=20))
)
)

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))
)
)

rac2 =
(description=
(load_balance=on)
(failover=on)
(address= (protocol=tcp)(host=10.1.3.2)(port=1522))
(connect_data= (service_name=ora92)
(failover_mode=(type=select)(method=basic)
(backup=rac1)(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½øÐÐÁ¬½Ó¡£

 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例