Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

Oracle

Posted Jan 21, 2003

FireWire Real Application Cluster - Page 2

By DatabaseJournal.com Staff

5: Compile the kernel

Prior to compiling the kernel be sure to run "make xconfig" from the /usr/src/linux directory. Choose the IEEE 1394 (FireWire) support (EXPERIMENTAL) menu option. Set the following options to "y":

  • IEEE 1394 (FireWire) support (EXPERIMENTAL)
  • OHCI-1394 support
  • SBP-2 support (Hard disks, etc)
  • Enable Phys DMA support for SBP2 (Debug)
  • Raw IEEE1394 I/O support
  • IEC61883-1 Plug support

Next build the kernel according to your distributions instructions.

You may run across an error "nodemgr.c: 1307: parse error before 'else'" when the kernel is compiling. This is a verbose debug option. We commented out line 1304 and recompiled the kernel.

Another error we ran into was "Error invoking target install of makefile /op/oracle/product/9.0.1/plsql/lib/ins_plsql.mk". To resolve this problem you'll need to edit the file $ORACLE_HOME/bin/genclntsh and change the following line:

LD_SELF_CONTAINED="-z defs"
to read:
LD_SELF_CONTAINED=""

6: Detect FireWire devices

The easiest way to add/detect new FireWire devices is to run the shell script rescan-scsi-bus.sh. The script may be found at: http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh

When you run this script you should see the following type of response:

Host adapter 0 (ide-scsi) found.
Host adapter 1 (sbp2) found.
Scanning for device 1 0 0 0 ...
NEW: Host: scsi1 Channel: 00 Id: 00 Lun: 00
      Vendor: WDC WD12 Model: 00JB-75CRA0      Rev:
      Type:   Direct-Access                    ANSI SCSI revision: 06
1 new device(s) found.
0 device(s) removed.

This indicates your FireWire drive was detected by Linux.

7: Partitioning your drive

If you decide to only use one external disk, then you'll need to be aware of a couple of things. If you do not use Logical Volume Manager (LVM) or Oracle Cluster File System (OCFS), then you'll most likely have to use FDISK to partition your raw devices. You will be limited to 3 primaries, 1 extended and 11 logical partitions. This means you will not have room for all the default tablespaces the Database Creation Assistant (DBCA) uses. For this reason we decided to drop the USERS and TOOLS tablespaces during the DBCA setup. This obviously doesn't follow the optimal flexible architecture (OFA), but since this is a development system it will work just fine. You could also use multiple disks to allow you to set up additional partitions.

It's recommended that you use LVM or OCFS.

8: Oracle patch

Install Oracle 9i Database server with the RAC option according to Note ID 184821.1 available on Metalink. There was an issue filed for shutdown immediate taking <60 seconds to unregister.

This was filed as Bug 1841387 which was fixed in the 9.0.1.1 patch set. However Oracle Support recommended we apply the 9.0.1.4.0 patch set. You can download this from http://metalink.oracle.com and simply follow the installation instructions. Once you've created and started your database, you're ready to connect to the RAC from a client workstation.

9: Testing SESSION Failover

You may use SESSION or SELECT type failover. SESSION is the simplest type. When the connection to an instance is lost, SESSION failover results only in the establishment of a new connection to a backup instance. Any work in progress is lost.

SELECT Failover is implemented by transparently re-executing the SELECT statement and then bringing the cursor up to the same point as it was before the failure. There's no automatic recovery mechanism built into SELECT failover to handle DML statements, such as INSERTs and UPDATES which are in progress when a failover occurs. Your application will still need to use error checking routines and transactions, but now if a failure occurs you can try the transaction again on the same connection. If it was a node failure the connection has already reestablished itself to another node.

The METHOD parameter defines if Oracle pre-establishes connections to connect to the backup node.

BASIC : In this case it simply establishes a new connection to the backup node. In this case the backup node isn't used until the used node crashes.

PRECONNECT : In this case it connects also to the backup node so that the switch from one instance to the other is quick.

Now comes the exciting part, testing your Real Application Cluster for failover. The following text describes the connect string in the clients TNSNAMES.ORA file for SELECT failover (notice that TYPE=SELECT):

CLUST = 
(DESCRIPTION = 
  (FAILOVER=ON) 
  (ADDRESS_LIST = 
     (LOAD_BALANCE=ON) 
     (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521)) 
     (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521)) 
  ) 
  (CONNECT_DATA = 
     (SERVICE_NAME = clust) 
     (FAILOVER_MODE=(TYPE=SELECT)(RETRIES=3)(TIMEOUT=3)) 
  ) 
)

From a client SQL Plus session connect to your RAC database. To determine which instance you connected to you can run the following:

 SQL> select instance_number,instance_name
        2   from v$instance;

In our case we were connected to instance "clust2". So if we were to run an SQL statement and take down this instance, then we should be failed over to instance "clust1" on the other node.

The next step is to run an SQL SELECT statement. Make sure it will run long enough for you to shutdown the instances you're currently connected to. You could import a table from your production system via the imp/exp utilities.

While the SQL is processing, type the following on your server to shut down the instance where your SQL is processing:

 [oracle@rac1]$>  srvctl stop -p clust -i clust2 -s inst

where clust is the name of your cluster database and clust2 is the specific instance you want to take down. If everything is working properly you should see your SQL results pause for a moment and then pick back up. Once the SQL has completed verify that you are connected to the other instance by running:

 SQL> select instance_number,instance_name
        2   from v$instance;

Conclusion

Now you've seen the steps necessary to configure RAC on Linux using FireWire drives. Oracle Real Application Clusters with FireWire on Linux enable you to build a robust clustered system on a shared disk using inexpensive hardware. This will allow you to test your clustered applications and get experience managing a cluster.

http://otn.oracle.com/tech/linux/open_source.html

http://metalink.oracle.com

Brian Carr (editor@oraclegiants.com), founding member of Oracle Giants, Oracle Certified Professional & Oracle ACE. William Garrett (wgarrett@neo.rr.com) is a Senior Application Developer/Web Technologies at a manufacturing company, in Akron, Ohio.



Oracle Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
Oracle Forum
Topic By Replies Updated
Oracle Data Mining: Classification jan.hasller 0 July 5th, 07:19 AM
Find duplicates - Unique IDs Lava 5 July 2nd, 08:30 AM
no matching unique or primary key rcanter 1 April 25th, 12:32 PM
Update values of one table based on condition of values in other table using Trigger Gladiator 3 February 29th, 06:01 PM


















Thanks for your registration, follow us on our social networks to keep up-to-date