Site icon IT Tutorial

Oracle Flashback -5

Merhaba Arkadaşlar,

Bu yazımda sizlere Oracle Flashback yazıma devam edip datafile kurtarmanın adımlarını anlatmaya devam edeceğim. Bu yazıyı okumadan önce Flashback ile alakalı önceki makaleleri okumanızı tavsiye ederim.

 

Önceki makalede drop ettiğimiz tablespace i ve datafile ı Flashback ile geri getirmiştik. Fakat dataları select çekerken hata alıyorduk şimdi gerekli düzenlemeleri yapıp onuda düzeltiyor olacağım.

7-) Şimdi önceki adımda datafile ımızı offline moda daha sonrada online moda getiriyoruz.

SQL> select * from v$recover_file;

FILE# ONLINE  ONLINE_

---------- ------- -------

ERROR                                                                CHANGE#

----------------------------------------------------------------- ----------

TIME

---------

7 OFFLINE OFFLINE

FILE NOT FOUND                                                             0


8 OFFLINE OFFLINE

UNKNOWN ERROR                                                        1857557

25-FEB-15

FILE# ONLINE  ONLINE_

---------- ------- -------

ERROR                                                                CHANGE#

----------------------------------------------------------------- ----------

TIME

---------


9 OFFLINE OFFLINE

UNKNOWN ERROR                                                        1859232

25-FEB-15

 

 

SQL> select tablespace_name, status from dba_tablespaces;




TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

AYDEM_DATA                     ONLINE

TB                             ONLINE

TBS                            ONLINE

TS                             ONLINE




10 rows selected.



Tablespace si offline moda getiriyoruz.
SQL> alter tablespace ts offline immediate;

Tablespace altered.



SQL> select tablespace_name, status from dba_tablespaces;

TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

AYDEM_DATA                     ONLINE

TB                             ONLINE

TBS                            ONLINE

TS                             OFFLINE




10 rows selected.


Şimdide online yapmaya çalışıyoruz.

SQL> alter tablespace ts online;

alter tablespace ts online

*

ERROR at line 1:

ORA-01190: control file or data file 9 is from before the last RESETLOGS

ORA-01110: data file 9: '/u01/app/oracle/oradata/deneme/ts_01.dbf'

 

😎 Fakat datafile ımızda tutarsızlık olduğu için online moda alamıyoruz. Bunun için rman den yardım alacağız.

RMAN Data Recovery Advisor toolu ile ilgili datafilelara recover edip öyle açacağız. Bu tool ile önce failure varmı yok mu listeliyoruz sonra ona advise ile tavsiye vermesini istiyoruz en son repair özelliğiyle aşağıdaki gibi düzeltmesini istiyoruz.

[oracle@MehmetSalih ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Feb 25 11:42:59 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DENEME (DBID=1985990806)

RMAN> list failure;


List of Database Failures

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

Failure ID Priority Status    Time Detected Summary

---------- -------- --------- ------------- -------

348        HIGH     OPEN      25-FEB-15     One or more non-system datafiles need media recovery

452        HIGH     OPEN      25-FEB-15     One or more non-system datafiles are offline

427        HIGH     OPEN      25-FEB-15     One or more non-system datafiles are missing




RMAN> advise failure;

List of Database Failures

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


Failure ID Priority Status    Time Detected Summary

---------- -------- --------- ------------- -------

348        HIGH     OPEN      25-FEB-15     One or more non-system datafiles need media recovery

452        HIGH     OPEN      25-FEB-15     One or more non-system datafiles are offline

427        HIGH     OPEN      25-FEB-15     One or more non-system datafiles are missing




analyzing automatic repair options; this may take some time

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=36 device type=DISK

analyzing automatic repair options complete


Not all specified failures can currently be repaired.

The following failures must be repaired before advise for others can be given.


Failure ID Priority Status    Time Detected Summary

---------- -------- --------- ------------- -------

348        HIGH     OPEN      25-FEB-15     One or more non-system datafiles need media recovery

427        HIGH     OPEN      25-FEB-15     One or more non-system datafiles are missing


Mandatory Manual Actions

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

no manual actions available




Optional Manual Actions

=======================
  1. If you restored the wrong version of data file /u01/app/oracle/oradata/deneme/tb_01.dbf, then replace it with the correct one
  2. If you restored the wrong version of data file /u01/app/oracle/oradata/deneme/ts_01.dbf, then replace it with the correct one
  3. If file /u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00007 was unintentionally renamed or moved, restore it
Automated Repair Options

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

Option Repair Description

------ ------------------

1      Restore and recover datafile 7; Recover datafile 8; Recover datafile 9

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

Repair script: /u01/app/oracle/diag/rdbms/deneme/deneme/hm/reco_3656126672.hm




RMAN> repair failure;

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

Repair script: /u01/app/oracle/diag/rdbms/deneme/deneme/hm/reco_3656126672.hm


contents of repair script:

# restore and recover datafile

restore datafile 7;

recover datafile 7;

# recover datafile

recover datafile 8, 9;




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

executing repair script




Starting restore at 25-FEB-15

using channel ORA_DISK_1


creating datafile file number=7 name=/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00007

restore not done; all files read only, offline, or already restored

Finished restore at 25-FEB-15


Starting recover at 25-FEB-15

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_2_bgv509dy_.arc

archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5d0sy_.arc

archived log file name=/u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_2_bgv509dy_.arc thread=1 sequence=2

archived log file name=/u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5d0sy_.arc thread=1 sequence=1

archived log file name=/u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5vhq4_.arc thread=1 sequence=1

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

Finished recover at 25-FEB-15


Starting recover at 25-FEB-15

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/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5d0sy_.arc

archived log file name=/u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5d0sy_.arc thread=1 sequence=1

archived log file name=/u01/app/oracle/fast_recovery_area/DENEME/archivelog/2015_02_25/o1_mf_1_1_bgv5vhq4_.arc thread=1 sequence=1

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

Finished recover at 25-FEB-15

repair failure complete

RMAN> exit


 

 

9-) Daha sonra tekrardan sorgu attığımızda sonuçların geldiğini görüyoruz.

[oracle@MehmetSalih ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 25 11:44:13 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> alter tablespace ts online;

Tablespace altered.


SQL> select * from ts.ts;

ID

----------

10


SQL>

 

Evett Flashback ile drop ettiğimiz bir tablespace in yada Datafile ında geri döndürülmesi olayını adım adım göstererek yaptım. Böylece bu yazı dizisinin sonuna gelmiş bulunmaktayım bir sonraki yazıda görüşmek dileğiyle 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 mehmet.deveci@gridgroup.com.tr 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

Exit mobile version