Oracle expdp/impdp用法

本文详细介绍了一种Oracle数据库的迁移流程,包括创建目录映射、导出数据、迁移数据到新服务器及导入数据等步骤。

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

<!--[if !supportLists]-->1.       <!--[endif]-->Go to the oracle server AMX currently used, execute

[oracle@lnxas4-ce2 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 12 07:18:47 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> connect /as sysdba

Connected.

SQL> create or replace directory bakdir as '/home/oracle/bak';

Directory created.

SQL> grant read,write on directory bakdir to qsh05;   

Grant succeeded.

SQL> exit

'/home/oracle/bak' is where to save database dump file, and ‘qsh05’ is database username.

<!--[if !supportLists]-->2.       <!--[endif]-->Make sure '/home/oracle/bak' is created, then execute

expdp qsh05/qsh05 dumpfile=qsh05.dmp directory=bakdir include=table

‘qsh05/qsh05’ is database username/password, and ‘dumpfile’ is the file name of database dump file, and ‘directory’ is the directory name created in step 1, because only need export table, so add ‘include=table’.

<!--[if !supportLists]-->3.       <!--[endif]-->If the export is successful, the end of log looks like following,

Dump file set for QSH05.SYS_EXPORT_SCHEMA_01 is:

  /home/oracle/bak/qsh05.dmp

Job "QSH05"."SYS_EXPORT_SCHEMA_01" successfully completed at 07:25:30

and go to /home/oracle/bak, there are two files, ‘qsh05.dmp’ and ‘export.log’.

<!--[if !supportLists]-->4.       <!--[endif]-->Go to the ORACLE server where the AMX wanted to migrate, and create a new user/password in database.

<!--[if !supportLists]-->5.       <!--[endif]-->Create a new dir, and create a new directory mapping to this dir as step 1.

<!--[if !supportLists]-->6.       <!--[endif]-->Copy dump file to the dir created in step 5, then execute

impdp new_user/new_pass remap_schema=qsh05:new_user dumpfile=qsh05.dmp directory=new_directory include=table

<!--[if !supportLists]-->7.       <!--[endif]-->If the import is successful, the end of log looks like following,

Job "QSH07"."SYS_IMPORT_FULL_01" successfully completed at 17:46:55

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值