oracle 匯入匯出

2021-09-01 09:04:15 字數 1257 閱讀 5688

oracle 的exp/imp命令用於實現對資料庫的匯出/匯入操作;

exp命令用於把資料從遠端資料庫伺服器匯出至本地,生成dmp檔案;

imp命令用於把本地的資料庫dmp檔案從本地匯入到遠端的oracle資料庫中。

--事例:

exp ibms/xx@ibms file=d:\daochu1.dmp full=y;

imp ibms/xx@xe fromuser=ibms touser=ibms file=d:/daochu1.dmp ignore=y;

--登入sqlplus

cmdsqlplus /nolog

conn system/admin@orcl

--建立表空間

create tablespace "ibms-data" logging datafile 'e:\oracle\product\10.2.0\oradata\orcl\mytbs01.dbf' size 500m autoextend on next 32m extent management local;

--刪除使用者

drop user ibms cascade;

--建立使用者

create user ibms identified by leap ;

--放開所有表空間

grant unlimited tablespace to ibms;

--給所有許可權

grant resource,connect,dba to ibms;

如果只想匯出一部分表:可以加上引數:

tables=(emp,dept,mgr)

或 tables=(t1: p1,t1: p2),如果 t1 是分割槽表

例如:exp system/manager@testdb file=e:\sampledb.dmp tables=(tablea,tableb)

將資料庫中的表tablea中的字段filed1 值為 "王五" 的資料匯出

exp system/manager@testdb file=e:\sampledb.dmp tables=(tablea) query=' where filed1='王五'

如果想對dmp檔案進行壓縮,可以在上面命令後面 加上 compress=y 來實現。

增量匯入    imp system./manager inctype= rectore full=y file=a

oracle匯出,匯入

匯出,在dos下執行 1.exp username userpassword databasename 可以是資料庫也可是遠端的,如username userpassword caac135 2.enter array fetch buffer size 4096 回車 3.export file ...

oracle匯入匯出

sqlplus system system egov create directory dump dir as d dbback exit expdp system system egov directory dump dir dumpfile urbanyw.dmp schemas urbanyw...

Oracle匯入匯出

最簡單 exp duser duser remote localinstancename owner duser file file path dmp imp duser duser remote localinstancename file file path dmp 詳細出處參考 win10下o...