Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cloning database to a different server

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
US
we are running Oracle 8.1.7 that on AIX 5.1 this is our production server.

We have a test server with Oracle 8.1.7 on AIX 5.1
our test server has an instance called (test) no records

We want to clone our production database to the test database.

Questions: Does the tablespaces and datafiles on the test Database need to the same name as the Production database with the same size?

Question: How does the database get copied from one server to the other?

I have read some documentation on cloning. You have to create a controlfile and then there is more steps after that.

I was thinking about the export/import but I would like to go with cloning.

Can some one explan it a little more clearer. Step by step
Both systems are the same.

thanks in advance
 
create fileystsems on clone machine as live
do hot / cold backup of live database

restore to clone system

if cold backup startup database (you must copy ALL datafiles, controlfiles, redo logs etc)

if hot backup perform database recovery - 'recover database using backup controlfile until cancel' (my preferred method as it tests out recovery procedure)


Alex
 
You can rename the database on the test server as part of the recovery if you wish

Alex
 
imp/exp is NOT cloning. it can give you a logically identical DB but not a physical one.

"cloning" is really just doing a physical backup/restore. if you're running archivelog (which you should be) just run a hot backup and restore it on the test server. if you're not then you won't be able to get a true "clone" (physical copy) w/o an instance shutdown & cold backup/restore (at which point you should make the prod DB archivelog:).

to answer a couple of your spacific ?s:

tablespaces and datafile sizes will need to be the same (though this will be the result of a physical restore anyway). datafile names (as well as control/logfiles) can be changed during the restore process (vi init file to rename controlfiles, alter database rename file '<old>' to '<new>';)

the database gets copied from the prod to test server by whatever method you normally propagate files (personally we require scp even on internal networks).

if you need help running/restoring a hot backup I'd be happe to provide instructions/scripts if needed.
 
Right now on the test database I have tablespaces and datafiles. Do these need to be the same name as the production tablespaces and datafiles?
 
I would like that if you could help me?
So I need to create/remove the tablespaces to match the production database?
 
what is a hot backup? Does this mean when the database is shutdown.

What is a cold backup? Does this mean the database is shutdown.

and what is a RMAN?

can someone explane that

Can I clone a database while it is running?
 
hot backup - backup taken while the database is up
cold backup- backup taken while the database is shut down
RMAN - Oracle utility for doing backups of all sorts - very versatile - no need to write long and convoluted scripts - also handles recovery

You really should familiarise yourself with the Backup and Recovery Manual

If you use hot backups there is no need to shut the database down

Alex
 
If people are using the database and I use the Hot backup would that possibley corrupt the production database.

And could I use the OS to do a Hot backup
copy the files

such as cp file /u03/app example

Do you know some exmaples of hot backup
 
Hi,

NO, No, No....

Copying files while the database is open is a route to disaster..

Using Hot Backup will not affect any users...

Read the Docs before trying anything - the Backup and Recovery guide is mandatory reading if you expect to get things right..

[profile]
 
Copying files while the database is open is a route to disaster..
"

ummm... what do you think a hot backup is?

you put the tablespaces into backup (alter tablespace <name> begin backup;,
copy the datafile(s) somewhere (another filesystem, DLT, etc.),
take tablespaces out of backup (alter tablespace end backup;),
force a logswitch (alter system switch logfile;),
copy the archive logs ranging from the sequence associated with the oldest online redo to the one you just forced and
backup the controlfile (alter database backup controlfile to '<path>/<file>';)

if you do this correctly it will not harm your database (I have over a dozen DBs that do exactly this nightly). I did accidentally forget the "-c" and ">" on a gzip enabled version of my script once but that was my fault. obviously it's not Oracle's fault if you do something stupid from a shell. :)
 
Hi,
My understanding of what he asked was whether he could avoid putting the database into backup mode for fear of corrupting the database if others were using it....
:
(If people are using the database and I use the Hot backup would that possibley corrupt the production database)



By concern was that he would try a copy while open and not in backup mode.

[profile]
 
hey, Turk,

sorry if I came across as snide (might have been a little out of line)...

even if you do copy datafile(s) w/o putting corresponding tablespace(s) into backup it won't hurt the source database, you just end up w/an unrecoverable image. the only danger this poses is if you assume you have good backups, don't test them and find this out the hard way when you actually need them in which case I don't have much sympathy.

later!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top