溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

oracle單實(shí)例綁定多個(gè)服務(wù)

發(fā)布時(shí)間:2020-07-23 18:53:43 來(lái)源:網(wǎng)絡(luò) 閱讀:455 作者:lineqi 欄目:關(guān)系型數(shù)據(jù)庫(kù)

背景:

項(xiàng)目前期是在一臺(tái)服務(wù)器建立了兩個(gè)實(shí)例,客戶端配置兩個(gè)連接,現(xiàn)在需要把兩個(gè)實(shí)例整合其中一個(gè)實(shí)例中去,要求不更改客戶端的配置。

例如

整合前有test,standby2兩個(gè)實(shí)例

整合后只有standby2這個(gè)實(shí)例

 

之前在RAC上用srvctl配置過(guò),還沒有在單實(shí)例上配置,現(xiàn)在具體操作整理如下:

1、創(chuàng)建服務(wù)

exec dbms_service.create_service('test','test');

select t.name,t.NETWORK_NAME  from v$services t;

standby2,standby2

 

2、設(shè)置服務(wù)立即生效

alter system set service_names='standby2,test' ;

select t.name,t.NETWORK_NAME  from v$services t;

standby2,standby2

test,test

3、重新加載監(jiān)聽

[oracle@standby2 ~]$ lsnrctl reload

[oracle@standby2 ~]$ lsnrctl status;

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 15-SEP-2014 12:52:32

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=standby2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                15-SEP-2014 12:39:28
Uptime                    0 days 0 hr. 13 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/standby2/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby2)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "test" has 1 instance(s).
  Instance "standby2", status READY, has 1 handler(s) for this service...
Service "standby2" has 1 instance(s).
  Instance "standby2", status READY, has 1 handler(s) for this service...
Service "standby2_DGMGRL" has 1 instance(s).
  Instance "standby2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

以上就是在standby2監(jiān)控的兩個(gè)服務(wù)standby2,test

4、關(guān)閉或刪除之前的test實(shí)例

這里建議關(guān)閉,等運(yùn)行一段時(shí)間后確定不需要這個(gè)實(shí)例才刪除。

5、測(cè)試

 

以上只是說(shuō)明了在不更改客戶端配置的情況可下,怎么樣保存應(yīng)用的正常訪問。至于怎么把實(shí)例test整合到standby2中并沒有詳細(xì)介紹,過(guò)程如下:

a、創(chuàng)建test實(shí)例所用到的用戶及授權(quán)

b、創(chuàng)建test實(shí)例所需要的表空間

c、從test實(shí)例導(dǎo)出數(shù)據(jù)

b、導(dǎo)入數(shù)據(jù)到standby2實(shí)例

f、參考第5點(diǎn)測(cè)試

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI