Oracle数据库导入与导出

给空表配空间语句 

1. select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null

数据库导出导入语句:  

1.导出 :exp 用户名/密码@远程库地址:端口/全局数据库 file=c:xxx.dmp owner=用户名 log=c:xxx.log(用于打印导出日志) tables=表名1,表名2,表名3(用于导出特定表)  

2.导入 :imp xxx_xx/xxxx@192.168.1.174:1521/orcl file=c:databasexxxx_xx_0809.dmp full=y 

cmd脚本:

exp test_jf/gangzi@localhost:1521/orcl file=E: empdb_gz.dmp
pause

imp test_jf/gangzi@localhost:1521/orcl file=C:UsersAdministratorDesktopjf.dmp full=y log=C:UsersAdministratorDesktopjf.log
pause 

删除指定用户的所有表

 drop user gangzi_nx cascade;

imp bclrms_tn/xxx@127.0.0.1:1521/orcl file=D:database_dmp n_bf20200811112325.dmp full=y

原文地址:https://www.cnblogs.com/gangzi4321/p/13474485.html