7

I am importing a Oracle dump fill created on a AIX Oracle 9.2 installation with a Full Export option to a Windows Oracle 10.2.0.4 on Windows 2008 R2 x64.

I want to import the file to a clean database. However if I don't create a database first, there's nothing to create. If I create the database, it throws a lot of errors complaining of missing users and tablespaces, even with FULL=Y.

How can I import this dump into a clean Oracle Install?

The export ran under system and the import also. The index file does not contain the statements to import the users and tablespaces, however when I run the full import on the original file, IMP tries to create the TABLESPACES (which have incorrect paths, which I have to change, and i know that) but it does not try to create the users, only complaining they don't exist.

The actual export command user is:

exp <a_User>/<a_Password> FULL=Y FILE=/PATHHERE/oradata/Export/expdat.dmp log=exp`date + %d%m%y.%H%M%S`.log consistent=y
Paul White
  • 94,921
  • 30
  • 437
  • 687
Alexandre Sousa
  • 91
  • 1
  • 1
  • 4

3 Answers3

3

If you are using the old imp method the users and tablespaces must be created first. This includes grants, database links and any advanced queues you may be using. A sample script could look like this in Windows imp a_DBA_user/apassword LOG =C:\dump\logs\import.log file =user01.dmp fromuser=user_name touser=user_name

The newer datapump method works wonderfully. You don't need to create the user but I would create any custom tablespaces you may have on the original.

A sample data pump call requires you to create a database link to the original database and a directory. This creates a directory

CREATE OR REPLACE DIRECTORY 
DATA_PUMP_DIR AS 
'C:\app\Oracle\product\11.2.0\dbhome_1\rdbms\log\';


GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO EXP_FULL_DATABASE;

GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO auser;

GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO IMP_FULL_DATABASE;

In your script to import set these variables NLS_LANG

ORACLE_SID= your database name

impdp a_user_who_exists/your database name directory=DATA_PUMP_DIR network_link=original database name schemas= user1,user2 LOGFILE=DataPump.log TABLE_EXISTS_ACTION=REPLACE

kevinskio
  • 4,272
  • 1
  • 30
  • 50
2

Eventually I ran a procedure to list all the users and tablespaces, recreated them on the target database and when running the import, used the DESTROY=Y switch. This solved my problem.

Alexandre Sousa
  • 91
  • 1
  • 1
  • 4
1

Try this one in a command prompt:

cd \
imp user_name/password file=path+dump name full=y

Like this:

imp ccs_status/ccs file=D:\ccs_status.dmp full=y
Mat
  • 10,289
  • 4
  • 43
  • 40
Zaid Ahmad
  • 11
  • 1