Pichaimani, May 02, 2001 - 4:57 pm UTC
Hi Tom,
Thanks a lot for all these wonderful case scenarios and solutions. I've really started enjoying working in Oracle.
Helena Markova, November 20, 2001 - 2:55 am UTC
partitioning
Anna, August 19, 2002 - 7:08 pm UTC
Tom, do you have any trick like this for cases when export was done from partitioned table and target server does not have partitioning enabled?
August 20, 2002 - 7:32 am UTC
I don't have any instances without partitiong but I did do this:
ops$tkyte@ORA817DEV.US.ORACLE.COM> CREATE TABLE t
2 (
3 x int primary key,
4 collection_year int
5 )
6 PARTITION BY RANGE (COLLECTION_YEAR) (
7 PARTITION PART_95 VALUES LESS THAN (1996) ,
8 PARTITION PART_96 VALUES LESS THAN (1997) ,
9 PARTITION PART_97 VALUES LESS THAN (1998) ,
10 PARTITION PART_98 VALUES LESS THAN (1999) ,
11 PARTITION PART_99 VALUES LESS THAN (2000) ,
12 PARTITION PART_00 VALUES LESS THAN (2001) ,
13 PARTITION PART_01 VALUES LESS THAN (MAXVALUE)
14 )
15 ;
Table created.
ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM>
ops$tkyte@ORA817DEV.US.ORACLE.COM> insert into t
2 select rownum, 1995+mod(rownum,7) from all_objects;
23620 rows created.
ops$tkyte@ORA817DEV.US.ORACLE.COM> commit;
Commit complete.
ops$tkyte@ORA817DEV.US.ORACLE.COM> !exp userid=/ tables=t
Export: Release 8.1.7.4.0 - Production on Tue Aug 20 07:29:03 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
Export done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table T
. . exporting partition PART_95 3374 rows exported
. . exporting partition PART_96 3375 rows exported
. . exporting partition PART_97 3375 rows exported
. . exporting partition PART_98 3374 rows exported
. . exporting partition PART_99 3374 rows exported
. . exporting partition PART_00 3374 rows exported
. . exporting partition PART_01 3374 rows exported
Export terminated successfully without warnings.
ops$tkyte@ORA817DEV.US.ORACLE.COM> drop table t;
Table dropped.
<b>
ops$tkyte@ORA817DEV.US.ORACLE.COM> create table t ( x int, collection_year int );
Table created.
ops$tkyte@ORA817DEV.US.ORACLE.COM> !imp userid=/ tables=t ignore=y
</b>
Import: Release 8.1.7.4.0 - Production on Tue Aug 20 07:29:29 2002
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Connected to: Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production
Export file created by EXPORT:V08.01.07 via conventional path
import done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character set
. importing OPS$TKYTE's objects into OPS$TKYTE
. . importing partition "T":"PART_95" 3374 rows imported
. . importing partition "T":"PART_96" 3375 rows imported
. . importing partition "T":"PART_97" 3375 rows imported
. . importing partition "T":"PART_98" 3374 rows imported
. . importing partition "T":"PART_99" 3374 rows imported
. . importing partition "T":"PART_00" 3374 rows imported
. . importing partition "T":"PART_01" 3374 rows imported
Import terminated successfully without warnings.
ops$tkyte@ORA817DEV.US.ORACLE.COM> select count(*) from t;
COUNT(*)
----------
23620
Have you tried using ignore=y on a pre-created table?
This would be a lifesaver if I could get it to work!
Janine Sisk, September 17, 2002 - 1:52 pm UTC
The column I am trying to drop is a LOB column, and it's just not working for me. I've followed the steps - renamed the table, created the view (matching each dummy value selected to the datatype of its column), created the trigger, and imp'd just that file. Everything looks fine, but it always fails with ORA-00932: inconsistent datatypes, and no rows are inserted into the table.
I'm guessing this has something to do with the way imp handles LOB data. Very frustrating!
September 17, 2002 - 8:04 pm UTC
Yes, as you can imagine -- LOBS and LONGS are "special" and take some very special handling.
You'll need to imp into a table -- rename the table and then CREATE NEW_TABLE as select from this table to perform any sort of conversions.
reader
A reader, September 09, 2005 - 11:35 am UTC
Is the instead of trigger strategy work efficiently,
if we want to import from export taken from a table with
name table1 from another database to table with name table2,
both have identical structure. The export have
large volume of data
September 09, 2005 - 11:41 am UTC
if they have the same structure, a view without any triggers would be sufficient.
reader
A reader, September 09, 2005 - 12:35 pm UTC
Thanks
reader
A reader, September 10, 2005 - 10:45 am UTC
If I use the view strategy to imp to table with another
name, I found that it is necessary to grant "create table"
privilege to the importer, because it seems oracle before
importing and finds the view, wants to make sure the
importing user ( user where objects will be
imported ) has the privilege to create table.
Is there a way to get around this. I like to give
absolute necessary permissions if possible
September 10, 2005 - 11:47 am UTC
It is not that it checks to see if you have the privilege, it is that it tries to create the table, that fails with ORA-01031 and NOT ORA-00955.
It therefore fails (ignore=y doesn't come into play)
They will need create table via a grant or a role they are granted.
reader
A reader, September 13, 2005 - 9:48 am UTC
what will be the minimum grants needed for
imp as well as exp of objects owned by user (ex: u1) other
than the user (ex: u2) who is running imp, exp
September 13, 2005 - 12:26 pm UTC
depends on what you are trying to import - could be create sequence, create table, create function , etc etc etc.
reader
A reader, September 13, 2005 - 11:10 am UTC
The test I performed on imp, reveals that, if any user
can insert into a database table (ex:u1.t1), that user
will be able imp data into the database table (ex:u1.t1)
as well.
I am trying to find the minimum grants for exp
a database object of another user
September 13, 2005 - 12:49 pm UTC
no, they would need create table -- else the attempted table create imp will do fails (even with ignore=y)
reader
A reader, September 13, 2005 - 4:58 pm UTC
"
depends on what you are trying to import - could be create sequence, create
table, create function , etc etc etc.
"
As for exp, I tried to grant to an user the individual
privs from EXP_FULL_DATABASE the following
5 sys privs
27 table privs
and 2 role_privs
Still could not exp table owned by another user.
However if I grant EXP_FULL_DATABASE, I can
Also for some reason not able to grant the following
SQL> grant "ADMINISTER RESOURCE MANAGER" to user1;
grant "ADMINISTER RESOURCE MANAGER" to user1
*
ERROR at line 1:
ORA-01919: role 'ADMINISTER RESOURCE MANAGER' does not exist