Solved

Importing new schema to database where such schema already exists , fails

Posted on 2007-12-03
5
945 Views
Last Modified: 2013-12-18
Dear  Experts,
I try to reimport shema in order to replace already exiting schema. However, after I issue the following command:
imp user/passsid FROMUSER=user TOUSER=user ignore=y compile=y destroy=y grants=y rows=n buffer=10000000 constraints=y file=my_dump.dmp log=imp.log

with set destroy=y (so the tablespace should be replaced) the tables from the my_dump.dmp are not recreated in the destination schema (my database). Where can be the problem?

Thanks for any advice

Adam
0
Comment
Question by:adamgasior
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 48

Assisted Solution

by:schwertner
schwertner earned 20 total points
ID: 20396562
FROMUSER=user TOUSER=user  is a very bad combination.
The PL/SQl code in the triggers (if any) will not be changed and will be
in his original state. So you have to avoid this.

If you would like to recreate the user using clasical Oracle import
the best practice is to drop all user objects before this (be careful!):

drop user scott cascade;
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 20396759
I've used FROMUSER and TOUSER many times successfully, so I would not say that this is a bad idea in all cases.  It depends on which objects are being imported, and for PL\SQL objects it depends on whether the schema name is hard-code into any PL\SQL objects or not.

An import will not usually destroy any existing objects.
0
 

Author Comment

by:adamgasior
ID: 20398408
I have two small additionals questions:

--> If I issue "drop user scott cascade" will it delete tablespace, stored procedures, triggers associated with that prqaticular user?

-->why import does not delete original objects? I set the option destroy=y?

Adam
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 60 total points
ID: 20398720
If you do a "drop user [username] cascade]" command that will drop the entire schema of that user, so yes, all tables, indexes, triggers, stored procedures, views, etc. owned by that schema/user will be dropped or deleted.  Will that empty a tablespace?  Maybe but maybe not, depending on whether other schemas also had objects in the same tablespace(s) that this user's objects were in.

Why doesn't import delete objects?  Oracle's classic import utility (imp) has never had the ability to drop or delete objects or data as far as I know (and I've never seen the "destroy" option before - are you sure it is valid?)  The new DataPump import (impdp) of Oracle10 can replace objects though, if you use the correct parameters.
0
 

Author Comment

by:adamgasior
ID: 20398835
thanks a lot
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question