Home » SQL & PL/SQL » SQL & PL/SQL » Copy Schema
Copy Schema [message #8496] Mon, 25 August 2003 12:51 Go to next message
Variant_530
Messages: 4
Registered: August 2003
Junior Member
How do I copy database objects from one schema to another. I need to copy all the objects and their properties. Is there some simple way to do this?
Re: Copy Schema [message #8497 is a reply to message #8496] Mon, 25 August 2003 13:29 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
export
and
import
Re: Copy Schema [message #8499 is a reply to message #8497] Mon, 25 August 2003 14:30 Go to previous messageGo to next message
Variant_530
Messages: 4
Registered: August 2003
Junior Member
Please clarify
"export
and
Import"
Re: Copy Schema [message #8501 is a reply to message #8499] Tue, 26 August 2003 06:56 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
-- to export 
-- dba/dba is the administrative account/password.
-- export all the objects ownned by schema1
-- a dmp file is created.
exp dba/dba owner=schema1 file=myfile.dmp
-- to import
-- now import objects ownened by schema1 into schema2
imp dba/dba  fromuser=schema1 touser=schema2 file=myfile.dmp

Re: Copy Schema [message #8504 is a reply to message #8501] Tue, 26 August 2003 16:13 Go to previous messageGo to next message
Variant_530
Messages: 4
Registered: August 2003
Junior Member
Thank you very much for your response.
Now, how do I do what you have described.
Step by step.
Please forgive my ignorance. This is why I posted the question on the Newbie forum.
Re: Copy Schema [message #8505 is a reply to message #8504] Tue, 26 August 2003 18:09 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Mahesh actually gave you the step-by-step instructions as to how to export and import objects. I would recommend you consult the documentation (available online at tahiti.oracle.com - free registration) for further details regarding the export and import utilities.
Re: Copy Schema [message #8507 is a reply to message #8504] Tue, 26 August 2003 19:36 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
Mahesh Rajendran's example was very nice. The following just adds a bit more detailed step by step explanation for newbies. Suppose you want to copy all objects and their properties from a schema named schema1 to a schema named schema2:

1. Get to an operating system prompt in an appropriate directory. For example, on my Windows NT system, I could open a DOS command window in the C:oracle81bin directory.

2. You will need to know the username and password of an account with dba privileges, such as username system and password manager, which are the original defaults that come with Oracle, if you haven't changed them.

3. To export, type the line below at the operating system prompt. You may need to substitute the appropriate username and password for system and manager, as mentioned in number 2 above and you will need to substitute the actual schema name for schema1.

exp system/manager owner=schema1 file=myfile.dmp

4. You will see a bunch of stuff on your screen, as the export of schema1 to the file myfile.dmp is taking place. When it is done, you will see the operating system prompt again.

5. To import, type the line below at the operating system prompt. You may need to substitute the appropriate username and password for system and manager, as mentioned in number 2 above and you will need to substitute the actual schema names for schema1 and schema2.

imp system/manager fromuser=schema1 touser=schema2 file=myfile.dmp

6. You will see a bunch of stuff on your screen, as the import from schema1 to schema2 using myfile.dmp is taking place. When it is done, you will see the operating system prompt again.
Re: Copy Schema [message #8516 is a reply to message #8507] Wed, 27 August 2003 11:11 Go to previous messageGo to next message
Variant_530
Messages: 4
Registered: August 2003
Junior Member
Thank you both.
Mahesh for actually getting a solution to my question, and to Barbara for putting that solution into an easily understood concise step-by-step statement.
Re: Copy Schema [message #8527 is a reply to message #8516] Thu, 28 August 2003 07:33 Go to previous message
Nguyen Ba Tu
Messages: 4
Registered: August 2003
Junior Member
In Oracle 9i, you can use command 'Copy database using...'
Previous Topic: Set Num 40 in oracle sqlplus
Next Topic: SQL GURUS
Goto Forum:
  


Current Time: Thu Apr 18 17:58:02 CDT 2024