Home » RDBMS Server » Networking and Gateways » PMON register problem (Oracle 10.2.0.1, Redhat Enterprise Linux 5 32bit)
PMON register problem [message #532492] Wed, 23 November 2011 02:14 Go to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Hi, Guys
Now we have Machine A and Machine B. db A and db B are DataGuard environment.

Due to some desire problem, when a switchover or failover occured, A and B should exchange each other's ip and host name.
for instance,

Before switchover,
              Machine A               Machine B
ip addr:   192.168.1.110            192.168.1.120
hostname:   prim                     stdby



After switchover,
              Machine A               Machine B
ip addr:   192.168.1.120            192.168.1.110
hostname:   stdby                    prim



Main steps :
1. switchover 
2. stop the listener on both site and modify the HOST column value to new one. 
3. modify the hostname and ip address on each site.
4. start the listener on both site and use "alter system register" to register the services.
5. stop the recover and start the recover and switch log file to test if the new archived log can recieved and apply on standby.



When going to step 4, I found the service can not register unless primary and standby database restart.

By the way, we have another similar environment on AIX 5.3 and Oracle 10.2.0.3.Not sure if this can work on the same method.

Is there anyway to avoid this restart process and make the service works?

Thanks very much.
Re: PMON register problem [message #532495 is a reply to message #532492] Wed, 23 November 2011 02:37 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Hi, man. I think you are probably taking the wrong approach here. Are you trying to ensure that clients always connect to the correct database, even after switchover? If so, you do it with services: write a startup trigger that will start a service on whichever database is currently the primary, and configure the clients to try both listeners looking for that service.

Re: PMON register problem [message #532501 is a reply to message #532495] Wed, 23 November 2011 03:02 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Hi, John
I do want to just do modify some configurations on db server and nothing need to do on client when facing switchover.

And my problem is the switchover is succeed, after modify the ip, hostname and restart listener, the service will not register by pmon. No correct services can view on "lsnrctl status".

You mean using redhat Linux's service with chkconfig command Or any other way?

Thanks very much.

Re: PMON register problem [message #532504 is a reply to message #532501] Wed, 23 November 2011 03:14 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I don't know what you mean by chkconfig. I mean what I said: start a service on the appropriate database. For example:
exec dbms_service.create_service('prim','prim');
exec dbms_service.create_service('stby','stby');

create trigger start_serv after startup on database
declare
vrole varchar2(30);
begin
select database_role into vrole from v$database;
if vrole='PRIMARY' 
then dbms_service.start_service('prim');
end if;
if vrole='PHYSICAL STANDBY' 
then dbms_service.start_service('stby');
end if;
end;
/

and configure your clients to try both listeners, asking for the service prim.
Re: PMON register problem [message #532516 is a reply to message #532504] Wed, 23 November 2011 03:38 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Hi, John
Here is the exact problem what I met:

SQL> exec dbms_service.create_service('prim1','prim1');

PL/SQL procedure successfully completed.

SQL> exec dbms_service.start_service('prim1');

PL/SQL procedure successfully completed.

SQL> ! lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-NOV-2011 08:46:05

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                23-NOV-2011 07:46:56
Uptime                    0 days 0 hr. 59 min. 9 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10201/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10201/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prim)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "liuzhou" has 1 instance(s).
  Instance "liuzhou", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

SQL> 
SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      dg, prim1


Here is what I really mean, no mater what kind of way, pmon or dbms_service can't really register a service.

Thanks very much.
Re: PMON register problem [message #532519 is a reply to message #532516] Wed, 23 November 2011 03:43 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
That's because you've been messing about with IP addresses. You need to set your LOCAL_LISTENER parameter on each database to point to the local listener address,
alter system set local_listener='(address=(protocol=tcp)(host=the.listeners.ip.address)(port=1521))';
Re: PMON register problem [message #532525 is a reply to message #532519] Wed, 23 November 2011 04:23 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

So after switchover, the hostname and ip addr will changed too, so parameter local_listener will need to change to.
Hard to say this will work though. Anyway, I will try.

Thanks.
Re: PMON register problem [message #532526 is a reply to message #532525] Wed, 23 November 2011 04:27 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
No, man! Think!
The whole idea is that you NEVER change an ip address. Each database registers its service(s) with its local listener. The clients try BOTH listeners (you do know that you must include FAILOVER=ON and LOAD_BALANCE=ON in the address list of your tnsnames alias? And that the address list will have both listeners?) and everything is automatic.

Re: PMON register problem [message #532758 is a reply to message #532526] Thu, 24 November 2011 07:19 Go to previous message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Ok.Thanks, John. Your solution is very good.
This need to be modified on every client. So I gave up for this one. And the application are point to the fixed address. For safety of switchover, we still chose to restart the db to let this register succeed.
Thanks again.
Previous Topic: Oracle Database not connect from outside lan via static ip
Next Topic: Problem with ORACLE_HOME
Goto Forum:
  


Current Time: Fri Mar 29 04:13:30 CDT 2024