-------------------------------------------------- Database import and export--------------------------------------------------------- ---------
Major premise: When encountering an unknown oracle data source, you need to know its original tablespace name and original user name. Of course, it is best to know its encoding method, aha~~~
Before performing import and export, give the user dba permission or as many permissions as possible to avoid successful export and import due to permission restrictions
*, oracle exports all information under a user --exp
exp caetest/caetest@strongdb file='d:\test.dmp' owner=('caetest') full=y;
*, oracle imports all information under a user (same name) --imp
imp caetest/caetest@orcl file='d:\test.dmp' log='d:\caetest.log' full=y;
*, oracle imports all information under a user (different name) --imp
imp caetest/caetest@orcl fromuser=fromname touser=tonewname file='d:\test.dmp' log='d:\caetest.log' full=y;
*, oracle exports all information under a user --expdp
1. Query an existing directory select * from dba_directories; 2. Create or modify directory information (delete --drop directory expdpdir;) create or replace directory expdpdir as 'd:\'; 3. Give a user read and write permissions to a directory (to retrieve it with --revoke...from syntax) grant read , write on directory expdpdir to caetest; export operation expdp caetest/caetest@strongdb schemas=caetest dumpfile='x.dmp' directory=expdpdir (note no semicolon)
*, oracle imports all information under a user (same name) --impdp
impdp caetest/caetest dumpfile='x.dmp' directory=expdpdir schemas=caetest (note no semicolon)
*, oracle imports all information under a user (different name) --impdp
impdp caetest/caetest dumpfile='x.dmp' directory=expdpdir remap_schema=oldname:newname; (note no semicolon)
*, oracle is imported into a database with different username and tablespace name --impdp
impdp username/key dumpfile=XXX.dmp directory=dtname remap_schema=oldname:newname remap_tablespace=oldts:newts (note no semicolon)
*, oracle import and export remote database data
1. Building the foundation of communication 1.1. Modify the tnsnames.ora file of the server as follows: The file is generally in: *product\11.2.0\dbhome_1\NETWORK\ADMIN directory The instance name that will be referenced = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = Remote IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME=orcl-instancename) ) ) 1.2、若是客户端,打开net manager 创建一个服务命名-将引用的实例名称,主机IP为:*,服务名orcl,端口1521 二、测试是否配置成功 cmd下,执行命令:tnsping 将引用的实例名称 成功便会返回关键字:OK 三、实例名称写成-将引用的实例名称,然后执行导入导出即可
备注:远程操作之后,所有的文件路径以及文件最终所在的位置以操作的服务器为准,既远程导出后,文件还是在远程服务器上的目录下的。切记,切记,切记。
执行导入导出后记得收回相应的权限
--------------------------------------------------资源列表--------------------------------------------------------------
oracle数据库导入导出exp/imp
http://www.cnblogs.com/fjfzhkb/archive/2007/09/03/879807.html
oracle数据库导入导出expdp/impdp
http://blog.csdn.net/indexman/article/details/7849401
oracle数据库导入导出expdp/impdp-的目录操作
http://www.2cto.com/database/201304/203333.html
oracle导入导出配置远程信息
http://blog.chinaunix.net/uid-20980141-id-447996.html