oracle 11g 手工熱備 資料庫

2021-09-20 22:11:54 字數 2507 閱讀 1844

檢視資料庫是否處於歸檔模式,開啟資料庫熱備模式,拷貝作業系統資料庫資料檔案到備份目錄

sys@prod> archive log list

database log mode archive mode

automatic archival enabled

oldest online log sequence 2

next log sequence to archive 4

current log sequence 4

sys@prod> alter database begin backup;

database altered.

sys@prod> host

[oracle@enmoedu1 prod]$ rm -rf /home/oracle/bak/*

[oracle@enmoedu1 prod]$ cp *.dbf /home/oracle/bak

[oracle@enmoedu1 prod]$ exit

exit

sys@prod> alter database end backup;

database altered.

刪除所有的資料檔案

sys@prod> host

[oracle@enmoedu1 prod]$ rm -rf *.dbf

[oracle@enmoedu1 prod]$ ll

total 172652

-rw-r----- 1 oracle oinstall 9748480 jan 2422:

50 control01.ctl

-rw-r----- 1 oracle oinstall 9748480 jan 2422:

50 control02.ctl

-rw-r----- 1 oracle oinstall 52429312 jan 2422:

50 redo01.log

-rw-r----- 1 oracle oinstall 52429312 jan 2422:

41 redo02.log

-rw-r----- 1 oracle oinstall 52429312 jan 2422:

41 redo03.log

[oracle@enmoedu1 prod]$

啟動資料庫報錯

sys@prod>

shutdown immediate;

database closed.

database dismounted.

oracle instance shut down.

sys@prod>

startup

oracle instance started.

total system global area 835104768 bytes

fixed size 2257840 bytes

variable size 536874064 bytes

database buffers 289406976 bytes

redo buffers 6565888 bytes

database mounted.

ora-01157: cannot identify/lock data file 1 - see dbwr trace file

sys@prod>

拷貝熱備後的資料檔案到原資料檔案目錄

[oracle@enmoedu1 prod]$ cp /home/oracle/bak/*.dbf ./ ——拷貝資料檔案到以前的資料檔案目錄

[oracle@enmoedu1 prod]$ exit

exit

sys@prod> select open_mode from v$database;

open_mode

--------------------

mounted

sys@prod> alter database open——嘗試開啟資料庫,報錯

2 ;

alter database open

*error at line 1:

ora-01113: file 1 needs media recovery

恢復資料庫

sys@prod>

recover database;——恢復資料庫

media recovery complete.

sys@prod>

alter database open;——開庫

database altered.

sys@prod>

select status from v$instance;

status

------------

open

oracle 11g 手工熱備 資料庫

檢視資料庫是否處於歸檔模式,開啟資料庫熱備模式,拷貝作業系統資料庫資料檔案到備份目錄 sys prod archive log list database log mode archive mode automatic archival enabled oldest online log seque...

oracle11g 手工建庫

官方文件檢視路徑 database administration administrator s guide 2 creating and configuring an oracle database step 1 specify an instance identifier sid oracle ...

oracle11g手工建立EM

1.清除em相關配置 刪除db配置 emca deconfig dbcontrol db 清除repository emca repos drop 2.配置em 建立db control emca config dbcontrol db repos create 3.啟動em em中文問題解決 開啟...