oracle service监听场景

来源:这里教程网 时间:2026-03-03 19:36:33 作者:

srvctl add service -d orcl -s service1 -r orcl1 -a orcl2 -P BASIC -e SELECT -z 180 -w 5 -x TRUE

srvctl add service -d orcl -s service2 -r orcl2 -a orcl1 -P BASIC -e SELECT -z 180 -w 5 -x TRUE

 

 

srvctl enable service -d orcl -s service1

srvctl enable service -d orcl -s service2

 

srvctl start service -d orcl -s service1

srvctl start service -d orcl -s service2

 

srvctl relocate service -d orcl -s service1 -i orcl1 -t orcl2

srvctl relocate service -d orcl -s service1 -i orcl2 -t orcl1

 

场景一

service1 在节点一

service2 在节点二

 

ora.orcl.db

      1        ONLINE  ONLINE       11grac1                  Open                

      2        ONLINE  ONLINE       11grac2                  Open                

ora.orcl.service1.svc

      1        ONLINE  ONLINE       11grac1                                      

ora.orcl.service2.svc

      1        ONLINE  ONLINE       11grac2                                      

 

 

[grid@11grac2 ~]$  lsnrctl status LISTENER_SCAN1

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2022 11:54:59

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_SCAN1

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                31-AUG-2022 15:30:36

Uptime                    0 days 20 hr. 24 min. 23 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/grid/crs_1/network/admin/listener.ora

Listener Log File         /oracle/grid/crs_1/log/diag/tnslsnr/11grac2/listener_scan1/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.238.39)(PORT=1521)))

Services Summary...

Service "orcl" has 2 instance(s).

  Instance "orcl1", status READY, has 2 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 2 instance(s).

  Instance "orcl1", status READY, has 1 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "service1" has 1 instance(s).

  Instance " orcl1", status READY, has 2 handler(s) for this service...

Service "service2" has 1 instance(s).

  Instance " orcl2", status READY, has 1 handler(s) for this service...

Service "zmh" has 1 instance(s).

  Instance "zmh2", status READY, has 2 handler(s) for this service...

Service "zmhXDB" has 1 instance(s).

  Instance "zmh2", status READY, has 1 handler(s) for this service...

The command completed successfully

 

场景二

service1 在节点二

service2 在节点二

 

ora.orcl.db

      1        ONLINE  ONLINE       11grac1                  Open                

      2        ONLINE  ONLINE       11grac2                  Open                

ora.orcl.service1.svc

      1        ONLINE  ONLINE       11grac2                                      

ora.orcl.service2.svc

      1        ONLINE  ONLINE       11grac2                                

     

[grid@11grac2 ~]$ lsnrctl status LISTENER_SCAN1

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2022 12:01:07

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_SCAN1

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                31-AUG-2022 15:30:36

Uptime                    0 days 20 hr. 30 min. 31 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/grid/crs_1/network/admin/listener.ora

Listener Log File         /oracle/grid/crs_1/log/diag/tnslsnr/11grac2/listener_scan1/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.238.39)(PORT=1521)))

Services Summary...

Service "orcl" has 2 instance(s).

  Instance "orcl1", status READY, has 2 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 2 instance(s).

  Instance "orcl1", status READY, has 1 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "service1" has 1 instance(s).

  Instance " orcl2", status READY, has 1 handler(s) for this service...

Service "service2" has 1 instance(s).

  Instance " orcl2", status READY, has 1 handler(s) for this service...

Service "zmh" has 1 instance(s).

  Instance "zmh2", status READY, has 2 handler(s) for this service...

Service "zmhXDB" has 1 instance(s).

  Instance "zmh2", status READY, has 1 handler(s) for this service...

The command completed successfully

 

 

场景三

relocate回来

service1 在节点一

service2 在节点二

 

 

ora.orcl.db

      1        ONLINE  ONLINE       11grac1                  Open                

      2        ONLINE  ONLINE       11grac2                  Open                

ora.orcl.service1.svc

      1        ONLINE  ONLINE       11grac1                                      

ora.orcl.service2.svc

      1        ONLINE  ONLINE       11grac2                                      

 

 

[grid@11grac2 ~]$ lsnrctl status LISTENER_SCAN1

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-SEP-2022 12:23:05

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_SCAN1

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                31-AUG-2022 15:30:36

Uptime                    0 days 20 hr. 52 min. 29 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/grid/crs_1/network/admin/listener.ora

Listener Log File         /oracle/grid/crs_1/log/diag/tnslsnr/11grac2/listener_scan1/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.238.39)(PORT=1521)))

Services Summary...

Service "orcl" has 2 instance(s).

  Instance "orcl1", status READY, has 2 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 2 instance(s).

  Instance "orcl1", status READY, has 1 handler(s) for this service...

  Instance "orcl2", status READY, has 1 handler(s) for this service...

Service "service1" has 1 instance(s).

  Instance " orcl1", status READY, has 2 handler(s) for this service...

Service "service2" has 1 instance(s).

  Instance " orcl2", status READY, has 1 handler(s) for this service...

Service "zmh" has 1 instance(s).

  Instance "zmh2", status READY, has 2 handler(s) for this service...

Service "zmhXDB" has 1 instance(s).

  Instance "zmh2", status READY, has 1 handler(s) for this service...

The command completed successfully

相关推荐