一、RAC One Node介紹
1、rac one node數(shù)據(jù)庫(kù)可以轉(zhuǎn)換成RAC數(shù)據(jù)庫(kù),轉(zhuǎn)換過(guò)程可以在線,無(wú)需停止RAC one node數(shù)據(jù)庫(kù);
2、rac one node可以創(chuàng)建多個(gè)rac onde node數(shù)據(jù)庫(kù)運(yùn)行在不同的節(jié)點(diǎn)上;
3、當(dāng)運(yùn)行節(jié)點(diǎn)需要維護(hù),如打patch,可以手動(dòng)切換(relocate)使用online database relocate,減少業(yè)務(wù)中斷時(shí)間;
4、rac one node比RAC數(shù)據(jù)庫(kù)減少了節(jié)點(diǎn)間數(shù)據(jù)傳輸時(shí)間以及GC類的等待事件;
5、從11.2.0.1開始就有了rac one node特性,但僅僅支持linux平臺(tái),在11.2.0.2以后支持所有平臺(tái);
參考文檔:Oracle RACOne Node -- Changes in 11.2.0.2 (文檔 ID 1232802.1)?
二、使用DBCA創(chuàng)建RAC One Node
[oracle@jzh2 ~]$ dbca
2.1 選擇"Oracle RAC One Node database"
后面創(chuàng)建數(shù)據(jù)庫(kù)與創(chuàng)建RAC數(shù)據(jù)庫(kù)基本一致,過(guò)程省略。。。。。
2.2、RAC one數(shù)據(jù)庫(kù)基本信息
$ srvctl config database -d jzh
Database unique name: jzh
Database name: jzh
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/jzh/spfilejzh.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: jzh
Database instances:
Disk Groups: DATA,ARCH
Mount point paths:
Services: jzhdb==============》新建的Service
Type: RACOneNode===========》數(shù)據(jù)庫(kù)類型是 one node
Online relocation timeout: 30
Instance name prefix: jzh
Candidate servers: jzh2,jzh3
Database is administrator managed
2.3、數(shù)據(jù)庫(kù)配置信息
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string jzh
db_unique_name string jzh
global_names boolean FALSE
instance_name string jzh_1==========》實(shí)例名,在RAC數(shù)據(jù)庫(kù)中實(shí)例一般為jzh2,而在RAC One Node中多了"_"。
lock_name_space string
log_file_name_convert string
processor_group_name string
service_names string jzhdb
2.4、集群信息
SQL> show parameter cluster_database
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
2.5、RAC One Node切換(relocate)
查詢當(dāng)前實(shí)例運(yùn)行情況:
$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.DATA.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.LISTENER.lsnr
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.VOTE.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.asm
ONLINE ONLINE jzh2 Started
ONLINE ONLINE jzh3 Started
ora.gsd
OFFLINE OFFLINE jzh2
OFFLINE OFFLINE jzh3
ora.net1.network
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.ons
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE jzh3
ora.cvu
1 OFFLINE OFFLINE
ora.jzh.db
1 ONLINE ONLINE jzh2 Open
ora.jzh.jzhdb.svc
1 ONLINE ONLINE jzh2
ora.jzh2.vip
1 ONLINE ONLINE jzh2
ora.jzh3.vip
1 ONLINE ONLINE jzh3
ora.oc4j
1 ONLINE ONLINE jzh3
ora.scan1.vip
1 ONLINE ONLINE jzh3
數(shù)據(jù)庫(kù)與service均運(yùn)行在節(jié)點(diǎn)1上(jzh2)
2.6、使用relocate將RAC One Node數(shù)據(jù)庫(kù)切到節(jié)點(diǎn)2上(jzh3)
$ srvctl relocate database -d jzh -n jzh3
relocate之后,再次查詢RAC One Node運(yùn)行情況:
$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.DATA.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.LISTENER.lsnr
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.VOTE.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.asm
ONLINE ONLINE jzh2 Started
ONLINE ONLINE jzh3 Started
ora.gsd
OFFLINE OFFLINE jzh2
OFFLINE OFFLINE jzh3
ora.net1.network
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.ons
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE jzh3
ora.cvu
1 OFFLINE OFFLINE
ora.jzh.db
2 ONLINE ONLINE jzh3 Open
ora.jzh.jzhdb.svc
1 ONLINE ONLINE jzh3
ora.jzh2.vip
1 ONLINE ONLINE jzh2
ora.jzh3.vip
1 ONLINE ONLINE jzh3
ora.oc4j
1 ONLINE ONLINE jzh3
ora.scan1.vip
1 ONLINE ONLINE jzh3
此時(shí),數(shù)據(jù)庫(kù)與service切換至節(jié)點(diǎn)2上(jzh3)。
2.7、查看數(shù)據(jù)庫(kù)配置信息
[grid@jzh2 ~]$ srvctl config service -d jzh
Service name: jzhdb
Service is enabled
Server pool: jzh
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: jzh_2
Available instances:
2.8 轉(zhuǎn)換RAC One Node至RAC
注:以RAC One Node database擁有者執(zhí)行以下命令:
$ su - oracle
$ srvctl convert database -d jzh -c RAC -n jzh2
$ srvctl config database -d jzh
Database unique name: jzh
Database name: jzh
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/jzh/spfilejzh.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: jzh
Database instances: jzh_1
Disk Groups: DATA,ARCH
Mount point paths:
Services: jzhdb
Type: RAC
Database is administrator managed
我們可以看到Type類型變成RAC了。
2.9、添加節(jié)點(diǎn)2(jzh3)實(shí)例
$ srvctl add instance -d jzh -i jzh_2 -n jzh3
$ srvctl config database -d jzh
Database unique name: jzh
Database name: jzh
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/jzh/spfilejzh.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: jzh
Database instances: jzh_1,jzh_2
Disk Groups: DATA,ARCH
Mount point paths:
Services: jzhdb
Type: RAC
Database is administrator managed
這里我們看到j(luò)zh_2添加進(jìn)來(lái)了。
$ srvctl start database -d jzh
$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.DATA.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.LISTENER.lsnr
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.VOTE.dg
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.asm
ONLINE ONLINE jzh2 Started
ONLINE ONLINE jzh3 Started
ora.gsd
OFFLINE OFFLINE jzh2
OFFLINE OFFLINE jzh3
ora.net1.network
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
ora.ons
ONLINE ONLINE jzh2
ONLINE ONLINE jzh3
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE jzh3
ora.cvu
1 OFFLINE OFFLINE
ora.jzh.db
1 ONLINE ONLINE jzh2 Open
2 ONLINE ONLINE jzh3 Open
ora.jzh.jzhdb.svc
1 ONLINE ONLINE jzh2
ora.jzh2.vip
1 ONLINE ONLINE jzh2
ora.jzh3.vip
1 ONLINE ONLINE jzh3
ora.oc4j
1 ONLINE ONLINE jzh3
ora.scan1.vip
1 ONLINE ONLINE jzh3
這里可以看到DB運(yùn)行在jzh2,jzh3上。
2.10、重新配置服務(wù)
$ srvctl stop service -d jzh -s jzhdb
$ srvctl remove service -d jzh -s jzhdb
$ srvctl add service -d jzh -s jzhdb -r jzh_1,jzh_2 -P BASIC
$ srvctl start service -d jzh -s jzhdb
至此,RAC One Node配置完成!
新聞名稱:Oracle11gRACOnenode安裝與配置
轉(zhuǎn)載來(lái)源:
http://weahome.cn/article/pigdcs.html