Home » RDBMS Server » Server Administration » Copy database
Copy database [message #56982] Mon, 12 May 2003 07:35 Go to next message
Dik
Messages: 27
Registered: June 2002
Junior Member
Hi,
I have a database on Unix and I would like to have the same database on windows NT.(with the same tablespaces, datafiles,users....,the same schema). How to do that? Is Export of full database enough?
Re: Copy database [message #56984 is a reply to message #56982] Mon, 12 May 2003 08:22 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
export the source db.
in target create the tablespaces 'with the same name ' like the source .
import to the target.
Re: Copy database [message #56988 is a reply to message #56982] Mon, 12 May 2003 10:03 Go to previous messageGo to next message
psmyth
Messages: 81
Registered: October 2002
Member
yup full export will be fine, but I'd create the tablespaces and datafiles first - and keep a copy of the sql scripts you used to do it, so you can do it again easily if you need to ;-)

I usually do a 'show=y' import first, and then strip out the 'create user' commands (search the log from the import for each username and then you can make a sql script to create each user)... often you'll find odd things that need to be fixed. Don't bother creating each of the tables in each schema, they'll get created when you import the schema. Its a bit painful to get the formatting sorted out (removing all the quotes etc), but its worth the effort.

Once you have the db built with all the tablespaces etc, and you've run the 'create user' scripts, you can run an import for each schema... eg:

imp system/manager file=full_export_of_unix_db.dmp fromuser={schemaname} touser={schemaname} ignore=y log=imp_schemaname.log

Do that for each user, and think about what order you do them in... if one schema has 'grants' from another user, it might be best to take that into account ;-)

Doing it all this way means you have 'create' scripts for future use, you have logs of the creation of each schema, and its a lot easier to spot anything that didn't work... and you only want to import your application schemas, not the Oracle 'internal' schemas (sys, dbsnmp etc).

Also, when you are running the 'full' export from the unix db, specify 'consistent=y'.
Re: Copy database [message #56992 is a reply to message #56982] Mon, 12 May 2003 13:02 Go to previous message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
Yes and no.

You have to first take a export with ROWS=N, then get the tablespace DDL from the dmp file, edit the paths (tehy will be different from the UNIX ones in Windows), then run the DDL to pre-create the tablespaces.

Then take another export with ROWS=Y, adn when importing use IGNORE=Y, to ignore tablespace existence.

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Previous Topic: Oracle 9i on Linux
Next Topic: Mac client 7 on Oracle 9i
Goto Forum:
  


Current Time: Mon Dec 30 16:46:11 CST 2024