dbua升級oracle 10.2.0.1 0 到11.2.0.4 失敗後還原過程
一 升級時候勾選bakcup database
二 假設升級中出現問題
這裡可以是意外升級中斷,機器down機器等
三 找到當初備份目錄
我這裡的環境是這樣
[/darin/admin/ora10g/backup]ls
control01.ctl control03.ctl ora10g_restore.sh redo02.log shutdown_ora10g.sql sysaux01.dbf temp01.dbf users01.dbf
control02.ctl example01.dbf redo01.log redo03.log startup_ora10g.sql system01.dbf undotbs01.dbf
可以發現 有一個 ora10g_restore.sh 檔案,我們開啟看看
#!/bin/sh
# -- Run this Script to Restore Oracle Database Instance ora10g
echo -- Bringing down the database from the new oracle home
ORACLE_HOME=/darin/product/11.2.0.4; export ORACLE_HOME
ORACLE_SID=ora10g; export ORACLE_SID
ORACLE_UNQNAME=ora10g; export ORACLE_UNQNAME
/darin/product/11.2.0.4/bin/emctl stop dbconsole
/darin/product/11.2.0.4/bin/sqlplus /nolog @/darin/admin/ora10g/backup/shutdown_ora10g.sql
echo You should Remove this entry from the /etc/oratab: ora10g:/darin/product/11.2.0.4:Y
echo -- Copying Datafiles....
/bin/cp /darin/admin/ora10g/backup/example01.dbf /darin/oradata/ora10g/example01.dbf
/bin/cp /darin/admin/ora10g/backup/redo01.log /darin/oradata/ora10g/redo01.log
/bin/cp /darin/admin/ora10g/backup/redo02.log /darin/oradata/ora10g/redo02.log
/bin/cp /darin/admin/ora10g/backup/redo03.log /darin/oradata/ora10g/redo03.log
/bin/cp /darin/admin/ora10g/backup/sysaux01.dbf /darin/oradata/ora10g/sysaux01.dbf
/bin/cp /darin/admin/ora10g/backup/system01.dbf /darin/oradata/ora10g/system01.dbf
/bin/cp /darin/admin/ora10g/backup/temp01.dbf /darin/oradata/ora10g/temp01.dbf
/bin/cp /darin/admin/ora10g/backup/undotbs01.dbf /darin/oradata/ora10g/undotbs01.dbf
/bin/cp /darin/admin/ora10g/backup/users01.dbf /darin/oradata/ora10g/users01.dbf
/bin/cp /darin/admin/ora10g/backup/control01.ctl /darin/oradata/ora10g/control01.ctl
/bin/cp /darin/admin/ora10g/backup/control02.ctl /darin/oradata/ora10g/control02.ctl
/bin/cp /darin/admin/ora10g/backup/control03.ctl /darin/oradata/ora10g/control03.ctl
echo -- Bringing up the database from the source oracle home
ORACLE_HOME=/darin/product/10.2.0; export ORACLE_HOME
ORACLE_SID=ora10g; export ORACLE_SID
unset LD_LIBRARY_PATH; unset LD_LIBRARY_PATH_64; unset SHLIB_PATH; unset LIB_PATH
echo You should Add this entry in the /etc/oratab: ora10g:/darin/product/10.2.0:Y
cd /darin/product/10.2.0
/darin/product/10.2.0/bin/sqlplus /nolog @/darin/admin/ora10g/backup/startup_ora10g.sql
/darin/product/11.2.0.4/bin/emca -restore db -silent -DB_UNIQUE_NAME ora10g -PORT 1521 -LISTENER LISTENER -SID ora10g -ORACLE_HOME /darin/product/11.2.0.4 -
HOST darin -LISTENER_OH /darin/product/11.2.0.4 -LOG_FILE /darin/cfgtoollogs/dbua/ora10g/upgrade3/restoreEmConfig.log -SRC_OH /darin/product/10.2.0
#Performed EM Restore Config Changes.
這個指令碼是資料庫還原指令碼
1 首先是切換環境變數到11g
2 然後停止em
3 關閉db
4 移除/etc/oratab: ora10g:/darin/product/11.2.0.4:Y 條目
5 Copy 檔案到你的原來的資料庫檔案目錄
6 切換到10g的環境變數
7 啟動資料庫
8 還原監聽
下面我們來執行一下這個指令碼(我現在是升級成功的環境)
darin[/darin/admin/ora10g/backup]./ora10g_restore.sh
-- Bringing down the database from the new oracle home
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://darin:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
SQL*Plus: Release 11.2.0.4.0 Production on Sat Aug 23 20:57:44 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected.
ORACLE instance shut down.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
You should Remove this entry from the /etc/oratab: ora10g:/darin/product/11.2.0.4:Y
-- Copying Datafiles....
-- Bringing up the database from the source oracle home
You should Add this entry in the /etc/oratab: ora10g:/darin/product/10.2.0:Y
SQL*Plus: Release 10.2.0.2.0 - Production on Sat Aug 23 21:00:28 2014
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to an idle instance.
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 2070552 bytes
Variable Size 100665320 bytes
Database Buffers 171966464 bytes
Redo Buffers 6316032 bytes
Database mounted.
Database opened.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
STARTED EMCA at Aug 23, 2014 9:01:07 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Aug 23, 2014 9:01:12 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /darin/cfgtoollogs/dbua/ora10g/upgrade3/restoreEmConfig.log.
Aug 23, 2014 9:01:14 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Aug 23, 2014 9:01:26 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Aug 23, 2014 9:03:12 PM oracle.sysman.emcp.EMDBPostConfig performRestore
INFO: Database Control started successfully
Aug 23, 2014 9:03:12 PM oracle.sysman.emcp.EMDBPostConfig performRestore
INFO: >>>>>>>>>>> The Database Control URL is http://darin:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 23, 2014 9:03:12 PM
還原完成
這裡我們還要在 /etc/oratab 增加條目
ora10g:/darin/product/10.2.0:Y
檢視監聽正常
darin[/home/oracle]lsnrctl status
LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 23-AUG-2014 21:07:13
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=darin)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.2.0 - Production
Start Date 23-AUG-2014 21:06:33
Uptime 0 days 0 hr. 0 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /darin/product/10.2.0/network/admin/listener.ora
Listener Log File /darin/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=darin)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora10g" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10gXDB" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
Instance "ora10g", status READY, has 1 handler(s) for this service
至此,還原結束。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26175573/viewspace-1256585/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 用dbua實現oracle 9.2.0.8到10.2.0.1的升級Oracle
- oracle 10.2.0.1 rac 升級到10.2.0.4 rac時,dbua升級的元件列表Oracle元件
- 使用DBUA升級 Oracle 11.2.0.4到Oracle 19C的問題記錄Oracle
- 單機升級11.2.0.1到11.2.0.4的實戰__DBUA視窗
- Oracle 10.2.0.1 升級到 10.2.0.4Oracle
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- Oracle 11.2.0.4升級到12.2.0.1Oracle
- 單例項環境下Oracle 11.2.0.3升級到11.2.0.4的過程單例Oracle
- oracle rac 10.2.0.1 升級到 oracle 10.2.0.4Oracle
- GC 10.2.0.1 OMS和Agent連線失敗後的處理過程GC
- (轉)Oracle 10.2.0.1 升級到 10.2.0.4Oracle
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- oracle for windows 11.2.0.1升級到11.2.0.4OracleWindows
- oracle資料庫升級11.2.0.3升級到11.2.0.4Oracle資料庫
- MacOS升級到Monterey後python SSL握手失敗問題MacPython
- 升級Oracle10.2.0.1Oracle
- ORACLE10G 10.2.0.1升級到10.2.0.5Oracle
- Oracle 10.2.0.1 升級到 10.2.0.4--轉載Oracle
- windows 下oracle從10.2.0.1升級到10.2.0.4WindowsOracle
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- 靜默升級oracle 11g (從11.2.0.1升級到11.2.0.4)Oracle
- oracle 之 安裝10.2.0.1 且 升級到 10.2.0.4Oracle
- Oracle10g RAC : 10.2.0.1 升級到 10.2.0.4Oracle
- POSTGRESQL 小版本升級失敗後的原因分析SQL
- 升級失敗後,資料庫降級方案(flashback database)資料庫Database
- 【UP_ORACLE】使用DBUA一鍵化靜默升級到19C以及DBUA引數詳解Oracle
- Oracle 10g rac升級(10.2.0.1 Rac到10.2.0.4)Oracle 10g
- linux下oracle RAC10.2.0.1升級到10.2.0.4LinuxOracle
- windows 2003,oracle 10.2.0.1升級到10.2.0.4WindowsOracle
- RHEL4.4下oracle10.2.0.1升級到10.2.0.3Oracle
- Oracle11g 11.2.0.3升級失敗後的兩種回退方法Oracle
- Oracle10.2.0.1 升級到Oracle10.2.0.4 簡單步驟Oracle
- 圖形化升級單機oracle 11.2.0.1 到 11.2.0.4Oracle
- 圖形化升級單機oracle 11.2.0.4 到 12.2.0.1Oracle
- Oracle RAC 10.2.0.5升級到11.2.0.4遇到的問題Oracle
- Oracle 10.2.0.5升級至11.2.0.4Oracle
- linux平臺下oracle從10.2.0.1升級到10.2.0.4LinuxOracle
- 探索Oracle之資料庫升級二 11.2.0.3升級到11.2.0.4完整步驟Oracle資料庫