Pages

Friday, July 4, 2008

Add a new TAF service with dbca

I needed to set up a new service for my three nodes Oracle RAC production environment.
I decided to use dbca because it's easier compared with srvctl command line.
Indeed when you use DBCA to create a service you do not need to add the corresponding TNS entry in your tnsnames.ora on the cluster nodes: DBCA does it all for you in the background.
Of course you can use SRVCTL to create a service, but you also need to manually add the TNS entry: moreover when you use SRVCTL, after you've created the new service you need to start it with a separate command, while DBCA starts it when you click FINISH button.
So let's start logging as oracle user from one of your nodes, and type
dbca



It first shows the Welcome window where you need to select your type of database: Oracle Real Application Cluster database or Oracle single instance database.



Next you need to choose the operation to be performed. Choose Services Management and click NEXT button.



At the step 2 select your database. In my case the screen shows my only BILLING database



The step 3 shows the current services available for the database chosen. In this screen you can add, remove or modify services. Today we want to add a new service so click the ADD button.



After clicking the ADD button you can choose a name for next service: in my case I called it SIM_TAF. Press OK button after you enter your service name.



Now configure your option for the new service. I choose it should have only a preferred instance where to run (BILLING3) and two available instances to switch over in case of problems (BILLING1 and BILLING2). Choose also your TAF (Transparent Application Failover) policy:
transparent application failover is a client-side feature that allows for clients to reconnect to surviving databases in the event of a failure of a database instance. Notifications are used by the server to trigger TAF callbacks on the client-side. Your options could be: Basic, in which the application connects to a backup node only after the primary connection fails. This approach has low overhead, but the end user experiences a delay while the new connection is created, or Pre-Connect, where the application simultaneously connects to both a primary and a backup node. This offers faster failover, because a pre-spawned connection is ready to use. But the extra connection adds everyday overhead by duplicating connections. For my environment Basic TAF policy was good. Click FINISH.



A summary screen will appear. Click OK



The configuration of the new service will start



Click NO if you don't want to perform other operation.



That's all.

Friday, April 18, 2008

RMAN: UPGRADE CATALOG command

While registering a new two nodes Oracle RAC installation to my recovery catalog I encountered the following error:





[oracle@blade05 ~]$ rman target sys/my_pwd catalog rman/cat@CATDB

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Apr 18 10:32:46 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: DWHDB (DBID=3585749232)
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 10.02.00.00 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version 10.02.00.00 in RCVCAT database is not current


It means I'm using a different version of rman between the RAC installation and the recovery catalog, indeed the RAC installation is at 10.2.0.4 while recovery catalog is at 10.2.01 version.
If you use a version of the recovery catalog that is older than that required by the RMAN client, then you must upgrade it using UPGRADE CATALOG command;
I'm upgrading from a client using 10.2.0.4 software version, while at the same time my recovery catalog is serving also other database using older or the same version. That's not a problem: it's important that recovery catalog is at least at the same version of your newest database client version.

So while I'm connected from RAC installation I need to issue the UPGRADE CATALOG command:
RMAN> upgrade catalog;

recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;

recovery catalog upgraded to version 10.02.00.04
DBMS_RCVMAN package upgraded to version 10.02.00.00
DBMS_RCVCAT package upgraded to version 10.02.00.00

RMAN>

That's all.

Friday, April 11, 2008

Patching Oracle RAC 10.2.0.1 on ASM with 10.2.0.4 Patch Set 3 for Linux x86

Using your oracle user, download and unzip the file p6810189_10204_Linux-x86.zip.







First of all, before applying the 10.2.0.4 patchset to the Oracle database you should verify if the DSTv4 (USA 2007) update included in the 10.2.0.4 patchset has implications on your database. Following the NoteId 553812.1 provided by Metalink the goal is to see if you have stored information that is affected and if you are already using a DST version higher then DSTv4 and what then to do.


Because I'm patching from a lower 10.2.0.X release to 10.2.0.4 I hav to execute the following query to check the current version of the Oracle time zone definitions:
SQL> SELECT version FROM v$timezone_file;

Becuse my current timezone version is lower then 4, I need to execute this other query to check if I'm storing *user* TZ (TSTZ and TSLTZ) data:
SQL> select c.owner || '.' || c.table_name || '(' || c.column_name || ') -' || c.data_type || ' ' col
from dba_tab_cols c, dba_objects o
where c.data_type like '%TIME ZONE'
and c.owner=o.owner
and c.table_name = o.object_name
and o.object_type = 'TABLE'
order by col
My output shows there is nothing outside the Data Dictionary (= other then SYS objects).


The following queries
SQL> SELECT object_name FROM dba_objects WHERE object_id IN (SELECT obj# FROM scheduler$_window);
SQL> SELECT object_name FROM dba_objects WHERE object_id IN (SELECT obj# FROM scheduler$_job);
show I have only 6 jobs defined and I have also no user TZ (TSTZ and TSLTZ) data, so there is no action to take for the Oracle time zone definitions, and I can simply upgrade from 10.2.0.1 to 10.2.0.4.


Now I have to stop one node because I need to patch first the clusterware software and it can be done using rolling updates.
Run the following commands from the first node of your RAC installation:
emctl stop dbconsole
isqlplusctl stop
srvctl stop service -d DWHDB -s DWHDB_TAF -i DWHDB1
srvctl stop instance -d DWHDB -i DWHDB1 -o immediate
srvctl stop asm -n bl3306
srvctl stop nodeapps -n bl3306


Go into the directory Disk1 and run ./runInstaller &


A Welcome screen appears.


Specify the home details for the clusterware home.


Click next on the cluster nodes screen.


It checks for product-specific prerequisites.


Click Install


And the Clusterware patching is starting.



Before click the EXIT button and complete the installation,login as root on the first node and execute the following command as suggested:




Run
/u01/app/oracle/product/10.2.0/crs_1/crsctl stop crs
/u01/app/oracle/product/10.2.0/crs_1/install/root102.sh


They stop and start the crs services on the first node.
Execute the same command on every nodes, I ru them only on my second node:
/u01/app/oracle/product/10.2.0/crs_1/crsctl stop crs
/u01/app/oracle/product/10.2.0/crs_1/install/root102.sh


Then execute as oracle user from one node:
crsctl query crs activeversion


Execute as oracle user from second node:
crsctl query crs activeversion


The clusterware software has been updated.

Click EXIT and then YES from the OUI interface.


Now execute the following command to completely stop the database (this patchset doesn't support rolling updates) from your first node:
emctl stop dbconsole
isqlplusctl stop
srvctl stop service -d database DWHDB -s DWHDB_TAF -i DWHDB1
srvctl stop database -d DWHDB -o immediate
srvctl stop asm -n bl3306
srvctl stop nodeapps -n bl3306


Execute the following command to completely stop the asm instance from your second node:
emctl stop dbconsole
isqlplusctl stop
srvctl stop asm -n bl3305
srvctl stop nodeapps -n bl3305


As oracle user run again the runInstaller


Click NEXT on Welcome screen.


Choose the Oracle home.


Click NEXT on cluster installation mode screen.


Click NEXT on prerequisite checks screen.


Enable and register your Oracle Configuration Manager.


Accept the license agreement


and test your registration


Click INSTALL on summary screen.


The installation is proceeding.


When asked execute as root user the following command on your first node
/u01/app/oracle/product/10.2.0/db_1/root.sh


and then again from your second node.


Clic EXIT on End of Installation screen



and the YES


Only from your first node, login as oracle user and execute:
srvctl start asm -n bl3306
srvctl start listener -n bl3306


Then run dbua


Click NEXT on Welcome screen.


Select Upgrade a Database and click NEXT.


Select your database and click NEXT, providing a user with sysdba privileges.


The upgrade of the database starts.


Choose the degree of parallelism to recompile any invalid objects, turn off archiving and click NEXT.


Specify your Flash Recovery Area and click NEXT.


Click FINISH on Summary screen.


Your database is now 10.2.0.4 patched.