Oracle 熱備份實踐

2021-06-21 23:09:44 字數 1616 閱讀 5467

實踐oracle的熱備份操作過程(windows下進行):

注意:1. oracle必須執行在歸檔模式下

檢視是否處於歸檔模式:

archive log list

如果不是處於歸檔模式,需要shutdown資料庫並且把資料庫設定為在歸檔模式下執行(在mount狀態下進行修改):

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

進行上面的預處理工作,使oracle能夠進行熱備份。接下來就可以進行熱備份了,但是在做熱備份之前,必須先弄清楚,需要備份的資料檔案有哪些,控制檔案有哪些?(熱備份主要備份上述物理檔案)

1. 檢視當前資料庫所有表空間名:select name from v$tablespace;

2. 檢視當前資料庫所有資料檔案:select file#,name,status from v$datafile;

3. 檢視當前資料庫所有的控制檔案:select name,status from v$controlfile;

4. 進行熱備份:

-- 歸檔當前聯機重做日誌檔案

alter system archive log current;

-- 備份資料檔案

alter tablespace system begin backup;

host copy e:\oracle\product\10.2.0\oradata\mydb\system01.dbf g:\orcl_bak\system01.dbf;

alter tablespace system end backup;

alter tablespace undotbs1 begin backup;

host copy e:\oracle\product\10.2.0\oradata\mydb\undotbs01.dbf g:\orcl_bak\undotbs01.dbf;

alter tablespace undotbs1 end backup;

alter tablespace sysaux begin backup;

host copy e:\oracle\product\10.2.0\oradata\mydb\sysaux01.dbf g:\orcl_bak\sysaux01.dbf;

alter tablespace sysaux end backup;

alter tablespace users begin backup;

host copy e:\oracle\product\10.2.0\oradata\mydb\users01.dbf g:\orcl_bak\users01.dbf;

alter tablespace users end backup;

-- 備份控制檔案

alter database backup controlfile to 'g:\orcl_bak\controlbinbak.000';

alter database backup controlfile to trace;

alter system archive log current;

通過上面步驟即在oracle下完成了一次熱備份。

oracle 雙機熱備份

一 建立 standby database 要求1 primary 與standby 資料庫所在主機上的 oracle server 及作業系統版本必須相同,且具有相同的補丁 2 primary 資料庫必須為 archive mode standby database 也必須為 archive mo...

oracle雙機熱備份

oracle雙機熱備份方法 一 建立standby database 要求 1 primary 與standby 資料庫所在主機上的oracle server及 作系統版本必須相同,且具有相同的補丁 2 primary 資料庫必須為archive mode standby database也必須為a...

oracle雙機熱備份方法

一 建立standby database 要求 1 primary 與standby 資料庫所在主機上的oracle server及 作系統版本必須相同,且具有相同的補丁 2 primary 資料庫必須為archive mode standby database也必須為archive mode 二 ...