一、逻辑导出导入使用案例
1、普通用户导出其它模式的表
1)创建用户test_user
create USER test_dexp IDENTIFIED by testdexp;
grant create SESSION to test_dexp;
2)使用test_dexp导出RESOURCES.EMPLOYEE_DEPARTMENT表
dexp test_dexp/testdexp file=table1.dmp log=table1.log tables=RESOURCES.EMPLOYEE_DEPARTMENT;
说明权限不够,授予如下权限
grant select on RESOURCES.EMPLOYEE_DEPARTMENT to test_dexp;
grant select for dump on RESOURCES.EMPLOYEE_DEPARTMENT to test_dexp;
再次导出
发现成功导出数据。
2、验证是否支持跨模式导入
在次,直接使用SYSDBA演示
1)导出模式TEST
dexp sysdba/SYSDBA file=schematest.dmp log=schematest.log schemas=TEST;
2)新建模式
create schema testdimp;
3)导入到testdimp模式下
dexp sysdba/SYSDBA file=schematest.dmp log=schematest.log remap_schema=TEST:TESTDIMP;
可以看到能够导入
3、验证是否支持部分表导入
首先删除testdimp模式,创建空模式testdimp
drop schema testdimp cascade;
导入一张表
dimp sysdba/SYSDBA file=schematest.dmp log=schematest.log remap_schema=TEST:TESTDIMP tables=TEST.T01_TRI_10000;
发现能导入。
4、验证表按条件导出
dexp sysdba/SYSDBA tables=RESOURCES.EMPLOYEE_DEPARTMENT file=test2.dmp log=test2.log query="WHERE STARTDATE > to_date('2001-02-01')";
发现能导出。