Oracle RMAN Data Recovery Advisor

Merhaba Arkadaşlar,

Bu yazımda sizlere Oracle 11g ile gelen Data Recovery Advisor özelliğinden bahsedeceğim. Bu özellik Oracle veritabanı içinde sevdiğim en güzel özellik diyebilirim neden olduğunu biraz sonra uygulamalı  olarak gösterdiğimde anlayacaksınız 🙂

 

2-dra

 

Oracle Veritabanında DBA lerin yönlendiren ve işlerini kolaylaştıran bir çok advisor vardır. Bu advisorları kullanarak işlemlerinizi çok daha rahat gerçekleştirebilirsiniz. Çünkü bu advisorları kullandığınızda sizin yerinize veritabanını analiz ediyor ve çıkan problemleri raporluyor hatta biraz sonra göreceğiniz gibi bide istersen o problemi ben senin yerine de yaparım diyo 🙂 Bu advisorlardan bazıları aşağıdaki gibidir.

  • Data Recovery Advisor (DRA)
  • SQL Tuning Advisor
  • SQL Access Advisor
  • Memory Advisor
  • Undo Advisor

Yukardaki advisorlar içerisinden ben Data Recovery Advisor ı anlatacağım. Peki Data Recovery Advisor ne işe yarar yada hangi durumda bu advisor ı kullanmalıyım ?

Data Recovery Advisor veritabanında meydana gelen corruptionları,Datafile,Controlfile kayıpları yani RMAN ile ilgili olan konuları analiz edip sorunları bize raporlayan ve Oracle 11g ile tanıtılan bir advisordır. Bu advisor da yok yok yani 🙂 Bir tek eksiği var ki o da RAC ( Real Application Cluster ) ortamları desteklemiyor olmasıdır. RAC ortamda bu advisor ı çalıştırdığınız zaman aşağıdaki hata ile karşılaşırsınız.

RMAN> LIST FAILURE;
using target database control file instead of recovery catalog
 RMAN-00571: ===========================================================
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
 RMAN-00571: ===========================================================
 RMAN-03002: failure of list command at 09/21/2011 13:43:53
 RMAN-05533: LIST FAILURE is not supported on RAC database
RMAN>

 

Şimdi test ortamında olası bir senaryoyu gösterip yazımı sonlandıracağım. Veritabanına bağlanmaya çalıştığımda veritabanının online olmadığını gördüm. Sunucu üzerinden SQLPLUS ile bağlanıp veritabanını başlattığım zaman aşağıdaki gibi hata alıyorum.

[oracle@database ~]$ . profile
 [oracle@database ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed May 29 21:27:07 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> select instance_name from v$instance;
INSTANCE_NAME
 ----------------
 POCDB
SQL> startup
 ORACLE instance started.
Total System Global Area 538640384 bytes
 Fixed Size 2230112 bytes
 Variable Size 339740832 bytes
 Database Buffers 192937984 bytes
 Redo Buffers 3731456 bytes
 Database mounted.
 ORA-00338: log 2 of thread 1 is more recent than control file
 ORA-00312: online log 2 thread 1:
 '/u01/app/oracle/oradata/POCDB/POCDB/onlinelog/o1_mf_2_9pdlq8p8_.log'

 

Veritabanını yukardaki hatayı verdi ne yapacam ne edecem diye düşünmeyin vakit kaybetmeden Data Recovery Advisor (DRA) a başvurun 🙂 Bu aşamadan sonra adım adım DRA ile veritabanını kurtarmayı göstereceğim.

 

1.Adım: RMAN e bağlanıp hataları ve bozuklukları bize rapor etmesini istiyoruz.

[oracle@database ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed May 29 21:29:47 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: POCDB (DBID=2629568568, not open)
RMAN> list failure;
using target database control file instead of recovery catalog
 List of Database Failures
 =========================
Failure ID Priority Status Time Detected Summary
 ---------- -------- --------- ------------- -------
 462 CRITICAL OPEN 29-MAY-14 Control file is older than datafiles and/or log files

 

2.Adım: Hataları 1.adımın sonunda gösteren Advisor a şimdide bu hata için ne yapabileceğimizi soruyoruz :)””

 RMAN> advise failure;
List of Database Failures
 =========================
Failure ID Priority Status Time Detected Summary
 ---------- -------- --------- ------------- -------
 462 CRITICAL OPEN 29-MAY-14 Control file is older than datafiles and/or log files
analyzing automatic repair options; this may take some time
 allocated channel: ORA_DISK_1
 channel ORA_DISK_1: SID=19 device type=DISK
 analyzing automatic repair options complete
Mandatory Manual Actions
 ========================
 no manual actions available
Optional Manual Actions
 =======================
 1. If you have the correct version of the control file, then shutdown the database and replace the old control file
Automated Repair Options
 ========================
 Option Repair Description
 ------ ------------------
 1 Restore a backup control file
 Strategy: The repair includes complete media recovery with no data loss
 Repair script: /u01/app/oracle/diag/rdbms/pocdb/POCDB/hm/reco_855908832.hm

 

3.Adım: Ne yapacağımızıda yukardaki adımda bize bildiren Advisora diyoruz ki Kardeşim o kadarını yaptın bari gerisinide getirde çayım soğumasın 🙂 Advisorda sağolsun çayımızı soğutmadan işlemleri aşağıdaki gibi kendisi yapıyor.

 RMAN> repair failure;
Strategy: The repair includes complete media recovery with no data loss
 Repair script: /u01/app/oracle/diag/rdbms/pocdb/POCDB/hm/reco_855908832.hm
contents of repair script:
 # restore control file
 shutdown;
 startup nomount;
 set dbid 2629568568;
 restore controlfile from autobackup;
 sql 'alter database mount';
Do you really want to execute the above repair (enter YES or NO)? yes
 executing repair script
database dismounted
 Oracle instance shut down
connected to target database (not started)
 Oracle instance started
Total System Global Area 538640384 bytes
Fixed Size 2230112 bytes
 Variable Size 339740832 bytes
 Database Buffers 192937984 bytes
 Redo Buffers 3731456 bytes
executing command: SET DBID
Starting restore at 29-MAY-14
 allocated channel: ORA_DISK_1
 channel ORA_DISK_1: SID=18 device type=DISK
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140529
 channel ORA_DISK_1: AUTOBACKUP found: c-2629568568-20140529-06
 channel ORA_DISK_1: restoring control file from AUTOBACKUP c-2629568568-20140529-06
 channel ORA_DISK_1: control file restore from AUTOBACKUP complete
 output file name=/u01/app/oracle/oradata/POCDB/controlfile/control.ctl
 Finished restore at 29-MAY-14
sql statement: alter database mount
 released channel: ORA_DISK_1
 repair failure complete
RMAN>

 

4.Adım: Advisor yukardaki gibi işini bitirdi ve son yaptığı işleme bakarsak veritabanımızı mount moduna getirdiğini görüyoruz. O zaman veritabanını aşağıdaki gibi tekrar açmaya çalışıyorum.

 [oracle@database ~]$ . profile
 [oracle@database ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed May 29 21:38:00 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
 Connected to:
 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database open;
 alter database open
 *
 ERROR at line 1:
 ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

5.Adım: Yukardaki gibi açma işlemi yine hata verdi bana diyorki veritabanını resetlogs ile aç. Resetlogs ile açınca da aşağıdaki gibi hata alıyorum.

 SQL> alter database open resetlogs;
 alter database open resetlogs
 *
 ERROR at line 1:
 ORA-01194: file 1 needs more recovery to be consistent
 ORA-01110: data file 1: '/u01/app/oracle/oradata/POCDBAUX/system01.dbf'
 SQL>

 

6.Adım: Veritabanı resetlogs ile açılmayıp hata verince tekrar Advisor ın yolunu tutuyorum. Ve yukardaki adımları  tekrarlıyorum. RMAN e bağlanıp hataları listelemesini emrediyorum 🙂

 [oracle@database ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed May 29 21:38:29 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: POCDB (DBID=2629568568, not open)
RMAN> list failure;
using target database control file instead of recovery catalog
 List of Database Failures
 =========================
Failure ID Priority Status Time Detected Summary
 ---------- -------- --------- ------------- -------
 510 CRITICAL OPEN 29-MAY-14 System datafile 1: '/u01/app/oracle/oradata/POCDBAUX/system01.dbf' needs media recovery
 507 CRITICAL OPEN 29-MAY-14 Control file needs media recovery
 513 HIGH OPEN 29-MAY-14 One or more non-system datafiles need media recovery

 

7.Adım: Advisor bize yine hataları listeledi. Şimdi sana zahmet ne yapacağımı da söyle diye emrediyorum.

RMAN> advise failure;
List of Database Failures
 =========================
Failure ID Priority Status Time Detected Summary
 ---------- -------- --------- ------------- -------
 510 CRITICAL OPEN 29-MAY-14 System datafile 1: '/u01/app/oracle/oradata/POCDBAUX/system01.dbf' needs media recovery
 507 CRITICAL OPEN 29-MAY-14 Control file needs media recovery
 513 HIGH OPEN 29-MAY-14 One or more non-system datafiles need media recovery
 analyzing automatic repair options; this may take some time
 allocated channel: ORA_DISK_1
 channel ORA_DISK_1: SID=20 device type=DISK
 analyzing automatic repair options complete
Mandatory Manual Actions
 ========================
 no manual actions available
Optional Manual Actions
 =======================
 1. If you have the correct version of the control file, then shutdown the database and replace the old control file
 2. If you restored the wrong version of data file /u01/app/oracle/oradata/POCDBAUX/system01.dbf, then replace it with the correct one
 3. If you restored the wrong version of data file /u01/app/oracle/oradata/POCDBAUX/sysaux01.dbf, then replace it with the correct one
 4. If you restored the wrong version of data file /u01/app/oracle/oradata/POCDBAUX/undotbs01.dbf, then replace it with the correct one
 5. If you restored the wrong version of data file /u01/app/oracle/oradata/POCDBAUX/users01.dbf, then replace it with the correct one
 6. If you restored the wrong version of data file /u01/app/oracle/oradata/POCDBAUX/rmancat.dbf, then replace it with the correct one
Automated Repair Options
 ========================
 Option Repair Description
 ------ ------------------
 1 Recover database
 Strategy: The repair includes complete media recovery with no data loss
 Repair script: /u01/app/oracle/diag/rdbms/pocdb/POCDB/hm/reco_1698080840.hm

 

8.Adım: Advisor yukardaki gibi ne yapmamız gerektiğini ve bunları yaparken kullanabileceğimiz scriptleri bile 7.adımın en sonunda belirttmiş sağolsun. Madem bu kadar uğraştın bari geri kalan işlemleride sen yap diyoruz. Ve advisor aşağıdaki gibi kendi tavsiyesini uygulayarak veritabanımızı onarıyor.

RMAN> repair failure;
Strategy: The repair includes complete media recovery with no data loss
 Repair script: /u01/app/oracle/diag/rdbms/pocdb/POCDB/hm/reco_1698080840.hm
contents of repair script:
 # recover database
 recover database;
 alter database open resetlogs;
Do you really want to execute the above repair (enter YES or NO)? yes
 executing repair script
Starting recover at 29-MAY-14
 using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oracle/oradata/POCDB/POCDB/onlinelog/o1_mf_1_9pdlq852_.log
 archived log file name=/u01/app/oracle/oradata/POCDB/POCDB/onlinelog/o1_mf_1_9pdlq852_.log thread=1 sequence=1
 media recovery complete, elapsed time: 00:00:00
 Finished recover at 29-MAY-14
database opened
 repair failure complete
RMAN>

 

8.Adımın son kısmına baktığımız zaman Advisor sağolsun bütün hataları bulup düzeltip veritabanımızı açtığını söylüyor.

Bende Advisora teşekkür ederek yazımı burada sonlandırıyor sizlere bol şanslar, en az ORA hataları aldığınız günler diliyorum esen kalın…

 

Oracle Exadata SQL Server Goldengate Weblogic EBS ve Linux konusunda aşağıdaki konularda 7×24 Uzman Danışmanlara yada Eğitimlere mi İhtiyacınız var [email protected] adresine mail atarak Bizimle iletişime geçebilirsiniz.

– Oracle Veritabanı Danışmanlığı
– Oracle Veritabanı Bakım ve Destek
– Exadata Danışmanlığı
– Exadata Bakım ve Destek
– SQL Server Veritabanı Danışmanlığı
– SQL Server Veritabanı Bakım ve Destek
– Goldengate Danışmanlığı
– Goldengate Bakım ve Destek
– Linux Danışmanlığı
– Linux Bakım ve Destek
– Oracle EBS Danışmanlığı
– Oracle EBS Bakım ve Destek
– Weblogic Danışmanlığı
– Weblogic Bakım ve Destek
– Oracle Veritabanı Eğitimleri
– Oracle VM Server Danışmanlığı
– Oracle VM Server Bakım ve Destek
– Oracle EPPM Danışmanlığı
– Oracle EPPM Bakım ve Destek
– Oracle Primavera Danışmanlığı
– Oracle Primavera Bakım ve Destek
– Oracle Eğitimleri
– SQL Server Eğitimleri
– Goldengate Eğitimleri
– Exadata Eğitimleri
– Linux Eğitimleri
– Oracle EBS Eğitimleri
– Oracle VM Server Eğitimleri
– Weblogic Eğitimleri
– Oracle EPPM Eğitimleri
– Oracle Primavera Eğitimleri

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

7 comments

  1. J clin oncol 29:41054112 mcginn CJ, zalupski MM et al (2001) side I go of diffusion dispense escalation with concurrent weekly full-dose gemcitabine in…
    hypoxic anoxic brain injury
    Tricare archives – cerescan hypoxia and anoxia

  2. Blog del estado de Wisconsin AFL CIO adele nowa plyta chomikuj sprawdziany z matematyki 1 gim chomikuj gry konne do pobrania en komputer zad 14 str 34
    en voz alta
    Z madrosci Talmudu.doc descarga los precios de criptomoneda en vivo usd

  3. Dios convocГі a los tres Presidentes mГЎs populares del mundo para una reuniГіn: Presidentes procedentes de Rusia, China en edad de jubilaciГіn con seguridad
    luces traseras
    La guГ­a completa en formato de currГ­culum para 2019: el trabajo adecuado, ВїcuГЎles son los beneficios de la seguridad social? Obtenga una nueva tarjeta de seguridad social, nГєmero de telГ©fono de seguridad social, cambio de nombre de seguridad social, oficina de administraciГіn de seguridad social, oficinas de seguridad social

  4. Howdy just wanted to give you a quick heads up and let you know a few of the images aren’t loading properly. I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same outcome.|

  5. This pop-up hot dog toaster is an excessive and hilarious kitchen tool that will make you a super quick and easy dinner when you dont feel like firing up the grill. You can even adjust the cooking time for the hot dogs, so if you like them a little more charred, you can keep them in for longer.
    How to stop lips from burning

  6. The median wage in 2018 for Dental Hygienists in California was $100,745 annually, or $48.44 hourly. The median is the point at which half of the workers earn
    http://bobijoel.ml/page/dental-hygienist-jobs-in-nc/

  7. Having read this I thought it was extremely enlightening. I appreciate you spending some time and energy to put this short article together. I once again find myself personally spending a significant amount of time both reading and leaving comments. But so what, it was still worthwhile!|

Leave a Reply

Your email address will not be published. Required fields are marked *