10 Replies Latest reply: Sep 16, 2011 4:20 PM by 888777 RSS

    Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC

    358556
      Hi All,

      I saw this link, but it mentions RAC as a solution:

      Using Oracle Clusterware to Protect A Single Instance Oracle Database 11g

      I have seen various articles about protecting single instance with cold failover using clusterware, but they mention scripts and older versions of Clusterware. I am trying to figure out if possible to incorporate virtual ip's / scan listeners or if this is even a supported configuration...



      I have set up clusterware 11gr2 using OCFS2. I basically just want to do a cold failover from one node to the other, and I do not wish to purchase a RAC license...

      thanks much

      Edited by: vcovco on Sep 30, 2010 1:52 PM
        • 1. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
          Sebastian Solbach -Dba Community-Oracle
          a.) Yes the scripts of 11.1 still work. However 11.2 does incorporate a new action section (besides start, stop and check) which is the clean section.
          b.) I just implemented the "old" way with a new application vip and a new "own" listener. Used appvipcreate / crsctl add resource for listener (own action script) and crsctl add resource for the database instance action scripts.
          c.) Yes it will also work with SCAN and VIP, since the SCAN and the SCANVIPs are both cluster resources and will "failover" to other nodes. However since they always will be running, you will not be able to restrict your database to the VIP (that's what I did with the own VIP).

          => Why are you using OCFS2? And not ASM + ACFS? Works perfectly well with the database as well...

          Regards
          Sebastian
          • 2. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
            358556
            Thanks so much ssolbach!

            This is great info! a,b, make sense...

            For c.) Yes it will also work with SCAN and VIP, since the SCAN and the SCANVIPs are both cluster resources and will "failover" to other nodes. However since they always will be running, you will not be able to restrict your database to the VIP (that's what I did with the own VIP).

            I am somewhat confused by the VIP and scan ip's. I am coming off a HP-UX serviceguard environment. So I guess, i don't understand why you would not use the default VIP since you can move that to either host? Guess I am trying to avoid lots of IP's all over the place, such as Cluster IP, scan IP, VIP ip's...I think I am still confused as to what all the IP's actually do--have read the guides a few times...

            As per using OCFS2---it seems like a more simple and straightforward way to access the data in a disaster recover scenario...seems like with ASM only backup method is through RMAN. Of course, I am the sysadmin and not the dba---maybe still not clear on advantages of using ASM....could you note why you would recommend ASM over ocfs2?

            I thank you very much--greatly appreciated for your insight....

            Edited by: vcovco on Oct 2, 2010 5:48 AM

            Edited by: vcovco on Oct 2, 2010 5:48 AM
            • 3. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
              Sebastian Solbach -Dba Community-Oracle
              Hi Vcovco,

              you have to understand, that a (Host)VIP only works correctly for Oracle in conjunction with a listener listening on that VIP address.
              Now if a (Host)VIP fails over to another node, the local listener will not. Hence even though you can ping the VIP no client can make connections via. this VIP, since there is no listener listening on that VIP on the foreign host. (But the client will get an information pronto to traverse further through his address list).
              SCAN VIPs however work differently, because they have a listener connected to them, which will also failover to another node. Hence allowing connections to be accepted, if running on other node (since the listener is moving with the SCAN VIPs).

              For this reason in the past, you needed to create a "user" VIP and a "user" listener, that there would be a failover of both (not like the Oracle host VIP). Since a SCAN VIP does exactly that, there is no need for a "user" VIP and listener (however this still works!).

              a.) Every DBA should make backups through RMAN in the meanwhile...
              b.) There is also a asmcd copy command

              Regarding the advantages over OCFS2
              - better performance (nearly RAW)
              - easier to extend (no need to resize)
              - no hotspots if storage is extended, since storage is automatically rebalanced.
              See here: http://www.oracle.com/technetwork/database/asm/db-tuning-guesswork-173710.pdf
              - easier consolidation
              Just to name a few.

              One other thing no one mentions:
              With OCFS2 you have a second clusterware running on the server. OCFS2 has it own fencing mechanism.
              So you have to regard some more things to "correlate" OCFS2 fencing and OCW fencing. Not that they decide differently, on which node to reboot.

              So my opinion is: keep it simple. Only use 1 clusterware.

              And last but not least: ASM now has a ACFS filesystem

              Sebastian
              • 4. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                358556
                Sebastian,

                This information is priceless! Thanks so much for your insight. I have also done more digging and ocfs2 scares me with no good way to control or override the fencing. Great point about having 'two clusterwares' running. Definitely time to remap our strategy...
                • 5. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                  khang
                  Sebastian/vcovco,
                  We are trying exactly what vcovco is doing - continue to use CRS 11.2 for a single instance cold failover of 10g/11g databases. This is working beautifully in CRS 11.1. In trying to install/configure 11.2, we are seeing that our ASM instances are showing RAC like behavior. We used to have ASM intances that ran independently on each node. A disk group could not be mounted on multiple nodes. This is the desired behavior. Now we're finding that that in 11.2 ASM instances cannot have the same name on multiple nodes. If you name all your ASM instances ASM then you are allowed to start the ASM instance on the first node, however, on the 2nd node you get the error "ORA-00304: requested INSTANCE_NUMBER is busy".  If you then rename the ASM instance on the 2nd node ASM1, by editing the pfile, then you are allowed to start the ASM instance up. With ASM on node 1 and ASM1 running on node 2, either instance can mount all Diskgroups simultaneously. This is not the desired behavior.

                  Do you have any suggestions on how to configure CRS/ASM so that this RAC like behavior is avoided?

                  Any help will be much appreciated.

                  Thanks!!
                  Angira.
                  • 6. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                    Sebastian Solbach -Dba Community-Oracle
                    Hi Angira,
                    pls open a new thread for your issue. If a question/thread is tagged as answered then many ppl. which could help you don't read it....

                    Regarding your question: Why do you want to start ASM in non clustered for for the single instance failover?
                    There is absolutely no harm in using ASM in clustered mode (there is also no license needed if you run ASM in clustered mode and have SI on top of it), and this makes the failover a lot easier....

                    Exactly this setup is described in this whitepaper:
                    http://www.oracle.com/technetwork/database/clusterware/overview/si-db-failover-11g-134623.pdf

                    Unfortunately Oracle has not released one for 11gR2, but you find the failover scripts in the installation home.

                    Sebastian
                    • 7. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                      khang
                      Thanks Sebastian.
                      Our concern was that soon as we run ASM in clustered mode that we would be entering RAC realm for which we are not licensed. We have confirmed with Oracle what you state here that installing GI in RAC clustered mode does not mean we are using RAC. And that a RAC license is only required when we install the DB software with RAC option. We are watching this licensing line very closely with Oracle in case they decide to change their minds. As soon as we opened up the GI install in a RAC cluster mode then this became a non-issue for us since we are able to use most of the scipts we had already developed with 11gR1.

                      The fact that GI 11.2 does not support ASM in non-clustered mode is actually mentioned in the installation documentation but we wanted to made sure that GI could be used in a non-RAC environment for cold-failover scenario.

                      There are some other issues we are running into in our AIX environment with failover of a user-defined cluster resource hierarchy but we are working with Oracle support on that.

                      Thanks!
                      Angira.
                      • 8. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                        user11970080
                        Hi Angira,

                        Could you pls share us the steps which you have followed. Even i am having an issue with the hierarchy(dependencies). I have followed the 11gr1 whitepaper to implement the same for 11gr2. Pls help.

                        Thx,
                        Krish
                        • 9. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                          user11970080
                          Below are the steps which i followd. Can you pls take a look & reply if the below are correct.



                          Step1 rg1
                          #########################################################################################################################

                          crsctl add resource rg1 -type cluster_resource \
                          -attr "ACTION_SCRIPT=$CRS_HOME/crs/public/act_resgroup.pl, \
                          CHECK_INTERVAL=600"

                          ./crsctl start resource rg1


                          Step2 rg1.vip
                          #########################################################################################################################

                          As root

                          $CRS_HOME/bin/appvipcfg create -network=1 -ip=xx.xx.xx.xx -vipname=rg1.vip -user=root -group=root

                          ./crsctl setperm resource rg1.vip -u user:oracle:r-x

                          ./crsctl start resource rg1.vip



                          Step3 rg1.listener
                          #########################################################################################################################

                          export CRS_HOME=/optware/grid/11.2.0.2
                          export ORACLE_HOME=/optware/oracle/11.2.0.2/db
                          export USRORA_LANG=$ORACLE_HOME
                          export USRORA_SRV=LISTENER_rg1
                          export ORACLE_SID=rg1
                          $CRS_HOME/crs/public/act_listener.pl start

                          Listener.ora
                          =========
                          LISTENER_rg1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=lxwkbc-app)(PORT=1320))))

                          Tnsnames.ora
                          =========
                          LISTENERS_rg1 =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = lxwkbc-app)(PORT = 1320)))


                          ./crsctl add resource rg1.listener -type cluster_resource \
                          -attr "ACTION_SCRIPT=$CRS_HOME/crs/public/act_listener.pl, \
                          CHECK_INTERVAL=20,RESTART_ATTEMPTS=5, \
                          START_DEPENDENCIES=hard(rg1.vip) pullup(rg1.vip),STOP_DEPENDENCIES=hard(rg1.vip)"


                          ./crsctl start resource rg1.listener



                          Step4 rg1.db_rg1
                          #########################################################################################################################
                          export CRS_HOME=/optware/grid/11.2.0.2
                          export ORACLE_HOME=/optware/oracle/11.2.0.2/db
                          export USRORA_LANG=$ORACLE_HOME
                          export USRORA_SRV=rg1
                          export ORACLE_SID=rg1
                          export USRORA_FLAGS=1

                          $CRS_HOME/crs/public/act_db.pl stop

                          ./crsctl add resource rg1.db_rg1 -type cluster_resource \
                          -attr "ACTION_SCRIPT=$CRS_HOME/crs/public/act_db.pl, CHECK_INTERVAL=20,RESTART_ATTEMPTS=5, \
                          START_DEPENDENCIES=hard(rg1.listener) pullup(rg1),STOP_DEPENDENCIES=hard(rg1.listener)"

                          ./crsctl start resource rg1.db_rg1

                          Step5 rg1.head
                          #########################################################################################################################

                          ./crsctl add resource rg1.head -type cluster_resource \
                          -attr "ACTION_SCRIPT=$CRS_HOME/crs/public/act_resgroup.pl, CHECK_INTERVAL=600,RESTART_ATTEMPTS=2, \
                          START_DEPENDENCIES=hard(rg1.listener,rg1.db_rg1,rg1)"

                          ./crsctl start resource rg1.head
                          • 10. Re: Protect single instance linux Oracle 11Gr2 with Clusterware 11Gr2 non-RAC
                            888777
                            In our 10g cluster resources, I could set and see all the values for the USR_ORA_xxx variables to tell it what $ORACLE_HOME and $ORACLE_SID to use. I see that you are setting them in your environment before you create and start your resources (listener and database). However, how to make them "stick" if you have multiple databases on each server within the cluster and you want them to start automatically without having your environment all set for a specific SID (like if you're starting all resources at the same time)? I could always create a specific ACTION_SCRIPT for each database, but I'd prefer the use the generic action scripts that we always used in 10g (act_db.pl, etc.). Suggestions?