Howto import an oracle dump in an different tablespace -


i want import oracle dump different tablespace.

i have tablespace used user a. i've revoked dba on user , given him grants connect , resource. i've dumped command

exp a/*** owner=a file=oracledump.dmp log=log.log compress=y

now want import dump tablespace b used user b. i've given him grants on connect , resource (no dba). i've executed following import:

imp b/*** file=oracledump.dmp log=import.log fromuser=a touser=b

the result log lots of errors:

imp-00017: following statement failed oracle error 20001: "begin dbms_stats.set_table_stats imp-00003: oracle error 20001 encountered ora-20001: invalid or inconsistent input values

after i've tried same import command option statistics=none. resulted in following errors:

ora-00959: tablespace 'a_tblspace' not exist

how should done?

note: lot of columns of type clob. looks problems have that.

note2: oracle versions mixture of 9.2, 10.1 , 10.1 xe. don't think has versions.

you've got couple of issues here.

firstly, different versions of oracle you're using reason table statistics error - had same issue when of our oracle 10g databases got upgraded release 2, , still on release 1 , swapping .dmp files between them.

the solution worked me use same version of exp , imp tools exporting , importing on different database instances. easiest using same pc (or oracle server) issue of exporting , importing commands.

secondly, suspect you're getting ora-00959: tablespace 'a_tblspace' not exist because you're trying import .dmp file full-blown oracle database 10g express edition (xe) database, which, default, creates single, predefined tablespace called users you.

if that's case, you'll need following..

  1. with .dmp file, create sql file containing structure (tables):

    imp <xe_username>/<password>@xe file=<filename.dmp> indexfile=index.sql full=y

  2. open indexfile (index.sql) in text editor can find , replace on entire file, , issue following find , replace statements in order (ignore single quotes.. '):

    find: 'rem<space>' replace: <nothing>

    find: '"<source_tablespace>"' replace: '"users"'

    find: '...' replace: 'rem ...'

    find: 'connect' replace: 'rem connect'

  3. save indexfile, run against oracle express edition account (i find it's best create new, blank xe user account - or drop , recreate if i'm refreshing):

    sqlplus <xe_username>/<password>@xe @index.sql

  4. finally run same .dmp file created indexfile against same account import data, stored procedures, views etc:

    imp <xe_username>/<password>@xe file=<filename.dmp> fromuser=<original_username> touser=<xe_username> ignore=y

you may pages of oracle errors when trying create objects such database jobs oracle try use same database identifier, fail you're on different database.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -