Wednesday, August 27, 2008

The Top New Features for DBAs and Developers Oracle 11g

Oracle Database 11g:
The Top New Features for DBAs and Developers
by Arup Nanda Oracle ACE Director


In this multipart series, learn how important new features such as Database Replay, Flashback Data Archive, and SecureFiles work via simple, actionable how-to's and sample code.

Change, although constantly present, is seldom risk-free. Even if the change is relatively minor (creating an index for example), your goal is probably to predict its precise impact as accurately as possible and then take appropriate action

Many new change assurance (or "Real Application Testing," as Oracle calls it) features in Oracle Database 11g bring that dream closer to reality. The Database Replay tool, for example, allows you to capture production database workload and replay it in a test (or even the same) database to assess the impact of change. Or consider SQL Performance Analyzer, which predicts the performance impact of changes to SQL before they are made. In my opinion, this Real Application Testing functionality alone justifies the upgrade.

Overall, Oracle Database 11g makes database infrastructure far more efficient, resilient, and manageable. For example, very compelling new features in the realm of partitioning ease the design and management of partitioned tables immensely.

In this series (as in the previous series focusing on Oracle Database 10g), you will learn how these new features work via simple, actionable how-to's and sample code.

Enjoy the series, and the release!


Database Replay

Explore Database Replay, the new tool that captures SQL statements and lets you replay them at will.

Partitioning

Learn about Referential, Internal, and Virtual Column partitioning; new sub-partitioning options; and more.
Transaction Management

Get an introduction to Flashback Data Archive and explore Enterprise Manager's LogMiner interface.

Schema Management

Add columns with a default value easily and explore invisible indexes, virtual columns, and read only tables.
SQL Plan Management

Use bind variables that pick the right plan every time and ensure a new execution plan is perfect before it's used.

SQL Performance Analyzer

Accurately assess the impact of rewriting of SQL statements and get suggested improvements.
SQL Access Advisor

Get advice about optimal table design based on actual use of the table, not just data.

PL/SQL: Efficient Coding

Triggers that fire several times at different events and ability to force triggers of the same type to follow a sequence are some new gems.
RMAN

Explore Data Recovery Advisor, do parallel backup of the same file, and create and manage virtual catalogs.

Security

Learn about Tablespace Encryption, case-sensitive passwords, data masking, and other features.
Automatic Storage Management

Learn about new SYSASM role, variable extent sizes, and other ASM improvements.

Manageability

Explore automatic memory management, multicolumn statistics, online patching, and more features.
Caching and Pooling

Explore SQL Result Cache, PL/SQL Function Cache, and Database Resident Connection Pooling.

SQL Operations: Pivot and Unpivot

Present information in a spreadsheet-type crosstab report from any relational table using simple SQL, and store any data from a crosstab table to a relational table.
SecureFiles

Explore next-generation LOBs: LOB encryption, compression, deduplication, and asynchronicity.

Resiliency

Explore Automatic Health Monitor, Automatic Diagnostic Repository, and other new resiliency features.
Data Guard

Query the physical standby database in real time without shutting down recovery, just for starters.

PL/SQL Performance

Explore in-lining of code, "real" native compilation, PLS timer, use of simple integer, and more.
Data Warehousing

Get a tour of some new features for data warehousing. [Coming soon]

And Don't Forget...

COPY command, Export/Imports, Data Pump improvements, and more. [Coming soon]

Premier Developer Conference for Java, SOA, Web 2.0, and SQL

Don't miss Oracle Develop, the premier developer program, at Oracle OpenWorld 2008! Hear and learn from world-leading experts and your peers about next-generation development trends and technologies for service-oriented architecture (SOA), Extreme Transaction Processing (XTP), virtualization, and Web 2.0. Advance your skills and expand your knowledge in scores of expert-led, in-depth technical sessions and advanced how-tos on Java, .Net, XML, SCA, PL/SQL, Ajax, PHP, Spring, Groovy on Rails, and more. And roll up your sleeves for in-depth, hands-on labs covering the very latest development technologies including database, SOA, Complex Event Processing (CEP), Java, and .NET.

Since its launch in 2006, Oracle Develop has grown both in size and attendance, with additional tracks on the latest development trends in the industry. Thousands of developers attend Oracle Develop each year, and 2008 promises to be the biggest program so far. Based on popular demand, we have extended the conference by adding an additional day this year to include more sessions and hands-on labs. And, as an Oracle Develop attendee, you also get access to OTN Night, Oracle OpenWorld Exhibition Halls, and keynotes.

* When: Sunday, September 21, 10:30 a.m. to 4:45 p.m.
Monday, September 22, 10:15 a.m. to 6:30 p.m.
Tuesday, September 23, 9:30 a.m. to 6:30 p.m.
* Where: San Francisco Marriott

Tuesday, August 12, 2008

Top Ten Math Major Pick-Up Lines

10. You fascinate me more than the Fundamental Theorem of Calculus.
9. Since distance equals velocity times time, let's let velocity or time approach infinity, because I want to go all the way with you.
8. My love for you is like a concave up function because it is always increasing.
7. Let's convert our potential energy to kinetic energy.
6. Wanna come back to my room....and see my 733mhz Pentium?
5. You and I would add up better than a Riemann sum.
4. Your body has the nicest arc length I've ever seen.
3. I wish I was your derivative because then I would be tangent to your curves.
2. I hope you know set theory because I want to intersect you and union you.
1. Would you like to see my log?

Top Ten Reasons to Become a Statistician

10. Deviation is considered normal.
9. We feel complete and sufficient.
8. We are mean lovers.
7. Statisticians do it discretely and continuously.
6. We are right 95% of the time.
5. We can safely comment on someone's posterior distribution.
4. We may not be normal but we are transformable.
3. We never have to say we are certain.
2. We are honestly significantly different.
1. No one wants our jobs.

Definitions of Terms Commonly Used in Math

CLEARLY: I don't want to write down all the in-between steps.

TRIVIAL: If I have to show you how to do this, you're in the wrong class.

OBVIOUSLY: I hope you weren't sleeping when we discussed this earlier, because I refuse to repeat it.

RECALL: I shouldn't have to tell you this, but for those of you who erase your memory tapes after every test, here it is again.

WITHOUT LOSS OF GENERALITY: I'm not about to do all the possible cases, so I'll do one and let you figure out the rest.

ONE MAY SHOW: One did, his name was Gauss.

IT IS WELL KNOWN: See "Mathematische Zeitschrift'', vol XXXVI, 1892.

CHECK FOR YOURSELF: This is the boring part of the proof, so you can do it on your own time.

SKETCH OF A PROOF: I couldn't verify the details, so I'll break it down into parts I couldn't prove.

HINT: The hardest of several possible ways to do a proof.

BRUTE FORCE: Four special cases, three counting arguments, two long inductions, and a partridge in a pair tree.

SOFT PROOF: One third less filling (of the page) than your regular proof, but it requires two extra years of course work just to understand the terms.

ELEGANT PROOF: Requires no previous knowledge of the subject, and is less than ten lines long.

SIMILARLY: At least one line of the proof of this case is the same as before.

CANONICAL FORM: 4 out of 5 mathematicians surveyed recommended this as the final form for the answer.

THE FOLLOWING ARE EQUIVALENT: If I say this it means that, and if I say that it means the other thing, and if I say the other thing...

BY A PREVIOUS THEOREM: I don't remember how it goes (come to think of it, I'm not really sure we did this at all), but if I stated it right, then the rest of this follows.

TWO LINE PROOF: I'll leave out everything but the conclusion.

BRIEFLY: I'm running out of time, so I'll just write and talk faster.

LET'S TALK THROUGH IT: I don't want to write it on the board because I'll make a mistake.

PROCEED FORMALLY: Manipulate symbols by the rules without any hint of their true meaning.

QUANTIFY: I can't find anything wrong with your proof except that it won't work if x is 0.

FINALLY: Only ten more steps to go...

Q.E.D. : T.G.I.F.

PROOF OMITTED: Trust me, it's true.

Top 10 Excuses for Not Turning in Math Homework

10. It's Isaac Newton's birthday.
9. I couldn't decide whether i is the square root of -1 or i are the square root of -1.
8. I accidently divided by 0 and my paper burst into flames.
7. It's stuck inside a Klein bottle.
6. I could only get arbitrarily close to my textbook.
5. I had too much pi and got sick.
4. Someone already published it, so I didn't bother to write it up.
3. A four-dimensional dog ate it.
2. I have a solar calculator and it was cloudy.
1. There wasn't enough room to write it in the margin.

Tuesday, August 05, 2008

MSSQL 2005 number 1 in what??????????????


I have seen this ad in their website and boy was I astonished...I never knew that MS SQL Server 2008 is number 1 in the enterprise database...have a look at their banner


apparently this is the article that they are saying...well...

SQL Server Still No. 1 in Databases
BZ Research study finds that 75 percent of enterprises use it
By Alan Zeichick

July 31, 2007 — Microsoft SQL Server is still No.1. According to the 2007 Database and Data Access, Integration and Reporting Study, completed by BZ Research in late June, 74.7 percent of enterprises are using SQL Server. This is slightly lower than the 76.4 percent reported in a comparable July 2006 study, but it’s still significantly higher than the other popular databases.

BZ Research, like SD Times, is a subsidiary of BZ Media. This survey, conducted during the second half of June, was completed by 686 software development managers.

The study showed that the other top databases, in terms of use, are Oracle (54.5 percent in 2007, up from 51.3 percent in 2006), Microsoft Access (54.4 percent, down from 56.1 percent), MySQL (43.4 percent, up from 38.5 percent), IBM DB2 (23.5 percent, up from 20.4 percent) and PostgreSQL (11.2 percent, down from 11.6 percent). All other databases had less than 10 percent responses.

One Microsoft user in this anonymous survey said, “SQL Server is much, much easier to use with ADO.NET than Oracle is at the moment. If Oracle ever addresses this, then we might be able to utilize Oracle more in the future.” Another commented, “Oracle is perceived as requiring a ‘Priesthood’ to program, configure and run. SQL Server is just another tool and is integrated with Visual Studio.” A third said, “SQL Server is more than adequate for our needs, easy to administer, works well with Visual Studio and runs fine on an x86 server. It is our standard for most in-house deployments. A lot of our third-party vendors use it too.”

Not everyone, of course, uses SQL Server: “We’re a major corporation and Oracle is a de facto standard for enterprise computing (along with IBM DB2). Microsoft SQL Server, though we use it, is not industrial strength.” Another added, “IBM is much easier to work with than Oracle in terms of tech support and sales.”

And sometimes it just depends: “We develop J2EE and .NET applications, SQL Server from Microsoft is everywhere in the small to mid customers, Oracle is in the large customers. When we sell applications we need to deploy apps that already mesh with existing databases.” Another said, “MySQL has been started to test as alternative to Oracle.”

Sybase had its fans and critics: “Sybase is still the de facto standard on Wall Street. It practically runs itself allowing the DBA staff to take on ‘other duties as assigned,’” said one respondent. Another said, “We wish Sybase added features as quickly as MySQL would, would extend T-SQL, and implement other features commonly found in other databases. Otherwise we’ll probably leave it.”

Not all installed databases are used for new projects, but are retained as part of legacy systems. The 2007 study also asked which databases were used for the most recently completed project. For this question, SQL Server was used by 51.0 percent of projects, followed by Oracle at 37.1 percent, MySQL at 20.7 percent, Access at 14.9 percent, DB2 at 12.5 percent and PostgreSQL at 4.2 percent. All other databases had fewer than three responses.

One respondent said, “Most [databases] are legacy, but new development is to be Oracle or SQL Server.”

Choosing Familiarity
When asked why they chose a specific database for their most recent project, nearly half of all respondents—45.9 percent—said “familiarity with the database.” The other top answers were “high availability or reliability features” (21.3 percent), “lowest development costs” (20.1 percent), “lowest deployment costs” (18.6 percent), “covered under site license” (17.1 percent) and “requested by specific applications” (15.3 percent).

The lowest responses to this question were “won competitive bidding” (1.9 percent) and “lowest memory footprint requirements” (3.1 percent).

The full study, with verbatim responses, is available for purchase from BZ Research.

The Professor Teaches About Evil and Christianity

"LET ME EXPLAIN THE problem science has with Jesus Christ." The atheist professor of philosophy pauses before his class and then asks one of his new students to stand. "You're a Christian, aren't you, son?"
"Yes, sir."
"So you believe in God?"
"Absolutely."
"Is God good?"
"Sure! God's good."
"Is God all-powerful? Can God do anything?"
"Yes."
"Are you good or evil?"
"The Bible says I'm evil."
The professor grins knowingly. "Ahh! THE BIBLE!" He considers for a moment. "Here's one for you. Let's say there's a sick person over here and you can cure him. You can do it. Would you help them? Would you try?"
"Yes sir, I would."
"So you're good...!"
"I wouldn't say that."
"Why not say that? You would help a sick and maimed person if you could...in fact most of us would if we could....God doesn't."
[No answer]
"He doesn't, does he? My brother was a Christian who died of cancer even though he prayed to Jesus to heal him. How is this Jesus good? Hmmm? Can you answer that one?"
[No answer]
The elderly man is sympathetic. "No, you can't, can you?" He takes a sip of water from a glass on his desk to give the student time to relax. "In philosophy, you have to go easy with the new ones. Let's start again, young fella. Is God good?"
"Er... Yes."
"Is Satan good?"
"No."
"Where does Satan come from?"
The student falters. "From... God..."
"That's right. God made Satan, didn't he?" The elderly man runs his bony fingers through his thinning hair and turns to the smirking student audience. "I think we're going to have a lot of fun this semester, ladies and gentlemen." He turns back to the Christian. "Tell me, son. Is there evil in this world?"
"Yes, sir."
"Evil's everywhere, isn't it? Did God make everything?"
"Yes."
"Who created evil?"
[No answer]
"Is there sickness in this world? Immorality? Hatred? Ugliness. All the terrible things - do they exist in this world? "
The student squirms on his feet. "Yes."
"Who created them?"
[No answer]
The professor suddenly shouts at his student, "WHO CREATED THEM? TELL ME, PLEASE!" The professor closes in for the kill and climbs into the Christian's face. In a still small voice, he asked, "God created all evil, didn't He, son?"
[No answer]
The student tries to hold the steady, experienced gaze and fails. Suddenly the lecturer breaks away to pace the front of the classroom like an aging panther. The class is mesmerized. "Tell me," he continues, "How is it that this God is good if He created all evil throughout all time?" The professor swishes his arms around to encompass the wickedness of the world. "All the hatred, the brutality, all the pain, all the torture, all the death and ugliness and all the suffering created by this good God is all over the world, isn't it, young man?"
[No answer]
"Don't you see it all over the place? Huh?" Pause. "Don't you?" The professor leans into the student's face again and
whispers, "Is God good?"
[No answer]
"Do you believe in Jesus Christ, son?"
The student's voice betrays him and cracks. "Yes, professor. I do."
The old man shakes his head sadly. "Science says you have five senses you use to identify and observe the world around you. Have you ever seen Jesus?"
"No, sir. I've never seen Him."
"Then tell us if you've ever heard your Jesus?"
"No, sir. I have not."
"Have you ever felt your Jesus, tasted your Jesus or smelt your Jesus... in fact, do you have any sensory perception of your God whatsoever?"
[No answer]
"Answer me, please."
"No, sir, I'm afraid I haven't."
"You're AFRAID... you haven't?"
"No, sir."
"Yet you still believe in him?"
"...yes..."
"That takes FAITH!" The professor smiles sagely at the underling. "According to the rules of empirical, testable, demonstrable protocol, science says your God doesn't exist. What do you say to that, son? Where is your God now?"
[The student doesn't answer]
"Sit down, please."
The first Christian sits...defeated.
Another Christian raises his hand. "Professor, may I address the class?"
The professor turns and smiles. "Ah, yet another Christian in the vanguard! Come, come, young man. Speak some proper wisdom to the gathering."
The Christian looks around the room. "Some interesting points you are making, sir. Now I've got a question for you. Is there such thing as heat?"
"Yes," the professor replies. "There's heat."
"Is there such a thing as cold?"
"Yes, son, there's cold too."
"No, sir, there isn't."
The professor's grin freezes. The room suddenly becomes very quiet. The second Christian continues.
"You can have lots of heat, even more heat, super-heat, mega-heat, white heat, a little heat or no heat, but we don't have anything called 'cold'. We can hit 273 degrees below zero, which is no heat, but we can't go any further after that. There is no such thing as cold, otherwise we would be able to go colder than -273°C. You see, sir, cold is only a word we use to describe the absence of heat. We cannot measure cold. Heat we can measure in thermal units because heat is energy. Cold is not the opposite of heat, sir, just the absence of it."
Silence. A pin drops somewhere in the classroom.
"Is there such a thing as darkness, professor?"
"That's a dumb question, son. What is night if it isn't darkness? What are you getting at...?"
"So you say there is such a thing as darkness?"
"Yes..."
"You're wrong again, sir. Darkness is not something, it is the absence of something. You can have low light, normal light, bright light, flashing light... but if you have no light constantly you have nothing and it's called darkness, isn't it? That's the meaning we use to define the word. In reality, Darkness isn't. If it were, you would be able to make darkness darker and give me a jar of it. Can you... give me a jar of darker darkness, professor?"
Despite himself, the professor smiles at the young effrontery before him. This will indeed be a good semester. "Would you mind telling us what your point is, young man?"
"Yes, professor. My point is, your philosophical premise is flawed to start with and so your conclusion must be in error...."
The professor goes toxic. "Flawed...? How dare you...!"
"Sir, may I explain what I mean?"
The class is all ears.
"Explain... ohhhhh, explain..." The professor makes an admirable effort to regain control. Suddenly he is affability himself. He waves his hand to silence the class, for the student to continue.
"You are working on the premise of duality," the Christian explains. "That for example there is life and then there's death; a good God and a bad God. You are viewing the concept of God as something finite, something we can measure. Sir, science cannot even explain a thought. It uses electricity and magnetism but has never seen, much less fully understood them. To view death as the opposite of life is to be ignorant of the fact that death cannot exist as a substantive thing. Death is not the opposite of life, merely the absence of it." The young man holds up a newspaper he takes from the desk of a neighbor who has been reading it. "Here is one of the most disgusting tabloids this country hosts, professor. Is there such a thing as immorality?"
"Of course there is, now look..."
"Wrong again, sir. You see, immorality is merely the absence of morality. Is there such thing as injustice? No. Injustice is the absence of justice. Is there such a thing as evil?" The Christian pauses. "Isn't evil the absence of good?"
The professor's face has turned an alarming color. He is so angry he is temporarily speechless.
The Christian continues, "If there is evil in the world, professor, and we all agree there is, then God, if He exists, must be accomplishing a work through the agency of evil.1 What is that work God is accomplishing? The Bible tells us it is to see if each one of us will, of our own free will, choose good over evil."2
The professor bridles. "As a philosophical scientist, I don't view this matter as having anything to do with any choice; as a realist, I absolutely do not recognize the concept of God or any other theological factor as being part of the world equation because God is not observable."
The Christian replies, "I would have thought that the absence of God's moral code in this world is probably one of the most observable phenomena going, Newspapers make billions of dollars reporting it every week! Tell me, professor. Do you teach your students that they evolved from a monkey?"
"If you are referring to the natural evolutionary process, young man, yes, of course I do."
"Have you ever observed evolution with your own eyes, sir?"
The professor makes a sucking sound with his teeth and gives his student a silent, stony stare.
"Professor. Since no one has ever observed the process of evolution at work and cannot even prove that this process is an on-going endeavor, are you not teaching your opinion, sir? Are you now not a scientist, but a preacher?"
"I'll overlook your impudence in the light of our philosophical discussion. Now, have you quite finished?" the professor hisses.
"So you don't accept God's moral code to do what is righteous?"
"I believe in what is - that's science!"
"Ahh! SCIENCE!" the student's face splits into a grin. "Sir, you rightly state that science is the study of observed phenomena. Science too is a premise which is flawed..."
"SCIENCE IS FLAWED..?" the professor splutters.
The class is in uproar. The Christian remains standing until the commotion has subsided. "To continue the point you were making earlier to the other student, may I give you an example of what I mean?"
The professor wisely keeps silent.
The Christian looks around the room. "Is there anyone in the class who has ever seen the professor's mind?" The class breaks out into laughter. The Christian points towards his elderly, crumbling tutor. "Is there anyone here who has ever heard the professor's mind... felt the professor's mind, touched or smelt the professor's mind? No one appears to have done so." The Christian shakes his head sadly. "It appears no one here has had any sensory perception of the professor's mind whatsoever. Well, according to the rules of empirical, stable, demonstrable protocol, science, I DECLARE that the professor has no mind."
The class is in chaos.
The Christian sits.

25 Phrases Of Wisdom

1. If you're too open minded, your brains will fall out.

2. Age is a very high price to pay for maturity.

3. Going to church doesn't make you a Christian any more than going to a garage makes you a mechanic.

4. Artificial intelligence is no match for natural stupidity.

5. If you must choose between two evils, pick the one you've never tried before.

6. My idea of housework is to sweep the room with a glance.

7. Not one shred of evidence supports the notion that life is serious.

8. It is easier to get forgiveness than permission.

9. For every action, there is an equal and opposite government program.

10. If you look like your passport picture, you probably need the trip.

11. Bills travel through the mail at twice the speed of checks.

12. A conscience is what hurts when all your other parts feel so good.

13. Eat well, stay fit, die anyway.

14. Men are from earth. Women are from earth. Deal with it.

15. No husband has ever been shot while doing the dishes.

16. A balanced diet is a cookie in each hand.

17. Middle age is when broadness of the mind and narrowness of the waist change places.

18. Opportunities always look bigger going than coming.

19. Junk is something you've kept for years and throw away three weeks before you need it.

20. There is always one more imbecile than you counted on.

21. Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.

22. By the time you can make ends meet, they move the ends.

23. Thou shalt not weigh more than thy refrigerator.

24. Someone who thinks logically provides a nice contrast to the real world.\

25. Your aren't wealthy until you posses something money can't buy.

Friday, August 01, 2008

Men strike back!! [Jokes]

Q: How many men does it take to open a beer?
A: None. It should be opened when she brings it.
---------------------------------------- -------------------------! --
Q: Why is a Laundromat a really bad place to pick up a woman?
A: Because a woman who can't even afford a washing machine will probably never be able to support you.
---------------------------------------- ---------------------------
Q: Why do women have smaller feet than men?
A: It's one of those "evolutionary things" that allows them to stand closer to the kitchen sink.
---------------------------------------- ---------------------------
Q: How do you know when a woman is about to say something smart?
A: When she starts a sentence with "A man once told me..."
---------------------------------------- ---------------------------
Q: How do you fix a woman's watch?
A: You don't. There is a clock on the oven.
---------------------------------------- ---------------------------
Q: If your dog is barking at the back door and your wife is yelling at the front door, who do you let in first?
A: The dog, of course. He'll shut up once you let him in.
---------------------------------------- ---------------------------
Q: What's worse than a Male Chauvinist Pig?
A: A woman who won't do what she's told.
---------------------------------------- ---------------------------
I married a Miss Right.
I just didn't know her first name was Always.
---------------------------------------- ---------------------------
Scientists have discovered a food that diminishes a woman's sex drive by 90%.
It's called a Wedding Cake.
---------------------------------------- ---------------------------
Why do men die before their wives?
They want to.
---------------------------------------- --------------- ------------
Women will never be equal to men until they can walk down the street with a bald head and a beer gut, and still think they are sexy.
---------------------------------------- ---------------------------
In the beginning, God created the earth and rested.
Then God created Man and rested.
Then God created Woman.
Since then, neither God nor Man has rested.
-------------- ---------------------------------------- -------------
Send this to a few good men who need a laugh and to the select few women who know this is all bull anyway !

Top Video Card as of July 2008

1. GTX 280
2. 9800GX2
3. HD4870
4. GTX 260
5. HD3870X2
6. HD4850
7. 8800Ultra
8. 9800GTX
9. 8800GTX
10. 8800GTS 512MB (G92 Revision)
11. 8800GT 512MB
12. HD3870 512MB
13. 9600GT
14. HD2900XT 1GB
15. HD2900Pro 1GB
16. HD2900XT 512MB
17. HD2900Pro 512MB
18. 8800GTS 640MB
19. HD3850 512MB
20. 8800GT 256MB
21. 8800GTS 320MB
22. 7950GX2
23. 8800GS/9600GSO
24. HD 3850 256MB
25. HD2900GT
26. X1950XTX
27. X1900XTX
28. X1950XT
29. X1900XT 512MB
30. 7900GTX
31. X1900XT 256MB
32. 7900GTO
33. 7800GTX 512MB
34. 7950GT
35. X1950Pro 512MB
36. X1950Pro 256MB
37. 7900GT 512MB
38. 8600GTS
39. X1800XT 512MB
40. 7900GT 256MB
41. X1800XT 256MB
42. X1900GT
43. X1950GT
44. 8600GT 512MB
45. 8600GT 256MB
46. X1900GT Rev2
47. 7800GTX 256MB
48. 7900GS
49. 7800GT
50. X1800XL
51. 7800GS
52. X1800GTO
53. HD2600XT
54. HD3650
55. X1650XT
56. X850XTPE
57. 7600GT
58. X850XT
59. 7600GTS
60. HD2600Pro
61. X800XT/PE
62. 6800Ultra/EE
63. 6800GT
64. 6800GS
65. X800XL
66. X850Pro
67. X800pro
68. X800GTO/GTO2
69. Chrome 440GTX
70. 8500GT
71. Chrome 430
72. X1650Pro
73. X1600XT
74. 7600GS
75. HD2400XT
76. X800
77. 6800
78. X800GT
79. 7300GT
80. X1300XT
81. X1600Pro
82. HD3450
83. 8400GS
84. 6800XT/LE
85. 6600GT
86. HD2400Pro
87. X700Pro
88. 9800XT
89. 5950Ultra
90. 9800Pro
91. 5900Ultra
92. 9700Pro
93. 5800Ultra
94. 9800
95. 9800SE 256bit
96. S3 Chrome S27
97. X700
98. 9700
99. 5900
100. 5800
101. X1300Pro
102. 6600
103. 5900XT
104. X600XT
105. TI4800
106. TI4600
107. 9600XT
108. TI4800SE
109. X1550
110. X1300
111. 5700Ultra
112. 9500Pro
113. 9800SE 128bit
114. X600
115. 9600Pro
116. TI4400
117. 9500
118. 6600LE
119. X1300SE
120. 5700
121. 7300GS
122. 9600
123. 6200
124. 6200LE
125. X550
126. TI4200
127. 5600
128. 5600XT
129. 9550
130. 9600SE
131. 7300LE
132. 5500
133. X1050
134. X300
135. 7300SE
136. 7100GS
137. 9550SE
138. 9200Pro
139. 9000Pro
140. Matrox Parhelia
141. 8500Pro
142. GeForce3 TI500
143. 8500
144. 8500LE
145. 5200Ultra
146. 9200
147. 9250
148. GeForce4 MX460
149. 5200
150. 9000
151. 9200SE
152. GeForce3
153. GeForce3 TI200
154. GeForce4 MX 440
155. 7500
156. GeForce2 Ultra
157. GeForce2 GTS
158. GeForce4 MX 420
159. Radeon (later renamed Radeon 7200)
160. GeForce 256 DDR
161. Voodoo5 5500
162. GeForce2 MX 400
163. GeForce 256
164. Savage 2000
165. GeForce2 MX
166. Radeon VE (later renamed Radeon 7000)
167. Voodoo4 4500
168. Matrox G400
169. TNT2
170. Rage128 Pro
171. Voodoo3
172. TNT
173. Rage128
174. Savage 4
175. Matrox G200
176. Riva128
177. Intel i740
178. Rage3D Pro
179. Voodoo Banshee
180. Voodoo2
181. Riva
182. Rage3D
183. VooDoo1

These rankings have come from Overclock.net.

5 Reasons Why a Developer Might Want to Become a CIO

The CIO job comes with lots of money and lots of perks. But would a software developer ever be willing to cash in his integrity and passion for programming to become a corporate wonk? Here are five compelling reasons why developers might do so.

1. It's all about the benjamins, baby.

Have you seen the money these cats make? Top information technology executives earn millions of dollars. And it's not just the cash CIOs pocket, it's the perks they get, too. Home security system to protect all their loot? Check. Personal use of the corporate jet? Check. Financial planner to funnel all that dough into off-shore, tax-free accounts?

2. It's good to be king.

Like Tom Petty and Jackie Mason say, "It's good to be king." As a CIO, you have control over the fate of an entire department. You control the priorities, salaries and indeed the future of everyone on your staff. If you want to make them come into the office on the weekend to work on their TPS reports, you can. You can also make software vendors laugh or cry with a flourish of your pen. You can spend a day on the links and call it business. And if you want to frolic in Las Vegas for a weekend, you don't have to ask anyone for permission. You just tell them you're attending a conference. Because what happens in Vegas, stays in Vegas.

3. You don't have to worry about your job getting outsourced.

Have you ever heard of a CIO's job getting shipped off to India? Either have we. CIOs are too busy managing their outsourcing contracts with Tata and IBM to worry about their positions being in jeopardy. Software developers, on the other hand, always have to worry about the axe-man hefting the hatchet over their heads.

4. Golden parachutes to the rescue.

On the off chance a company decides to part ways with its CIO, the CIO is all but guaranteed a soft landing due to the employment contract his lawyer inked for him when he joined the company. While software developers are lucky if they get a measly six weeks severance, the CIO usually skips away with a minimum of six months severance, health insurance and all vested stock options.

5. Quit bugging me.

Even software developers tire of fixing bugs. Some days, they'd much rather be the person creating all the problems than the poor slob who has to clean them up.

Want the other side of the story? Read 8 Reasons Why a Developer Would NEVER Want to Be A CIO.

Nvidia to quit chipset business

Ricky Morris, DIGITIMES, Taipei [Friday 1 August 2008]

Nvidia has decided to throw in the towel and quit the chipset business, sources close to the situation at one of Taiwan's top motherboard makers have revealed. As the story is told, Nvidia called a meeting earlier this week with its motherboard partners to gauge support for it continuing to develop chipsets in the future.

The motherboard makers' response? Silence.

It is still early days and not all the facts are known at the time of writing, but it is believed Nvidia will transfer the chipset team to working on GPU projects. On the motherboard makers' side, some makers have already canceled upcoming high-end motherboard projects based on the nForce 7-series chipset.

The loss of its chipset business is expected to have a significant impact on Nvidia's GPU business in the short-term. Reception to the nForce 200 chip (BR04) which will enable SLI technology on Intel X58 motherboards has been lukewarm at best, with many makers saying they will not bother adding the chip on their boards. This means Nvidia needs to find a way of licensing and enabling multi-GPU support on motherboards using Intel and/or AMD chipsets fast. Otherwise it will have to cede the top-end of the graphics card market to AMD, which now has the benefit of Crossfire.

The news would also debunk any recent speculation that Apple will be adopting Nvidia chipsets for its upcoming notebook products. It would be unfortunate if Apple really has poured water on the close relationship it has built with Intel over the past few years, only to have its new best friend exit the market before products are even announced.

Wednesday, July 02, 2008

Oracle will be first

This is an excerpt from an oracle book


Oracle Will Be First
If you haven’t seen the “Oracle Firsts” on oracle.com, I’ve listed them here so that I can add a couple of notes from Oracle’s past to what I believe is a compelling vision in the Oracle future. Oracle will be the leader throughout the Information Age not only because they create the “bend in the road,” but they’re also willing to turn willingly when the road bends unexpectedly. Unlike Microsoft, they include Java to its fullest extent, embracing volumes of developers. Unlike IBM, they bring in every hardware solution, driving scalability to fruition and bringing choices to their customers. They embrace Linux for the future that it will bring while driving information to the Web with relentless force. They continue to support SAP and Microsoft while courting the Open Source community. I remember building the first Oracle client-server application with Brad Brown and Joe Trezzo when we were at Oracle in 1987. We wondered why it took so long for others to follow. Now, I just look at Oracle firsts and know that others will follow (in time), but I like to be part of the leading edge. Consider these Oracle firsts and get ready for a much-accelerated future:

■ First commercial RDBMS
■ First 32-bit database
■ First database with read consistency
■ First client-server database
■ First SMP database
■ First 64-bit RDBMS
■ First Web database
■ First database with Native Java Support
■ First commercial RDBMS ported to Linux
■ First database with XML
■ First database with Real Application Clusters (RAC)
■ First True Grid database
■ Free Oracle Database (Oracle Express Edition)
■ Unbreakable Linux Support

Friday, June 06, 2008

2008 CELTICS vs. LAKERS Game 1 (Celtics 1-0 | Lakers 0-1)

The Lakers-Celtics Rivalry or Celtics-Lakers Rivalry is a rivalry between two of the most storied basketball franchises in National Basketball Association history, the Los Angeles Lakers and Boston Celtics. The rivalry has been less intense since the retirements of Magic Johnson and Larry Bird in the early 1990s. The Celtics currently lead in total championships with 16 to the Lakers' 14.



Celtics 98, Lakers 88 (F)


1st five for the lakers
Derek Fisher
Kobe Bryant
Radmanovic
Lamar Odom
Pau Gasol


1st five for the celtics


Rajon Rondo
Ray Allen
Paul Pierce
Kevin Garnett
Perkins

Wednesday, June 04, 2008

AMD rolls out new laptop chip package




SAN JOSE, California - Advanced Micro Devices Inc. rolled out a new package of chips for laptops Wednesday, a major overhaul of its mobile lineup the chip maker hopes will help it climb out of a deep financial trough.

The Sunnyvale-based company, saddled with debt and hurt by product delays, is betting consumers will gravitate toward its new Turion brand processor and related chipset — part of a package that chip makers call a "platform" and sell together — because of their focus on high-definition video playback.

This new generation of Turion laptop chips will appear at launch in twice as many different computers — from Hewlett-Packard Co., Acer Inc., Toshiba Corp. and others — as the previous generation, released two years ago, AMD said.

Chip makers AMD, Intel Corp. and Nvidia Corp. are battling harder over high-end graphics as more people watch movies and television programs on their home computers and as operating systems and Web applications require better visuals.

To that end, AMD's new chips, which were unveiled at the Computex computer show in Taiwan, rely heavily on parts from ATI Technologies, a graphics chip supplier that AMD acquired for $5.6 billion in 2006 to help it challenge Nvidia and much larger Intel.

Intel is the world's No. 1 maker of microprocessors, the brains of personal computers. AMD is a distant No. 2, and with the acquisition of ATI now makes standalone graphics chips. Nvidia is the market leader in standalone graphics chips.

AMD hopes that by infusing its general-purpose chips with more advanced graphics capabilities it can boost their appeal and help the company increase its market share.

AMD has racked up more than $4 billion in losses over the last six quarters as Intel snatched away market share with newer parts and AMD struggled to digest the pricey ATI acquisition.

AMD's new Turion X2 Ultra Dual-Core mobile processors, which come in clock speeds up to 2.4 gigahertz, are accompanied by powerful new chipsets, a separate set of chips that do most of the graphics work — absent a standalone graphics chip — and control how the processor communicates with the rest of the computer.

AMD says its chipsets deliver three times better 3-D performance and five times better high-definition image quality than competing models because of the strength of its integrated graphics. AMD also says its chips transmit high-definition videos and photos faster over wireless networks.

The company says demand for its new lineup of laptop chips has been strong. - AP

Davao to be a center for outsourcing companies

MANILA, Philippines - Davao City, the Philippines’ largest urban area in Mindanao, is expected to be a viable alternative information technology hub three years from now, a study said.

In a report, research firm XMG said organizations belonging to the business process outsourcing (BPO) industry are expected to lead the development of the area as a robust technology hub.

Citing a study it conducted between January to March 2008, the company said that outsourcing vendors who participated in the survey are very bullish about Davao City, primarily due to the area’s larger population of untapped qualified resources compared to Cebu City in the Visayas.

The study highlighted that competition in Cebu City is nearing saturation as the talent ramp-up continues.

The study also highlighted the population of Davao City as considerably higher than other Tier-2 offshoring cities globally. In the Philippine context, Davao City’s population is 71% higher than Cebu City, 499% larger than Olongapo-Subic City, 333% higher than the Angeles-Clark area, and 340% larger than Baguio City.

“The city’s estimated workforce is twice of Cebu, 9 times of Subic, and 7 times of Clark, and 6 times of Baguio. This has not even taken to account the manpower pool at the nearby cities and provinces of Davao City," the company said.

According to the study, Davao City has various educational institutions annually yielding a higher number of IT and BPO qualified graduates than Subic, Clark, and Baguio by 689%, 278%, and 40% respectively.

Telecom facilities, transportation networks, and public transport systems are already in place in Davao City, the study said. However, XMG indicated there is a need to further improve and modernize these services.

In addition, the existence of a public transport system in Davao City is noteworthy yet still needs improvement in order to expand locators’ recruitment reach and the transportation of people from various points in and out of the city.

The study said the attractiveness of Davao City is greatly affected by the negative perception about the Mindanao region as a whole.

On February 2008, a travel advisory was released by US Consular Affairs warning their citizens on the risk of traveling in Central, Western, and Southern part of Mindanao due to security and safety reasons, which includes terrorism.

XMG researcher Camille Lumbang said that although these travel warnings are empirically grounded from actual hostile incidents in Mindanao, it should be emphasized that these are only isolated incidents from specific areas.

“There is a challenge then to substantiate and prove that such occurrences do not pose a general security threat for Davao City," she said.

Lumbang admitted, however, “there is a crying need for both the government and private sector to act together in improving the overall image of Davao City to attract ICT locators."

Citing a previous study, XMG said Davao City has been upgraded to a level C2 rating from its previous level D standing as the city emerges as a viable site for captive and outsourcing services.

“While there are still a number of geopolitical, geophysical and infrastructure challenges, the large untapped manpower base in Davao City will give its allure and ‘staying power’ as a viable site in the years to come," Lumbang said

The report continues added: “Potential locators in Davao City must have a heightened awareness and should conduct their own formal and internal risks analysis rather than reacting to headlines about specific regions under consideration such as the problems happening in other parts of Mindanao."

Among the emerging alternative offshoring cities cited in the study were Montevideo in Uruguay, Jakarta in Indonesia, and Casablanca in Morocco. It focused on forecasting the global demand for offshoring and outsourcing services and the site optimization of emerging cities. - GMANews.TV

Software company warns against dangerous domains

SAN JOSE, Calif. - When surfing the Internet for safe Web sites, not all domains are equal.

Companies that assign addresses for Web sites appear to be cutting corners on security more when they assign names in certain domains than in others, according to a report to be released Wednesday by antivirus software vendor McAfee Inc.

McAfee found the most dangerous domains to navigate to are “.hk" (Hong Kong), “.cn" (China) and “.info" (information).

Of all “.hk" sites McAfee tested, it flagged 19.2 percent as dangerous or potentially dangerous to visitors; it flagged 11.8 percent of “.cn" sites and 11.7 percent of “.info" sites that way.

A little more than 5 percent of the sites under the “.com" domain—the world’s most popular—were identified as dangerous.

More spammers, malicious code writers and other cybercriminals can establish an online presence when domain name registry businesses cut requirements for registering a site in order to boost their profit and profile. The report does not identify domain name registration companies McAfee believes are responsible for those lapses.

Hundreds, perhaps thousands, of companies are in the business of registering domain names; some are large and well known, while others are small and less reputable, offering their services on the cheap and with flimsy or no background checks to lure in more customers.

The fact that Internet scam artists gravitate to domain name services with lower fees and fewer requirements isn’t new.

What McAfee’s “Mapping the Mal Web" report, now in its second year, tries to do is identify the domains that are populated with the highest concentration of risky sites.

The servers for “.hk" and “.cn" Web sites don’t have to be in China; Web site operators can register sites from anywhere to target different geographies.

Other risky domains include “.ro" (Romania), with 6.8 percent, and “.ru" (Russia), with 6 percent of sites flagged as dangerous.

Shane Keats, research analyst for McAfee and lead author of the report, said the increase in dangerous sites registered under the “.hk" and “.cn" domains over last year’s report was caused in part by better data collection on McAfee’s part on those domains and by apparent security lapses in some registrar companies’ processes for registering addresses.

“My advice about surfing behavior is that if you’re really desperate for cheap Prozac and the pharmacy ends in ‘.cn,’ don’t do it. Just don’t do it," Keats said. “Find another place to get your Prozac."

Many Internet frauds involve fake sites for pharmaceuticals.

The McAfee report is based on results from 9.9 million Web sites that were tested in 265 domains for serving malicious code, excessive pop-up ads or forms to fill out that actually are tools for harvesting e-mail addresses for sending spam.

Keats said domain name registrars that are strict about authenticating that Web site owners are operating a legitimate business see far fewer malicious Web sites using their services.

Where McAfee found some of the least-risky domain names: “.gov" (government use), with 0.05 percent flagged; “.jp" (Japan), with 0.1 percent flagged and “.au" (Australia), with 0.3 percent flagged. - AP

Saturday, May 31, 2008

Oracle: Duplicate Database using RMAN

please remove the 2 double quotes in EOF, i cant post it without the double quotes

export ORACLE_SID=TEST2
sqlplus /nolog "<<"EOF
connect / as sysdba
alter system switch logfile;
exit
EOF
rmanA.sh
export ORACLE_SID=TEST3
sqlplus /nolog "<<"EOF
connect sys/oracledba as sysdba
shutdown abort
startup nomount
exit
EOF
rm /data/oracle8/TEST3/*
rman "<<"EOF
connect target rman/rman_oracledba@test2
connect catalog rman/rman_oracledba@test1
connect auxiliary sys/oracledba@test3
run {
# set until time "to_date('2002-01-29:15:16:53','yyyy-mm-dd:hh24:mi:ss')";
# set until time "to_date('30-JAN-2002 10:50:00','dd-mon-YYYY HH24:MI:SS')";
set until time '31-JAN-2002 10:51:00';
# set until time 'sysdate-1/1000';
# set until scn = 155534;
allocate auxiliary channel d1 type disk;
allocate auxiliary channel d2 type disk;
duplicate target database to test3;
}
EOF

Wednesday, May 28, 2008

Lopez Arroyo Family Feud (century old)

The Arroyo-Lopez War
By Perry Diaz

INQUIRER.net
First Posted 14:40:00 05/23/2008

Finally, after almost 80 years of a family feud between two wealthy clans, it seems that the final battle has started. On one side of the conflict is the Arroyo clan, wealthy merchants of Chinese origin who gained political supremacy in the early 1900's when their patriarch, Jose Arroyo, was elected Senator in 1919.

With the help of his close friend -- then Senate President Manuel L. Quezon -- his younger brother, Dr. Mariano Arroyo, was appointed provincial governor in 1928.

On the other side is the Lopez clan headed by Eugenio "Eñing" Lopez who used his newspaper El Tiempo -- founded in 1901 by his father Benito Lopez, the first governor of Iloilo in 1906, who was assassinated two years later by a rival political faction -- to expose the jueteng ring that Governor Arroyo and a Chinese trader named Sualoy started in Iloilo. El Tiempo's incessant exposure of the jueteng operations finally paid off. Sualoy was charged, found guilty, imprisoned and deported to China.
That was the beginning of the Arroyo-Lopez War. As a result of the crackdown on the jueteng operations, Governor Arroyo filed a libel suit against Lopez and El Tiempo. Lopez retaliated by filing administrative charges against Governor Arroyo. Governor General Davis was also informed about the case and he sent Judge Francisco Moran to investigate. Moran discovered that Governor Arroyo was involved in the jueteng operations, including a gambling den.

Consequently, Moran dismissed the libel charges against Lopez and his newspaper. In 1930, the administrative trial found Governor Arroyo guilty of corruption and Governor General Davis relieved him from his post.

Humiliated, Jesusa Lacson Arroyo, the widow of Senator Arroyo who died in 1927, picked up the pieces and moved her entire family to Negros Occidental. One of her sons, Ignacio, would become the father of the current First Gentleman, Jose Miguel "Mike" Arroyo.

Meanwhile, Eugenio Lopez progressed in business; his brother Fernando entered politics and was elected Vice-President three times. Don Eugenio established the first airline in Asia and expanded his newspaper business. In 1962, he purchased Meralco, the country's largest electric company. His son, Eugenio "Geny" Lopez, Jr., built ABS-CBN to become the country's undisputed leader in broadcasting.

In 1972, the Lopez family suffered under the martial law regime of Ferdinand Marcos. Geny Lopez was implicated in an alleged plot to kill Marcos. Under obscure circumstances, Lopez escaped from detention and slipped out of the country. Marcos' brother-in-law, Kokoy Romualdez, then took over Meralco. When Marcos was ousted in 1986, Cory Aquino returned Meralco and ABS-CBN to the Lopezes.

For more than 20 years, the Lopezes had undisputed control of Meralco. They also diversified into new business ventures. Over the past several years, ABS-CBN became a pain in the neck of President Gloria Macapagal- Arroyo. Their coverage of the various scandals involving the First Couple have contributed much to the Arroyos' negative public image.

It is no wonder then that Meralco is now in the crosshairs of President Arroyo's sight. The joint congressional hearing chaired by Senator Miriam Defensor-Santiago and Congressman Juan Miguel "Mikey" Arroyo has stirred to life a family feud dormant for 78 years. There are speculations that the real reason for the Meralco "witch hunt" is for government to take over Meralco and break it up into smaller companies. If this should happen, guess who would take over a divested Meralco?
Let's look at one who has been at the forefront of the battle: Winston Garcia, President and General Manager of the Government Service Insurance System (GSIS). His aggressive and arrogant demeanor in the Meralco boardroom -- he is a recent member on the Meralco board, representing GSIS which has 23% ownership of Meralco -- has made a lot of people wonder what his ulterior motive might be. Many believe that Garcia is on the board to wage a "proxy war" for the Arroyos.

For one thing, Garcia is not the typical government bureaucrat. He is a scion of a powerful political dynasty in Cebu with close ties to Malacañang. His father, Pablo, is a congressman and concurrently Deputy Speaker of the House. His brother, Pablo John, is also a congressman. And his sister, Gwendolyn, is the current Governor of Cebu. She announced recently that she is a candidate for Vice President in 2010.

In addition, the Garcia family has large stockholdings in the Aboitiz-owned Visayan Electric Company (VECO), the country's second largest private electric utility. The corporate officers include three Garcias, to wit: Dennis A. Garcia, President and General Manager; Ramontito A. Garcia,Treasurer; and Jess Anthony N. Garcia, legal counsel and Assistant Corporate Secretary. Of the 11 members of the VECO Board of Directors, five are Garcias, namely, Dennis N.A. Garcia, Ramontito E. Garcia, Gil A. Garcia II, Charles Sylvester A. Garcia, and Antonio V. A. Garcia de Escaño.
The Aboitizes have five members of the Board. Recently a news account reported that Winston Garcia is serving VECO as a lawyer on retainer. The question is: What would VECO -- and Winston Garcia -- stand to gain if Meralco were broken up into smaller companies?

It is also common knowledge that the Aboitizes are business cronies of the First Couple. With the Lopezes trying hard to defend themselves from a pack of wolves, it would probably take a miracle to survive these attacks. But miracles do happen, and they happen when least expected. The last question is: What would the Arroyos stand to gain if and when Meralco breaks up?



Ruby on Rails on Oracle: A Simple Tutorial

Source: Oracle.com

Ruby on Rails on Oracle: A Simple Tutorial

by Richard Monson-Haefel

Rails is an easy framework to work with, but like any technology it takes time to master.

Published April 2006

Comments about this article? Visit the Ruby/RoR Discussion Forum

You may have already heard about Ruby on Rails, the new application framework that seems to be taking the Web development community, in particular J2EE and PHP programmers, by storm.

Rails is a capable Web application platform and has, in less than two years, gained significant traction among J2EE and PHP programmers. The attraction of both J2EE and PHP programmers makes a lot of sense when you look at the strengths of Rails. For one thing, it uses a strict model-view-controller architecture that any self-respecting design-patterns wonk would admire—this explains its attraction to J2EE developers. Second, it’s easy to build basic systems with Rails—which is attractive to PHP developers.

However, Rails has some pretty significant limitations from a database perspective. Rails makes a lot of assumptions about your database layout and application needs. For example, Rails assumes that all tables use a single, non-compound, primary key. Compound primary keys are not supported! In addition, Rails does not support two-phase commit; it supports multiple databases, but cannot coordinate transactions among them.

This article is not intended to be a booster piece for Rails nor is it an expose. It’s simply an introduction to the technology. It contains both praise and criticism. At times the criticism might appear a bit heavy handed (especially to Rails enthusiasts), but don’t be fooled. Using any Web application framework is going to be tricky, whether it’s J2EE, ASP.NET, or PHP. In the long run, you can be a lot more productive with Rails than you can be with many other Web application development platforms, but it takes time to learn the ropes.

What is Ruby? What is Rails?

Ruby is a dynamic programming language similar in many respects to Perl, Python, and Smalltalk, but it is its own animal. Java and PHP programmers seem to pick up the language pretty easily and they have been Ruby’s biggest supporters. But others have been attracted to the language, too; including Don Box, who is well known as one of the wonkiest-wonks of the Microsoft world.

Ruby is not new; it was created in 1993, making it older than Java or PHP, both of which were first introduced to the public in 1995. So while Ruby is a mature language, it’s been less popular than some other languages. As a result, the ecosystem that surrounds the Ruby programming language is not as rich as those that have grown up around Java, PHP, or Perl. Consequently, you will find fewer frameworks, libraries, books, Web sites, blogs, and other resources dedicated to the language.

The marketing impotence of the Ruby community changed recently, when David Heinemeier Hanson introduced the Rails framework, arguably the most popular application of Ruby in its history. Rails extends the Ruby programming language into a domain specific language especially well suited for web development. It also leverages ActiveRecord, another language extension that adapts Ruby to object-relational persistence. Other than Rails’ lack of support for compound primary keys and two-phase commit, its biggest obstacle to adoption has been that you need to learn a new programming language to use it. This is not something that most people can simply ignore with a lot of hand-waving; learning a new language can be a fun but daunting task.

If, however, you were interested in expanding your resume, I can think of no other language I would recommend higher than Ruby. Ruby represents the culmination of 10 years of development without the tampering of commercial interests. As a result, Ruby is a delight to work with and, in many cases, is an order of magnitude more productive than Java, C, or Microsoft .NET languages. (The exception may be IronPython, a port of the Python language to the Microsoft .NET environment. Python, like Ruby, is a dynamic and productive programming language.)

What is Rails For?

Rails is designed from the ground up to create dynamic Web sites that use a relational database backend. It adds key words to the Ruby programming language that make Web applications easier to configure. In addition, it’s designed to automatically generate a complete, if somewhat crude, Web application from an existing database schema. The latter is both Ruby’s greatest strength and its Achilles’ heel. Rails makes assumptions about database schema naming conventions that, if followed, make generating a basic Web site a matter of executing single command. But to do this may require additional configurations or in some cases may not be possible at all. You’re also likely to find that just about every database convention that Rails expects can be overridden, but the more overriding that is needed, the less productive the platform becomes. This is why Rails is great when developing “green-field” applications with new databases. Unfortunately, it’s not a great solution when dealing with legacy systems.

The best way to appreciate Rails in green-field application development is via an example. If you already have an Oracle database installed on which you can create new databases and tables, it should take less than 15 minutes to create a complete Web application. In this case, we’ll use Ruby of Rails to build a product catalog.

Example: A Simple Product Catalog

Last year I started investing in high-grade (HG) comic books, specifically old issues from as far back as 1946. I created a simple Ruby on Rails database application that allows me to insert, remove, modify and delete new comics as I buy and sell them. It’s only intended for my use, so I kept it pretty simple. The application that will be developed in this article is a trimmed down version of the Ruby on Rails application I use at home.

Although Rails and Oracle Database can be used on a variety of platforms, this article focuses on Windows XP, arguably one of the most frequently used operating systems by Oracle application developers. This example is pretty simple; it’s essentially the database equivalent of a “Hello World” programming language example. It’s designed to give you a small taste of Ruby, but it doesn’t represent the full capabilities of Rails, any more than a “Hello World” example demonstrates the full capabilities of any programming language.

If you experience problems running this example, it’s likely to be for one of three reasons: Either you downloaded the wrong code, your database is not set up to allow you to connect to it, or your Windows XP operating system is giving you problems. In developing this example, I had a number of problems related to versioning and database configuration—all of which were a result of ignorance. I leaned heavily on a friend of mine, Michael Carland, to get everything working and to make this example as simple as possible.

The fact of the matter is, getting Ruby on Rails and Oracle to work together is not trivial. In fact, it can be a bit frustrating at times. Follow the directions in this article exactly and you shouldn’t have problems. However, once you step outside the boundaries of this example, expect to have some issues. Rails can be very productive, but it’s a command-line development environment and doesn’t come with all of the “automagic” typically associated with advanced integrated development environments. If you are not a “do-it-yourself” technical person, than I wouldn’t recommend Rails to you at this time.

Step 1: Set up the Oracle database

You wouldn’t be reading this article if you were not interested in using Rails in combination with Oracle, so you’ll need to have an installed instance of the Oracle database and you’ll need to add a single table to the database. It’s important that you follow the exact naming conventions used in this article, otherwise a lot of the automatic code generation provided by Rails simply won’t work (without some tweaking). The table you need to create is described as follows:

CREATE TABLE comics ( id NUMBER(10) NOT NULL, title VARCHAR2(60), issue NUMBER(4), publisher VARCHAR2(60), PRIMARY KEY (id) ); CREATE SEQUENCE comics_seq;

There is a SQL Script file here which you can use to create the table and add some product data. I suggest that you use it so that your application is consistent with the one being developed here. The easiest way to do that is to use SQL*Plus as follows. (The assumption is that you already have an Oracle database installed and know how to use it.)

Using SQL*Plus, create a user with DBA privileges that you can use for this application.

SQL> GRANT dba TO ruby IDENTIFIED BY ruby; SQL> ALTER USER ruby DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp; SQL> EXIT

Using the SQL file, create the application table, COMICS, and insert some example data.

C:\> sqlplus ruby/ruby@rails @comics.sql

As you may have noticed, the COMICS table created for this example is plural, which may appear problematic since a common approach is to give tables singular names (e.g. COMIC). However, Rails takes the approach that tables should be named in the plural. This default can be overridden using a Rails configuration but using plural names is easier.

Step 2: Install Ruby, RubyGems, Rails, and the Rails Oracle library

There are two pieces of software you’ll need in order to use Rails on Windows XP: the Ruby programming language with RubyGems installation package, Rails 1.0 (1.1 was recently released; this articles addresses 1.0 only), and the Rails Oracle database library. To download and install Ruby with the Gems package installer, do the following.

  1. Go to http://rubyinstaller.rubyforge.org/.
  2. Download the “One-Click Ruby Installer”.
  3. Follow the installation instructions.

Once the Ruby programming platform is installed you can use RubyGems, a Ruby application that allows you to install Ruby frameworks very easily. To install the Rails application development framework, all you need to do is open a command-line prompt and type in a single command.

C:\> gem install rails -v 1.0.0 --remote

Now that you have Ruby, RubyGems, and Rails installed you can install a specialized code library that will allow your Rails applications to talk to your Oracle database server. To download and install Oracle Rails library, go to http://rubyforge.org/projects/ruby-oci8, download ruby-oci8-0.1.13-mswin.r to your C drive, and then using your command window, execute the following command.

C:\> ruby ruby-oci8-0.1.13-mswin.rb

Assuming that everything went smoothly, you have now installed Ruby, Rails, and the Rails-Oracle connection library. You are now ready to create your first Ruby on Rails Web application.

Step 3: Create the Web Application

In order to create your new Rails application, you will need to create a new Rails project as follows.

Create a new project using the rails command line application (this will automatically create a new directory).

C:\> rails comics_catalog

Change directories so you are in the new project directory created in the previous step.

C:\> cd comics_catalog C:\comics_catalog>

Now that you have a new Rails project directory, you’ll need to configure your project so that the Rails applications will use the Rails-Oracle connection library.

Within your project directory, there is a directory called config and in it is a file named database.yml. You need to edit database.yml using your favorite text editor. Initially, the file will look like this:

development:
adapter: mysql
database: rails_development
host: localhost
username: root
password:

# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: rails_test
host: localhost
username: root
password:

production:
adapter: mysql
database: rails_production
host: localhost
username: root
password:

Different databases require different connection properties. Rails is set up to work with MySQL by default, but you want to re-configure this project to use Oracle. Change the development properties as described on this Oracle on Rails wiki page. (You could change the test and production properties also, but the scope of this article doesn’t include testing or production releases.)

There are a number of approaches to creating a Web application in Rails, but the simplest by far is to use scaffold, a command line feature in Rails 1.0.0, which will build the entire application in a single command.

C:\comics_catalog> ruby script/generate scaffold Comic

Other than a cascade of output in the command window, what just happened? Well, the Rails code generator created model, view, and controller Ruby code to access the COMICS table. In this case you created the application using the Rails scaffold, which does all the work for you. If you make any changes to the database tables, you’ll need to run the scaffold command again. Otherwise, your application may not work.

Now that the web application has been generated, you can start the Ruby Web server, WEBRick.

C:\comics_catalog> ruby script/server

You can change the Ruby code for your application or the COMICS table at anytime without having to restart the web server. However, if you change the database configuration file (i.e. database.yml) you will need to restart the server.

Now you can access your Rails Comic Catalog application on your own development machine, using your favorite Web browser. Just access the following URL.

http://localhost:3000/comics/list

Your browser should show a list of comics in your Catalog like the one in Figure 1.


Figure 1: Product Catalog List

When you use the scaffold to create a Rails Web application, it will automatically create three Web components that allow you to see a list of all records in the target database table and to insert, modify, and delete records in that table. Figure 1 shows a list of all of the sample data that was inserted into your database table when you executed the SQL script at the start of this tutorial.

In addition to the Listing view, there is also a details view. Just click on any of the “Show” links to see a Web paged dedicated to displaying the data in that particular record. Figure 2 is an example of this details page.


Figure 2: The Details Page

You can also edit any record in the database table. Click on the “Back” link, or use your browser back button to get back to the Listing page, then click on the “Edit” link of any record. Figure 3 shows an example of the Editing view of one of the records in the COMICS database table.


Figure 3: The Editing View

You can also add new records to the COMICS table by going back to the Listing view and clicking on the “New Comic” link. This will present you with an insertion view similar to the one in figure 3, except the fields will all be blank.

Mastering Rails

While the Product Catalog example showed how easy it is to create a very simple application using Rails, it’s not all that useful except for tracking inventory. You can create much more complicated Web applications with Rails, but that will require that you jump into the code a bit, which would require some study. Rails is an easy framework to work with, but like any technology it takes time to master. At this point, I can only recommend Rails to technically-savvy individuals and development teams who are embarking on “green-field” application development. If you don’t fall into this rough category, I wouldn’t recommend using Rails until the tooling has matured.

In order to really master Rails, you should read a book, a number of which will be available later this year, but one that is very good and is available now is Agile Web Programming with Ruby on Rails by David Heninmier Hanson and Dave Thomas (Published by Pragmatic Bookshelf, 2005). Hanson is, of course, the guy who created Rails and Thomas is one of the authors of Programming Ruby: The Pragmatic Programmers' Guide (Pragmatic Bookshelf; 2nd edition, 2004).


Oracle: Query DB Cache Advice

select
size_for_estimate c1,
buffers_for_estimate c2,
estd_physical_read_factor c3,
estd_physical_reads c4
from
v$db_cache_advice
where
name = 'DEFAULT'
and
block_size = (SELECT value FROM V$PARAMETER
WHERE name = 'db_block_size')
and
advice_status = 'ON'

Oracle: Query Used space in Meg by segment type

rem -----------------------------------------------------------------------
rem Filename: usedsp.sql
rem Purpose: Used space in Meg by segment type
rem Author: Frank Naude, Oracle FAQ
rem -----------------------------------------------------------------------

set pagesize 50000
set line 80

col "Total Used Meg" format 999,999,990
col "Data part" format 999,999,990
col "Index part" format 999,999,990
col "LOB part" format 999,999,990
col "RBS part" format 999,999,990

tti 'Used space in Meg by segment type'

select sum(bytes)/1024/1024 "Total Used",
sum( decode( substr(segment_type,1,5), 'TABLE', bytes/1024/1024, 0))
"Data part",
sum( decode( substr(segment_type,1,5), 'INDEX', bytes/1024/1024, 0))
"Index part",
sum( decode( substr(segment_type,1,3), 'LOB', bytes/1024/1024, 0))
"LOB part",
sum( decode(segment_type, 'ROLLBACK', bytes/1024/1024, 0))
"RBS part",
sum( decode(segment_type, 'TEMPORARY', bytes/1024/1024, 0))
"TEMP part"
from sys.dba_segments
/
tti off

tti "Total database size"

select sum(bytes)/1024/1024 "Total DB size in Meg"
from sys.v_$datafile
/
tti off

Tuesday, May 27, 2008

Exporting your Printer Configuration in Linux

Have you ever encounter when you need to transfer hundreds of printer configuration from one linux box to another, well I have fortunately I have found an article on the web on how to easily you can export those configurations.

Saving the Configuration File

When you save your printer configuration using Printer Configuration Tool, it creates its own configuration file that is used to create the /etc/printcap file that the printer daemon (lpd) reads. You can use the command line options to save or restore this file. If you save your /etc/printcap file and overwrite your existing /etc/printcap file with the saved file, your printer configuration will not be restored. Each time the printer daemon is restarted, it creates a new /etc/printcap file from the special Printer Configuration Tool configuration file. If you have configured a backup system for your configuration files, you should use the following method to save your printer configuration. If you added any custom settings in the /etc/printcap.local file, you should save it as part of your backup system also.

To save your printer configuration, type this command as root:

/usr/sbin/redhat-config-printer-tui --Xexport > settings.xml

Your configuration is saved to the file settings.xml.

If you save this file, you can restore your printer settings. This is useful if your printer configuration is deleted, you reinstall Red Hat Linux and do not have your printer configuration file anymore, or you want to use the same printer configuration on multiple systems. To restore the configuration, type this command as root:

/usr/sbin/redhat-config-printer-tui --Ximport <>

If you already have a configuration file (you have configured one or more printers on the system already) and you try to import another configuration file, the existing configuration file will be overwritten. If you want to keep your existing configuration and add the configuration in the saved file, you can merge the files with the following command (as root):

/usr/sbin/redhat-config-printer-tui --Ximport --merge <>

Your printer list will then consist of the printers you configured on the system as well as the printers you imported from the saved configuration file. If the imported configuration file has a print queue with the same name as an existing print queue on the system, the print queue from the imported file will override the existing printer.

After importing the configuration file (with or without the merge command), you must restart the printer daemon with the command /sbin/service lpd restart or by starting Printer Configuration Tool and clicking Apply.

Setup Oracle Standby Database ( Data Guard )

Oracle9i Data Guard is the new name for Oracle8i Standby Server, incorporating a large number of new features. In this article I shall only focus on those relevant to the "Oracle9i Database: New Features For Administrators" OCP exam. For more detailed information read the Oracle9i Data Guard Concepts and Administration documentation.

Architecture

The Oracle9i Data Guard architecture incorporates the following items:

  • Primary Database - A production database that is used to create standby databases. The archive logs from the primary database are transfered and applied to standby databases. Each standby can only be associated with a single primary database, but a single primary database can be associated with multiple standby databases.
  • Standby Database - A replica of the primary database.
  • Log Transport Services - Control the automatic transfer of archive redo log files from the primary database to one or more standby destinations.
  • Network Configuration - The primary database is connected to one or more standby databases using Oracle Net.
  • Log Apply Services - Apply the archived redo logs to the standby database. The Managed Recovery Process (MRP) actually does the work of maintaining and applying the archived redo logs.
  • Role Management Services - Control the changing of database roles from primary to standby. The services include switchover, switchback and failover.
  • Data Guard Broker - Controls the creation and monitoring of Data Guard. It comes with a GUI and command line interface.

The services required on the primary database are:

  • Log Writer Process (LGWR) - Collects redo information and updates the online redo logs. It can also create local archived redo logs and transmit online redo to standby databases.
  • Archiver Process (ARCn) - One or more archiver processes make copies of online redo logs either locally or remotely for standby databases.
  • Fetch Archive Log (FAL) Server - Services requests for archive redo logs from FAL clients running on multiple standby databases. Multiple FAL servers can be run on a primary database, one for each FAL request. .

The services required on the standby database are:

  • Fetch Archive Log (FAL) Client - Pulls archived redo log files from the primary site. Initiates transfer of archived redo logs when it detects a gap sequence.
  • Remote File Server (RFS) - Receives archived and/or standby redo logs from the primary database.
  • Archiver (ARCn) Processes - Archives the standby redo logs applied by the managed recovery process (MRP).
  • Managed Recovery Process (MRP) - Applies archive redo log information to the standby database.

Database Synchronization Options

Data Guard can be configured to run with varying synchronization modes indicating the potential for data loss:

  • No-Data-Loss mode : This simply means that the log transport services will not acknowledge modifications to the primary database until they are available to the standby database. This doesn't mean that the modifications have been applied to the standby database, merely that the log information is available to the log apply services should failover occur. This mode is implemented using standby redo logs on the standby server.
  • No-Data-Divergence mode : This is an extension of the no-data-loss mode whereby modifications to the primary database are prevented if conectivity between the primary and at least one standby database is unavailable.
  • Minimal-Data-Loss mode : When the performance requirements of the primary database are the top priority this mode provides the optimum balance of data protection and performance.

Setup No-Data-Divergence

To setup no-data-divergence, the most extreme level of data protection, then do the following:

Setup Primary Database

  • Shutdown the database using: SHUTDOWN IMMEDIATE
  • Backup all database files.
  • Add an entry for the standby server into the tnsnames.ora file:
stby1=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myServerName)(PORT = 1512))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = stby1.world)
    )
  )
  • Assuming your database in already in ARCHIVELOG mode one of the archive destinations will be set. Add the other entires:
CONTROL_FILES=primary.ctl
COMPATIBLE=9.0.1.0.0
LOG_ARCHIVE_START=true
LOG_ARCHIVE_DEST_1='LOCATION=C:\Oracle\Oradata\TSH1\Archive MANDATORY REOPEN=30'
LOG_ARCHIVE_DEST_2='SERVICE=stby1 LGWR SYNC AFFIRM'
LOG_ARCHIVE_DEST_STATE_1=enable
LOG_ARCHIVE_DEST_STATE_2=enable
LOG_ARCHIVE_FORMAT=arc%t_%s.arc
REMOTE_ARCHIVE_ENABLE=true

The LGWR SYNC AFFIRM keywords indicate that the Logwriter should synchronously write updates to the online redo logs to this location and wait for confirmation of the write before proceeding. The remote site will process and archive these standby redo logs to keep the databases synchronized. This whole process can impact performance greatly but provides maximum data security.

  • Startup the database using: STARTUP PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
  • Create standby database controlfile using: ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'c:\stbycf.f';

Setup Standby Database

  • Copy the production backup files to the standby server.
  • Copy the standby controlfile to the standby server.
  • Alter the control_files and archive parameters of the init.ora as follows:
SERVICE_NAMES = stby1
CONTROL_FILES=standby.ctl
COMPATIBLE=9.0.1.0.0
LOG_ARCHIVE_START=true
LOCK_NAME_SPACE=stby1
FAL_SERVER=prim1
FAL_CLIENT=stby1
 
# Uncomment is filename conversion is needed
#DB_FILE_NAME_CONVERT=("/primary","/standby")
#LOG_FILE_NAME_CONVERT=("/primary","/standby")
 
STANDBY_ARCHIVE_DEST=C:\Oracle\Oradata\TSH1\Archive
LOG_ARCHIVE_DEST_1='LOCATION=C:\Oracle\Oradata\TSH1\Archive'
LOG_ARCHIVE_TRACE=127
LOG_ARCHIVE_FORMAT=arc%t_%s.arc
STANDBY_FILE_MANAGEMENT=auto
REMOTE_ARCHIVE_ENABLE=true
  • Add the following entries into the listener.ora file:
(ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1512))
)
 
STANDBY_LISTENER = (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=myHost))
)

The file should resemble the following:

# LISTENER.ORA Network Configuration File: C:\Oracle\Ora901\network\admin\listener.ora
# Generated by Oracle configuration tools.
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1512))
      )
    )
    (DESCRIPTION =
      (PROTOCOL_STACK =
        (PRESENTATION = GIOP)
        (SESSION = RAW)
      )
      (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 2481))
    )
  )
 
STANDBY_LISTENER = (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=myHost))
)
 
 
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC = (SID_NAME = PLSExtProc)(ORACLE_HOME = C:\Oracle\Ora901)(PROGRAM = extproc))
    (SID_DESC = (ORACLE_HOME = C:\Oracle\Ora901) (SID_NAME = TSH1)
    )
  )
  • Reload the listener file using lsnrctl reload from the command prompt.
  • Add the following entry into the tnsnames.ora file:
stby1=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myServerName)(PORT = 1512))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = stby1.world)
    )
  )

Create standby redo logs on the standby database to receive online redo information from the Logwriter on the primary database. The minimum number of groups required is an exact match, number and size, of the primary database, but performance may be increased by adding more:

ALTER DATABASE ADD STANDBY LOGFILE GROUP 10
  ('C:\Oracle\Oradata\TSH1\redo1a.log','C:\Oracle\Oradata\TSH1\redo1b.log') SIZE 500K;

Start Managed Standby Recovery

During managed recovery the transfer of archivelogs is controlled by the servers without user intervention.

  • Copy all archive logs from the primary to the standby server. This is the only time you should need to do this.
  • From sqlplus do the following:
SQL> CONNECT sys/password AS SYSDBA
SQL> STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Protect Primary Database

Now that Data Guard is configured and running the primary database can be prevented from applying updates unless the update has been sent to at least one standby location. Connect to the primary database and execute:

ALTER DATABASE SET STANDBY DATABASE PROTECTED;

Cancel Managed Standby Recovery

To stop managed standby recovery:

SQL> -- Cancel protected mode on primary
SQL> CONNECT sys/password@primary1 AS SYSDBA
SQL> ALTER DATABASE SET STANDBY DATABASE UNPROTECTED;
SQL> 
SQL> -- Cancel recovery if necessary
SQL> CONNECT sys/password@standby1 AS SYSDBA
SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN READ ONLY;

The database can subsequently be switched back to recovery mode as follows:

SQL> -- Startup managed recovery
SQL> CONNECT sys/password@standby1 AS SYSDBA
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
 
SQL> -- Protect primary database
SQL> CONNECT sys/password@primary1 AS SYSDBA
SQL> ALTER DATABASE SET STANDBY DATABASE PROTECTED;

Activating A Standby Database

If the primary database is not available the standby database can be activated as a primary database using the following statements:

SQL> -- Cancel recovery if necessary
SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;

Since the standby database is now the primary database it should be backed up immediately. The previous primary database can then be configured as a standby.

Backup Standby Database

Backups of the standby database can only be performed if the database is shut down or in read only mode. Read only mode is best for managed recovery systems as archive logs will still be transfered during the backup process, thus preventing gap sequences. Once the server is in the desired mode simply copy the appropriate database files.

Database Switchover

A database can be in one of two mutually exclusive modes (primary or standby). These roles can be altered at runtime without loss of data or resetting of redo logs. This process is known as a Switchover and can be performed using the following statements:

-- Convert primary database to standby
CONNECT sys/change_on_install@prim1 AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY;
 
-- Shutdown primary database
SHUTDOWN IMMEDIATE;
 
-- Mount old primary database as standby database
STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
 
 
-- Convert standby database to primary
CONNECT sys/change_on_install@stby1 AS SYSDBA
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
 
-- Shutdown standby database
SHUTDOWN IMMEDIATE;
 
-- Open old standby database as primary
STARTUP PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora

This process has no affect on alternative standby locations. The process of converting the instances back to their original roles is known as a Switchback. The switchback is accomplished by performing another switchover.

Database Failover

Graceful Database Failover occurs when database failover causes a standby database to be converted to a primary database:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE ACTIVATE STANDBY DATABASE;

This process will recovery all or some of the application data using the standby redo logs, therefore avoiding reinstantiation of other standby databases. If completed successfully, only the primary database will need to be reinstatiated as a standby database.

Forced Database Failover changes one standby database to a primary database. Application data may be lost neccessitating the reinstantiation of the primary and all standby databases.

Automatic Archive Gap Detection

Gaps in the sequence of archive logs can be created when changes are applied to the primary database while the standby database is unavailable. In Oracle8i the archive redo logs associated with these gaps had to be identified using the V$ARCHIVE_GAP view and copied manually to the standby server before managed recovery could be initiated again. In Oracle9i most of these gap sequences can be resolved automatically. The following parameters must be added to the standby init.ora file where the values indicate net services names.

FAL_SERVER = 'primary_db1'
FAL_CLIENT = 'standby_db1'

The FAL server is normally the primary database, but can be another standby database. Once the standby database is placed in managed recovery mode it will automatically check for gap sequences. If it finds any it will request the appropriate files from the primary database via the FAL server. If the gap sequences cannot be resolved the files have to be recovered manually.

Background Managed Recovery

In Oracle8i managed recovery caused the user session to hang until the process was stopped by the user. This type of recovery is still available along with a background recovery that spawns a new background process and frees the user session:

-- User session hangs
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
 
-- User session released
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Delayed Redo Application

Application of the archived redo logs to the standby database can be delayed using the DELAY keyword. If a rogue statement significantly damages the primary database the DBA can choose to switch to the standby database, which will be in a state prior to this action:

-- Delay application of archived redo logs by 30 minutes.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DELAY 30;
 
-- Return to no delay (Default).
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;

For further information see: