达梦V8的逻辑导出与导入思维导图![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f63cc8e1237888c6a1b0dd36ba41ed87.png)
常用导出脚本
---最普通的导出
dexp USERID=SYSDBA/SYSDBA FULL=Y file=db_full.dmp LOG=db_full.log DIRECTORY=/dm8/expimp FILESIZE=128m
---带并行的导出
dexp USERID=SYSDBA/SYSDBA FULL=Y file=db_full%U.dmp LOG=db_full%U.log DIRECTORY=/dm8/expimp/full_filesize FILESIZE=128m PARALLEL=4 TABLE_PARALLEL=4
---制造大表
begin
for i in 1..10 loop
insert into testu.BOOKINFO_BAK select * from testu.BOOKINFO_BAK;
commit;
end loop;
end;
/
select OWNER,TABLE_NAME,TABLESPACE_NAME from dba_tables where TABLE_NAME like 'BOOK%';
---当前库有105G
---128M*99个=只能导出12.375G,所以报错
dexp USERID=SYSDBA/SYSDBA FULL=Y file=db_full%U.dmp LOG=db_full%U.log DIRECTORY=/dm8/expimp/full_filesize FILESIZE=128m
---当前库有105G
---开4个并行,表开4个并行,大概花费:all the export process spent total 2426.117 s
dexp USERID=SYSDBA/SYSDBA FULL=Y file=db_full%U.dmp LOG=db_full%U.log DIRECTORY=/dm8/expimp/full_filesize FILESIZE=2048m PARALLEL=4 TABLE_PARALLEL=4
---当前库有105G
---无并行,大概花费:all the export process spent total 2309.595 s
dexp USERID=SYSDBA/SYSDBA FULL=Y file=db_full%U.dmp LOG=db_full%U.log DIRECTORY=/dm8/expimp/full_filesize FILESIZE=2048m
---使用表的用户名testu登录执行导出
dexp userid=testu/abcdef123456 tables=bookinfo file=db_testu_bookinfo%u.dmp log=db_testu_bookinfo%u.log directory=/dm8/expimp/full_filesize filesize=2048m
---使用超级用户sysdba导出普通用户testu,某个表
dexp userid=SYSDBA/SYSDBA tables=testu.bookinfo file=db_testu_bookinfo%u.dmp log=db_testu_bookinfo%u.log directory=/dm8/expimp/full_filesize filesize=2048m
---使用超级用户sysdba导出普通用户testu,多个表
dexp userid=SYSDBA/SYSDBA tables=testu.bookinfo,testu.bookinfo2 file=db_testu_bookinfo_2%u.dmp log=db_testu_bookinfo_2%u.log directory=/dm8/expimp/full_filesize filesize=2048m
---使用超级用户sysdba导出普通用户testu,匹配bookinfo开头的表
---FUZZY_MATCH TABLES 选项是否支持模糊匹配(N)
dexp userid=SYSDBA/SYSDBA tables=testu.bookinfo% file=db_testu_bookinfo_n%u.dmp log=db_testu_bookinfo_n%u.log directory=/dm8/expimp/full_filesize filesize=2048m FUZZY_MATCH=y
---FUZZY_MATCH 和exclude 冲突了,exclude没有生效
dexp userid=SYSDBA/SYSDBA exclude=tables:testu.BOOKINFO_BAK tables=testu.bookinfo% file=db_testu_bookinfo_ne%u.dmp log=db_testu_bookinfo_ne%u.log directory=/dm8/expimp/full_filesize filesize=2048m FUZZY_MATCH=y
---虽然写的是owner,导出回显schema[TESTU] export terminate.
dexp userid=SYSDBA/SYSDBA exclude=tables:testu.BOOKINFO_BAK owner=testu file=db_testu_bookinfo_o%u.dmp log=db_testu_bookinfo_o%u.log directory=/dm8/expimp/full_filesize filesize=2048m
---写的是schema,导出回显schema[TESTU] export terminate.....
dexp userid=SYSDBA/SYSDBA exclude=tables:testu.BOOKINFO_BAK SCHEMAS=testu file=db_testu_bookinfo_s%u.dmp log=db_testu_bookinfo_s%u.log directory=/dm8/expimp/full_filesize filesize=2048m
更多资讯 达梦社区 https://eco.dameng.com