- Find the Kernal Parameter
[oracle@XAG109 ~]$ uname -r
3.10.0-514.el7.x86_64
- Find the 32 or 64 bit
[oracle@XAG109 ~]$ uname -p
x86_64
- Find the no of Database in one partiuclar Server
[oracle@XAG109 ~]$ cat /etc/oratab
DG:/u01/app/oracle/product/11.2.0/dbhome_1:N
- Find the Oracle Inventory location and group
[oracle@XAG109 ~]$ cat $ORACLE_HOME/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
- Find the all ORACLE_HOME Locations
[oracle@XAG109 ~]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml
<?xml version="1.0" standalone="yes" ?>
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.1.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="1"/>
</HOME_LIST>
</INVENTORY>
- To Check which instance is wokring
[oracle@XAG109 ~]$ ps -ef | grep -i smon
oracle 1271 1130 0 12:11 pts/0 00:00:00 grep --color=auto -i smon
- To Connect to Stage database
[oracle@XAG109 ~]$ .oraenv
ORACLE_SID = [DG] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
- Check the version
[oracle@XAG109 ~]$ sqlplus / as sysdba
SQL> startup;
SQL> select instance_name,host_name,version,status from v$instance;
INSTANCE_NAME HOST_NAME VERSION STATUS
-------------------------------------------------------------
DG XAG109.COM 11.2.0.1.0 OPEN
SQL>
SET PAGESIZE 32
set linesize 200
col comp_name format a40
col version format a20
col status format a10
select comp_name,version,status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------------- --------------------
OWB 11.2.0.1.0 VALID
Oracle Application Express 3.2.1.00.10 VALID
Oracle Enterprise Manager 11.2.0.1.0 VALID
OLAP Catalog 11.2.0.1.0 VALID
Spatial 11.2.0.1.0 VALID
Oracle Multimedia 11.2.0.1.0 VALID
Oracle XML Database 11.2.0.1.0 VALID
Oracle Text 11.2.0.1.0 VALID
Oracle Expression Filter 11.2.0.1.0 VALID
Oracle Rules Manager 11.2.0.1.0 VALID
Oracle Workspace Manager 11.2.0.1.0 VALID
Oracle Database Catalog Views 11.2.0.1.0 VALID
Oracle Database Packages and Types 11.2.0.1.0 VALID
JServer JAVA Virtual Machine 11.2.0.1.0 VALID
Oracle XDK 11.2.0.1.0 VALID
Oracle Database Java Packages 11.2.0.1.0 VALID
OLAP Analytic Workspace 11.2.0.1.0 VALID
Oracle OLAP API 11.2.0.1.0 VALID
- Check the 11.2.0.4 software binaries
[oracle@XAG109 ~]$ pwd
/home/oracle
[oracle@XAG109 ~]$ mkdir setup
[oracle@XAG109 ~]$ cd setup
[oracle@XAG109 setup]$ ls
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@XAG109 setup]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@XAG109 setup]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@XAG109 setup]$ rm p13390677_112040_Linux-x86-64_1of7.zip
[oracle@XAG109 setup]$ rm p13390677_112040_Linux-x86-64_2of7.zip
[oracle@XAG109 setup]$ ls
database
[oracle@XAG109 setup]$ cd database/
- Now Export the new Oracle Home
[oracle@XAG109 database]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@XAG109 database]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
- Install the Binaries of 11.2.0.4
[oracle@XAG109 database]$ ./runInstaller
@94 % it will prompt to run the root.sh script
select Y for all to replace the current files with the new files.
方案1
- Now run the DBUA from 11.2.0.4
#修改.bash_profile 中的 ORACLE_HOME 指向新ORACLE_HOME
[oracle@XAG109 ~]$ which dbua
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/dbua
[oracle@XAG109 database]$ dbua
方案2
[oracle@XAG109 ~]$ which sqlplus
/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus
[oracle@XAG109 ~]$ sqlplus / as sysdba
SQL> select * from v$version;
--------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ -------------------------------
db_file_name_convert string
db_name string DG
db_unique_name string DG
global_names boolean FALSE
instance_name string DG
lock_name_space string
log_file_name_convert string
service_names string DG
SQL> spool /home/oracle/upgrade01.log
SQL> @/u01/app/oracle/product/11.2.0.4/dbhome_1/rdbms/admin/utlu112i.sql
SQL> spool off
- 根据提示修正不符合升级条件的地方,清空回收站
SQL> purge DBA_RECYCLEBIN;
SQL> select count(*) from DBA_RECYCLEBIN;
#查看无效对象
SQL> select count(*) from dba_objects where status<>'VALID';
SQL> EXECUTE dbms_stats.gather_dictionary_stats;
#备份数据库、关闭数据库、关闭监听
SQL> shutdown immediate;
[oracle@XAG109 ~]$ lsnrctl stop
修改.bash_profile 中的$ORACLE_HOME 指向新路径
network file(tnsnames.ora listener.ora sqlnet.ora)
[oracle@oracle2 admin]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/*.ora /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/
#修正DG listener.ora 及 tnsnames.ora 中静态监听内容(ORACLE_HOME)
- SPFILE
cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileDG.ora /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/
- 拷贝密码文件:
[oracle@oracle1 ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwDG /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/orapwDG
- upgrade模式打开数据库
[oracle@XAG109 dbs]$ which sqlplus
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/sqlplus
[oracle@XAG109 dbs]$ sqlplus / as sysdba
SQL> startup UPGRADE
SQL> set echo on
SQL> spool /home/oracle/update02.log
SQL> set time on
SQL>@/u01/app/oracle/product/11.2.0.4/dbhome_1/rdbms/admin/catupgrd.sql
#3o分钟(做完后自動shutdown immediate)
SQL> sqlplus / as sysdba
SQL> startup
SQL> select count(*) from dba_objects where status<>'VALID';
453
SQL> @/u01/app/oracle/product/11.2.0.4/dbhome_1/rdbms/admin/utlrp.sql
SQL> select count(*) from dba_objects where status<>'VALID';
0
SQL> @/u01/app/oracle/product/11.2.0.4/dbhome_1/rdbms/admin/utlu112s.sql
SQL> select count(*) from dba_objects where status<>'VALID';
0
SQL> EXECUTE dbms_stats.gather_dictionary_stats;
SQL> shutdown immediate
SQL> startup
---------------------方案2結束-----------------------
- 检查升级情况
[oracle@XAG109 ~]$ which sqlplus
[oracle@india ~]$ sqlplus / as sysdba
SQL>
set linesize 200
col instance_name format a40
col host_name format a20
col version format a20
col status format a10
select instance_name,host_name,version,status from v$instance;
INSTANCE_NAME HOST_NAME VERSION STATUS
---------------------------------------- --------------------
DG XAG109.COM 11.2.0.4.0 OPEN
SQL>
SET PAGESIZE 32
set linesize 200
col comp_name format a40
col version format a20
col status format a10
select comp_name,version,status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------------- --------------------
OWB 11.2.0.1.0 VALID
Oracle Application Express 3.2.1.00.10 VALID
Oracle Enterprise Manager 11.2.0.4.0 VALID
OLAP Catalog 11.2.0.4.0 VALID
Spatial 11.2.0.4.0 VALID
Oracle Multimedia 11.2.0.4.0 VALID
Oracle XML Database 11.2.0.4.0 VALID
Oracle Text 11.2.0.4.0 VALID
Oracle Expression Filter 11.2.0.4.0 VALID
Oracle Rules Manager 11.2.0.4.0 VALID
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
JServer JAVA Virtual Machine 11.2.0.4.0 VALID
Oracle XDK 11.2.0.4.0 VALID
Oracle Database Java Packages 11.2.0.4.0 VALID
OLAP Analytic Workspace 11.2.0.4.0 VALID
Oracle OLAP API 11.2.0.4.0 VALID
- 安装 oracle 11g r2 时出现错误
调用makefile
/oracle/app/oracle/product/11.2.0.4/db_1/sysman/lib/ins_emagent.mk的目标nmo时出错。
主要因为C库的问题,解决办法就是手动指定C库位置出现agent nmhs问题后,找到
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
vim $ORACLE_HOME/sysman/lib/ins_emagent.mk文件,在文件里找字符串
$(SYSMANBIN)emdctl:
$(MK_EMAGENT_NMECTL)
进行修改为如下
$(SYSMANBIN)emdctl:
$(MK_EMAGENT_NMECTL) -lnnz11
注意:lnnz和$(MK_EMAGENT_NMECTL)之间有空格