dbeaver导出表结构和数据_Oracle 导入导出表空间跟数据表通用操作笔记
1:如果要導入的用戶下有空表,需要執行下面語句
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
查詢出的數據拷出來,再次執行
2:cmd進入命令,導出
導出用戶所有的表到D盤:exp aa/1234 file=D:biao.dmp owner=aa;
導出用戶aa中的表dept到D盤:exp aa/1234 file=d:dept.dmp tables=(dept);
導出用戶aa中的表dept,emp到D盤:exp aa/1234 file=d:dept.dmp tables=(dept,emp);
3:刪除原有用戶
在cmd中輸入
sqlplus / as sysdba
drop user aa cascade
4:創建用戶
create user aa identified by 1234;(aa:用戶名,1234:密碼)
grant dba,connect to aa;-----授權
5:導入
將D盤的biao.dmp導入到用戶bb中:
imp aa/1234 file=d:biao.dmp full=y
imp whjyj/whjyj file=d:ckprojectwhjyjbiao.dmp full=y
將用戶aa中表dept中的數據導入到用戶bb的dept表中:
imp bb/1234 file=d:dept.dmp tables=(dept) ignore=y full=y
總結:
exp smart/smart file=D:smart.dmp owner=smart;
drop user whjyj cascade;
create user smart identified by smart;
grant dba,connect to smart;
imp smart/smart file=d:smart.dmp full=y;
select * from all_tables where owner='whjyj' 查看當前用戶所有表
drop user user_name cascade;刪除用戶以及表數據
create tablespace whjyj datafile ‘E:appAdministratorwhjyj.dbf’ size 100M; 創建表空間
create user whjyj identified by whjyj default tablespace whjyj; 創建用戶并且分配表空間
grant dba,connect to whjyj; 授權
總結
以上是生活随笔為你收集整理的dbeaver导出表结构和数据_Oracle 导入导出表空间跟数据表通用操作笔记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python在线翻译代码_Python
- 下一篇: python爬虫自学路线_python