Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

moving oracle database to test machine

Jade Bulante
Frequent Advisor

moving oracle database to test machine

I have test unix system that I would like to move a copy of our oracle production database using backup tape. I use the cpio command that backups everything starting from root. Is this possible?? What are the steps?? Is there a guide you can email me?

Thanks...
4 REPLIES
Srinivasan Sankar
Occasional Visitor

Re: moving oracle database to test machine

Hope both the systems run the same version of the o/s.

Was the backup a cold database backup?
Then copy/restore the DB files to the target system. Need the database code tree ( same version ?) . edit the file /etc/oratab which is the file which gives the version of the Oracle database to have the instance you want. this will have the same format like the source system.

Log in as oracle on the source system and copy the .profile and other relevant files to the target system ( or get them from backup... there are environment variables like ORACLE_HOME and ORACLE_BASE defined here).

Then the code tree may have a link in the directory which poitns to the bdump,cdump,pfile and udump directories for the ORACLE_SID you are trying to recover.

Login as oracle on the target system.
. oraenv
answer the question with the ORACLE_SID you need to start.

You may try starting the database and then fix every problem you see on startup, which is not very hard. You may get errors like permissions of files being not correct etc.

Get started on the fist few steps mentioned and then ask when you face the next problem :-)
we can solve anything!!
Jade Bulante
Frequent Advisor

Re: moving oracle database to test machine

Both of the system run the same O/S. The backup tape is a cold database backup but the instance was running when backup kicked in. Do we need to shutdown the database even if we're not using legato?? Like my previous notes, we are using cpio and was nobody logged in the system.

How does other companies do oracle backups when the databse is up all the time??
Srinivasan Sankar
Occasional Visitor

Re: moving oracle database to test machine

ORACLE database backups:There are two modes possible.1) Hot backup . this is done when the database is open ( it does not matter whether it is used or not ) To do this you need to put the database in backup mode ( all tables of the DB)Then the files are copied using any O/S utility like tar,cp,cpio or any thing else .The database is taken out of backup mode after the copy is done . One of the requirements to be able to do this is that the DB should be in archive log mode enabled as the recovery also will need archive logs.2) cold backup:To doi this the DB needs to be shutdown and then all the files are copied to the target area. Then the target DB instance is recovered.If you have not done this , you need to start again using one of the two methods. the second one is recomended for a person with less ORACLE DB skills.
we can solve anything!!
Jade Bulante
Frequent Advisor

Re: moving oracle database to test machine

Since you put it that way, I guess you're right. Since I'm inexperienced with Oracle, I would like to test out the cold backup by running a cron file that automatically shutdown the database, backup with my cpio cron job and startup the database. Do you have anything or can you forward me a link that I copy a script that will shutdown, backup and startup the database??

I'm sure there is something out there, since most companies are running 24/7 production servers.

I saw an article that tells you to vi the /etc/oratab file
EX: SID:ORACLE_HOME:Auto

but this one starts up the database if system is rebooted. I would like something that would kick in before my cron job starts backing up. Thanks for all your help again.

Jade