Restore dari off line backup
Restore dari hasil offline backup adalah sangat sederhana, sesederhana backup-nya. Lihat offline backup di sini http://rohmad.net/…/off-line-backup-database-oracle/
Berikut ini step-step restore dengan memakai instance yang sama.
- Siapkan file-file yang akan direstore
File-file tersebut adalah control, log, data, dan temp file - Pastikan instance sudah mati
SQL> shutdown immediate;
- Restore file-file backup ke directory asalnya
$ cp /backup/ts/control01.ctl /oradata/ts/control01.ctl
$ cp /backup/ts/control02.ctl /oradata/ts/control02.ctl
$ cp /backup/ts/control03.ctl /oradata/ts/control03.ctl
$ cp /backup/ts/redo04.log /oradata/ts/redo04.log
$ cp /backup/ts/redo05.log /oradata/ts/redo05.log
$ cp /backup/ts/redo06.log /oradata/ts/redo06.log
$ cp /backup/ts/sysaux01.dbf /oradata/ts/sysaux01.dbf
$ cp /backup/ts/system01.dbf /oradata/ts/system01.dbf
$ cp /backup/ts/temp01.dbf /oradata/ts/temp01.dbf
$ cp /backup/ts/undotbs01.dbf /oradata/ts/undotbs01.dbf
$ cp /backup/ts/users01.dbf /oradata/ts/users01.dbf - Nyalakan database
SQL> startup;
Jika karena suatu hal, kita tidak bisa merestore ke direktori asalnya, maka kita bisa merestore ke tempat (direktori) lain. Step 1 dan 2 masih seperti yang di atas. Step 3 dan seterusnya adalah berikut ini:
- Restore ke directory baru
Control file$ cp /backup/ts/control01.ctl /newdir/ts/control01.ctl
Log file
$ cp /backup/ts/control02.ctl /newdir/ts/control02.ctl
$ cp /backup/ts/control03.ctl /newdir/ts/control03.ctl$ cp /backup/ts/redo04.log /newdir/ts/redo04.log
Data file
$ cp /backup/ts/redo05.log /newdir/ts/redo05.log
$ cp /backup/ts/redo06.log /newdir/ts/redo06.log$ cp /backup/ts/sysaux01.dbf /newdir/ts/sysaux01.dbf
Temp file
$ cp /backup/ts/system01.dbf /newdir/ts/system01.dbf
$ cp /backup/ts/undotbs01.dbf /newdir/ts/undotbs01.dbf
$ cp /backup/ts/users01.dbf /newdir/ts/users01.dbf$ cp /backup/ts/temp01.dbf /newdir/ts/temp01.dbf
- Ubah konfigurasi control file. Edit init (instance parameter) file.
Filenya di $ORACLE_HOME/dbs/init[NAMAINSTANCE].ora
Ganti lokasi control file dari yang lama ke yang baru.
Value yang lama:control_files='/oradata/ts/control01.ctl', '/oradata/ts/control02.ctl','/oradata/ts/control03.ctl'
Value yang baru:control_files='/newdir/ts/control01.ctl', '/newdir/ts/control02.ctl','/newdir/ts/control03.ctl'
- Ubah konfigurasi file yang lainnya (log, data, dan temp file)
SQL> startup mount
SQL> alter database rename file '/oradata/ts/redo04.log' to '/newdir/ts/redo04.log';
SQL> alter database rename file '/oradata/ts/sysaux01.dbf' to '/newdir/ts/sysaux01.dbf';
SQL> alter database rename file '/oradata/ts/temp01.dbf' to '/newdir/ts/temp01.dbf';
dan seterusnya ... - Open database
SQL> alter database open;
Error yang terkait
- Jika control file tidak ada, atau ada tapi direktorinya berubah dan init file belum diedit
SQL> startup
ORACLE instance started.Total System Global Area 1610612736 bytes
Fixed Size 2177912 bytes
Variable Size 396149896 bytes
Database Buffers 1207959552 bytes
Redo Buffers 4325376 bytes
ORA-00205: error in identifying control file, check alert log for more info - Jika ada data file yang kelewatan, atau ada tapi direktorinya berubah dan belum di-alter/rename
SQL> startup
ORACLE instance started.Total System Global Area 1610612736 bytes
Fixed Size 2177912 bytes
Variable Size 396149896 bytes
Database Buffers 1207959552 bytes
Redo Buffers 4325376 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/oradata/ts/users01.dbf'
Tidak ada komentar:
Posting Komentar