orcle 資料庫plsql cmd資料的匯入匯出

2021-08-19 18:31:15 字數 1485 閱讀 5287

1.plslq資料匯出

(1)匯出資料庫表結構

(2)匯出表資料

(3)匯入:

注意:在使用plsql匯入.sql資料表結構時,如果本地新建使用者或者表空間與匯出檔案裡邊的使用者名稱或者表空間不一樣,那麼會匯入失敗,檢查匯入檔案.sql裡邊的使用者名稱及表空間名,修改後再匯入。

二. cmd 匯出匯入

1.匯出

1).將資料庫test完全匯出,使用者名稱system 密碼manager 匯出到d:\daochu.dmp中

exp system/manager@test file=d:\daochu.dmp full=y

2).將資料庫中system使用者與sys使用者的表匯出

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

3).將資料庫中的表table1 、table2匯出

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

4).將資料庫中的表table1中的字段filed1以"00"打頭的資料匯出

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

如果是匯出遠端資料庫,需要在test前加上ip,如system/[email protected]/test

2.匯入

1).將d:\daochu.dmp 中的資料匯入 orcl資料庫中。

imp system/[email protected]:1521/orcl file=d:\daochu.dmp  full=y  ignore=y

2).將d:\daochu.dmp中的表table1 匯入

imp system/manager@test file=d:\daochu.dmp tables=(table1)

orcle資料庫管理表操作

1.建立表 最基本的 create table t1 id number 4 name varchar2 20 備份 create table t2 as t1 只複製表結構不複製內容 create table t3 as t1 where 1 2 條件為假 2.修改表 增加一列 alter tab...

orcle資料庫修改字段精度

oracle資料庫字段精度修改 方法 通過乙個臨時的字段修改原有的字段精度 1,將原欄位修改改變名稱 2,新建字段設定精度並將原字段的資料複製到該字段中 3,刪除原字段的備份字段 修改原欄位名test age為test age tmp alter table test table rename co...

ORCLE10g 資料庫定時任務

如果想讓oracle 資料庫定時執行乙個什麼任務,可以用如下的方法實現 上例子 準備東西 create table t3 k integer primary key,d date 例子表 create sequence seq test start with 1 increment by 1 例子序...