RAC中通過設定服務名實現業務分割

來源:互聯網
上載者:User

說明:通過在RAC中新增四個監聽服務,來實現通過不同服務名串連到不同的執行個體。

1.查看並使用srvctl來增加服務名

[Oracle@bysrac1 ~]$ crs_stat -t
-bash: crs_stat: command not found
[oracle@bysrac1 ~]$ su - grid
Password:
[grid@bysrac1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-OCT-2013 09:41:36
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 24-OCT-2013 09:24:34
Uptime 0 days 0 hr. 17 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/app/grid/diag/tnslsnr/bysrac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.221)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.226)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "bysrac" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
The command completed successfully

使用srvctl向監聽中增加 jiaoyi ,fengkong,caiwu,jiesuan四個服務--要用ORACLE使用者

[grid@bysrac1 ~]$ srvctl add service -d bysrac -s jiaoyi -r "bysrac1"
PRCD-1026 : Failed to create service jiaoyi for database bysrac
PRKH-1014 : Current user grid is not the same as oracle owner oracle of oracle home /u01/app/oracle/product/11.2.0/dbhome_1.
[grid@bysrac1 ~]$ exit
logout
[oracle@bysrac1 ~]$ srvctl add service -d bysrac -s jiaoyi -r "bysrac1"
[oracle@bysrac1 ~]$ srvctl add service -d bysrac -s fengkong -r "bysrac2"
[oracle@bysrac1 ~]$ srvctl add service -d bysrac -s caiwu -r "bysrac1"
[oracle@bysrac1 ~]$ srvctl add service -d bysrac -s jiesuan -r "bysrac2"
[oracle@bysrac1 ~]$ su - grid
Password:
[grid@bysrac1 ~]$ crs_stat -t 可以看到新增的四個服務已經存在,但還是OFFLINE狀態。
Name Type Target State Host
------------------------------------------------------------
ora....MBAK.dg ora....up.type OFFLINE OFFLINE
ora....DATA.dg ora....up.type ONLINE ONLINE bysrac1
ora....SMDG.dg ora....up.type ONLINE ONLINE bysrac1
ora....ER.lsnr ora....er.type ONLINE ONLINE bysrac1
ora....N1.lsnr ora....er.type ONLINE ONLINE bysrac2
ora.asm ora.asm.type ONLINE ONLINE bysrac1
ora....iwu.svc ora....ce.type OFFLINE OFFLINE
ora.bysrac.db ora....se.type ONLINE ONLINE bysrac1
ora....ong.svc ora....ce.type OFFLINE OFFLINE
ora....oyi.svc ora....ce.type OFFLINE OFFLINE
ora....uan.svc ora....ce.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE bysrac1
ora....C1.lsnr application ONLINE ONLINE bysrac1
ora....ac1.gsd application OFFLINE OFFLINE
ora....ac1.ons application ONLINE ONLINE bysrac1
ora....ac1.vip ora....t1.type ONLINE ONLINE bysrac1
ora....SM2.asm application ONLINE ONLINE bysrac2
ora....C2.lsnr application ONLINE ONLINE bysrac2
ora....ac2.gsd application OFFLINE OFFLINE
ora....ac2.ons application ONLINE ONLINE bysrac2
ora....ac2.vip ora....t1.type ONLINE ONLINE bysrac2
ora.eons ora.eons.type ONLINE ONLINE bysrac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE bysrac1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE bysrac1

ora.scan1.vip ora....ip.type ONLINE ONLINE bysrac2

啟動新增的四個監聽的服務

[grid@bysrac1 ~]$ crs_start ora.bysrac.jiaoyi.svc
Attempting to start `ora.bysrac.jiaoyi.svc` on member `bysrac1`
Start of `ora.bysrac.jiaoyi.svc` on member `bysrac1` succeeded.
[grid@bysrac1 ~]$ crs_start ora.bysrac.fengkong.svc
Attempting to stop `ora.bysrac.db` on member `bysrac2`
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

Stop of `ora.bysrac.db` on member `bysrac2` succeeded.
Attempting to start `ora.bysrac.db` on member `bysrac2`
Start of `ora.bysrac.db` on member `bysrac2` succeeded.
Attempting to start `ora.bysrac.jiesuan.svc` on member `bysrac2`
Start of `ora.bysrac.jiesuan.svc` on member `bysrac2` succeeded.
Attempting to start `ora.bysrac.fengkong.svc` on member `bysrac2`
Start of `ora.bysrac.fengkong.svc` on member `bysrac2` succeeded.
[grid@bysrac1 ~]$ crs_start ora.bysrac.caiwu.svc
Attempting to start `ora.bysrac.caiwu.svc` on member `bysrac1`
Start of `ora.bysrac.caiwu.svc` on member `bysrac1` succeeded.
[grid@bysrac1 ~]$ crs_start ora.bysrac.jiesuan.svc
CRS-5702: Resource 'ora.bysrac.jiesuan.svc' is already running on 'bysrac2'
CRS-0223: Resource 'ora.bysrac.jiesuan.svc' has placement error.

更多詳情見請繼續閱讀下一頁的精彩內容:

RAC環境下管理OGG-HA

RAC環境下配置OGG同步

GoldenGate單向表DML同步

Oracle GoldenGate 系列:Extract 進程的恢複原理

Oracle GoldenGate安裝配置

Oracle goldengate的OGG-01004 OGG-1296錯誤

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.