3

I am trying to learn Oracle database and I am having difficulties on importing a backup file with impdp command. I googled deeply but couldn't find answers to my problems. What have I done until now is:

  1. I created a user as Test1 with tablespace
  2. I granted some privileges through sqlplus
  3. I imported the backup file by using impdp command with options fromuser=Test2 touser=Test1
  4. I imported the backup file by using impdp command with options fromuser=Test2 touser=Test1
  5. I started sqldeveloper and connected to Test1
  6. I expanded tables but there is no table to be displayed
  7. I expanded other users. There is also another Test1 among other users
  8. I checked tables of Test1 and the tables were all there

Now my questions:

  1. Although I chose touser=Test1 option, why the tables are displayed in Test1 which is in other users group? I expected the tables to be in first users' table list
  2. How can I import database directly to the user I created? I don't want to use other users because I have to use [schema_name].[table_name] in my selects which is a waste of time for me.
  3. I can click on tables in other user table list and display the data but I cannot open a blank sql page to write some queries. Is there any way to do that?

EDIT:

The command I used when importing is:

impdp Test1/123 DIRECTORY=backup_dir DUMPFILE=Test.dmp FULL=Y fromuser=Test2 touser=Test1

The result is as follows:

User and Other Users tables

1

Just in case somebody else needs, I am posting the solution I used. Instead of using fromuser and touser options, I used remap_schema option:

> impdp user1/password DIRECTORY=backup_dir DUMPFILE=Dump.dmp FULL=Y
> remap_schema=user2:user1

Also, if the tablespaces are different, they must be remapped, too:

> impdp user1/password DIRECTORY=backup_dir DUMPFILE=Dump.dmp FULL=Y
> remap_schema=user2:user1 remap_tablespace=table2:table1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.