国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

oracle數據庫的導入導出

2019-11-09 13:41:02
字體:
來源:轉載
供稿:網友

Oracle數據庫導出有4種模式:ful(全庫導出),owner(用戶導出),table(表導出),tablespace(表空間導出)。

 

1、數據常用導出命令

①將數據庫TEST完全導出,用戶名system密碼manager,導出到/tmp/daochu.dmp中

exp system/manager@TEST  file=/tmp/daochu.dmp  full=y  (全庫導出)

exp xtjg_user/123456@ORCL  file=/tmp/XTJG.dmp  默認導出連接數據庫的用戶數據庫對象

 

②將數據庫中system用戶和sys用戶的表導出

exp system/manager@TEST file=d:/daochu.dmp owner=(system,sys)

 

③將數據庫中的表table1 、table2導出

exp system/manager@TEST file=d:/daochu.dmp tables=(table1,table2)

 

④ 將數據庫中的表table1中的字段filed1以"00"打頭的數據導出

exp system/manager@TEST file=d:/daochu.dmp tables=(table1)query=/" where filed1 like '00%'/"

2、導入dmp命令

在導入dmp文件時候,通常我們需要新建一個用戶來導入,新用戶需要一個表空間和一個臨時表空間。

 

表空間是數據庫的邏輯劃分,一個表空間只能屬于一個數據庫。所有的數據庫對象都存放在指定的表空間中。但主要存放的是表,所以稱作表空間。Oracle臨時表空間主要用來做查詢和存放一些緩沖區數據。臨時表空間,可自動釋放;而表空間中存儲表數據、函數、過程、序列等。是隨數據庫永久存在的。

 

新建臨時表空間:

create temporary tablespace user_temp

tempfile '/usr/local/oradata/orcl/user_temp.dbf'

size 50m

autoextend on

next 50m maxsize 20480m

extent management local;

 

新建表空間:

create tablespace xtjg

logging

datafile '/usr/local/oradata/orcl/xtjg.dbf'

size 50m

autoextend on ;

 

新建用戶:

create user xtjg_user identified by 123456  

default tablespace xtjg

temporary tablespace user_temp;

 

授權新用戶:

grant connect,resource to user_name;

grand dba to user_name;

 

導入dmp文件:

imp user_name/user_passWord@SID file=F:/xxx.dmp full=y;

如:imp xtjg_user/123456@orcl   file=/home/software/XTJG.dmp full=y;

 

備注:

1、關于full=y參數

 

①oracle exp命令中的full參數

full=y(全庫導出): 導出除ORDSYS,MDSYS,CTXSYS,ORDPLUGINS,LBACSYS這些系統用戶之外的所有用戶的數據.

full=n或不加full:默認導出連接數據庫的用戶數據庫對象.

②oracle imp命令中的full參數

Full=y  導入一個完整的數據庫

 

2、刪除命令

刪除用戶:

drop user user_name cascade;

刪除表空間和臨時表空間:

drop tablespace tablespace_name including contents;

 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 昭觉县| 凤台县| 辽源市| 偃师市| 乌兰察布市| 禹城市| 滨州市| 顺平县| 天峻县| 会宁县| 天门市| 赣榆县| 贵州省| 永仁县| 临洮县| 久治县| 高雄市| 习水县| 龙陵县| 牟定县| 荔波县| 三明市| 台山市| 黄浦区| 五家渠市| 香格里拉县| 龙川县| 石楼县| 阿拉尔市| 文水县| 舞钢市| 株洲市| 宝应县| 连南| 澄城县| 蒙阴县| 清新县| 阳泉市| 三穗县| 玉树县| 宁陕县|