A quick 9iRAC example
The names of the two instances I’m using are EAST and WEST, so I’ll use them here to refer to commands you’ll execute at the sqlplus prompt. This test assumes you’re logged into the same schema on both instances. I used ‘sys’ but you can create your own schema if you like.
1. On WEST do:
SQL> create table rac_test (c1 number, c2 varchar2 (64));
2. On EAST do:
SQL> desc rac_test
3. On WEST do:
SQL> insert into rac_test values (1, ‘SEAN’);
SQL> insert into rac_test values (2, ‘MIKE’);
SQL> insert into rac_test values (3, ‘JANE’);
4. On EAST do: (notice no rows are returned)
SQL> select * from rac_test;
5. On WEST do:
SQL> commit;
6. On EAST do: (notice the rows appear now)
SQL> select * from rac_test;
7. On WEST do:
SQL> update rac_test set c2 = ‘SHAWN’ where c1 = 1;
8. On EAST do: (notice the error Oracle returns)
SQL> select * from rac_test where c1 = 1 for update nowait;
select * from rac_test where c1 = 1 for update nowait
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
9. Again on EAST do: (notice Oracle waits…)
SQL> update rac_test set c2 = ‘JOE’ where c1 = 1;
10. On WEST do:
SQL> commit;
11. On EAST the transaction completes.
This simple exercise illustrates that two sessions running on different instances, against the same database are behaving just like two sessions on a single instance or machine against a database. This is key. Oracle must maintain transactional consistency. Oracle maintains ACID properties which are Atomicity, Consistency, Isolation, and Duarability. Atomicity means a transaction either executes to completion, or fails. Consistency means that the database operates in discrete transactions, and moves from one consistent state to another. Isolation means that actions of other transactions are invisible until they are completed (commited). Finally Durability means when a transaction has finally completed and commited, it becomes permanent.
Our example above demonstrates that Oracle maintains all these promises, even in a clustered environment. How Oracle does this behind the scenes involves the null, shared, and exclusive locks we described above, and current and past image management. A lot of these details are reserved for a 9iRAC internals article. Take a look below at Madhu Tumma’s article for more on 9iRAC internals.
Part 2 – Basic Costs + Hardware Platform Outline
Part 3 – Software Requirements, Versions, etc
Part 5 – Firewire + OCFS Setup
Part 6 – Cluster Manager Setup
Part 7 – Cluster Database Setup
Part 8 – Review of Clustered Features + Architecture