Oracle 數(shù)據(jù)庫導(dǎo)出(exp)/ 導(dǎo)入(imp)

          簡說Oracle 數(shù)據(jù)庫導(dǎo)出(exp)/ 導(dǎo)入(imp)

          exp
          將數(shù)據(jù)庫內(nèi)的各對象以二進制方式下載成dmp 文件,方便數(shù)據(jù)遷移。
          buffer :下載數(shù)據(jù)緩沖區(qū),以字節(jié)為單位,缺省依賴操作系統(tǒng)
          consistent :下載期間所涉及的數(shù)據(jù)保持read only,缺省為n
          direct :使用直通方式,缺省為n
          feeback :顯示處理記錄條數(shù),缺省為0,即不顯示
          file:輸出文件,缺省為expdat.dmp
          filesize:輸出文件大小,缺省為操作系統(tǒng)最大值
          indexes:是否下載索引,缺省為n,這是指索引的定義而非數(shù)據(jù),exp 不下載索引數(shù)據(jù)
          log:log 文件,缺省為無,在標(biāo)準(zhǔn)輸出顯示
          owner:指明下載的用戶名
          query:選擇記錄的一個子集
          rows:是否下載表記錄
          tables:輸出的表名列表
          導(dǎo)出整個實例
          exp dbuser/oracle file=oradb.dmp log=oradb.log full=y consistent=y direct=y
          user 應(yīng)具有dba 權(quán)限
          導(dǎo)出某個用戶所有對象
          exp dbuser/oracle file=dbuser.dmp log=dbuser.log owner=dbuser buffer=4096000 feedback=10000
          導(dǎo)出一張或幾張表
          exp dbuser/oracle file=dbuser.dmp log=dbuser.log tables=table1,table2 buffer=4096000
          feedback=10000
          導(dǎo)出某張表的部分?jǐn)?shù)據(jù)
          exp dbuser/oracle file=dbuser.dmp log=dbuser.log tables=table1 buffer=4096000 feedback=10000
          query=\”where col1=\’…\’ and col2 \<…\”
          不可用于嵌套表
          以多個固定大小文件方式導(dǎo)出某張表
          exp dbuser/oracle file=1.dmp,2.dmp,3.dmp,… filesize=1000m tables=emp buffer=4096000
          feedback=10000
          這種做法通常用在:表數(shù)據(jù)量較大,單個dump 文件可能會超出文件系統(tǒng)的限制
          直通路徑方式
          direct=y,取代buffer 選項,query 選項不可用
          有利于提高下載速度
          consistent 選項
          自export 啟動后,consistent=y 凍結(jié)來自其它會話的對export 操作的數(shù)據(jù)對象的更新,這樣可以保證
          dump 結(jié)果的一致性。但這個過程不能太長,以免回滾段和聯(lián)機日志消耗完
          imp
          將exp 下載的dmp 文件上載到數(shù)據(jù)庫內(nèi)。
          buffer:上載數(shù)據(jù)緩沖區(qū),以字節(jié)為單位,缺省依賴操作系統(tǒng)
          commit:上載數(shù)據(jù)緩沖區(qū)中的記錄上載后是否執(zhí)行提交
          feeback :顯示處理記錄條數(shù),缺省為0,即不顯示
          file:輸入文件,缺省為expdat.dmp
          filesize:輸入文件大小,缺省為操作系統(tǒng)最大值
          fromuser:指明來源用戶方
          ignore:是否忽略對象創(chuàng)建錯誤,缺省為n,在上載前對象已被建立往往是一個正常現(xiàn)象,所以此選項建
          議設(shè)為y
          indexes:是否上載索引,缺省為n,這是指索引的定義而非數(shù)據(jù),如果上載時索引已建立,此選項即使為
          n 也無效,imp 自動更新索引數(shù)據(jù)
          log:log 文件,缺省為無,在標(biāo)準(zhǔn)輸出顯示
          rows:是否上載表記錄
          tables:輸入的表名列表
          touser:指明目的用戶方
          導(dǎo)入整個實例
          imp dbuser/oracle file=oradb.dmp log=oradb.log full=y buffer=4096000 commit=y ignore=y
          feedback=10000
          導(dǎo)入某個用戶所有對象
          imp dbuser/oracle file=dbuser.dmp log=dbuser.log fromuser=dbuser touser=dbuser2 buffer=2048000
          commit=y ignore=y feedback=10000
          導(dǎo)入一張或幾張表
          imp dbuser2/oracle file=user.dmp log=user.log tables=table1,table2 fromuser=dbuser
          touser=dbuser2 buffer=2048000 commit=y ignore=y feedback=10000
          以多個固定大小文件方式導(dǎo)入某張表
          imp dbuser/oracle file=\(1.dmp,2.dmp,3.dmp,…\) filesize=1000m tables=emp fromuser=dbuser
          touser=dbuser2 buffer=4096000 commit=y ignore=y feedback=10000
           
          Oracle 數(shù)據(jù)庫的備份與恢復(fù)
           
           

          oracle數(shù)據(jù)庫有三種標(biāo)準(zhǔn)的備份方法,它們分別是導(dǎo)出/導(dǎo)入(exp/imp).熱備份與冷備份.導(dǎo)出備件是一種邏輯備份,冷備份與熱備份是物理備份.

          利用export可將數(shù)據(jù)從數(shù)據(jù)庫中提取出來,利用import則可將提取出來的數(shù)據(jù)送回到oracle數(shù)據(jù)庫中去.
          一. 導(dǎo)出/導(dǎo)入(export/import)
          oracle支持三種方式類型的輸出:
          1. 簡單導(dǎo)出數(shù)據(jù)(export)與導(dǎo)入數(shù)據(jù)(import)

           (1).表方式(t方式),將指定表的數(shù)據(jù)導(dǎo)出.
           (2).用戶方式(u方式),將指定用戶的所有對象及數(shù)據(jù)導(dǎo)出.

           (3).全庫方式(full方式),瘵數(shù)據(jù)庫中的所有對象導(dǎo)出.

          數(shù)據(jù)導(dǎo)入(import)的過程是數(shù)據(jù)導(dǎo)出(export)的逆過程,分別將數(shù)據(jù)文件導(dǎo)入數(shù)據(jù)庫與將數(shù)據(jù)庫數(shù)據(jù)導(dǎo)出到數(shù)據(jù)文件.

          2. 增量導(dǎo)出/導(dǎo)入

          增量導(dǎo)出是一種常用的數(shù)據(jù)備份方法,它只能對整個數(shù)據(jù)庫來實施,并且必須作為system來導(dǎo)出.在進行此種導(dǎo)出時,系統(tǒng)不要求回答任何問題.導(dǎo)出文件名缺省為export.dmp,如果不希望自己的輸出文件定名為export.dmp,必須在命令行中指出要用的文件名.

          增量導(dǎo)出包括三種類型:

          (1).“完全”增量導(dǎo)出(complete)exp system/manager inctype=complete file=040731.dmp

           即備份三個數(shù)據(jù)庫,比如:

           備份上一次備份后改變的數(shù)據(jù),比如:

           (2).“增量型”增量導(dǎo)出

           exp system/manager inctype=incremental file=040731.dmp

           (3).“累積型”增量導(dǎo)出

           累計型導(dǎo)出方式是導(dǎo)出自上次“完全”導(dǎo)出之后數(shù)據(jù)庫中變化了的信息.比如:

           exp system/manager inctype=cumulative file=040731.dmp

           數(shù)據(jù)庫管理員可以排定一個備份日程表,用數(shù)據(jù)導(dǎo)出的三個不同方式合理高效的完成.

           比如數(shù)據(jù)庫的被封任務(wù)可以做如下安排:

           星期一:完全備份(a)
           星期二:增量導(dǎo)出(b)

           星期三:增量導(dǎo)出(c)

           星期四:增量導(dǎo)出(d)

           星期五:累計導(dǎo)出(e)

           星期六:增量導(dǎo)出(f)

           星期日:增量導(dǎo)出(g)

          posted on 2010-03-12 18:45 duduli 閱讀(693) 評論(0)  編輯  收藏 所屬分類: 數(shù)據(jù)庫

          <2010年3月>
          28123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          導(dǎo)航

          統(tǒng)計

          公告

          welcome to my place.

          常用鏈接

          留言簿(5)

          我參與的團隊

          隨筆分類

          隨筆檔案

          新聞分類

          石頭JAVA擺地攤兒

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          @duduli
          主站蜘蛛池模板: 正安县| 商水县| 塔城市| 台中县| 丁青县| 且末县| 山阴县| 常熟市| 屯昌县| 洪江市| 雷州市| 莱州市| 西乌珠穆沁旗| 平乐县| 九龙县| 福鼎市| 佛坪县| 长宁县| 阳高县| 陇川县| 龙岩市| 金昌市| 石狮市| 广汉市| 教育| 安化县| 大同市| 沛县| 灵宝市| 年辖:市辖区| 建平县| 耒阳市| 大新县| 桑植县| 岗巴县| 湛江市| 邵阳县| 绥化市| 丹东市| 孝义市| 双柏县|