Archive for December, 2005

The Warlord’s Son

Just finished reading The Warlord\'s Son I got from my Dad for Christmas. I suppose a lot of people read up on Afghani/Pakistani culture immediately after 9/11 to gain some understanding of what might drive people to commit such an attack on America. I decided to read The Great Game: The Struggle for Empire in Central Asia (Kodansha Globe) to gain some historical perspective on the region as well as my normal ‘hot spots’ resource – Robert Young Pelton\'s The World\'s Most Dangerous Places : 5th Edition (Robert Young  Pelton the World\'s Most Dangerous Places). I believe there is a TV show based on the latter book at this point, not sure – I don’t get to watch much TV.

So The Warlord’s Son was a nice refresher on the region – the story is about a print journalist who flies to Peshawar to cover the region immediately after 9/11 – I’m not into spoilers, but I found the story to be well informed and very engaging as a thriller.

Most interesting to me was the anthropological angle of Pashtun culture – the Pashtunwali code – malmastiya and nanataway – the obligation to provide safe harbor to visitors who come in peace. I met a 7-11 owner a few months after 9/11 – he was Pashtun (there are no nationalities if you are Pashtun !) and I was very impressed by his straightforwardness and clarity about world politics – it was a refreshing meeting during a period of intense bombast on our TV. We spoke for several hours about the region he came from, the history of other countries fighting over Khyber Pass to guarantee trade access through the mountains between whatever-istan it happens to be in the current century.

Anyway, I’m rambling – read the book – it’s good!

Comments

Identify unsupported types for logical standby in Oracle 10G

An important step in creating a logical standby of your Oracle 10G database when using dataguard is to ensure that all the data is compatible.

These two queries will help you quickly spot what you need:

select distinct owner, table_name from dba_logstdby_unsupported order by owner, table_name;

select owner, table_name, bad_column from dba_logstdby_not_unique where table_name not in (select table_name from dba_logstdby_unsupported);

Comments

It’s magic! (rman knows the LIKE command)

Well maybe not exactly magic, but pretty nice nonetheless. In the previous entry I discussed managing the standby archivelogs (in the flashback recovery area). If you are running everything with a catalog database and have a primary and a standby, the primary and standby are pretty much identical except in the flashback area:

/path/to/flashback/archivelog/$DB_UNIQUE_NAME/data/files

so on the primary and standby, which have different $DB_UNIQUE_NAME, there is a directory unique to each machine. If you
ever need to clear out files on one or the other and don’t use RMAN to do it, this will make sure the catalog is accurate:

- use rman to connect to the primary and catalog
- RMAN> crosscheck archivelog all like ‘%$DB_UNIQUE_NAME%’;
Do the same on the standby…

This only updates the catalog for the online archivelog files. To update the backup files as well:

run {
allocate channel device type disk;
crosscheck backup;
}

Comments

Deleting archivelog on physical standby with RMAN in Oracle 10g

Turns out to be quite easy actually. I do backups from the primary database to a local drive and have been puzzled how to delete the standby archive logs after they ship. The ‘obvious’ solution is the documented feature in RMAN:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY

However, that didn’t work when I originally setup RMAN. Turns out that because I’m using ‘Maximum Performance Mode’, my standby archivelog destination is NOT mandatory and therefore Oracle only half pays attention to it.

Finally (August 2005) Oracle released a Metalink Note 331924.1 explaining how to enable this feature of RMAN with either Max Performance or Max Availability mode – just add _log_deletion_policy=’ALL’ to the spfile, restart your database and all should be good (haven’t tested yet – have to ask for reboot time).

Anyway – back to those archivelogs on the standby.

Turns out that RMAN, when you are using a catalog, IS aware of the standby logs, but just can’t delete them if you connected to the primary database. If you invoke RMAN from the standby machine, you can just use regular RMAN commands to manage the files. I had been just deleting archivelogs manually from the drive on the standby once they were old, to keep room available – turns out eventually (9 months on a fairly busy server) I got this message in the alert log, that finally forced me to do it right (although I will take some comfort in getting it wrong since Oracle documented the feature a year after releasing the software):

ORA-19815: WARNING: db_recovery_file_dest_size of 62914560000 bytes is 95.59% used, and has 2773004800 remaining bytes available.

*************************************************************
You have the following choices to free up space from
flash recovery area:
1. Consider changing your RMAN retention policy.
If you are using dataguard, then consider changing your
RMAN archivelog deletion policy.
2. Backup files to tertiary device such as tape using the
RMAN command BACKUP RECOVERY AREA.
3. Add disk space and increase the db_recovery_file_dest_size
parameter to reflect the new space.
4. Delete unncessary files using the RMAN DELETE command.
If an OS command was used to delete files, then use
RMAN CROSSCHECK and DELETE EXPIRED commands.
*************************************************************

What’s strange and let me know that something was horribly wrong, is that there were only 4Gb of files in that area, and the message says that 95.9% of the 60 Gb is used.

Anyway, do what I said above – use RMAN to connect to your standby d/b and the catalog, and for example to delete up to 5 days ago of archivelogs sitting in the flashback area:

run {
allocate channel for maintenance device type disk;
delete archivelog until time 'sysdate -5';
}

(This assumes the db_recovery_file_dest IS the flashback area!)

If you create these files with a directory path specification, you end up with empty directories as each older day's archivelogs get cleaned out, so eventually you will have to hand delete these.

Comments

The ‘which database’ debate continues

My friend Talli pointed out some interesting links right as I am in the middle of reconsidering the oracle/mysql/postgresql – which is better debate. With the newly released mysql5.0 and oracle’s investment in their innodb technology, it looks like a killer platform, but postgresql 8.0 has some killer features and I’ve always liked the more ‘academically’ correct approach to the relational model that postgresql has.

Feed lounge has switched from mysql to postgresql with good results.

Sun is backing postgresql as well.

Guess I need to rethink taking the road more travelled (mysql) once again ..

Comments