国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home php教程 php手冊 Oracle Faq(Oracle TAF的配置)

Oracle Faq(Oracle TAF的配置)

Jun 21, 2016 am 09:10 AM
name oracle service

oracle

如需轉(zhuǎn)載,請注明出處!(刁饞在此先謝過了……)
Oracle TAF的配置

TAF為Transparent Application FailOver的縮寫,一般應(yīng)用TAF都是在OPS/RAC環(huán)境中。從8i開始有的這一功能,目的和想法都是很好的,但目前應(yīng)用還很有限,本文將針對TAF相關(guān)問題作個詳細探討。

本文的測試環(huán)境是Tru64 V5.1+ Oracle9.2.0.1 RAC。

一、相關(guān)參數(shù)的說明

說實話oracle關(guān)于網(wǎng)絡(luò)的幾個配置參數(shù)真的是太亂了,很多人都弄不清到底是怎么回事,常見的錯誤為:
"ORA-12514 :TNS:listener could not resolve SERVICE_NAME given in connect descriptor" 和
"ORA-12154 :TNS: Could not resolve service name"
實質(zhì)都是一樣的,要解決這樣的問題需要我們弄情幾個參數(shù):

initsid.ora中的幾個參數(shù):
DB_NAME --- database name,即建數(shù)據(jù)庫時所提供的名稱。
GLOBAL_NAMES --- True/false,設(shè)定是否使用數(shù)據(jù)庫域名。
DB_DOMAIN --- 數(shù)據(jù)庫域名,如果GLOBAL_NAMES=True則要求提供這個參數(shù)。
SERVICE_NAMES --- service names list,服務(wù)名稱,可以有多個。

INSTANCE_NAME --- instance name,和SERVICE_NAMES一樣從817開始支持,即從817開始可以將數(shù)據(jù)庫、實例和服務(wù)名稱分開。默認instance_name的值為instance的SID,即環(huán)境變量ORACLE_SID所對應(yīng)的值。在817以前沒有instance_name參數(shù)時,不同的instance是以SID來區(qū)分的。按照oracle817以后的文檔解釋:SID是為了區(qū)別同一主機上各instance的共享內(nèi)存,并不是instance的唯一區(qū)別標示,而instance_name則是區(qū)別各個instance的。

環(huán)境變量:
ORACLE_SID --- 在817以前沒有instance_name參數(shù)時,不同的instance是以SID來區(qū)分的(詳細說明見上面的initsid.ora參數(shù)解釋)。

listener.ora中的幾個參數(shù):
GLOBAL_DBNAME --- 全局數(shù)據(jù)庫名稱,在分布式環(huán)境中唯一確定不同的數(shù)據(jù)庫。它的值為initsid.ora中DB_NAME和DB_DOMAIN的組合,即GLOBAL_DBNAME=DB_NAME.DB_DOMAIN,其中DB_DOMAIN如果沒有設(shè)此處也就不需要了。這個參數(shù)在分布式環(huán)境中建議明確指定。
SERVICE_NAME --- 服務(wù)名稱,取initsid.ora中service_names list至一即可。
SID_NAME --- 對應(yīng)環(huán)境變量ORACLE_SID的值。
INSTANCE_NAME ---對應(yīng)初始化參數(shù)instance_name。

tnsnames.ora中的幾個參數(shù):
service_name --- 服務(wù)名稱,取initsid.ora中service_names list至一即可。
sid_name --- 可以簡寫成:sid,對應(yīng)ORACLE_SID,也可以是初始化參數(shù)instance_name,當(dāng)?shù)扔趇nstance_name且instance_name不等于ORACLE_SID時,oracle會自動注冊一個監(jiān)聽進程,此用以區(qū)分不同的instance。
instance_name --- 從817開始有了這個新的參數(shù)可以使用,對應(yīng)初始化參數(shù)instance_name。

這樣一來,參數(shù)就很復(fù)雜了,不過我們實際使用并不會用當(dāng)然十月簡單越好了。

二、相關(guān)參數(shù)設(shè)置

下面我將舉例說明相關(guān)參數(shù)的設(shè)置:
1、環(huán)境變量: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的設(shè)置
其實TAF設(shè)置很簡單,在tnsnames.ora中添加failover=on即可,有兩種不同的設(shè)置方法:
1、公用一個tns 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測試方法
一般可以將當(dāng)前連接的instance down下來,client端將不會斷開,并自動切換到backup節(jié)點上。相反也會自動切換回來。

當(dāng)然也有人提出用post_transaction的方式來測試TAF,其實這樣有時是得不到預(yù)期結(jié)果的,原因在于Oracle連接到一個instance上后,此后它會優(yōu)先嘗試對該instance的連接,當(dāng)你disconnect后,client端一有新的請求就會自動嘗試對最近連接的instance進行連接,如果不成功才會嘗試對backup instance進行連接。
??






Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MongoDB vs. Oracle: Choosing the Right Database for Your Needs MongoDB vs. Oracle: Choosing the Right Database for Your Needs Apr 22, 2025 am 12:10 AM

MongoDB is suitable for unstructured data and high scalability requirements, while Oracle is suitable for scenarios that require strict data consistency. 1.MongoDB flexibly stores data in different structures, suitable for social media and the Internet of Things. 2. Oracle structured data model ensures data integrity and is suitable for financial transactions. 3.MongoDB scales horizontally through shards, and Oracle scales vertically through RAC. 4.MongoDB has low maintenance costs, while Oracle has high maintenance costs but is fully supported.

MySQL vs. Oracle: Licensing, Features, and Benefits MySQL vs. Oracle: Licensing, Features, and Benefits May 08, 2025 am 12:05 AM

The main difference between MySQL and Oracle is licenses, features, and advantages. 1. License: MySQL provides a GPL license for free use, and Oracle adopts a proprietary license, which is expensive. 2. Function: MySQL has simple functions and is suitable for web applications and small and medium-sized enterprises. Oracle has powerful functions and is suitable for large-scale data and complex businesses. 3. Advantages: MySQL is open source free, suitable for startups, and Oracle is reliable in performance, suitable for large enterprises.

MySQL and Oracle: Exploring Performance and Scalability MySQL and Oracle: Exploring Performance and Scalability Apr 29, 2025 am 12:12 AM

The difference between MySQL and Oracle in performance and scalability is: 1. MySQL performs better on small to medium-sized data sets, suitable for fast scaling and efficient reading and writing; 2. Oracle has more advantages in handling large data sets and complex queries, suitable for high availability and complex business logic. MySQL extends through master-slave replication and sharding technologies, while Oracle achieves high availability and scalability through RAC.

MySQL vs. Oracle: Understanding Licensing and Cost MySQL vs. Oracle: Understanding Licensing and Cost May 03, 2025 am 12:19 AM

MySQL uses GPL and commercial licenses for small and open source projects; Oracle uses commercial licenses for enterprises that require high performance. MySQL's GPL license is free, and commercial licenses require payment; Oracle license fees are calculated based on processors or users, and the cost is relatively high.

MongoDB vs. Oracle: Exploring NoSQL and Relational Approaches MongoDB vs. Oracle: Exploring NoSQL and Relational Approaches May 07, 2025 am 12:02 AM

In different application scenarios, choosing MongoDB or Oracle depends on specific needs: 1) If you need to process a large amount of unstructured data and do not have high requirements for data consistency, choose MongoDB; 2) If you need strict data consistency and complex queries, choose Oracle.

How to learn Java without taking detours. Share methods and techniques for efficiently learning Java How to learn Java without taking detours. Share methods and techniques for efficiently learning Java May 20, 2025 pm 08:24 PM

The key to learning Java without taking detours is: 1. Understand core concepts and grammar; 2. Practice more; 3. Understand memory management and garbage collection; 4. Join online communities; 5. Read other people’s code; 6. Understand common libraries and frameworks; 7. Learn to deal with common mistakes; 8. Make a learning plan and proceed step by step. These methods can help you master Java programming efficiently.

See all articles