linux下oracle資料的匯入匯出

2021-06-22 10:19:25 字數 1019 閱讀 3759

資料庫的匯入匯出方法

首先說一下匯入匯出的關鍵字:匯出exp、匯入imp 這兩個關鍵字是不能再sqlplus中執行的,實在登入狀態下執行的

1、匯出資料

將例項名為ihis下完全匯出,登入使用者是username,密碼是password,file是匯出檔案的存放位址命令如下

exp username/[email protected]/ihis file=/home/oracle/daochu.dmp full=y--->這是資料庫ihis下所有表的資料都匯出

如果只想匯出ihis下的名叫test的表的資料,命令如下

exp username/[email protected]/ihis file=/home/oracle/daochu.dmp tables=test 

如果想匯出多個資料庫下面的表,命令如下

exp username/password@ihis file=/home/oracle/daochu.dmp owner=(username,sys)

如果想匯出ihis下表test中的字段field以」0812112「開頭的資料,命令如下

exp username/password@ihis file=/home/oracle/daochu.dmp tables=test query=\"where field like '0812112%'\"

注:如果需要匯出許可權關係,可使用grants=y

2、匯入資料

將/home/oracle/daochu.dmp中的所有資料匯入,命令如下

imp username/password@ihis file=/home/oracle/daochu.dmp ignore=y full=y

如果是想匯入其中的乙個表,命令如下

imp username/password@ihis file=/home/oracle/daochu.dmp tables=test ignore=y full=y

注:ignore:當匯入的表和資料庫中的表有重複的時候會報錯,加上ignore表示忽略

full:表示全部

Linux 下匯入匯出oracle資料

切換到oracle使用者 su oracle 設定編碼,服務端和客戶端的編碼要保持一致,否則中文會亂碼 export nls lang simplified chinese china.al32utf8 登入oracle客戶端 select table name from user tables 登...

linux下Oracle實現資料的自動備份

由於近期工作的原因,要做乙個簡單的oracle資料自動備份,因為是乙個單體應用,所以就利用了linux的定時任務和oracle的exp進行資料備份,如果有不足和需要改正的地方,歡迎各位高手指正,不勝感激。下邊就開始具體的操作 mkdir p u01 oracle bak data 新建資料備份目錄 ...

Linux下的Oracle操作

su oracle lsnrctl start sqlplus nolog conn user pass startup shutdown immediate imp dba許可權 expimp 先刪除使用者,再建立使用者,賦許可權,再建立序列 drop user username cascade ...