How to import an oracle dump into a different tablespace

本文介绍如何将Oracle的DMP文件导入到不同的表空间中。首先使用特定命令创建包含表结构的SQL文件,并修改该文件以适应新的表空间设置。接着通过SQL Plus运行修改后的SQL文件来创建表结构,最后再导入DMP文件中的数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值