升級_開闊視野之Oracle圖形化升級(dbca建庫後升級)—10.2.0.1.0升為10.2.0.5.0,dbca10.2.0.5.0
***********************************************聲明***********************************************************************
原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明出處,否則追究著作權法律責任。
表述有錯誤之處,請您留言或郵件(hyldba@163.com)指明,不勝感激。
本文轉載必須保留此處:http://blog.csdn.net/huangyanlong/article/details/39677103
深藍的blog:http://blog.csdn.net/huangyanlong
****************************************************************************************************************************
前提:安裝oracle軟體後,完成了dbca建庫
目標:完成oracle軟體由10.2.0.1.0升級為10.2.0.5.0
1.查看資料庫狀態、版本
[oracle@hyl ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 17 18:27:42 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- --------------------
hyldb OPEN
SQL> select comp_name,version,status from dba_registry;
2. 解壓安裝包
找到oracle10g的升級安裝包,如下所示:
解壓壓縮包
[root@hyl soft]# unzip p8202632_10205_Linux-x86-64.zip
3. 關閉資料庫
[oracle@hyl ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 29 10:23:51 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate;
--關庫
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@hyl ~]$ lsnrctl statuse
--核實監聽已經停止
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 29-SEP-2014 10:30:51
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 29-SEP-2014 09:54:36
Uptime 0 days 0 hr. 36 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hyl)(PORT=1521)))
The listener supports no services
The command completed successfully
4. 資料備份
生產環境時此處需要做一次備份,以免升級失敗時造成資料丟失,此文省略。
5. 升級oracle軟體
遠程調用圖形化介面,如例:
這裡跳過需求包檢查即可,點擊yes繼續,如:
[root@hyl ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh
--按提示執行指令碼
Running Oracle 10g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
執行指令碼後,點擊介面ok,進入到結束介面,如下:
6. 升級資料庫
[oracle@hyl ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Sep 29 11:05:28 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
啟動到upgrade狀態
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2094800 bytes
Variable Size 75499824 bytes
Database Buffers 83886080 bytes
Redo Buffers 6291456 bytes
Database mounted.
Database opened.
升級資料字典
SQL> spool /u01/app/oracle/update_log/cpu_up.log//把指令碼資訊錄入到一個記錄檔中
SQL> @?/rdbms/admin/catupgrd.sql //開始跑指令碼,升級資料字典,約10分鐘
SQL> spool off; --結束記錄檔
SQL> shutdown immediate; --關庫
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup --正常啟庫
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2094800 bytes
Variable Size 150997296 bytes
Database Buffers 8388608 bytes
Redo Buffers 6291456 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/utlrp.sql --執行該指令碼
SQL> select * from utl_recomp_errors;
SQL> col comp_name for a30
SQL> col status for a20
SQL> col VERSION for a10
SQL> set linesize 200
SQL> select comp_name,version,status from dba_registry;
SQL> show parameter comp
修改相容性
SQL> alter system set compatible='10.2.0.5.0' scope=spfile;
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
至此,資料庫完成由10.2.0.1.0升級到10.2.0.5.0版本。
7. 完成
[oracle@hyl ~]$ sqlplus '/as sysdba'
--登陸資料庫
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Sep 29 11:57:49 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
小結
對比dbca建庫前後進行cpu升級的過程,會發現明顯的區別:
1、未進行dbca建庫,只需進行軟體升級,升級後建庫即可;
2、dbca建庫後(即存在資料庫的情況下),升級軟體後,需要升級資料字典,修改相容性。
簡而記之
cpu升級(10.2.0.1.0-10.2.0.5.0) |
條件 |
操作 |
後續 |
存在庫 |
升級軟體 |
後續建庫 |
不存在庫 |
升級軟體+資料字典+相容性 |
完成升級直接存取庫 |
***********************************************聲明***********************************************************************
原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明出處,否則追究著作權法律責任。
表述有錯誤之處,請您留言或郵件(hyldba@163.com)指明,不勝感激。
本文轉載必須保留此處:http://blog.csdn.net/huangyanlong/article/details/39677103
深藍的blog:http://blog.csdn.net/huangyanlong
****************************************************************************************************************************
oracle 10201 linux,安裝軟體後,升級10204後,dbca建立資料庫時EM報錯 ,這個怎解決
這個沒有關係,資料庫是可以用的,但EM出了問題,可以通過emca指令碼重新設定EM即可:
指令碼具體位置:
/u01/app/oracle/product/10.2.0/db_1/bin/emca
問ORACLE102010升級到102050,需要REDHAT AS幾?
需要購買redhat可以扣我。