E 开始正式升级
Note:
以11g 软件来启库,且已UPGRADE方式,注意环境变量的设置!
执行$ORACLE_HOME/rdbms/admin/catupgrd.sql来升级!
node1-> export ORACLE_SID=devdb1
node1-> export ORACLE_BASE=/u01/app/oracle
node1-> export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
node1-> export PATH=$ORACLE_HOME/bin:$PATH.
node1-> which sqlplus
/u01/app/oracle/product/11.2.0/db_1/bin/sqlplus
node1-> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 27 13:01:19 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup upgrade
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1219260416 bytes
Fixed Size 2252744 bytes
Variable Size 385876024 bytes
Database Buffers 822083584 bytes
Redo Buffers 9048064 bytes
Database mounted.
Database opened.
SQL> spool /home/oracle/u_info4.log
SQL> @?/rdbms/admin/catupgrd
…..
……
……
.
Oracle Database 11.2 Post-Upgrade Status Tool 12-27-2013 14:12:22
.
Component Current Version Elapsed Time
Name Status Number HH:MM:SS
.
Oracle Server
. VALID 11.2.0.4.0 00:13:37
JServer JAVA Virtual Machine
. VALID 11.2.0.4.0 00:10:44
Oracle Real Application Clusters
. VALID 11.2.0.4.0 00:00:00
Oracle Workspace Manager
. VALID 11.2.0.4.0 00:00:37
OLAP Analytic Workspace
. VALID 11.2.0.4.0 00:00:17
OLAP Catalog
. VALID 11.2.0.4.0 00:00:50
Oracle OLAP API
. VALID 11.2.0.4.0 00:00:29
Oracle Enterprise Manager
. VALID 11.2.0.4.0 00:07:15
Oracle XDK
. VALID 11.2.0.4.0 00:03:15
Oracle Text
. VALID 11.2.0.4.0 00:00:46
Oracle XML Database
. VALID 11.2.0.4.0 00:05:15
Oracle Database Java Packages
. VALID 11.2.0.4.0 00:00:19
Oracle Multimedia
. VALID 11.2.0.4.0 00:03:41
Spatial
. VALID 11.2.0.4.0 00:05:15
Oracle Expression Filter
. VALID 11.2.0.4.0 00:00:12
Oracle Rules Manager
. VALID 11.2.0.4.0 00:00:09
Final Actions
. 00:00:43
Total Upgrade Time: 00:53:32
PL/SQL procedure successfully completed.
SQL>
SQL> SET SERVEROUTPUT OFF
SQL> SET VERIFY ON
SQL> commit;
Commit complete.
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL>
SQL> DOC
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC> The above sql script is the final step of the upgrade. Please
DOC> review any errors in the spool log file. If there are any errors in
DOC> the spool file, consult the Oracle Database Upgrade Guide for
DOC> troubleshooting recommendations.
DOC>
DOC> Next restart for normal operation, and then run utlrp.sql to
DOC> recompile any invalid application objects.
DOC>
DOC> If the source database had an older time zone version prior to
DOC> upgrade, then please run the DBMS_DST package. DBMS_DST will upgrade
DOC> TIMESTAMP WITH TIME ZONE data to use the latest time zone file shipped
DOC> with Oracle.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL>
SQL> Rem Set errorlogging off
SQL> SET ERRORLOGGING OFF;
SQL>
SQL> REM END OF CATUPGRD.SQL
SQL>
SQL> REM bug 12337546 – Exit current sqlplus session at end of catupgrd.sql.
SQL> REM This forces user to start a new sqlplus session in order
SQL> REM to connect to the upgraded db.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
node1->
大概整个升级过程持续 00:53:32。
提示检查升级日志,去查看/home/oracle/u_info4.log且需要处理掉错误!!!!!!!
检查日志过程中,之前在C 步骤尝试升级数据库时遇到的错误已经不存在,且亦无其它错误出现。
F 执行catuppst.sql执行升级后操作
执行 @$ORACLE_HOME/rdbms/admin/catuppst.sql
node1-> hostname
node1.oracleonlinux.cn
node1-> export ORACLE_SID=devdb1
node1-> export ORACLE_BASE=/u01/app/oracle
node1-> export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
node1-> export PATH=$ORACLE_HOME/bin:$PATH.
node1-> which sqlplus
/u01/app/oracle/product/11.2.0/db_1/bin/sqlplus
node1-> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 27 15:25:11 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 1219260416 bytes
Fixed Size 2252744 bytes
Variable Size 503316536 bytes
Database Buffers 704643072 bytes
Redo Buffers 9048064 bytes
Database mounted.
Database opened.
SQL> spool /home/oracle/u5.log
SQL> @$ORACLE_HOME/rdbms/admin/catuppst.sql
TIMESTAMP
——————————————————————————–
COMP_TIMESTAMP POSTUP_BGN 2013-12-27 15:26:38
PL/SQL procedure successfully completed.
This script will migrate the Baseline data on a pre-11g database
to the 11g database.
…..
…..
SQL> PROMPT Updating registry…
Updating registry…
SQL> INSERT INTO registry$history
2 (action_time, action,
3 namespace, version, id,
4 bundle_series, comments)
5 VALUES
6 (SYSTIMESTAMP, ‘APPLY’,
7 SYS_CONTEXT(‘REGISTRY$CTX’,’NAMESPACE’),
8 ‘11.2.0.4’,
9 0,
10 ‘PSU’,
11 ‘Patchset 11.2.0.2.0’);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_DEVDB_APPLY_2013Dec27_15_26_50.log
SQL>
根据提示检查/home/oracle/u5.log和
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_DEVDB_APPLY_2013Dec27_15_26_50.log均无错误!!!!
G 编译失效对象
执行 @$ORACLE_HOME/rdbms/admin/utlrp.sql来编译失效对象
SQL> spool /home/oracle/u6.log
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
TIMESTAMP
————————————————————————————————————–
COMP_TIMESTAMP UTLRP_BGN 2013-12-27 15:31:15
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like ‘UTL_RECOMP_SLAVE_%’;
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like ‘UTL_RECOMP_SLAVE_%’;
DOC>#
PL/SQL procedure successfully completed.
TIMESTAMP
————————————————————————————————————–
COMP_TIMESTAMP UTLRP_END 2013-12-27 15:33:55
DOC> The following query reports the number of objects that have compiled
DOC> with errors.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
——————-
0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
—————————
0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
PL/SQL procedure successfully completed.
SQL>
H 升级后确认监听
确保listener是运行在11gR2 Grid路径下:
node1-> lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 27-DEC-2013 15:39:46
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 – Production
Start Date 26-DEC-2013 22:12:55
Uptime 0 days 17 hr. 26 min. 51 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/node1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.0.33)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.0.35)(PORT=1521)))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM1”, status READY, has 1 handler(s) for this service…
Service “devdb.oracleonlinux.cn” has 1 instance(s).
Instance “devdb1”, status READY, has 2 handler(s) for this service…
Service “devdbXDB.oracleonlinux.cn” has 1 instance(s).
Instance “devdb1”, status READY, has 1 handler(s) for this service…
The command completed successfully
node1->