Oracle備份恢複簡單過程以及中間的坑.

來源:互聯網
上載者:User

標籤:伺服器   移動   ...   creat   enc   建立資料表空間   dir   ace   name   

 Oracle

冷備:

貌似需要dbca建立一致的oracle instance 伺服器配置版本盡量相同,安裝路徑相同.

關閉Oracle服務

將oracle app 目錄下的oradata以及有快速閃回區的話中的control檔案複製到新的伺服器裡面 注意是完全一致的目錄

如果有自己的業務庫的資料 也得移動到相同的目錄中,

啟動恢複到資料庫的資料庫服務, 如果正常立即可用.

熱備:

exp expdp imp impdp rman 暫時不寫了 用的少.

exp/imp 的方式速度較慢 但是相容性較好 高低版本都有 不過貌似12c開始oracle要慢慢的不用這種陳舊的備份恢複方式了

優點:用戶端運行 比較簡單 不考慮linux  winserver的區別等.

exp system/[email protected] owner=username file=c:\backupdir\dumpname.dump lot=c:\somedir\log.txt

匯入:

需要建立需要恢複庫的資料表空間以及使用者等, 不然oracle會報錯

建立語句

sqlplus / as sysdba 或執行相關命令, 

資料表空間:

create bigfile(可選) tablespace talespacename datafile ‘dir\data.dbf‘ size 100m autoextend on next 100m;

使用者

create user username default tablespace tablespacename identified by password

許可權

測試環境的話賦權多一點... 不過這一點就暴露自己的菜鳥屬性了..

grant dba,resource,connect,create any table,create any view,create any sequence,unlimited tablespce to username

然後 

imp system/[email protected] fromuser=username touser=username file=backdumpwithdirectory.dmp log=xxxx.log

注意 oracle11.2.0.1 以及幾個低版本有bug 會導致exp時部分空表導不出來 造成環境不可用,所以還是建議用expdp

expdp 需要建立directory 所以建議在伺服器端執行

方法 :

sqlplus / as sysdba

create directory as ‘ directory‘

然後在command裡面執行

expdp system/password directory=dir schemas=username dumpfile=some logfile=some

恢複時

先建立資料表空間和使用者

使用者的許可權不需要賦予了備份恢複時會自動加上

impdp system/password directory=dir schemas=username dumpfile=some logfile=some

比較簡單 像是parallel 以及其他參數可以慢慢學習使用.

Oracle備份恢複簡單過程以及中間的坑.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.