Wednesday, April 23, 2008

Active dataguard - oracle 11g !!

Oracle 11g dataguard has this nice feature called Active dataguard, where you can have your standby database open read only and still have the redologs being applied to the standby database. This is definitely a huge improvement to standby functionality, 'cos you can leverage all your select queries to the standby database, while using the primary for all DDL/DML activity.

Here are the steps to follow.

1. Disable the redolog apply.
2. Alter database open readonly; (on standby database)
3. Enable the redolog apply.

and you are done.

-- Vish.

Tuesday, April 22, 2008

Command history for sqlplus - rlwrap !!

There’s a utility called rlwrap that you can install and once that is done, you can use UP arrow and sqlplus remembers your previous commands (as in MS-DOS).

This procedure is for Sun Solaris Sparc 64 bit OS.


Step 1 :

1. Download ncurses-5.4-sol10-sparc-local.gz from http://solaris-freeware.saix.net/programlistsparc10.html

2. Download readline and rlwrap packages from http://ivan.kartik.sk/index.php?show_article=26

Step 2 :

To install rlwrap on Solaris execute following commands:

gunzip ncurses-5.4-sol10-sparc-local.gz
gunzip readline-5.2-solaris9-sparc.gz
gunzip rlwrap-0.28-solaris9-sparc.gz


pkgadd -d readline-5.2-solaris9-sparc
pkgadd -d rlwrap-0.28-solaris9-sparc
pkgadd -d ncurses-5.4-sol10-sparc-local

Step 3 :

As readline library is located in /usr/local/lib don't forget to add that line to LD_LIBRARY_PATH.

Also put following line to your .profile:

alias sqplus='/usr/local/bin/rlwrap sqlplus'





-

Monday, April 07, 2008

Who is using temporary tablespace

John Emmons has given a nice script to show who is using the temporary tablespace and how much, a very useful script.

Here's the script that he has on his site.

set pagesize 1000
select a.tablespace_name, trunc(b.allocated)Allocated, trunc(a.free) Free, trunc(b.allocated-a.free) USED,
(100-trunc(((b.allocated-a.free)*100)/b.allocated)) Percentfree from
(select tablespace_name, sum(bytes)/1024/1024 free from sys.dba_free_space group by tablespace_name) a,
(select sum(bytes)/1024/1024 allocated, tablespace_name from dba_data_files group by tablespace_name ) b
where a.tablespace_name = b.tablespace_name
union
select 'Total', trunc( sum(b.allocated)), trunc(sum(a.free)), trunc(sum((b.allocated-a.free))),
00000 from
(select tablespace_name, sum(bytes)/1024/1024 free from sys.dba_free_space group by tablespace_name) a,
(select sum(bytes)/1024/1024 allocated, tablespace_name from dba_data_files group by tablespace_name ) b
where a.tablespace_name = b.tablespace_name
order by 2;

-- Vish.

Om Shanti Om

I could not believe that an Indian movie "Om Shanti Om" is rated as top 47th movie among the top 50 movies on movies.yahoo.com for the year 2007.

You can check it out here.

http://movies.yahoo.com/mvc/top10?lid=660


-- Vish.

Spiritualism Vs Hunger !!

Its been a long time that I've visited this blog. I've been busy with the last two jobs and didn't really get anytime to get here. But I plan to be active from now on. I've decided to include non-oracle related stuff also here, so that I have a way to communicate myself with the whole world.

Coming to Spiritualism vs Hunger. I've always wanted to write about it and finally the time has come. I believe in spiritualism and it is definitely needed for humans. I do respect people who believe in spiritualism. It gives you peace of mind and strength to face difficulties.

Coming to the point, I've seen people donating money to temples and people in India do that a lot. I don't agree with them at all. There are people in India who are in need of food. In my view hunger comes first and then spiritualism, luxury or whatever it is. HUNGER is the first thing that has to be taken care of. Feed the people first and then the temples. There's a saying in telugu (my mother tongue), "MANAVASEVE MADAVASEVA", which I believe in. It means "Service to human is Service to God", which is absolutely true.

And why do we donate money to the temples? I don't think a lot of people understand or even try to understand the reason behind it. I was doing it because my parents taught me to do so and I believe that so is the reason with so many other people. It is just that people believe in God and they believe that donating money to God is a good thing. And what is the money used for? To promote religion and to build temples? Forget about building temples when there are people around dying with hunger. Lets feed the hungry people first. I'm not saying that you leave your worldly luxuries and then spare the money to feed these people. All I'm saying is that lets spare the money that we donate to the temples and use that money to feed these hungry people.

I don't think any religion would say NO to feed hungry people. Also, at the same time, I DO NOT encourage giving money to beggars. Its an absolute NO-NO. Instead, lets pass on the money to charitable organizations who use the money in an organized way to feed hungry people and may be to send poor children to school.

I've started sponsoring a child in India and so can you. Ashanet.org is a non-profit organization where you can sponsor a child in india. They will be given food, shelter and also sent to school. I would encourage all of you to have a look at the link below and forward it to as many people as you can. You can sponsor a child at $20 to $30 a month. You can also google for "sponsor a child ashanet", in case the link below does not work.

https://www.ashanet.org/siliconvalley/sac//index.html

Lets start working towards feeding the hungry people. You can do your part by feeding one person from your earnings and if every one of us do that, the world will be HUNGER-FREE, a dream come true!!

Let me reiterate the saying, "Service to human is Service to God".


-- Vish.