Sistem veri dosyasının silinmesi durumunda VT’nin tamir edilmesi (system datafile recovery)
senaryo :
1- system01.bdf i sildik vt halen acık, orjinal yerine restore recover yaptık sorunsuz db acıldı
2- test01.dbf i sildik sonrasında farklı bir lokasyona restore recover ettik.(vt yi kapatmadık veri kaybetmedik)
archive log moddayız elimizde full yedek var
|
1 2 3 4 5 6 7 8 9 10 11 |
SQL> shutdown immediate SQL> startup ORACLE instance started. Total System Global Area 910163968 bytes Fixed Size 1283380 bytes Variable Size 230689484 bytes Database Buffers 675282944 bytes Redo Buffers 2908160 bytes Database mounted. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '/oracle/oradata/data/system01.dbf' |
|
1 2 3 4 5 |
-bash-3.00$ rman target / Recovery Manager: Release 10.2.0.2.0 - Production on Fri Jun 3 08:56:09 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORATR (DBID=3117323921, not open) |
|
1 2 3 |
RMAN> restore tablespace system ; RMAN> recover tablespace system ; RMAN> alter database open ; |
|
1 2 3 4 5 |
SQL> select status from v$instance; STATUS ------------ OPEN |
yedek , redologlar ve archive loglar elimizde oldugu için sorunsuz olarak db yi açabildik.
test01.dbf in oldugu disk arizalandı yeni disk takıldı /oracle/oradata/data1 dizinine mount edildi.
test01.dbf i buraya restore edeceğiz.
|
1 |
SQL> alter tablespace test offline; |
|
1 2 3 4 5 6 7 8 |
SQL> alter tablespace test offline * ERROR at line 1: ORA-01116: error in opening database file 6 ORA-01110: data file 6: '/oracle/oradata/data/test01.dbf' ORA-27041: unable to open file Intel SVR4 UNIX Error: 2: No such file or directory Additional information: 3 |
|
1 2 |
SQL> alter tablespace test offline immediate; Tablespace altered. |
|
1 2 3 4 |
SQL> alter tablespace test rename datafile '/oracle/oradata/data/test01.dbf' to '/oracle/oradata/data1/test01.dbf'; |
|
1 2 3 4 |
SQL> alter tablespace test rename datafile '/oracle/oradata/data/test01.dbf' to '/oracle/oradata/data1/test01.dbf' ; |
|
1 2 3 4 5 6 7 8 9 10 |
SQL> alter tablespace test * ERROR at line 1: ORA-01525: error in renaming data files ORA-01141: error renaming data file 6 - new file '/oracle/oradata/data1/test01.dbf' not found ORA-01110: data file 6: '/oracle/oradata/data/test01.dbf' ORA-27037: unable to obtain file status Intel SVR4 UNIX Error: 2: No such file or directory Additional information: 3 |
|
1 2 3 |
SQL> select ts.name tablespace, df.file#, df.name datafile 2 from v$tablespace ts, v$datafile df 3 where ts.ts# = df.ts#; |
|
1 2 3 4 5 6 |
RUN TO '/oracle/oradata/data1/test01.dbf'; RESTORE TABLESPACE 'TEST'; SWITCH DATAFILE ALL; RECOVER TABLESPACE 'TEST'; |
|
1 2 |
SQL> alter tablespace test online; Tablespace altered. |
Kategori seçin...
