Skip to content

41: Restoring database from backup in different locations in different machine:

Agnivo102 edited this page Jun 16, 2026 · 4 revisions

Restoring database from backup in different machine:

Step 1:

First take a copy of the backup file in separate machine. You can do it over network using scp or you can use the shared folder to do this.

Screenshot

Step 2:

Next step is creating an oracle environment for the database in the other server. For the edit the Pratap file just like we do during database creation manually.

Screenshot Screenshot

Step 3:

Next step is creating the password file. You can create a new one with the same password for the database or copy that databases password file. Here I have copied the password file of another database with the same sys user password.

Screenshot

Step 4:-

Now go into rman tool. Currently we don't have spfile or pfile. So we can't use the sqlplus to start the database. But the rman tool can forcefully start the database into nomount state even without the spfile.

Screenshot

Startup nomount;

Step 5:-

Now that the database is started run this command to restore the spfile from the backup.

Screenshot

This one is for the spfile and control files.

Screenshot

This one is for the data files, like remember the tag name which I had given.

Restore spfile from 'backup location';

Screenshot

This will restore the spfile.

Screenshot

This will also create the pfile.

Step 6:

Now open the pfile in another terminal and create the locations where the control files and data files and audit dump file is saved.

Screenshot Screenshot

Step 7:

Now shutdown the database from RMAN tool and start it up to nomount again inside sqlplus. This time the database will use the spfile to startup.

Screenshot

Step 8:

Now go to RMAN tool again and restore the control file.

Screenshot

Step 9: Now mount the database and restore the datafiles.

Screenshot

Now in control file which is the physical repository of backups, it is written that last backup was saved in the fast recovery area location of the other machine. So if we used the command restore database; it will try the restoration by using the backup from there but nothing is present here.

So now we have to use this command: catalog start with '/u01/backup'; to tell the control file to use those files as backup.

Screenshot

Step 10:

Now restore the database.

Screenshot
Screenshot

Now open the database.

Screenshot

Restoring database in a completely different location in u02 directory in a different machine. That is, its data files and control files will be in u02 directory.

Step 1:

First create the directory. The copy the backup files in that directory.

Screenshot
Screenshot
Screenshot

Step 2:

Screenshot

Note:

This one is showing strange errors don't know why.

Screenshot Screenshot

Lets do this with the prod database backup files from the previous again. The backup files are already moved to a different location.

Step 2 again:

Start the Rman tool with prod database. Restore spfile in there. And create pfile from it.

Screenshot

Step 3:

Now to change the location of the files we need to change the locations of the control files in the spfile.

This was the previous state of the file.

Screenshot

I changed it to this.

Screenshot

Step 4:

Now delete the spfile and create the spfile again from the updated pfile.

Screenshot
Screenshot

Step 5:

Now restart the database in nomount state and restore the control file.

Screenshot
Screenshot

See control files got restored in the new place.

Screenshot

Step 6:

Now the next step is to change the control file which contains the location of the datafiles. We need to change that from the previous location.

The control file looks completely in-editable directly as its a binary file.

Screenshot

We also can't do the changes like this by changing tablespace. Tablespace cannon be altered until the database is in open state and we can't open the databasw unless the data files are properly in place.

I also tried to check the spfile and control completely using the v$parameter view and don't see any property for data files which we can chnage using alter system.

The datafiles gets restored in the previous location as I couldn't change the control file.

Screenshot
Screenshot
Screenshot

The control files are in different space but the data files are in the previous place.

Screenshot

Steps 7:

Screenshot

Success:

Screenshot

Finish:

Screenshot

Note: One important thing. The server from where the database originally existed and the server where the database backup s copied they both need to have the same memory specification i,e same hard disk space and same RAM. Or restoration won't work.

Clone this wiki locally