Search This Blog

Showing posts with label IMP. Show all posts
Showing posts with label IMP. Show all posts

Saturday, January 5, 2008

During import table created in wrong tablespace.

During import table is created in other than default tablespace is happen what is reason.
Suppose we have two databases.
1. Orcl
2. Hgc

Now i created one table in ORCL database in SYSTEM tablespace.

SQL> create table test_orcl ( no number) tablespace SYSTEM;
Table created.

Now in HGC database i import above created table in user default tablespace.

SQL> conn system/oracle@hgc
Connected.
SQL> alter user scott default tablespace USERS;
User altered.

NOTE:
1. I assign default tablespace "USERS" to scott user which import table.
2. Scott user having "connect" & "resource" role privileges

Question: NOW TELL me during IMPORT in which tablespace "USERS" or "SYSTEM" tbs table "test_orcl" created ?

NOW guess your answer..we will check later ...

SQL> conn scott/tiger@Orcl
Connected.
SQL> host exp scott/tiger@Orcl file=c:\test_orcl.dmp tables=test_orcl
Export: Release 10.1.0.5.0 - Production on Wed Jan 2 11:59:18 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
. . exporting table TEST_ORCL 0 rows exported
Export terminated successfully without warnings.

NOW import table in HGC database.

SQL> conn scott/tiger@HGC
Connected.
SQL> host imp scott/tiger@HGC file=c:\test_orcl.dmp fromuser=scott touser=scott
Import: Release 10.1.0.5.0 - Production on Wed Jan 2 12:02:26 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
. . importing table "TEST_ORCL" 0 rows imported
Import terminated successfully without warnings.

now we check in which tablespace table is created ?

SQL> select table_name,tablespace_name
2 from user_tables
3 where table_name='TEST_ORCL';
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TEST_ORCL SYSTEM

ofh table is created in SYSTEM tablespace instead of user default tablespace means "USERS' why it so ?

Again import table but now make one changes ...
1. Revoke "resource" role and grant explicit quota on tablespace to user.

SQL> conn system/oracle@hgc
Connected.
SQL> revoke resource from scott;
Revoke succeeded.
SQL> alter user scott quota 100m on users;
User altered.

NOW import again...

SQL> conn scott/tiger@hgc
Connected.
SQL> drop table test_orcl purge;
Table dropped.
SQL> host imp scott/tiger@HGC file=c:\test_orcl.dmp fromuser=scott touser=scott
Import: Release 10.1.0.5.0 - Production on Wed Jan 2 12:06:51 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
. . importing table "TEST_ORCL" 0 rows imported
Import terminated successfully without warnings.

SQL> select table_name,tablespace_name
2 from user_tables
3 where table_name='TEST_ORCL';
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
TEST_ORCL USERS

But what is actual reason...?
1. Resource role having "unlimited tablespace" privileges means database user have quota on all tablespace in database if user having "unlimited tablespace" privileges.

2. table is created in "system" tablespace becuase tables is actually created in SYSTEM tablespace on "ORCL" database during first time creation.

Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
"CREATE TABLE "TEST_ORCL" ("NO" NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 1 MA"
"XTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL "
"DEFAULT) TABLESPACE "SYSTEM" LOGGING NOCOMPRESS"
. . skipping table "TEST_ORCL"

Tuesday, October 16, 2007

IMP-00032;IMP-00008

During Import process if you will get below error message

IMP-00032: SQL statement exceeded buffer length
IMP-00008: unrecognized statement in the export file:


Solutions

use BUFFER parameter with import command.
Note: use MAXIMUM value for BUFFER parameters eg: BUFFER=1000000

Wednesday, April 4, 2007

IMP-00010


IMP-00010: not a valid export file, header failed verification.



Main Reason :
1.File Corrupted During Transfer.
Note : FTP should be done in BINARY MODE

2.When export dump file is higher version and import in lower version.
example:
export dump file is Oracle 9i
and import in Oracle 8i


Export From <-----> Import to <-----> Use Import/Export Utility
Version : 10.2.0.1.0 <-----> 10.1.0.2.0 <-----> 10.1.0.2.0
Version : 10.2.0.1.0 <-----> 9.2 <-----> 9.2
Version : 10.2.0.1.0 <-----> 9.0.1 <-----> 9.0.1
Version : 10.2.0.1.0 <-----> 8.1.7 <-----> 8.1.7
Version : 10.2.0.1.0 <-----> 8.0.6 <-----> 8.0.6



Note : Use Suppose you want to import 10.2.0.1.0 export dump file in 8.1.7
then you must use 8.1.7 export tools for export data from 10.2.0.1.0.
and run CATEXP.SQL script.
Located : $ORACLE_HOME/rdbms/admin
Install Oracle 9i client and client Oracle 9i client to Oracle 10g server and export
your database.



Export From <-----> Import to <-----> Use Import/Export Utility
Version : 10.1.0.2.0 <-----> 9.2 <-----> 9.2
Version : 10.1.0.2.0 <-----> 9.0.1 <-----> 9.0.1
Version : 10.1.0.2.0 <-----> 8.1.7 <-----> 8.1.7
Version : 10.1.0.2.0 <-----> 8.0.6 <-----> 8.0.6


Export From <-----> Import to <-----> Use Import/Export Utility
Version : 9.2.0.1.0 <-----> 9.0.1 <-----> 9.0.1
Version : 9.2.0.1.0 <-----> 8.1.7 <-----> 8.1.7
Version : 9.2.0.1.0 <-----> 8.0.6 <-----> 8.0.6
Version : 9.2.0.1.0 <-----> 7.3.4 <-----> 7.3.4 plus run catexp7.sql



Export From <-----> Import to <-----> Use Import/Export Utility
Version : 9.0.1.1.2 <-----> 8.1.7 <-----> 8.1.7
Version : 9.0.1.1.2 <-----> 8.0.6 <-----> 8.0.6
Version : 9.0.1.1.2 <-----> 7.3.4 <-----> 7.3.4 plus run catexp.sql


Export From <-----> Import to <-----> Use Import/Export Utility
Version : 8.1.7.4 <-----> 8.0.6 <-----> 8.0.6



Export From <-----> Import to <-----> Use Import utility
Version : 8.1.7.4 <-----> 10.2.0.1.0 <-----> 10.2.0.1.0
Version : 9.0.1.1.2
Version : 9.2.0.1.0
Version : 10.1.0.2.0
Version : 10.2.0.1.0

Export From <-----> Import to <-----> Use Import utility
Version : 8.1.7.4 <-----> 9.2.0.1.0 <-----> 9.2.0.1.0
Version : 9.0.1.1.2
Version : 9.2.0.1.0

Export From <-----> Import to <-----> Use Import utility
Version : 8.1.7.4 <-----> 9.0.1.1.2 <-----> 9.0.1.1.2
Version : 9.0.1.1.2

Above procedure and table is best practice to export and import but also consider below case.

Dumpfile exported in Oracle 11gr1

Import in 10gr1, 9i, 8i

Then use Oracle 11gr1 client (IMPORT) binary to export 11g dumpfile.

Install oracle 11g client and connect to 10g,9i,8i server and import.

Dumpfile exported in Oracle 10g

Import in 9i,8i

Then use Oracle 10g client (IMPORT) binary to export 10g dumpfile

Install oracle 10g client and connect to 9i,8i server and import.

Dumpfile exported in Oracle 9i

Import in 8i

Then use Oracle 9i client (IMPORT) binary to export 9i dumpfile

Install oracle 9i client and connect to 8i server and import.


Tuesday, January 30, 2007

Import Error

1.IMP-00058; ORA-00904;
clause : Table Defination changed.
Suggestion : imp + show=y check table defination.

2.IMP-00019; IMP-00003; ORA-01722;
clause : Table.column DATATYPE is changed
Suggestion : imp + show=y check table.column DATATYPE

3.IMP-00003; ORA-01114; IMP-00017; ORA-O1115; OSD-04026; ORA-27069;
OS Platform :-> UNIX
Suggestion : ULIMIT is low.increase and try again.

4.IMP-00046; IMP-00008; IMP-00051;
Suggestion : use DIRECT=n and use BINARY MODE for transfer dump file through FTP.