Bugra Canbakal's Oracle Blog

  • Home
  • Contact
  • SITE MAP
You are here: Home / Oracle / Restore işleminde datafile pathlerinin yerinin değiştirilmesi

Restore işleminde datafile pathlerinin yerinin değiştirilmesi

09:08 PM By Bugra Canbakal Leave a Comment

1.AMAÇ VE KAPSAM

Restore işleminde datafileların pathlerinin yerlerinin değiştirilmesi

2.UYGULAMA

2.1. Database’i mount posizyonunda açıyoruz.

[oracle@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 – Production on Sat Oct 23 17:35:15 2010

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

Connected to an idle instance.

SQL> startup mount;

ORACLE instance started.

Total System Global Area  422670336 bytes

Fixed Size                  1300352 bytes

Variable Size             251660416 bytes

Database Buffers          163577856 bytes

Redo Buffers                6131712 bytes

Database mounted.

SQL>

2.2. Şuan OS üstünde hiçbir datafile bulunmuyor. Datafileların numarasının ve controlfile ustundeki lokosyonlarını öğrenmek için aşağıdaki sorguyu yazıyoruz.

SQL> select file#,name from v$datafile;

FILE#

———-

NAME

——————————————————————————–

1

/u02/app/oracle/standby/oradata/data/system01.dbf

2

/u02/app/oracle/standby/oradata/data/sysaux01.dbf

3

/u02/app/oracle/standby/oradata/data/undotbs01.dbf

FILE#

———-

NAME

——————————————————————————–

4

/u02/app/oracle/standby/oradata/data/users01.dbf

5

/u02/app/oracle/standby/oradata/data/example01.dbf

SQL>

2.3. Backupdan geri dönüş yaparken 1 ve 5 numaralı datafile’ın lokasyonunu değiştirmek istiyorum o yüzden recover scriptinin içine bu tanımı ekliyorum.

RMAN> run {

set newname for datafile 1  to  ‘/u02/app/oracle/standby/oradata/datafile/system01.dbf’;

set newname for datafile 5  to  ‘/u02/app/oracle/standby/oradata/datafile/example01.dbf’;

allocate channel t1 type disk format ‘/home/oracle/Desktop/yedek/%d_%Y%M%D_t%t_s%s_p%p.rman’;

allocate channel t2 type disk format ‘/home/oracle/Desktop/yedek/%d_%Y%M%D_t%t_s%s_p%p.rman’;

allocate channel t3 type disk format ‘/home/oracle/Desktop/yedek/%d_%Y%M%D_t%t_s%s_p%p.rman’;

allocate channel t4 type disk format ‘/home/oracle/Desktop/yedek/%d_%Y%M%D_t%t_s%s_p%p.rman’;

allocate channel t5 type disk format ‘/home/oracle/Desktop/yedek/%d_%Y%M%D_t%t_s%s_p%p.rman’;

restore database;

release channel t1;

release channel t2;

release channel t3;

release channel t4;

release channel t5;

}

executing command: SET NEWNAME

using target database control file instead of recovery catalog

executing command: SET NEWNAME

allocated channel: t1

channel t1: SID=143 device

allocated channel: t2

channel t2: SID=144 device

allocated channel: t3

channel t3: SID=145 device

allocated channel: t4

channel t4: SID=148 device

allocated channel: t5

channel t5: SID=147 device

Starting restore at 23-OCT-10

channel t1: starting datafile backup set restore

channel t1: specifying datafile(s) to restore from backup set

channel t1: restoring datafile 00003 to /u02/app/oracle/standby/oradata/data/undotbs01.dbf

channel t1: reading from backup piece /home/oracle/Desktop/yedek/ORCL_20101015_t732466629_s12_p1.rman

channel t2: starting datafile backup set restore

channel t2: specifying datafile(s) to restore from backup set

channel t2: restoring datafile 00005 to /u02/app/oracle/standby/oradata/datafile/example01.dbf

channel t2: reading from backup piece /home/oracle/Desktop/yedek/ORCL_20101015_t732466623_s11_p1.rman

channel t3: starting datafile backup set restore

channel t3: specifying datafile(s) to restore from backup set

channel t3: restoring datafile 00004 to /u02/app/oracle/standby/oradata/data/users01.dbf

channel t3: reading from backup piece /home/oracle/Desktop/yedek/ORCL_20101015_t732466629_s13_p1.rman

channel t4: starting datafile backup set restore

channel t4: specifying datafile(s) to restore from backup set

channel t4: restoring datafile 00002 to /u02/app/oracle/standby/oradata/data/sysaux01.dbf

channel t4: reading from backup piece /home/oracle/Desktop/yedek/ORCL_20101015_t732466623_s10_p1.rman

channel t5: starting datafile backup set restore

channel t5: specifying datafile(s) to restore from backup set

channel t5: restoring datafile 00001 to /u02/app/oracle/standby/oradata/datafile/system01.dbf

channel t5: reading from backup piece /home/oracle/Desktop/yedek/ORCL_20101015_t732466622_s9_p1.rman

channel t1: piece handle=/home/oracle/Desktop/yedek/ORCL_20101015_t732466629_s12_p1.rman tag=TAG20101015T145701

channel t1: restored backup piece 1

channel t1: restore complete, elapsed time: 00:00:08

channel t3: piece handle=/home/oracle/Desktop/yedek/ORCL_20101015_t732466629_s13_p1.rman tag=TAG20101015T145701

channel t3: restored backup piece 1

channel t3: restore complete, elapsed time: 00:00:33

channel t2: piece handle=/home/oracle/Desktop/yedek/ORCL_20101015_t732466623_s11_p1.rman tag=TAG20101015T145701

channel t2: restored backup piece 1

channel t2: restore complete, elapsed time: 00:00:33

channel t4: piece handle=/home/oracle/Desktop/yedek/ORCL_20101015_t732466623_s10_p1.rman tag=TAG20101015T145701

channel t4: restored backup piece 1

channel t4: restore complete, elapsed time: 00:02:04

channel t5: piece handle=/home/oracle/Desktop/yedek/ORCL_20101015_t732466622_s9_p1.rman tag=TAG20101015T145701

channel t5: restored backup piece 1

channel t5: restore complete, elapsed time: 00:02:25

Finished restore at 23-OCT-10

released channel: t1

released channel: t2

released channel: t3

released channel: t4

released channel: t5

RMAN>

2.4. Farklı lokasyonlara restore ettiğimiz 2 datafile’ı controlfile ustundede değiştirmemiz gerekiyor.

SQL> ALTER DATABASE RENAME FILE ‘/u02/app/oracle/standby/oradata/data/example01.dbf’ to ‘/u02/app/oracle/standby/oradata/datafile/example01.dbf’;

Database altered.

SQL> ALTER DATABASE RENAME FILE ‘/u02/app/oracle/standby/oradata/data/system01.dbf’ to ‘/u02/app/oracle/standby/oradata/datafile/system01.dbf’;

Database altered.

SQL> select name from v$datafile;

NAME

——————————————————————————–

/u02/app/oracle/standby/oradata/datafile/system01.dbf

/u02/app/oracle/standby/oradata/data/sysaux01.dbf

/u02/app/oracle/standby/oradata/data/undotbs01.dbf

/u02/app/oracle/standby/oradata/data/users01.dbf

/u02/app/oracle/standby/oradata/datafile/example01.dbf

Share this:

  • LinkedIn
  • Twitter

Konuyla ilgili diğer yazılar

  • Oracle DUL (Data UnLoader) //Life is DUL without it
  • Oracle AMDU
  • Incremental backup icin Block Change Tracking dosyası olusturmak
  • Data block corrupt kurtarma işlemi
  • Installation of Oracle RMAN Catalog

Filed Under: Oracle, Single Node Tagged With: datafile, oracle, rman

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About Me



Language:

  • English
  • Turkish

Categories

  • Oracle
    • RAC – Real Application Cluster
    • RMAN
    • Single Node
    • Standby – Dataguard
  • OS
    • Linux

Blogroll

  • Emre Baransel
  • Gökhan Atıl
  • H. Tonguc Yılmaz
  • Kamil Türkyılmaz
  • Tanel Poder
  • Turkce Oracle
  • Turkish Oracle User Group
  • Uwe Hesse
  • Zekeriya Beşiroğlu

Archives

  • April 2014
  • March 2014
  • August 2013
  • June 2013
  • March 2013
  • January 2013
  • December 2012
  • November 2012
  • July 2012
  • June 2012
  • May 2012
  • January 2012
  • November 2011
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • June 2010
OCP
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

[footer_backtotop]

Copyright © 2010-2014 Bugra Canbakal. All rights reserved.