Kamran Agayev's Oracle Blog

Oracle Certified Master

Archive for May, 2010

Exclusive Interview with Syed Sabdar Hussain

Posted by Kamran Agayev A. on 31st May 2010

  Sabdar Syed is an Oracle ACE, Oracle Certified Professional (8i, 9i & 10g), Oracle Certified Expert (10g RAC), and Oracle 11i E-Business Certified Professional with over 8 years of experience in Oracle Database and Oracle Applications Administration with strong Unix/Linux administration skills. He’s currently working as an Oracle Database Administrator for a first bank, Saudi Hollandi Bank, in Kingdom of Saudi Arabia, (Riyadh). He has extensive experience with Oracle Database 11g, 10g, 9i, & 8i , Oracle 10g RAC, and Oracle E-Business Suite 11i, Specializing in Installing, Configuring, Administering, Cloning, Patching, Upgrading and Migrating, and troubleshooting of Oracle Database 11g, 10g, 9i, & 8i , Oracle 10g RAC, and Oracle E-Business Suite 11i on different UNIX and Linux OS including Solaris, HP-Unix, IBM AIX and Red Hat. Good exposure in implementing backup & recovery strategies and implementing high-availability solutions (Real Application Clusters (RAC), Data Guard (Standby)).He has written and published a couple of articles on Oracle Metalink Customer Knowledge Exchange.

He owns his blog ( http://sabdarsyed.blogspot.com ) where he discusses the issues that he faced and resolved, and also the topics he tested or implemented. 

Could u please provide answer to the following questions as follows:

  • Brief information about yourself and your family

 I am Syed Sabdar Hussain, an Indian national currently working for Saudi Hollandi Bank, K.S.A.  I have 3 brothers and a sister and I am married person and have one son. My wife is Rozina and my son is Rayyan (2 years old).

  • Your education

I have done my graduation in Bachelor of Computer Sciences i.e B.Sc (Computers)

 

  • Your experience with Oracle. When you started first? Has it been interest of your side or just a coincidence?

 I started using and practicing Oracle SQL & PL/SQL from my graduation in the year 1999-2000. When I completed my graduation, I got trained in Oracle 8i DBA Administration in the year 2001. Then, I started working as Oracle DBA since 2002.

  • What was the motive behind to prefer Oracle? Who you have been influenced by?

My elder brother, Mr. Syed Jaffar Hussain, who was already interviewed in your blog, is my motivator and mentor. He preferred me to choose my career in Oracle Technologies, and also he taught me many core techniques in Oracle DBA. I always follow his footsteps. He is not only a motivator to me but also he is a motivator for many other DBAs too.

 

  • What would your preference of profession if not Oracle?

If not an Oracle DBA, then I would have been a programmer or developer

  • What motivates you in your job?

My ability to work hard and deliver results, and reorganization and appreciation at the work motivates me.  My past experience motivates me to become DBA from Junior to Senior Level.

 

  • Do you give lectures on Oracle?

 No, but I do give internal technical presentations in the company and do train Junior DBAs. I’m sure that I will be prepared for open lectures on Oracle in near future when the opportunity comes.

  • Have you authored any book in Oracle?

 I’m currently reviewing the book “Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump” for Rampant Techpress. And, I helped my elder brother by reviewing the chapters and testing the scenarios he prepared for his upcoming book “Oracle 11g R1 / R2 Real Application Clusters Handbook”. And looking forward to review other Oracle books and write a book on my own in Oracle Technologies in near future.

  

  • Do you manage with your time as to read books on Oracle? What is the name of the book that you read recently?

 Whenever possible I do read Online Oracle Documentations, Oracle ILT (Instructor Led Training) materials, and Oracle Books. Following are the few books which I’m currently referring:

“Oracle Database 10g Performance Tuning Tips & Techniques”

“Oracle Automatic Storage Management: Under-the-Hood & Practical Deployment Guide”

“Pro Oracle Database 10g RAC on Linux: Installation, Administration, and Performance”

“Oracle Data Guard 11g Handbook”

  • What do you think on OTN forums?

OTN Forum is a great and wonderful technical forum and one and only place for every DBA to join and get the answers for their questions and clear their doubts from the top experts in Oracle. I’m also a member of OTN and myself asked many questions and answered to the other DBA questions in OTN forums. I would strongly recommend every novice and junior DBAs to keep follow the OTN forums to gain the great real knowledge shared by the experts.

  • Do you refer to the documentation? And how often does it happen?

Of course and I regularly refer the Oracle Documentations, my first and foremost source would be Oracle Documentation to get the concepts clear, and definitely documentation is a key for every Oracle Professional. I would prefer to read ILT materials as well, as these ILT chapters and concepts are refined and prepared from the vast Oracle Decimations.

  • What is the biggest mistake you have ever made during your DBA career?

As long as I remember, I have never done such mistake in my DBA career which causes bigger problem.  Sometimes, I do commit silly mistakes which can be negligible; well after all we are human beings :) 

 

  • What was your greatest achievement as an Oracle DBA?

 Implanted Oracle 10g R2 RAC on Two Nodes, Upgraded and migrated critical banking database (2TB) from 9i to 10g, Converted single-instance to RAC Database using RCONFIG in with nominal downtime, Converted large Data Warehouse Databases from non-ASM to  ASM, Performed Cross Platform Database Migration, Implemented Physical Standby Database, etc.

  • What is your priority to manage the challenges you face?

 First understanding the issue or challenge, and prepare myself to resolve the issue with all the possibilities I know, or discussing with the team members or contacting with Oracle Support  to get their ideas to approach the solution, i.e. no question of giving up the challenges to face.

 

  • How would you describe the essence of your success? According to your definition of success, how successful have you been so far?

Confidence, dedication and hard work are few essences of my success; these helped me a lot to be in this position today.

 

  • What are your best skills which make you differ from others?

Sharing the knowledge and help others in resolving the problems

 

  • What’s your major weakness?

Being transparent and being calm sometimes

 

  • Have you ever lost your spirit? If so, what has been the reason and how have you overcome it?

Have no such known. But sometimes discourage and criticism make us feel loosing spirit. But no issue, after all we are humans, we need to think positive and need to know what we are, and get going. Never feel happy when someone appreciate your work and never feel bad or loose your spirit when someone discourage or criticize. So, believe in always of what you do.

 

  • What is the next success you would like to attain and your efforts to this end?

My next goal or success is to become an Oracle Certified Master; I’m gearing up for it, and will appear for this exam by the end of this year or the beginning of the next year. But, I have to undergo two Oracle Training courses to eligible for writing this exam.

 

  • How do you balance your daily life with your career?

Not so easy to balance the personal life with professional life. All the time I’m on demand and should available for weekend activities in the bank. Due to this, sometimes, I don’t find enough time to spend with family, but I will surely fulfill the promises right after my busy schedules.

 

  • Please describe your one day summary of activities?

Wake up by 7 am and get ready, take breakfast and go to the office by 8 am, 1 hr for lunch in the after noon, return to home by 6 pm from the office, rest of the time spent at home by playing with my son, watching TV news channels for sometime, working on laptop and using internet for sometime, having dinner with family members together, and usually will go to bed by 12 in the night. It’s like machinery life throughout the week.

 

  • How many hours do you work and sleep in a day?

I work for 9-10 hours and sleep for 6 hours a day.

  • Where and how do you spend your daily, weekly and annual holidays?

During weekends with friends and colleagues, and definitely annual holidays with parents back in India.

  • Do you think about Oracle during vacations?

No

  • Do you have time or motivation to go in for any sports? If yes, which kind of sport do you go in for?

 Now a days NO, but I used to play cricket during my college days.

  • What’s your favorite meal and non-alcoholic drink?

 Chicken and Mutton biriyani (rice with spice) prepared in Hyderabadi style with Pepsi or Coke

  • What foreign languages do you know?

 A little bit of Arabic language, and Indian languages – Telugu & Hindi and little bit of Kannada.

  • What’s your average typing speed?

 Not too fast and not too slow, just average :)

  • Have you ever get involved in politics?

 Never but like to read and know about politics.

  • What are your hobbies? 

 Watching comedy movies, reading news papers, playing video games etc

 

  • How do you spend your free time?

Watching movies, TV and sparing sometime with friends and chit chat with them

  • What’s your biggest ambition?

 My ambition is to acquire the most elite position and to attain senior level in Oracle field. And, of course, to join and extend my support to my elder brother in his future establishing company

  • What would be your advice to the beginners in Oracle?

 I would suggest and advice the beginners in Oracle to join OTN Forums and other Oracle Forums, do practice all the DBA scenarios on different OS including Unix/Linux, prepare for Oracle Certifications, make a habit of referring Oracle Documentations/books/blogs., etc.

  • Would you like your children to follow in your footsteps or take a different path in life?

 I will wish them to choose their own path which would definitely better for them.

  • Do you have any followers of you?

 Yes, my followers are from my family, friends, and my blog viewers.

  • What is your vision on the future of Oracle?

 Oracle has already come up with consolidate, compress and control in the latest version 11g R2 in the market.  But still I would like to see Oracle is to be more integrated technology and complete solution for all the worlds business needs. i.e. All-in-One/one place for everything.

  • Could you please take a photo in your office near to your desktop?

 

Posted in Expert Interviews | 7 Comments »

RMAN Data Recovery Advisor in Oracle 11g – scenario based explanation

Posted by Kamran Agayev A. on 21st May 2010

One of the great new features of RMAN in Oracle 11g is the new tool named Data Recovery Advisor. This tool automates the diagnose of the data failure and corruption, advises the recovery steps and performs automatic recovery of the database failure.  This tool could be used from GUI as well as from CLI.

In the following scenario we’ll use Data Recovery Advisor to recover the lost data

–          We have three tablespaces (USERS, USERS02, USERS03)

–          We create two tables on two tablespaces (tbl_test01 on USERS and tbl_test02 on USERS02)

–          We corrupt the datafiles of USERS and USERS02 tablespace and delete the USERS03 datafile

–          Using LIST FAILURE command we see list three data failure (two data block corruption and one missing datafile)

–          We get advice for all these problems and manually restore the third datafile and recover it

–          We use REPAIR FAILURE command to make RMAN automatically repair the data block corruption

Let’s start performing the above scenario

–          Create two new tablespaces (USERS02, USER03) and create two tables on USERS and USERS02 tablespaces.

[sourcecode] SQL> create tablespace users02 datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’ size 1m;

Tablespace created.

SQL> create tablespace users03 datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ size 1m;

Tablespace created.

SQL> create table tbl_test01 (name varchar2(10)) tablespace users;

Table created.

SQL> create table tbl_test02 (name varchar2(10)) tablespace users02;

Table created.

SQL> insert into tbl_test01 values(‘my_test01’);

1 row created.

SQL> insert into tbl_test02 values(‘my_test02’);

1 row created.

SQL> commit;

Commit complete.

SQL>

[/sourcecode]

–          Take backup of the database

[sourcecode] RMAN> backup database plus archivelog; [/sourcecode]

–          Corrupt the datafiles using techniques that are described in the Performing Block Media Recovery with RMAN video tutorial. Then flush the buffer cache and query the table. You’ll get “ORA-01578: ORACLE data block corrupted” error. Query the V$DATABASE_BLOCK_CORRUPTION view. You can get an empty result, however after a while Oracle automatically detects and updates the view. Then shutdown the database, delete the datafile that belongs to the USERS03 tablespace, mount the database and use ALTER DATABASE DATAFILE ‘path_of_the_users03.dbf’ OFFLINE; command to make it offline and start the database:

[sourcecode]

SQL> alter system flush buffer_cache;

System altered.

SQL> select * from tbl_test01;

select * from tbl_test01

              *

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 4, block # 72)

ORA-01110: data file 4: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS01.DBF’

SQL> alter system flush buffer_cache;

System altered.

SQL> select * from tbl_test02;

select * from tbl_test02

              *

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 5, block # 16)

ORA-01110: data file 5: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’

SQL> select * from v$database_block_corruption;

no rows selected

[/sourcecode]

Wait a while and run the command again:

[sourcecode]

SQL> select * from v$database_block_corruption;

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO

———- ———- ———- —————— ———

         4         72          1                  0 CHECKSUM

         5         16          1                  0 CHECKSUM

SQL> shut abort

SQL> startup mount;

SQL> alter database datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ offline;

Database altered.

SQL> alter database open;

Database altered.

SQL>

[/sourcecode]

–          Now use LIST FAILURE command to let RMAN gather the data failures you have:

[sourcecode] C:\>rman target /

RMAN> list failure;

using target database control file instead of recovery catalog

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles are  missing

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

You can get detailed information on any listed failure:

RMAN> list failure 328 detail;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles are

 missing

  Impact: See impact for individual child failures

  List of child failures for parent failure ID 328

  Failure ID Priority Status    Time Detected Summary

  ———- ——– ——— ————- ——-

  331        HIGH     OPEN      20-MAY-10     Datafile 6: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ is missing

    Impact: Some objects in tablespace USERS03 might be unavailable

–          Now use ADVISE FAILURE command to get necessary advises and ready scripts to perform a recovery

RMAN> advise failure all;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles ar

 missing

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\O

ADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\O

ADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

analyzing automatic repair options; this may take some time

using channel ORA_DISK_1

analyzing automatic repair options complete

Mandatory Manual Actions

========================

no manual actions available

Optional Manual Actions

=======================

1. If file C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF was unintentionally renaed or moved, restore it

Automated Repair Options

========================

Option Repair Description

—— ——————

1      Restore and recover datafile 6; Perform block media recovery of block 16 in file 5; Perform block media recovery of block 72 in file 4

  Strategy: The repair includes complete media recovery with no data loss

  Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_3231280737.hm

RMAN>

[/sourcecode]

So we have a detailed information on what we have and how we can perform a recovery. We need to restore and recover the datafile 6 and perform block media recovery on datafile 4 and 5. RMAN created a script which could be run to perform the whole recovery. Here’s the source of the script:

[sourcecode]

   # restore and recover datafile

   sql ‘alter database datafile 6 offline’;

   restore datafile 6;

   recover datafile 6;

   sql ‘alter database datafile 6 online’;

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

[/sourcecode]

Let’s perform the first action manually. So run the following commands in RMAN

[sourcecode] RMAN>    sql ‘alter database datafile 6 offline’;

RMAN>    restore datafile 6;

RMAN>    recover datafile 6;

RMAN>    sql ‘alter database datafile 6 online’;

Now use ADVISE FAILURE command again.  It will diagnose the failures and update the result:

RMAN> advise failure all;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\OR

ADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\OR

ADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

analyzing automatic repair options; this may take some time

using channel ORA_DISK_1

analyzing automatic repair options complete

Mandatory Manual Actions

========================

no manual actions available

Optional Manual Actions

=======================

no manual actions available

Automated Repair Options

========================

Option Repair Description

—— ——————

1      Perform block media recovery of block 16 in file 5; Perform block media recovery of block 72 in file 4

  Strategy: The repair includes complete media recovery with no data loss

  Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

[/sourcecode]

–          Now let’s preview the repair plan of RMAN and repair all data. For this, use REPAIR FAILURE PREVIEW command and REPAIR FAILURE as follows:

[sourcecode]

RMAN> repair failure preview;

Strategy: The repair includes complete media recovery with no data loss

Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

contents of repair script:

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss

Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

contents of repair script:

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

Do you really want to execute the above repair (enter YES or NO)? YES

executing repair script

Starting recover at 20-MAY-10

using channel ORA_DISK_1

channel ORA_DISK_1: restoring block(s)

channel ORA_DISK_1: specifying block(s) to restore from backup set

restoring blocks of datafile 00005

restoring blocks of datafile 00004

<…output trimmed ….>

<…output trimmed ….>

starting media recovery

media recovery complete, elapsed time: 00:00:07

Finished recover at 20-MAY-10

repair failure complete

RMAN>

[/sourcecode]

–          Now query the tables:

[sourcecode]

SQL> select * from tbl_test01;

NAME

———-

my_test01

SQL> select * from tbl_test02;

NAME

———-

my_test02

SQL>

[/sourcecode]

Posted in Administration, RMAN Backup and Recovery | 7 Comments »