Monday, December 28, 2009

Price of a relationship

I heard Ishfaq Ahmad several times talking about strong relationships or friendships, he was mainly emphasizing on people's collaboration & communication and the worth they give to their relationships.

Once in his program he talked about Cost of a relationship, it was brain buzzing idea! and since then i believe in "There is always a Price to keep a relationship" d'nt think me a materialistic or even Ishfaq Ahmad...but it is true that in our world, we have to buy every-single bit of our owe objects, we even silent or undisclosed mannerly buy our owing relationships.

Taking friendship under vision, there could be following properties one can presume i.e.

- How it was started?
- What was it's intensity?
- How often you practiced that friendship?
- What is the frequency now?
- What is it's price to keep it going at start?
- What is it's price to keep it going, now?
- How important is this friendship to you?

if you can find answer to above questions, for a particular relationship/friendship, you would probably find "How important a certain relationship/friendship is for you?".

lets take a case study and calculate Price to keep relationship/friendship.

Case: my ever first friendship that i can recall now! i.e. with "Seven Das Chohan"

so lets find the answers...

- How it was started?
He was my class-fellow in 1st grade, Sharing same Desk...

- What was it's intensity?
it was quite smooth, we never felt each other demanding.

- How often you practiced that friendship?
everyday :) as we were class fellows.

- What is the frequency now?
we stayed together until 5th grade, when he was depromoted and later left school to
get admission in a non-Muslim school, and then he just disappeared, so frequency is zero now.

- What is it's price to keep it going at start?
Not much notifiable, mostly sharing home work & lunch box & playing together in recess time...etc.

- What is it's price to keep it going, now?
as we are not in contact anymore, so cost is zero.

- How important is this friendship to you?
it is not important, i am living without it :-|

I am afraid to calculate Price of my current or living friendships/relationship as it could create several issue for me... :) anyhow it would be really interesting for you to take some time from your busy life and calculate the cost you bare to keep a relationship or friendship and then see how important is it!

I have noticed that there are many relationships or friendship i keep, they are costing me a lot, but i am willing to carry on with them, and there are some who's cost is just a phone call or chat or email once in a year, but still they have a great importance to me...

Disclaimer: D'nt break your friendship or relationship after reading this post, it is just to poke you, to think on your dead relationships/friendships or even on those which are going to be dead in near future, you should realize how small price you pay to keep some really enjoyable companies...

Moral, Friends & Relations are the actual assets we carry...


Tuesday, December 22, 2009

Musa Khan caste theory

It has been several years i am out of Pakistan, but still, sometimes i get stuck in my past, as once Qazi Ahkam (my best teacher) said about Mirza Ghalib poetry, "tum Ghalib koo aaj perloo aur kai saloon baad jub koi waqia hoga tab tum uss key sath Ghalib ki shayari ko mansoob karoogay, tu tum phir uss key sher ka maza logay" english "you read Ghalib's poetry today & you will understand it several years after when something will happen and you will related Ghalib's poetry to that event & will enjoy!"

I never understood Qazi Akham statement until i recalled Ghalib's ghalaz famous line "Khaaq main kia soratain hongi key pinha hongai..." i realized his greatness when i came to know about death of Nusrat Fateh Ali Khan, then Dr. Ghulam Murtaza and then might be continuing, so as soon as someone of such caliber leave us, i just recall Ghalib's misra "Khaaq main kia soratain hongi key pinha hongai..."

coming back quickly to Musa Khan...let me introduce him,

- Musa Khan was unofficial accountant of Haji Jamsher Khan at Khyber Medical Center (NWFP biggest private hospital at that time)
- Musa Khan did Metric in 1937 under British held India.
- Musa Khan was from same village as Haji Jamsher Khan.
- Musa Khan was not sure about his age, but you can imagine he was my colleague in 1999-2002.
- Musa Khan was really intelligent person, and was handling millions of dollars manual account single headed.
- Musa Khan was use to tell short but meaning full stories.
- Musa Khan was by nature very quiet.

Initially i was appointed in KMC as office clerk but later i was promoted and become some kinda office manager, during that time i use to recheck all cash-in/cash-out by my colleague cashiers, with the time i found different ways by which one can steal money and it was really shocking that i found several corruption cases, even my very senior & religious colleagues were making huge corruption by some really pathetic ways. Anyhow, initially i was reluctant to hold people on such cases, but lately i decided to adopt some policy to avoid such robbery. So i started notifying my colleagues in person about their scams and asked them to bring that money some of my colleagues were working more 10 years in same hospital for a very nominal salary, i didn't felt good to report Haji Jamsher or even Musa Khan about such things...this process started very well, all my colleagues were then very attentive as they knew i can get hold of them...

Islamudin Shami was an actor mostly played Villon roles in Pushtu movies was also hired by Haji Jamsher to prepare fake account books, those were presented for Income Tax department...Shami was really pissed off with people working in actual accounts, as they had chances to scam money while Shami never got any chance to rube Haji Jamsher...he was always searching "Howto blame office staff". Anyhow, Khan Wali, one of office cashier who was use to come in night duty, and was most corrupt person among all office pissed off with me and prepared a drama with Shami i.e.

They somehow gathered all those payments proofs those were missing and i asked some of my colleagues to bring back...but they were making excuses and were trying to delay...though i never reported Haji Jamsher about they took all those proofs to Haji Jamsher and told him that Nayyar is making corruption along with two of my colleague (the one were defaulter)...anyhow Haji Jamsher called all office staff (only clerical) to come in his office and then he blamed Me, Janzeb (who was Haji Jamsher best friend's son in law) and Rasheed (Haji Jamsher's personal school headmistress son). As soon as Haji presented the acquisition, Janzeb & Rasheed started weeping and asked forgiveness, though i was really shocked... it was really a strange situation for me, i was too young & less experienced to face such situation...though unexpectedly Haji Jamsher turned to me "Nayyar, tell me what is fact, i believe in you!"
I d'nt know why but i said "Haji Saab, none of them were intentionally doing it, i had identified them & they were about to payback all." My statement, i did't knew will worth to Haji, he simply on my statement left both clerks and gave me serious warnning...and divided all missing amount on three people including me... so they started cutting our salary for next few months... :(

After few week passed, Khan wali, janzeb & rasheed including shami became big enemy for me... they started fighting and pin pointing my work....

After getting really frustrated i once discuss all situation with Musa Khan, who in return narrated this short story.

Once in a Jungle a tigress had two new born (tiger Cub) children, she had to leave them alone to hunt meal for them, once tigress in search of meal/hunt went too far, so that night came in her way to home & she was unable to reach her kids, she thought that they might have been dead due of she did'nt bother to return during the night, though in early morning she went her home to bury her kids in grave. But when she arrived her her kids were fine & playing...she asked her kids, what happen, how come you survived ? they told her "Mother, there was a She Goat, who feed them when we were weeping with hunger..." tigress rushed to see that She Goat & said, you have done a great favour to me, in return i bless you immunity, no one in jungle will attack on you! you will remain our friend...

After some time, In same jungle an Eagle was flying over that area, he saw a very strange event, i.e. that She Goat is walking among lions & tigers and no one is eating her...Eagle out of curiosity went to She Goat and asked her about this phenomena, She Goat told her all that story...Eagle got a lesson from She Goat, that Helping someone is a good act!

Just after few days, same eagle came weeping to that She Goat...she saw that Eagle has no feather on him, and he is crying badly...She Goat asked him, what has happen to you? Eagle said, i was flying over some part of the jungle, i saw few small mouse were dieing with cold, i felt that their mother wouldn't be able to rescue them, so i went and took all those mouse's kids under me to warm...when i saw Sun rise, i tried to flew but i could not...because my all feathers were eaten by mice...

In reply to Eagles terrible happening, She Goat said "Naiki karo lakin Aseel sey, Kamasal say nahin..." english "Always give favour to high caste people, never low..."

Now you think about your life happening & then let me know, were She Goat correct?

though i usually find, She was correct! ;)


Monday, December 14, 2009

A hundred years age of unix/oracle admin

since i am a bit off workload these days, so i usually feel lazy, i know you are thinking, its pretty natural :) anyhow, i told one of my colleague about my feeling & laziness, she out of the box gave me a really bright idea, "Nayyar, when you are down & lazy, try to follow your feelings, do exact your heart is telling you..." it seems pretty ordinary statement, but actually it is not!

so yesterday i started thinking what exactly my heart feels, and i found myself more confused, can you tell me what exactly your heart wants to do? i mean it is really complex, if you try to search your feelings & try to refine what exactly is your desire, you will suddenly find yourself more confused rather clueless...After a while i got a tiny feeling about my profession, what exact i should do ? can you answer this? is it easy to tell anyone what exactly you are suppose to do? puff again confusing...

after few hours, i started to think on my career history and tried to find what exact i adore to do! and surprisingly i found that me, i mean Nayyar, i mean me :) like to be Guile program :-| ok! you d'nt know about guile then please read it...

my first encounter with guile was in 2005, when zeenix gave me a few minutes intro, but i got stock into guile badly, even during my MS second semester, we had to submit final project, i asked Dr. Lutfullah & Zeenix about ideas on guile project, though only zeenix sent me, this (His) project wish-list, as a matter of fact there were quite a few projects, but i selected XML-RPC binding project, and soon after that i prepared so called this project proposal which lately was submitted to Shahid Nawaz, he was our supervisor in MS Projects.

at that time zeenix left for Karachi (Pakistan), so it was hard to get hold of him, i somehow find myself hopeless in start of this project, as no one at Peshawar (Pakistan) was able to teach/help/program guile and it became really hard to get time from my busy schedule to do my own research on guile...during guile intro zeenix told me about #guile at if you never have been in then you should feel ashamed :-| ... so i started getting into #guile and spending everyday few hours in this chatroom, talking to people, mostly "wingo, rotty & zeenix himself..." with the time i got several good source of learning guile such as,

1. guile ebook - (it is not complete though really interesting and helpful)
2. guile/scheme/lisp video lectures - (Excellent stuff from MIT)
3. #guile itself.
4. if you know any other, please let me know, i will add here ;)

so yesterday, i thought to poke all those folks at #guile and logged in there, check below

i was lucky to find wingo & zeenix both online and did a small chat :)

Later i confesses at #guile "hacking guile for a week is hundred years life of a unix/oracle admin ;)"


Thursday, December 10, 2009

Ultrasound aur Molvi

When I was in Metric (10th grade), we were introduced to mathematical theorems, most of them were really boring & were passing by my head, but somehow i remembered few of them, not complete text ofcourse :) but at least the idea behind or the results... some of them are really interesting and amazing.

for example, two diagonal line will have always same angle on opposite sides.

i.e. in figure a=b & c=d , is't it interesting ?

there was another one, which is really interesting i.e.

Two parallel line will never colloid each other :)

this is really interesting, in our surrounding you will observe it in everyday happening, if two things are in parallel they have no chance to colloid, if and only if they keep themselves parallel.

i remember my childhood days, when we were use to go for Juma(Friday) Prayers & were listening to our Molvi's speech on several issues, he was sometime very scientific as he turn his speech direction to science & Islam, most of the time he was proving that what science is saying is exactly according to Islam, to consolidate his arguments, he was mostly giving us examples.

such as, drinking water in Islamic way, sleeping, fasting etc... as a matter of fact, there are many :)

But sometimes he become really annoyed with scientist around the world and he was saying about "What science CANNOT achieve", then his speech became more interesting because he was use to explain several issue where scientist were hopeless at that time.

The most frequently used example was "Baby Gender detection, before birth" he was use to say us, look innocent muslims...all these scientist are working on many big inventions, they even went in space & moon, but they are still unable to detect baby's gender before it's birth!

This is true at that time we were really amazed by his example...and most of the Juma (Friday) prayer crowd was praising his knowledge & way of convincing us towards religion.

But what happen just few years after, science & scientist were able to detect baby's gender through Ultrasound technology, even more they now reached to a technology level, where through medical exams they can even predict the baby's abilities & disabilities, beyond that they are now producing human organs & test tube babies, genetic engineering is a known field to everyone...

This is fact, that his example was not reference from any authentic Islamic book, it was his own perception about science & he just without giving it a second thought threw to us, but what happen next, he disturbed people's belief with his own false statements, now imagine what a person of that time will think about Islam, did Scientist proved Islam is wrong? or Islam is outdated ? or even Islam has nothing to do with science ?

keep in mind that this statement was widely used in Islam & Science lectures throughout Pakistan and it was very popular argument among Molvi Hazrat.

i wish our Molvlies should take some time and think about mathematical laws, if you are parallel you have no chance of collision.


Tuesday, December 8, 2009

Braindump Batoor

last evening when i reached home, it was too hot to stay inside TV lounge, i preferred to put a chair in gallery & see people moving around while taking cool fresh breeze coming from beach was not really romantic but ofcourse relaxing ;) soon after sunset mosquito started bugging me off, and i had to come inside TV lounge, after turning On television i was just surfing channels and went to K2 (Khyber TV channel), i saw Batoor is presenting some live show, i have seen him several times before on is normal to see my class fellows & students coming on television especially Khyber TV, but yesterday out of blue, i decided lets call Batoor :)

i brought my notebook and started calling through my VOIP account, their number was busy, as it was very late in Pakistan, i was expecting to get through easily but it was'nt as i expected...anyhow after almost 30 min continues tries i got connected, they were at that time playing JAL songs, i guess their producer/director received my call and as soon as he came to know i am calling from Africa, he shouted on everybody, "We are going back, Batoor ... Batoor, get ready, we are going back on SOLAR..." i am not sure if SOLAR is some camera angle thingy...anyhow he asked me to wait a second, in few neno seconds i was online with Batoor :D

I started very well, though i was dam exited as it was my ever first call to any TV channel, i just said "Hello Batoor, i am Nayyar Ahmad, from Southern Africa" and BANG....! i lost his voice... i was able to listen him, but he complaint, Nayyar i CAN'T listen you, can you please come up again...and then my call dropped, holy cow, it was first time i came online with any known person on TV Live show, and i lost connection.... though i was lucky as soon as i tried again, i got connected, but same guy who picked my before complaint, Nayyar we can't hear you properly, please call us next time.... i was just able to leave a message for Batoor i.e. "Batoor, its me, Nayyar, your teacher at IMSCIENCES"....tont tont dropped.

So later when i went to bed, i started thinking, what i really remember about Batoor, lets dump it somewhere or even blog in future if i get chance to speak about him, i will just open this post and read :)

things i can recall about him are:

1. He was in BCS 4 semester when i took over their class.
2. He was mostly wearing round neck t-shirts, and loose jeans.
3. He was mostly speaking in English.
4. He was always late in class, especially i saw him coming late in first period.
5. His father died, when he was my student, and we (his class fellows & me) spoke a while in class when he came from vacations.
6. He was mostly downloading lyrics of English songs, those he was using in his late night FM radio show.
7. Once when i blocked that lyrics site in proxy server, he came to me with Asad(his class fellow) for request to open that site only on that small lab, where they were mostly sitting.
8. He met once me in RMI (Rehman Medical Center), he came to take some lab report of his grand father/mother (i am not sure).
9. He once showed me his hand written one page resume, that he wrote for VJ at Khyber TV, when Khyber TV got famous.
10. i listened him several times on FM radio, where he use to dedicate songs to his teachers and class fellows :)

this is all what i can recall about him.

This is really strange, as we being teachers, when teaching students, we are seeing them as Doctors, Engineers, IT Professionals...etc, but later when they get into some shape they are surprisingly different.


Wednesday, November 25, 2009

Waseem ki Bermuda Triangle

Waseem here is not because i am trying to bash him, in fact, i was thinking for long to post about some non-Islamic stories/tales those are developed among unaware Muslims & because of their poor general or Islamic knowledge or even less interest in research, they easily get victimize to such tales.

Few months ago, Waseem (ex-house mate) visited me with another friend (both are of almost same caliber in religious beliefs), though Waseem recently converted from SUNI MUSLIM to SHIA for many unknown reason :) anyhow we went to an open restaurant near by beach & were exchanging views on several topics, somehow Waseem started praising his new boss who is again a SHIA Muslim and so called PPP (Pakistan People Party) member though he lost in recent election but he is an active member of his kind. So Waseem started saying many things about him, and suddenly he turned to his boss's vast Islamic knowledge, he said, my boss has explained me Where POSSIBLY be The IMAM MEHDI. if you read carefully the Wikipedia link, even me, was unable to find the exact location where Muslims are expecting him to arrive! but his boss is confirmed & presented his own theory!

According to Waseem's boss, Imam Mehdi is in Bermuda Triangle ! a minute of silence...

Just out of my curiosity, even though i had already read about Bermuda Triangle, i asked him what is Bermuda Triangle? that made him in driving seat. He started like...

Bermuda Triangle is in an ocean (remember he was'nt clear where exactly it is!) and it has a big water Twister, anything including ships , airplanes etc... when pass through that triangle, they get disappear, even birds cannot fly over that triangle, our Imam Mehdi is seating there and waiting for his time, he does not allow anything to fly our him. Sooner or later he will come out, though according to his boss there are already many indication of his arrival! I was reluctant to make any comments on his boss narrated tale but at the same time, i was thinking why he is such firm believer of this kind of rumor, just because his boss has quoted or Waseems likes telling stories, or this is human nature, or something else?

if for a second you keep your belief aside & start thinking on, what if someone tells you that miles in depth of water, there is a human being living, in this current time, you will take it as a joke, imagine today NASA & other research center already have reached to heights of space in search of life, they never thought about going under Bermuda triangle ? answer to me is simple, their scientist are not idiots.

If you take ten minutes and read brief about Bermuda triangle, for example following is a paragraph taken from Wikipedia.

"The area is one of the most heavily-sailed shipping lanes in the world, with ships crossing through it daily for ports in the Americas, Europe, and the Caribbean Islands. Cruise ships are also plentiful, and pleasure craft regularly go back and forth between Florida and the islands. It is also a heavily flown route for commercial and private aircraft heading towards Florida, the Caribbean, and South America from points north."

According to statistics of accident happened in the area with movements of ships & airplanes, it is QUITE SAFE ZONE.

I was since then thinking often why Waseem belief undoubtedly on his boss's philosophy who is not even graduated from any sort of educational institute, who was an illegal immigrant in Japan & made money by selling Japanese used cars, Who fought under recently elections winning party (PPP) banner & he might be seating in future Pakistan's National or Provisional Assembly.

until last week, when i read Paul Graham's this essay where he gave a brilliant thought about people's identity, according to him, Politics is a part of our identity, while during reading of his article i realize that Politics & Religion both serve same in our identity, and the article even covers our Religious affiliation (*this correction is made after Zeenix comment*), which make us discuss it without having it's proper knowledge.

i would request you, not to take this post as non-Islamic or against some SHIA belief, but think on your identity, think on your belief, see how low actually we know about that Topics we discuss, should we try to avoid spreading such belief, instead of defending them without any research!


Wednesday, November 18, 2009

missing email accounts in Contact Book, MS Outlook

well, well, well, i feel regretted when do blogging about MS shits, but you know you cannot avoid it!

We were facing an idiot issue with our outlook contact book, when we created new email accounts they were not updating in outlook's contact book, another issue that i saw was, when i tried to download fresh contact book in outlook, it gave me error something "an object not found...blah blah" so here is the solution.


1. you cannot see new email accounts in outlook contact book.
2. when you refresh/download new contact book at outlook, it gives you error.


you "offline address list" in exchange is not properly configured.


1. open Exchange System Manager
2. open "Recipients" tab.
3. click on "Offline Address List"
4. under right pane, you will see an object "Offline Address List" right click on it and select "Properties".
5. under General tab, click on "add" navigate in newly open window and select "Global Address List"
6. click OK.
7. right click on "Offline Address List" again and select Rebuild.

soon after these steps you will be able to see all missing email accounts, while you will no more face errors on refresh/download contact book.


Tuesday, November 3, 2009

slow/delay in ssh login at Solaris/Linux

well, you might have notice when you access some UNIX machine, you will see a bit delay in login process, it can hang for a while at different levels such as,

1. Before asking username/login prompt
2. After asking username/login prompt
3. After taking password.

interestingly on all three cases the culprit is your DNS/name-resolution service.


1. mostly probably your DNS is not accessible or unable to resolve remote host's hostname.

2. if DNS is working then your host file is the issue! it should be correctly written.

3. check your client/workstation hostname is resolvable at server.

3rd is really tricky as if /etc/ssh/sshd_config is configured to ask for reverse dns (rDNS) request server will try to resolve client/workstation's hostname at server, and if your DNS is not configured to resolve client-side machine hostname, you will get delay on login.

The easiest solution to all login delay would be editing /etc/ssh/sshd_config and disbaling "useDNS" parameter by setting it "useDNS no".


Tuesday, October 20, 2009

Solaris boot sequence chart

I found this boot chart for opensolaris at EREMIN blog, for sure has a worth to read.


Fix! FATAL: system is not bootable, boot command is disabled

When i was trying to login through Serial Port on our RAC test machines to boot them in single user mode, i got following error i.e.


FATAL: system is not bootable, boot command is disabled


I broke in console prompt before memory initialization completed !


{1} ok printenv auto-boot?
auto-boot? = true
{1} ok setenv auto-boot? false
auto-boot? = false
{1} ok reset-all


Monday, October 19, 2009

Fix, /opt/iplanet/ldap/slapd-hostname/start-slapd: not found

Eric reported me slow login on Solaris 10 machines, i started my investigation from name resolution & i found that the machine was unable to resolve hostname(s) from DNS. initially i was expecting some kind of misconfiguration of resolv.conf but lately i found that DNS server of that environment was down!

So i simply shoot

#svcadm -v restart network/iplanetldap

but found that service did'nt started :(

anyhow with further investigation i found following,


when you will run svcadm -v restart network/iplanetldap you will get following error in log file i.e.


# cat /var/svc/log/network-iplanetldap:default.log

[ Oct 18 23:02:34 Executing start method ("/opt/iplanet/ldap/slapd-hostname/start-slapd") ]
/sbin/sh: /opt/iplanet/ldap/slapd-hostname/start-slapd: not found


HOSTNAME in error was wrong! so i found the cause, that somehow ldap daemon startup script is not getting correct hostname of the machine.


Run following command to check store configuration for ldap daemon.

Step 01: #svccfg export network/iplanetldap > /tmp/ldap-old-config.xml

this will create a file “/tmp/ldap-old-config.xml” you should vi/edit this file & correct hostname inside.

Output of the file is:

bash-3.00# vi /tmp/ldap-old-config.xml

edit following lines:

name='start' type='method' exec='/opt/iplanet/ldap/slapd-hostname/start-slapd' timeout_seconds='60'
name='stop' type='method' exec='/opt/iplanet/ldap/slapd-hostname/stop-slapd' timeout_seconds='60'

Step 02: svccfg import /tmp/ldap-old.xml

Step 03: svcadm -v restart network/iplanetldap

Step 04: svcadm -v clear network/iplanetldap

Step 05: svcs -l network/iplanetldap


Thursday, October 8, 2009

System Administration Best Practices for System Admin Team

After joining System Administrator team, i found that we lack a lot of best practices & then started my research on what could be the best practice guidelines for system administrators... unfortunately i was unable to get any serious & well written sysadmin best practice guide. So finally i decided to write my own :)

this document is not final word from sysadmin world, there may be some best practice points missing, i would appreciate, if you can come up with your suggestions for improvement of this document.



Sunday, October 4, 2009


sometimes when i am surfing through blogs, i get inspired by people who share their small yet heavily weighted thoughts...same happen when i read Vin Diesel facebook blog post!

"Confidence is the most important thing you can teach someone... if you can teach them confidence, you don't have to teach them anything else."

i agree with his father!


Friday, October 2, 2009

gunzip, uncompress file.gz to another/different directory

Ariel asked me to help him in unzipping his file.gz which is on a directory/disk that has no space to unzip, he wanted unzip to another directory/disk which had enough space to house unzipped files.

initially i was checking gunzip manual but didn't found any option to do this kind of task, though at freenode someone told me to use zcat instead of gunzip! e.g.

$zcat filename.gz > /path/to/unzipped/file

so sometimes instead of reading command's manual we need to check command's capabilities ;)


Wednesday, September 16, 2009

WARNING::lib=/opt/oracle/extapi/64/asm err:9 rc:Directory does not exist

We were receiving this warning in both of our 11g RAC node's alert logs , after research i found that it is an ORACLE bug which is trying to warn you about ASMLIB not found in /opt !

error snap:

WARNING::lib=/opt/oracle/extapi/64/asm err:9 rc:Directory does not exist
msgbuf=No such file or directory


it is a warning not an error, safely ignore it!


[1] Metalink Note. 727204.1


error, Switch to short timeout for ipc polling

if you have hard luck as me you are hit by another BUG !


you are receiving in /u01/app/diag/asm/+asm/+ASMSID/trace files


Switch to short timeout for ipc polling
a session (kjzhi) is registered
session (kjzhi) is about to end
Registered session (kjzhi)[11][4][0][1] is cleaned up
Switch to long timeout for ipc polling


it is not your fault :) you require to run Patch id: 6678289

in case if you are using SPARC you may have to install SUN Patch id 123908-01 (or later) before doing Patch 6678289.

[1] Metalink Note: 750773.1
[2] Metalink Note: 353150.1


CRS-0184: Cannot communicate with the CRS daemon, Hunted!

after reboot of my rac nodes, i found that one of the nodes is having problem in starting up CRS i.e.


CRS-0184: Cannot communicate with the CRS daemon


$ less /u01/app/crs/log/nodename/crsd/crsd.log


2009-09-09 09:52:49.154: [ COMMCRS][2]clsc_connect: (10076b610) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_nodename_))

2009-09-09 09:52:49.154: [ CSSCLNT][1]clsssInitNative: failed to connect to (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_nodename_)), rc 9

2009-09-09 09:52:49.156: [ CRSRTI][1] CSS is not ready. Received status 3 from CSS. Waiting for good status ..


sometimes when CRS server reboot it try to create sockets under /tmp/.oracle or /var/tmp/.oracle and there are already previous socket files...which are protecting to create new sockets.


using root user remove all files under /tmp/.oracle or /var/tmp/.oracle

restart CRS on faulty node or even reboot that machine!


Tuesday, September 15, 2009

IPMP Error, All Interfaces in group ipmpsync have failed

we were having problem with our IPMP configured virtual interface, it was frequently fluctuating...and even once it was failover to other node in RAC, after investigation we found that there are following kind of errors reported in IPMP logs i.e.

error snap:

Cannot meet requested failure detection time of 10000 ms on (inet ce0) new failure detection time for group "ipmp0" is 188510 ms
Improved failure detection time 47127 ms on (inet ce1) for group "ipmp0"
All Interfaces in group ipmpsync have failed

after small googling i found this post, where this kinda behavior is explained, in fact, it is expected due to network overhead, as IPMP regularly after a small interval test its configured interfaces, and due to any reason if it is unable to test the availability it will report subject interface as down, and will increase the time interval with predefined amount of case if this behavior continues it will declare interface down and possibly will failover that specific interface to any other available node.

We can manually increase or decrease the IPMP testing period/interval by modifying "FAILURE_DETECTION_TIME" to any value in milliseconds, inside /etc/default/mpathd file.

Then you need to run

pkill -HUP in.mpathd

You can continue to increase this value and once you define a rational amount of time where you stop getting this error, you can continue to work on network/communication tuning and find out the network overheads!


Monday, September 7, 2009

Error in Voting/OCR disk during CRS installation

My CRS installation story is still continuing, as soon as i get some error, a new blog post is ready :)

now during CRS installation in the screen where you have to supply Voting/OCR disk you might get following error i.e.

The specified shared raw partition /dev/rdsk/ora_ocr_raw_280m may not have correct permission. Verify that the partition is owned by Oracle User.

and when you check your disk's permission, it is telling you something else !

$ls -ltr /dev/rdsk/ora_ocr_raw_280m
crw-rw---- 1 oracle oinstall 85, 8194 Sep 6 08:51 /dev/rdsk/ora_ocr_raw_280m

does it mean the permission is correctly set ? NO NOT YET ;)

you need to check the permission of actual device ! i.e.

# ls -ltr ../../devices/scsi_vhci/ssd@g50060e800000000000005ba500000020:a,raw
crw-r----- 1 root sys 118, 504 Aug 28 16:35 ../../devices/scsi_vhci/ssd@g50060e800000000000005ba500000020:a,raw

so from here you can see that the actual device is owned by root:sys which is causing this permission need to change the permission of actual device to oracle:oinstall. i.e.

#chown -R -h oracle:oinstall ../../devices/scsi_vhci/ssd@g50060e800000000000005ba500000020:a,raw

# ls -ltr ../../devices/scsi_vhci/ssd@g50060e800000000000005ba500000020:a,raw

crw-r----- 1 oracle oinstall 118, 504 Sep 4 14:55 ../../devices/scsi_vhci/ssd@g50060e800000000000005ba500000020:a,raw

NOTE: in both voting & ocr you should use slice 0 of the disk.


Thursday, September 3, 2009

Concept behind IP Network Addressing in crs installation, rac

As yesterday i was installation CRS and i got stuck on Network Configuration Screen, where i have to fill the Public, Virtual & Private network IPs... i was getting following error i.e.

You must enter unique values for the public node name, the private node name and the virtual hostname for all nodes in the cluster. The name, YOUR-HOSTNAME , that you entered is being used by more than once for the same node.


The virtual hostname(s), YOUR-HOSTNAME, you have specified appears to be already assigned to another system on the network. Please ensure that the virtual hostname(s) that you use for each of the nodes in the cluster are not in use currently.

after reading the ORACLE official documentation and testing the provided machine's configuration i found that, my installation server had name resolution problem, firstly our DNS was resolving hostname on wrong IP and later when they changed it to resolve from /etc/hosts it was unable to resolve from this file...anyhow later with investigation i was able to give a brief idea that how CRS IP Network Configuration should look like, its simple ! here it is:


You should have three IPs/Hostname i.e.

1. Public Hostname/IP (Physical Interface):
Public Hostname should register in DNS or /etc/hosts file and should be accessible i.e. one can ping it.

2. VIP Hostname/IP(Logical Interface):
VIP Hostname/IP should register in DNS or /etc/hosts file and should NOT be accessible i.e. one CANNOT ping it.

NOTE: in case of IPMP VIP should be LOGICAL interface.

3. Private Hostname/IP(Physical Interface):
Private Hostname should register in DNS or /etc/hosts file and should be accessible i.e. one can ping it.


Thursday, August 27, 2009

Poem, for Qazi Muhammad Ahkam.

I am nowhere near to poetry, i am self admitted idiot to this field, though i can't stop myself to write a poem for him. He has a great impact in my life, one can imagine what force me to write my ever first poem :)

i hope he will like it too!

inspiration that you made to me
is the objective of life to me

i do all to get until you
you are always ahead of me

you were a source of light to me
i found you all, in me

Khizar has a presence to me
if it's true, it is you to me.

[1] Khizar: the angel, considered to help or bring God's blessings...
[2] Qazi Muhammand Ahkam: he is my best teacher, taught me Physics & life & motivation... :)


Wednesday, August 26, 2009

Ph.d Student recommendation or Reference letter, template

I.U.H made me referee for his Ph.d admission in a European university, I.U.H is very near to me, he was in real a very promising and obedient student & lately a close friend. The university later sent me an email to write a reference, i was first thinking to use some template, but as i never like ready made stuff, at least for writing, in my opinion it kills yours i decided to write it by myself... the university had some limitations on size of reference letter, so i had to be very precised, i am publishing this reference letter here, i wish it is helpful by any means in your case ! , i will appreciate if you can add some comment on this tiny writing and advice me to correct it for future...

Download link


group.dba does not exist, projmod error

Gabi asked me to help her in configuring Oracle 11g new RAC servers, she was getting errors on kernel parameters configuration in Solaris 10. According to my own written RAC pre installation guide on Solaris 10, i was deceived by ORACLE's official documentation they didn't mentioned about "projadd" so when she was trying to execute projmod command to set kernel parameters, she was getting error "group.dba does not exist".

after realizing that there is of course some steps messing i consult uncle google ;) and found a post , where i found the missing block i.e. projadd command, in fact we need to first add a project only then after we can projmod (modify) it. here is the command:

#projadd -U oracle -K "project.max-shm-memory=(priv,10G,deny)" group.dba


Friday, August 21, 2009

Concept behind IPMP confiugration for RAC's Public & Interconnect, Solaris

For our coming "going to born" baby Oracle 11g RAC on Solaris 10, i wrote a step by step pre installation task guide, that i am going to release pretty soon, though i mentioned on that guide about configuration of IPMP, i was expecting that our system admins will be able to do by themselves but unfortunately it was just new for them, so i have to make more research to discuss the exact IPMP concept and configuration with them. Here are my finding

Consider you have 4 Network cards in your machine i.e.

1. c0 ---> Public IP Interface
2. c1 ---> Public IP Interface (standby)
3. c2 ---> Private Interconnect IP Interface
4. c3 ---> Private Interconnect IP Interface (standby)

so consider if you have subnet ( for Public Interface and ( as private interconnect subnet, i am not considering netmask and other IP/Network configuration in my example, but you should keep in mind that all Public IP's for RAC network configuration should be in single/same Subnet, while all Interconnect IP's should also be in single/same subnet.

So now 1st to configure Public Interface you need three/3 IPs e.g., &

so you will assign them like:

1. c0 ---> will be assign --- called Physical IP
2. c0:1 ---> will be assign --- called Test IP
3. c1 ---> will be assign --- called Test IP

all three should be in same/single IPMP group.

for private interconnect, you need also three IPs e.g., &

1. c2 ---> will be assign --- called Physical IP
2. c2:1 ---> will be assign --- called Test IP
3. c3 ---> will be assign --- called Test IP

all three should be in same/single IPMP group other then Public IPMP group. You should NOT keep Public & Interconnect IPMP group names similar, otherwise it can cause serious network problems and even ORACLE discourage doing this.


1. Metalink Note: 283107.1
2. Metalink Note: 368464.1


really impressive SPAM

yesterday i received an email, though i have a tendency to delete SPAM emails even before opening it, and i have a nice & quick scrutiny method, but this email deceived me !

here it is:

Hi Nayyar

Sorry for the delay in responding. Our international launch has been
exciting and very busy.

Here is the link for more information on FDI International

This will give you a presentation on the company. Please email me with a
good time to call to you so we can discuss the I information more in detail
and discuss us partnering together. I am 6 hours behind.

Your Partner in Success,

Lynette Jones Lewis
Direct Line: (410) 428 - 5014
Fax: (877) 267 - 3063

i would like to know, if you receive such email, will you try to give it a read or no?


Thursday, August 6, 2009

ORA-01157: cannot identify/lock data file

Yesterday when we were testing auto startup of development environment databases, i found that one of the database is getting following error:

ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:

from above datafile name you have realized that its a kinda jerk :s someone has made a datafile with no sense and then he/she have removed the file by O.S command, but he/she did'nt updated database about it !

So during the test when we were starting this database it came untill mount stage and then got stuck !!! i.e.


SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:

so to fix it, i did following:


SQL>alter database datafile 29 OFFLINE DROP;
SQL>alter database open;


Thursday, July 30, 2009

howto autostart database & listener under Solaris & Linux

whenever our office require to do some maintenance work, they ask us to take databases down, mostly it is on weekend and it turns to become a headache...we found that this thing is happening only or mostly with developer's environment database we decided to configure all developer's environment databases on autostart !

here is a small howto:

step 1: Modify oratab

For Solaris:

$vi /var/opt/oracle/oratab

For Linux:

$vi /etc/oratab

at the end of oratab file, you will see following lines :


replace above with:


step 2: Creating script

$vi /etc/init.d/

write following content in it:


if [ ! -f $ORACLE_HOME/bin/dbstart ]
echo "Oracle startup: cannot start"

case "$1" in
'start') # Start the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
'stop') # Stop the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut"

step 3: configure O.S to run on bootup/shutdown

For Solaris:

Link the to /etc/rc directories:

ln -s /etc/init.d/ /etc/rc0.d/K10dbora
ln -s /etc/init.d/ /etc/rc2.d/S99dbora


cp /etc/init.d/ /etc/rc0.d/K10dbora

cp /etc/init.d/ /etc/rc2.d/S99dbora

Note:we did cp on solaris 9. not sure but ln was not working.

For Linux:

$chkconfig --level 345 on

step 4: create pfile under $ORACLE_HOME/dbs --- OPTIONAL

if your database do not have pfile under $ORACLE_HOME/dbs you need to create by following command.

connect as "sysdba"

SQL> create pfile='$ORACLE_HOME/dba/initSID.ora' from spfile;


Wednesday, July 15, 2009

ORA-00018 maximum number of sessions exceeded

We had ORA-00018 problem in one of our database in data center, in fact, the application users suddenly have been increased and we were not informed about it, so as soon as the default sessions limit went off, the database blocked all new sessions, and even if we were connecting to database with SYS, it was reporting somewhat, database is not available... though there was't any error reporting in alert-logs except few session waiting too long in queue. This could be because of session queue was over loaded and it was keeping all new database connections in queue for too long.

I followed this thread. to resolve it, though the terrible part of the story is, it can only be solved by bouncing the instance... So we had to wait until working hours :(

SPECIAL NOTE: if you are having this problem in RAC environment, then you should give a look to Riyaj Post


Tuesday, July 14, 2009

Oracle 11g Pre Installation on Solaris 10 x64

Yesterday , i was asked to write a Pre Installation task guide for oracle 11g, i went through several sites to get detail of the document. Though oracle 11g can be installed under ASM or Local File system, in our case we took local file system. There isn't any complexity in oracle 11g installation.


References: [1] [2]
Meta Link Note: 743042.1


Tuesday, July 7, 2009

create standby when archive logs are lost/corrupt

I have been in such situation where somehow we lost or (most recently) got corrupt the archive logs from production site and we had to synchronize our standby/DataGaurd site. Anyhow the terrible fact about such situation is that we had to recreate standby database, here is the scenario with solution :)

Scenario: Your database is archiving itself to shared storage (of course in RAC) or it is using local disk (in NON-RAC) and somehow your disk get failed and you lost all/(some of) your archive files, or oracle wrote archive log on a corrupt block and a specific archive log file is lost. In either case you lost archives before transferring to standby/Dataguard database.

Consequences: You d'nt have any other way to regenerate that archive file and you are now to a point where you have to recreate that specific standby database.

Protection: In our office, we have a slight protection against such failure i.e. we have a shell cron script that is running after every 5 min. and coping archive log files to a NFS mounted disk. This is very handy in cases when we lost archive log file on disk but it is found in NFS mounted disk. BUT last week we even did'nt had those missing archive log files in NFS mounted disk.

Solution: You have to undergo with following procedure.

Step 1: Create a new rman based backup, EXCLUDING Archive Log Files, Including control file for standby.

Step 2: Copy all archives to standby site, those who are recent then your last backup. i.e. those archive log file that were generated after you made step 1 backup.

Step 3: recreate your standby database just as normal.

PS: you can take help from my post to accomplish step 3.

Request: if you know any other better way then this, d'nt forget to share with me :p


Monday, June 29, 2009

Steps to shutdown Dataguard/Standby database for maintenance work

In our office there are certain situations where we have to shutdown Dataguard site, mostly for maintenance work, such as shared disk, server's hardware or any general maintenance at our DR (Disaster Recovery) site.

Point behind shutdown/startup of Dataguard is when Dataguard/Standby database come online it should get synchronized to Production/Primary site.

There may be many ways to achieve our goal, here is my recipe:


step 1: Disable standby archive writing:
at primary/production database

SQL> alter system set log_archive_dest_state_2=defer scope = both sid = '*';

PS: in case of RAC: this step should be done at just ONE of the RAC node.

step 2: Disable auto recovery at standby site:
at secondary/DR database

SQL> alter database recover managed standby database cancel;
PS: In case of RAC: above command should run on just ONE of the standby RAC node.

SQL> shutdown immediate
PS: in case of RAC: shutdown should be done on ALL standby RAC nodes.


Step 1: Coping all archive from primary to DR generated during shutdown.

in this step we will copy all archive those were generated after standby database was taken down.

$scp /opt/oracle/archive/*.arc oracle@DR-Site-IP:/opt/oracle/archive

Step 2:
Startup standby database and configure automatic recovery:

SQL> startup nomount

SQL> alter database mount standby database;
SQL> alter database recover managed standby database disconnect from session;

PS: in case of RAC: repeat following commands on all standby nodes.

SQL> startup nomount
SQL> alter database mount standby database;

step 3: Enable standby archive writing:
at primary/production database

SQL> alter system set log_archive_dest_state_2=enable scope = both sid = '*';
PS: in case of RAC: this step should be done at just ONE of the RAC node.


Wednesday, June 17, 2009

Hates Air France

I have experienced twice flying from Jo'burg (South Africa) to Paris (France), first trip was aimed to participate in Linuxtag2007 in June while the second was in November 2007 for FAD (Fedora Ambassadors Day).

First Trip Experience: when i reached Jo'burg airport, the Airport authorities announced at eleventh hour "a possible delay in flight"", the flight was planned at 7.30PM and almost 200+ passengers were at the boarding gate, as if you have been in Jo'burg airport, new basement construction at that time had very few seats to almost all of us were lying on floor, after almost one and half hours suddenly few uniform Airport staff arrived and informed us that the Aircraft has some problem our engineers are working on them...everybody was concern what has happen to aircraft, so they said we d'nt have info...engineers are working on them...we again went on floor and start chatting each other...i was sitting with an ex-Zimbabwe citizen who's parents were British...but lately due to current political problems in Zimbabwe he had to leave country and went back UK, his son was working in Cape Town, so he often use to come SA.

anyhow, we were telling different stories each other and time was slowly passing, suddenly we heard voice "all passengers going to Paris with Airfrance please consult boarding gate counter"...everybody rush to get there...same uniform guy started "Sir, our aircraft is unable to get singnals, due to which it can't take off. our another flight which is planned for 11:45PM is ready, we can only offer our Business class passengers to board on this flight, rest will stay on airport." every economy class passenger started screaming Sir..Sir..! do you will give us Hotel...a big NO :-| you have sleep on floor, yahoooo !!!

somehow, i got a chance to reach near by the guy who was giving boarding passes to Business class, i got a chance to speak with him, i said, Sir...could you please help me ! he said WHAT? i replied, i am economy class passenger but i have a very important meeting at Berlin, if i miss this flight i will never be able to get that meeting. He quickly with anger "We are only shifting Business Class...silence" but i didn't moved from his desk and kept watching all business class getting there boarding...i was holding my boarding pass in my hand such that he could read my name. He suddenly pointed me, Mr...You Mr..i noticed him he was seeing me, "GIVE ME YOUR BOARDING PASS" i handed over him and here we go !!! i was shifted on flight with business class passengers...So after 4 hours delay i was lucky to get a substitute flight.

Second Trip Experience: This time i was traveling for FAD in November 2007, same happen, i reached Jo'burg Airport we got boarding on time...this was very pleasant, i was really happy that thanks God, this time we are flying on time...our aircraft was slowly filling with people, after a while they even closed the aircraft door and started pre take off safety checks...but we noticed that they are not starting aircraft engines...flight was timed 11:45PM we all were waiting inside aircraft to get take off, almost after 1 & half hour, the pilot announced, "Dear passengers, we are having some technical fault in aircraft, and we could not get signals, we are really sorry to inform, you that we have to cancel this flight !" Big BANG !!! flight cancel.

this time i wasn't that lucky i had to sleep on airport floor !!!

Air France AF447 crash: they are again claiming Aircraft was unable to get signals...

Now Air France has used its million of dollars assets to buy media and flush their own narrated stories, so people will think that it is just an incident, but i am sure that they killed these 200+ passengers just due to lack of services...their aircraft are in fucking bad conditions, even if you ever travel on other world class airways you will feel the difference... even in Pakistan the Daewoo bus service is better then Air France.

I am feeling so sorry about the people suffered in this crash and give my deep condolence to their families....

Appeal: Please please...for God sake..if you have an option to avoid Air France, please d'nt leave your chance to be a safe traveler. Air France is playing with its passengers lives.

Wednesday, June 10, 2009

Steps to configure Shared Server

Yesterday, Eric asked me to configure Shared Server on one of our DR site database, the idea was to test some application level connectivity issue. Though oracle strongly discourage you to run your database server as shared (MTS) still there are cases such as JAVA based application connection where shared server could be handy.

I found this post very helpful, short & focused.


Monday, June 1, 2009

Tips to Analyze False Statements

i have been thinking for a while about my sense of identifying false statements, i have an ability to find out false statements in conversation with ease. it might be because my brain has strong statement analysis algorithm, or it could be because the opponent is using really easy to detect false statement algorithm at his brain.

you might think me an idiot...but i will try to explain how my analogy is working, it might not be just as you analyze or it might be helpful for you to fix yours, or at least compare with mine... :)

False Statement Cases:

1. The person is reporting a news which is a public issue e.g. Political, Religious, Sports...etc

if the person is making statement regarding an immediate future decision which is going to be a rule sooner, he will try to state as much correct as he can....But if he is speaking about some Political,Religious,Sportsman personal life, be sure he/she is going to bluff a lot.

For Example:

High degree true statements:

Political - person report about decision on some bill in senate...etc
Religious - speaking about an event in recent past or near future, or telling you some well know versus from holy books...etc
Sports - talking about recent held games score list, or near future happening tournaments date schedule...etc

High degree False statement:

Political - talking about politicians sexual affairs or their corruption stories...or even their bank accounts...etc.
Religious - talking about way past events, those are not well know...reporting you versus of holy books those you heard first time....etc.
Sports - reporting tournament budget or publicity expenditure...sportsman accounts...etc.

2. Narrating some event:

There are two cases in this type of statement,

a - The event happen without your presence.

i. the person reporting is not first person who report you this event.

In such case you already have a scatch in mind about the event, though reporting events in general has lot of false reporting even if it is through print-media, you will get hell lot of false statements. So if you have an idea about some even and someone is reporting the same to you, it give you better chance to compare the new reporting with your past knowledge/information.

ii. the person is reporting you event for the first time.

No doubt mostly in our life, we receive information regarding events where we were not present and someone is give us information for the first time. Mostly when people get idea that you d'nt have information of the event he is reporting you, he/she will try to add false statements as much as he can. this kind of first intro stories are mostly mixture with lots of false statements.

b - The event happen in your presence.

Of course if you are part of an event and someone is reporting you from that event, you have better position to analyze about statement worth. In such situation people mostly take care of reporting false statement, as you were a part of same event.

3. Numbers

If someone is reporting you numbers/figures you have to take care in such situations.

Mostly people use round-off figures that can be a problem for you lately.

e.g. you are making some business deal and your supplier gave you a rough idea of items price in round-off later when you actually buy products, you get heavy lose.

such as 3 <> 2.7 and round-off will make 2.7 to 3 that can cause you loses.

There are some other cases as well in Numbers, For Example, people report a person's wealth in round-off i.e. "Mr. XX is millionaire" but do you think he has exact that figure in his bank account...this kind of statement are mostly false.

Another case is in distance reporting, if you ask how for would be New Yark from Kabul :D they will always make a guess, never heard real distance.

4. Newspaper:

Newspaper is one of the biggest source of false statements, be sure when you read newspaper almost 80% of text is false...most of the newspapers specially in 3rd world are ran by politicians or mafia, so they print only what they want.

you have to take care especially text on current affairs.

5. Drama/Films:

:D do you need me to write for this category !

the most enjoyable part of their shit false story would be "This FILM/DRAMA is based on true story" :D

6. Back Biting:

Mainly more than 80% is false, when a person is talking about someone in his absence, be sure he is biased and he would spread hell lot of shit. In such situation you have to first find reason "why he is reporting this shit in someone's absence" then what benefit he is expecting from this lie/reporting.

BIG TIP make your false statement true:

Just keep all above points in mind before reporting false statement, i am sure you can report high degree false statement almost as that is true.

PS: i would ask all my readers to share their way of identifying false statement.


Tuesday, May 26, 2009

DataGuard - Step by Step

1. Intro

Oracle9i Data Guard provides an extensive set of data protection and disaster recovery features to help you to survive disasters, human errors, and corruptions that can incapacitate a database. Based on business requirements, these features can be advantageously combined with other Oracle9i high-availability and disaster recovery features for enhanced levels of high availability and disaster protection.

Oracle9i Data Guard is the management, monitoring, and automation software that works with a production database and one or more standby databases to protect your data against failures, errors, and corruptions that might otherwise destroy your database. It protects critical data by automating the creation, management, and monitoring of the databases and other components in a Data Guard configuration. It automates the otherwise manual process of maintaining a transactional consistent copy of an Oracle production database, called a standby database, that can be used if the production database is taken offline for routine maintenance or becomes damaged.

In a Data Guard configuration, a production database is referred to as a primary database. Using a backup copy of the primary database, you can create from one to nine physical and logical standby databases and incorporate them in a Data Guard configuration. Primary and standby databases can be running on a single node or in a Real Application Clusters environment. Every standby database is associated with only one primary database. However, a single primary database can support multiple physical standby databases, logical standby databases, or a mix of both in the same configuration:

Physical standby databases A physical standby database is physically identical to the primary database, with on-disk database structures that are identical to the primary database on a block-for-block basis. The physical standby database is updated by performing recovery. It can either be recovering data or open for read-only reporting.

Logical standby databases A logical standby database is logically identical to the primary database. The logical standby database is updated using SQL statements. The tables in a logical standby database can be used simultaneously for recovery and for other tasks such as reporting, summations, and queries.

2. Implementation:

2.1 Checking Force Logging:

This check need to be done on both databases i.e. (SID01 & SID02)

SQL> select force_logging from v$database;

If the result of above command shows “NO” then we need run following command.

2.2. Enable Force Logging:

SQL> alter database force logging;

2.3 Checking Archive log mode:

Both databases have to be in Archive Mode. If they are NOT we have to enable Archive mode.

Checking Archive Mode:

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enable

Archive destination /opt/oracle/archive/SID01

Oldest online log sequence 2386

Current log sequence 2388

If you get “Database log mode NO ARCHIVE MODE” it means you have to do following steps to convert it in ARCHIVE MODE.

If your database is already in ARCHIVE MODE skip the following step.

Enabling Archive Mode:











2.4 Creating RMAN base backup:



allocate channel canal01 type disk ;

allocate channel canal02 type disk ;

sql 'alter database backup controlfile to trace';

sql 'alter system archive log current';

backup filesperset 4 format “/backup/rman/dumps/SID01/SID01_db_%U.bkp" ( database );

backup format “/backup/rman/dumps/SID01/" current controlfile for standby keep forever nologs;

backup format "/backup/rman/dumps/SID01/SID01_arch_%U.bkp" archivelog all;

release channel canal01;

release channel canal02




allocate channel canal01 type disk ;

allocate channel canal02 type disk ;

sql 'alter database backup controlfile to trace';

sql 'alter system archive log current';

backup filesperset 4 format “/backup/rman/dumps/SID02/SID02_db_%U.bkp" ( database );

backup format “/backup/rman/dumps/SID02/" current controlfile for standby keep forever nologs;

backup format "/backup/rman/dumps/SID02/SID02_arch_%U.bkp" archivelog all;

release channel canal01;

release channel canal02


2.5 Coping RMAN Backup to DR:


SID01:/backup/rman/dumps/SID01 >scp * oracle@


SID02:/backup/rman/dumps/SID02 >scp * oracle@

2.6 Coping Archive from primary to DR:


SID01:/opt/oracle/archive/SID01 >scp *.arc oracle@ /opt/oracle/archive/SID01


SID02:/opt/oracle/archive/SID02 >scp *.arc oracle@ /opt/oracle/archive/SID02

2.6 Checking tnsnames alias & listener:

You need to check tnsnames alias and listener status on both site from both direction.


From Primay to DR:

$tnsping SID01dr

From DR to Primary:

$tnsping SID01prod


From Primay to DR:

$tnsping SID02dr

From DR to Primary:

$tnsping SID02prod

2.7 Create pfile for standby on primary

You have to create pfile from spfile at primary database and later copy it to DR site.


SQL> create pfile='/tmp/initSID01.ora.standby' from spfile;


SQL> create pfile='/tmp/initSID02.ora.standby' from spfile;

2.8 Coping pfile from primary to standby – DR site


scp /tmp/initSID01.ora.standby oracle@


scp /tmp/initSID02.ora.standby oracle@

2.9 Edit standby parameter file


$vi initSID01.ora.standby






































*.remote_archive_enable = 'TRUE'


$vi initSID02.ora.standby






































*.remote_archive_enable = 'TRUE'

PS: In above text block the important parameters that needs to be changed are in biger fonts.

2.10 Copy initSID01.ora.standby to $ORACLE_HOME/dbs/:


cp /opt/oracle/admin/pfile/initSID01.ora.standby $ORACLE_HOME/dbs/initSID02.ora


cp /opt/oracle/admin/pfile/initSID02.ora.standby $ORACLE_HOME/dbs/initSID02.ora

2.11 Create





sqlplus /nolog @/opt/oracle/admin/SID01/standby/inicia_SID01_standby.sql

rman @/opt/oracle/admin/SID01/standby/executa_duplicate.rman

sqlplus /nolog @/opt/oracle/admin/SID01/standby/gera_stb_redolog.sql





sqlplus /nolog @/opt/oracle/admin/SID02/standby/inicia_SID02_standby.sql

rman @/opt/oracle/admin/SID02/standby/executa_duplicate.rman

sqlplus /nolog @/opt/oracle/admin/SID02/standby/gera_stb_redolog.sql

PS: calls three sub scripts, that should be created in same directory as following:

2.11.1 create inicia_SID02_standby.sql


Vi inicia_SID01_standby.sql


connect / as sysdba;

shutdown abort;

startup nomount pfile='/opt/oracle/admin/SID01/pfile/initSID01.ora.standby';

create spfile='/opt/oracle/admin/SID01/pfile/spfileSID01' from pfile='/opt/oracle/admin/SID01/pfile/initSID01.ora.standby';

shutdown immediate;

startup nomount;



Vi inicia_SID02_standby.sql


connect / as sysdba;

shutdown abort;

startup nomount pfile='/opt/oracle/admin/SID02/pfile/initSID02.ora.standby';

create spfile='/opt/oracle/admin/SID02/pfile/spfileSID02' from pfile='/opt/oracle/admin/SID02/pfile/initSID02.ora.standby';

shutdown immediate;

startup nomount;


2.11.2 Create executa_duplicate.rman


Vi executa_duplicate.rman


connect auxiliary / ;

connect target sys/******@SID01prod;



allocate auxiliary channel canal01 device type disk format '/backup/rman/dumps/SID01/SID01_db_%U.bkp';

allocate auxiliary channel canal02 device type disk format '/backup/rman/dumps/SID01/SID01_db_%U.bkp';

duplicate target database for standby nofilenamecheck dorecover;

release channel canal01;

release channel canal02;




Vi executa_duplicate.rman


connect auxiliary / ;

connect target sys/******@SID02prod;



allocate auxiliary channel canal01 device type disk format '/backup/rman/dumps/SID02/SID02_db_%U.bkp';

allocate auxiliary channel canal02 device type disk format '/backup/rman/dumps/SID02/SID02_db_%U.bkp';

duplicate target database for standby nofilenamecheck dorecover;

release channel canal01;

release channel canal02;



2.11.3 create gera_stb_redolog.sql


Vi gera_stb_redolog.sql


alter database add standby logfile group 4 ( '/opt/oracle/oradata/SID01/SID01_sblog04_a.dbf' ) size 100M;

alter database add standby logfile group 5 ( '/opt/oracle/oradata/SID01/SID01_sblog05_a.dbf' ) size 100M;

alter database add standby logfile group 6 ( '/opt/oracle/oradata/SID01/SID01_sblog06_a.dbf' ) size 100M;

alter database add standby logfile group 7 ( '/opt/oracle/oradata/SID01/SID01_sblog07_a.dbf' ) size 100M;


Vi gera_stb_redolog.sql


alter database add standby logfile group 4 ( '/opt/oracle/oradata/SID02/SID02_sblog04_a.dbf' ) size 100M;

alter database add standby logfile group 5 ( '/opt/oracle/oradata/SID02/SID02_sblog05_a.dbf' ) size 100M;

alter database add standby logfile group 6 ( '/opt/oracle/oradata/SID02/SID02_sblog06_a.dbf' ) size 100M;

alter database add standby logfile group 7 ( '/opt/oracle/oradata/SID02/SID02_sblog07_a.dbf' ) size 100M;

2.12 run





2.13 Shutdown and Startup to mount:


SQL> shutdown abort

SQL> startup nomount

SQL> alter database mount standby database;


SQL> shutdown abort

SQL> startup nomount

SQL> alter database mount standby database;

2.14: Enable Archive Dest for standby at Primary:

At Primary:


SQL> alter system set log_archive_dest_2='SERVICE=SID01dr arch' scope=both;

SQL> alter system set log_archive_dest_state_2=enable scope=both;


SQL> alter system set log_archive_dest_2='SERVICE=SID02dr arch' scope=both;

SQL> alter system set log_archive_dest_state_2=enable scope=both;

2.15 Enable automatic recovery at standby:


SQL> alter database recover managed standby database disconnect from session;


SQL> alter database recover managed standby database disconnect from session;

2.16 Define FAL server & client at standby database


SQL> alter system set fal_server='SID01prod' scope=both;

SQL> alter system set fal_client='SID01dr' scope=both;


SQL> alter system set fal_server='SID02prod' scope=both;

SQL> alter system set fal_client='SID02dr' scope=both;