Total Pageviews

Thursday 25 December 2014

What is the workaround if you missed the "SWITCH DATAFILE ALL" after the RMAN command "RESTORE DATABASE"?

The following are the 2 solutions to rename the datafiles to the restored pathname :


problem script : 

run {
allocate channel c1 type disk;
allocate channel c2 type disk;

allocate channel c3 type disk;
set newname FOR DATAFILE 1 to '/some_path/datafile_name_1.dbf'
set newname FOR DATAFILE 2 to '/some_path/datafile_name_2.dbf'
set newname FOR DATAFILE 3 to '/some_path/datafile_name_3.dbf'
set newname FOR DATAFILE 4 to '/some_path/datafile_name_4.dbf'
set newname FOR DATAFILE 5  to '/some_path/datafile_name_5.dbf'
restore database;
switch datafile all;  --- You missed this step , your recovery will fail . How to solve the prob
recover database;
release channel c1;
release channel c2;

release channel c3;
}

Problem is that if you missed "Switch datafile all" in your recovery script , you cannot run this command manually from some  session other than your SET NEWNAME script session .


Solution#1. Issue the following command to rename the all datafiles to their restored pathname.

SQL> alter database rename file '{OLD_PATHNAME}' to '{NEW_PATHNAME}';

Solution#2. Catalog the restored datafiles as datafilecopies.

a. Catalog the datafilecopies. Make sure to replace the '{DIRECTORY}' with the location of the restored datafiles.

RMAN> catalog start with '{DIRECTORY}';

b. Afterward, switch to datafilecopies.

RMAN> switch database to copy;

1 comment:

  1. Jadwal Pertandingan Ayam SV388 7 Maret 2019 - Minggu, Ujung Pandang 10 Maret 2019 – Pada Hari Tersebut Akan Di Laksanakan Berbagai Pertandingan Sabung Ayam Secara Live di Arena Sabung Ayam Thailand.

    Situs Judi Sabung Ayam Online SV388 Merupakan Situs Judi Asal Thailand Yang Sangat Terkenal Dengan Permainan Sabung Ayam Yang Fair dan Menghibur Para Penonton Judi Sabung Ayam.

    Untuk Info Lebih Lanjut Bisa Hub kami Di :
    wechat : bolavita
    line : cs_bolavita
    whatsapp : +628122222995
    BBM: BOLAVITA

    ReplyDelete