How to import an oracle dump into a different tablespace

来源:互联网 发布:万国数据 待遇 编辑:程序博客网 时间:2024/05/18 02:41
  1. With your .DMP file, create a SQL file containing the structure (Tables):  (The default path of the index file is C:\Users\Administrator)

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

  2. Open the indexfile (index.sql) in a text editor that can do find and replace over an entire file, and issue the following find and replace statements IN ORDER (ignore the single quotes.. '):

    Find: 'REM<space>' Replace: <nothing>

    Find: '"<source_tablespace>"' Replace: '"<Your_tablespace>"'

    Find: '...' Replace: 'REM ...'

    Find: 'CONNECT' Replace: 'REM CONNECT

  3. Save the indexfile, then run it against your Oracle Express Edition account (I find it's best to create a new, blank XE user account - or drop and recreate if I'm refreshing):   sqlplus <xe_username>/<password>@XE @index.sql

  4. Finally run the same .DMP file you created the indexfile with against the same account to import the data, stored procedures, views etc:

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


Original Blog: http://stackoverflow.com/questions/61963/howto-import-an-oracle-dump-in-an-different-tablespace
0 0
原创粉丝点击