10.2.0.x升级到10.2.0.5.5

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:10.2.0.x升级到10.2.0.5.5

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

一、数据库10.2.0.x升级到10.2.0.5.5步骤
1、升级数据库到10.2.0.5.0
执行8202632升级补丁中的./runInstaller
执行dbua
 
2、升级opatch
使用6880880补丁替换原$ORACLE_HOME/OPatch目录
 
3、升级数据库到10.2.0.5.5
使用补丁12827745,执行$ORACLE_HOME/OPatch/opatch apply ./12827745
执行数据库升级
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> — Execute the next statement only if this is the first
PSU applied for 10.2.0.5 or this is the first PSU applied since 10.2.0.5.3.
SQL> @utlrp.sql
SQL> QUIT
 
二、升级过程中出现错误
1、opatch版本过低
严重:OPatch invoked as follows: 'apply ./ '
信息:
Oracle 主目录       : /opt/oracle/product/10.2.0/db_1
主产品清单: /opt/oracle/oraInventory
   从           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.4.9
OUI 版本       : 10.2.0.5.0
OUI 位置      : /opt/oracle/product/10.2.0/db_1/oui
日志文件位置 : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/
opatch/opatch2011-11-03_12-43-59下午.log
 
Patch 12827745 requires OPatch version 10.2.0.5.0.
The OPatch version being used (10.2.0.4.9) doesn't meet the minimum version
required by the patch(es). Please download latest OPatch from My Oracle Support.
 
信息:系统无任何变化, OPatch 不会尝试还原系统
 
[oracle@node1 12827745]$ $ORACLE_HOME/OPatch/opatch version
Invoking OPatch 10.2.0.4.9
 
OPatch Version: 10.2.0.4.9
 
OPatch succeeded.
 
处理办法:升级opatch
下载补丁p6880880_102000_Linux-x86-64,备份原来$ORACLE_HOME/OPatch,然后用下载的补丁替换
[oracle@node1 opatch]$ $ORACLE_HOME/OPatch/opatch version
Invoking OPatch 10.2.0.5.1
 
OPatch Version: 10.2.0.5.1
 
OPatch succeeded.
 
2、检测补丁是否冲突
[oracle@node1 12827745]$ $ORACLE_HOME/OPatch/opatch \
>prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Invoking OPatch 10.2.0.5.1
 
Oracle 中间补丁程序安装程序版本 10.2.0.5.1
版权所有 (c) 2010, Oracle Corporation。保留所有权利。
 
PREREQ session
 
Oracle 主目录       : /opt/oracle/product/10.2.0/db_1
主产品清单: /opt/oracle/oraInventory
   从           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.5.1
OUI 版本       : 10.2.0.5.0
OUI 位置      : /opt/oracle/product/10.2.0/db_1/oui
日志文件位置 : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/
opatch/opatch2011-11-03_13-50-44下午.log
 
Patch history file: /opt/oracle/product/10.2.0/db_1/
cfgtoollogs/opatch/opatch_history.txt
 
Invoking prereq "checkconflictagainstohwithdetail"
 
Prereq "checkConflictAgainstOHWithDetail" passed.
 
OPatch succeeded.
 
3、CheckActiveFilesAndExecutables failed
[oracle@node1 12827745]$ $ORACLE_HOME/OPatch/opatch apply 
Invoking OPatch 10.2.0.5.1
 
Oracle 中间补丁程序安装程序版本 10.2.0.5.1
版权所有 (c) 2010, Oracle Corporation。保留所有权利。
 
 
Oracle 主目录       : /opt/oracle/product/10.2.0/db_1
主产品清单: /opt/oracle/oraInventory
   从           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.5.1
OUI 版本       : 10.2.0.5.0
OUI 位置      : /opt/oracle/product/10.2.0/db_1/oui
日志文件位置 : /opt/oracle/product/10.2.0/db_1/
cfgtoollogs/opatch/opatch2011-11-03_13-39-44下午.log
 
Patch history file: /opt/oracle/product/10.2.0/db_1/
cfgtoollogs/opatch/opatch_history.txt
 
ApplySession 将中间补丁程序 '12827745' 应用到 OH '/opt/oracle/product/10.2.0/db_1'
 
Running prerequisite checks…
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
 
 
Following executables are active :
/opt/oracle/product/10.2.0/db_1/bin/oracle
在先决条件检查期间 ApplySession 失败:
Prerequisite check "CheckActiveFilesAndExecutables" failed.
系统无任何变化, OPatch 不会尝试还原系统
 
OPatch failed with error code 74
 
解决办法:关闭数据库相关程序
 
[oracle@node1 12827745]$  sqlplus / as sysdba
 
SQL*Plus: Release 10.2.0.5.0 – Production on Thu Nov 3 13:52:31 2011
 
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
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !  
[oracle@node1 ~]$ lsnrctl stop
[oracle@node1 ~]$ emctl stop dbconsole
 
4、@catbundle.sql psu apply报错
ORA-04045: errors during recompilation/revalidation of IS1OGG.DDLREPLICATION
ORA-04064: not executed, invalidated 
ORA-04064: not executed, invalidated package body "IS1OGG.DDLREPLICATION"
ORA-06508: PL/SQL: could not find program unit being called: "IS1OGG.DDLREPLICATION"
ORA-06512: at line 870
ORA-04064: not executed, invalidated package body "IS1OGG.DDLREPLICATION"
ORA-06508: PL/SQL: could not find program unit being called: "IS1OGG.DDLREPLICATION"
ORA-06508: PL/SQL: could not find program unit being called: "IS1OGG.DDLREPLICATION"
ORA-06512: at line 870
ORA-04045: errors during recompilation/revalidation of IS1OGG.DDLREPLICATION
ORA-04064: not executed, invalidated 
ORA-04064: not executed, invalidated package body "IS1OGG.DDLREPLICATION"
ORA-06508: PL/SQL: could not find program unit being called: "IS1OGG.DDLREPLICATION"
ORA-06512: at line 870
ORA-04064: not executed, invalidated package body "IS1OGG.DDLREPLICATION"
ORA-06508: PL/SQL: could not find program unit being called: "IS1OGG.DDLREPLICATION"
 
解决方法:关闭ogg的ddl捕获
因为ddl捕获触发器,导致这些操作失败
ddl_disable.sql
升级完成后,开启ddl捕获触发器
ddl_enable.sql
 
三、opatch主要命令解释
1、查看升级是否成功
[oracle@node1 ~]$   $ORACLE_HOME/OPatch/opatch lsinv -bugs_fixed|grep PSU
                                                    ENCAPSULATED BY EXCEPTION HANDLING
9952230    12827745  Thu Nov 03 13:55:42 CST 2011   DATABASE PSU 10.2.0.5.1 (INCLUDES CPUOCT2010)
10248542   12827745  Thu Nov 03 13:55:42 CST 2011   DATABASE PSU 10.2.0.5.2 (INCLUDES CPUJAN2011)
11724962   12827745  Thu Nov 03 13:55:42 CST 2011   DATABASE PSU 10.2.0.5.3 (INCLUDES CPUAPR2011)
12419392   12827745  Thu Nov 03 13:55:42 CST 2011   DATABASE PSU 10.2.0.5.4 (INCLUDES CPUJUL2011)
12827745   12827745  Thu Nov 03 13:55:42 CST 2011   DATABASE PSU 10.2.0.5.5 (INCLUDES CPUOCT2011)
 
2、检测补丁是否冲突
[oracle@node1 12827745]$ $ORACLE_HOME/OPatch/opatch prereq  \
>CheckConflictAgainstOHWithDetail -phBaseDir ./
Invoking OPatch 10.2.0.5.1
 
Oracle 中间补丁程序安装程序版本 10.2.0.5.1
版权所有 (c) 2010, Oracle Corporation。保留所有权利。
 
PREREQ session
 
Oracle 主目录       : /opt/oracle/product/10.2.0/db_1
主产品清单: /opt/oracle/oraInventory
   从           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.5.1
OUI 版本       : 10.2.0.5.0
OUI 位置      : /opt/oracle/product/10.2.0/db_1/oui
日志文件位置 : /opt/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/
opatch2011-11-03_13-50-44下午.log
 
Patch history file: /opt/oracle/product/10.2.0/db_1/
cfgtoollogs/opatch/opatch_history.txt
 
Invoking prereq "checkconflictagainstohwithdetail"
 
Prereq "checkConflictAgainstOHWithDetail" passed.
 
OPatch succeeded.
 
3、预演补丁实施
opatch apply -report
 
4、卸载补丁
opatch rollback -id 8350262

Oracle 小升级 opatch apply使用

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:Oracle 小升级 opatch apply使用

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

这里记录的是Oracle 升级到10.2.0.4后,出现EM不能正常启动情况下,Oracle提示需要打上Patch 8350262,下面是记录打补丁过程

[oracle@ocp ~]$ unzip ~/p8350262_10204_Generic.zip
Archive:  /home/oracle/p8350262_10204_Generic.zip
   creating: 8350262/
  inflating: 8350262/killDBConsole
   creating: 8350262/files/
   creating: 8350262/files/sysman/
   creating: 8350262/files/sysman/jlib/
   creating: 8350262/files/sysman/jlib/emCORE.jar/
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/
  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/
  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class
  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class
   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/
  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class
   creating: 8350262/files/sysman/jlib/emd_java.jar/
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/
  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/
  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class
  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class
   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/
  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class
  inflating: 8350262/killDBConsole.pl
  inflating: 8350262/README.txt
   creating: 8350262/etc/
   creating: 8350262/etc/xml/
  inflating: 8350262/etc/xml/ShiphomeDirectoryStructure.xml
  inflating: 8350262/etc/xml/GenericActions.xml
   creating: 8350262/etc/config/
  inflating: 8350262/etc/config/inventory
  inflating: 8350262/etc/config/actions
[oracle@ocp ~]cd 8350262
[oracle@ocp 8350262]$ $ORACLE_HOME/OPatch/opatch apply     --Note:$ORACLE_HOME/OPatch/opatch路径
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.
Oracle Home       : /opt/oracle/app/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/app/10.2.0/db_1/oui
Log file location : /opt/oracle/app/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-17_18-11-40PM.log
ApplySession applying interim patch '8350262' to OH '/opt/oracle/app/10.2.0/db_1'
Running prerequisite checks...
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '8350262' for restore. This might take a while...
Backing up files affected by the patch '8350262' for rollback. This might take a while...
Patching component oracle.sysman.agent.core, 10.2.0.4.0a...
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"
Updating jar file "/opt/oracle/app/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"
ApplySession adding interim patch '8350262' to inventory
Verifying the update...
Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 8350262 are present in Oracle Home.
OPatch succeeded.
[oracle@ocp 8350262]$ ../opatch lsinventory  --Note检测是否安装成功
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.
Oracle Home       : /opt/oracle/app/10.2.0/db_1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/app/10.2.0/db_1/oui
Log file location : /opt/oracle/app/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-17_18-18-34PM.log
Lsinventory Output file location : /opt/oracle/app/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-10-17_18-18-34PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
There are 2 products installed in this Oracle Home.
Interim patches (1) :
Patch  8350262      : applied on Mon Oct 17 18:17:28 CST 2011
   Created on 14 Sep 2010, 04:59:44 hrs PST8PDT
   Bugs fixed:
     8350262
--------------------------------------------------------------------------------
OPatch succeeded.

p8350262_10204_Generic
p8350262_10205_Generic

checking network configuration requirements

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:checking network configuration requirements

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

最近准备考ocp,所以决定按照教程,从头到尾系统的学习一次oracle,也算是为了对得起考证的几千大洋。
在安装oracle 10g的过程中,遇到了checking network configuration requirements is: Not executed的错误提示。

没有执行网络检测,google下,发现是/etc/hosts中没有指定静态ip地址导致,检测/etc/hosts发现果真如此(好久没有装oracle 了,竟然忘记这个基础的东西)修改如下配置
127.0.0.1 ocp localhost.localdomain localhost
192.168.1.55 ocp.xifenfei.com
重新检测,显示正常

升级到Oracle 10.2.0.4

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:升级到Oracle 10.2.0.4

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

一、单实例升级先决条件:
1.表空间需求
确保system表空间至少有10M空间可用
2.系统参数:
确保参数SHARED_POOL_SIZE 和 JAVA_POOL_SIZE大于150MB以上,为加快升级速度,在系统内存可用的情况下,可临时调大这2个参数
SQL> SHOW PARAMETER SHARED_POOL_SIZE
SQL> SHOW PARAMETER JAVA_POOL_SIZE
SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=’200M’ SCOPE=spfile;
SQL> ALTER SYSTEM SET JAVA_POOL_SIZE=’200M’ SCOPE=spfile;
二、实施升级
1.关闭需要升级的实例
停止实例
SQL> shutdown immediate
停止与该实例相关的所有后台进程
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
2.备份Oracle Home 目录及数据库
tar -cvf $ORACLE_BASE /orabak/ –确保Oracle相关的所有配置都位于$ORACLE_BASE目录,如监听等
cp *.dbf con*.ora redo*.log /orabak/ –对数据库实施冷备
3.升级软件
./runIstanller –>oracle 账户
root.sh –>root 账户
4.更新数据字典
SQL> startup upgrade
SQL> spool patch.log
SQL> @?/rdbms/admin/catupgrd.sql –注9i 使用catpatch.sql
SQL> spool off
SQL> !egrep “ORA-|Error” patch.log -i
5.重编译失效对象:
sql>shutdown immediate
sql>startup
SQL>@?/rdbms/admin/utlrp.sql
6.修改兼容性参数
SQL> alter system set compatible=’10.2.0.4.0′ scope=spfile;
7.如果使用了恢复目录,则执行下面的命令
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
8.如果升级回退:
SQL> STARTUP DOWNGRADE
SQL> SPOOL downgrade.log
SQL> @catdwgrd.sql(10.2.10运行的是这个,而10.1降级用的是d92000.sql,即dold_release.sql)
SQL>spool off
SQL>shutdown immediate
9.重新启动数据库:
SQL> SHUTDOWN
SQL> STARTUP
$ lsnrctl start
$ isqlplusctl start
$ emctl start dbconsole
10.检查升级后的情况
SQL> col comp_name for a35
SQL> col comp_name for a30
SQL> col version for a10
SQL> select comp_name,version,status from sys.dba_registry;
COMP_NAME VERSION STATUS
———————————– ———- ———————-
Oracle Database Catalog Views 10.2.0.4.0 VALID
Oracle Database Packages and Types 10.2.0.4.0 VALID
Oracle Workspace Manager 10.2.0.4.3 VALID
JServer JAVA Virtual Machine 10.2.0.4.0 VALID
Oracle XDK 10.2.0.4.0 VALID
Oracle Database Java Packages 10.2.0.4.0 VALID
Oracle Expression Filter 10.2.0.4.0 VALID
Oracle Data Mining 10.2.0.4.0 VALID
Oracle Text 10.2.0.4.0 VALID
Oracle XML Database 10.2.0.4.0 VALID
Oracle Rule Manager 10.2.0.4.0 VALID
COMP_NAME VERSION STATUS
———————————– ———- ———————-
Oracle interMedia 10.2.0.4.0 VALID
OLAP Analytic Workspace 10.2.0.4.0 VALID
Oracle OLAP API 10.2.0.4.0 VALID
OLAP Catalog 10.2.0.4.0 VALID
Spatial 10.2.0.4.0 VALID
Oracle Enterprise Manager 10.2.0.4.0 VALID
17 rows selected.
SQL> select * from utl_recomp_errors;
no rows selected

crs 10.2.0.1 bug(公网ip为私有ip时)

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:crs 10.2.0.1 bug(公网ip为私有ip时)

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

当crs10.2.0.1公用网卡IP段使用10、172、192段(非路由网段)的时候
1、会出现以下两种情况:
1)最后检查时出现如下错误
Checking existence of VIP node application (required)
Check failed.
Check failed on nodes:
rac1,rac2
2)在rac2上执行root.sh脚本最后
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
……
Timed out waiting for the CRS stack to start.
2、解决方法:
在root.sh在第二个节点执行完之后,以 root 用户身份在第二个节点上手动调用 VIPCA
# /u01/app/oracle/product/10.2.0/crs_1/bin/vipca
配置虚拟ip

redhat 4 安装 Oracle 10g

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:redhat 4 安装 Oracle 10g

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

必须安装包
binutils-2.15.92.0.2-13.EL4
compat-db-4.1.25-9
compat-libstdc++-296-2.96-132.7.2
control-center-2.8.0-12
gcc-3.4.3-22.1.EL4
gcc-c++-3.4.3-22.1.EL44
glibc-2.3.4-2.9
glibc-common-2.3.4-2.9
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-22.1
libstdc++-devel-3.4.3-22.1
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
setarch-1.6-1
用户和组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
创建文件夹
mkdir -p /u01/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
修改系统参数
vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
vi /etc/profile
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
设置环境变量
vi ~/.bash_profile
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=orcl
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=$PATH:$ORACLE_HOME/bin
export PATH NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID

Oracle升级(10.2.0.1—–>10.2.0.3)

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:Oracle升级(10.2.0.1—–>10.2.0.3)

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

数据库版本linux 32位(10.2.0.1升级到10.2.0.3)
1、停止OEM/isqlplus/监听/DB实例
$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop
$ sqlplus / as sysdba
SQL> shutdown immediate;
2、升级Oracle软件
1) 备份ORACLE_HOME和oraInventory
升级前对要升级的ORACLE_HOME进行备份是必要的, 还有oraInventory目录, 一
旦升级失败便于回退
方法一,使用tar备份
$ cd $ORACLE_HOME/..
$ tar jcvf db_1_`date +%Y%m%d`.tar.bz2 db_1
$ cd $ORACLE_BASE
$ tar jcvf oraInventory_`date +%Y%m%d`.tar.bz2 oraInventory
方法二,使用cp备份
$ cd $ORACLE_HOME
$ cp -pr db_1 db_1_new (备份到新目录, 且保留mode,ownership,timestamps等信息)
$ cp -pr oraInventory oraInventory_new
2) 升级Oracle 软件
2.1)通过response文件开始升级, 升级时间大概2-3分钟.
$ cd /u01/software/10g/
$ unzip p5337014_10203_LINUX.zip
$ cd Disk1
注意升级前要保证/tmp空间有2.5G空余空间
$ ./runInstaller -silent -responseFile /u01/software/10g/DISK1/response/patchset.rsp
ORACLE_HOME=”/u01/app/oracle/product/10.2.0/db_1″
ORACLE_HOME_NAME=”OraDb10g_home1″ DECLINE_SECURITY_UPDATES=”true”
如果未使用默认的组oinstall, 则runInstaller命令后需再加一个参数:
UNIX_GROUP_NAME=”oinstall”
各参数含义如下:
-silent 表示以静默方式安装,不会有任何提示;
-responseFile 表示使用哪个响应文件,必需使用绝对路径;
ORACLE_HOME=”/u01/app/oracle/product/10.2.0/db_1″ oracle安装目录;
ORACLE_HOME_NAME=”OraDb10g_home1″ ORACLE_HOME名;
DECLINE_SECURITY_UPDATES=”true” 是否需要安全更新, true表示不需要,
否则会要求输入metalink账号和联网信息;(10.2.0.3中无此选项)
UNIX_GROUP_NAME=”oinstall” oracle用户用于安装软件的组名;
2.2)设置DISPLAY=192.168.0.1:0.0 (设置图形显示,用的是xmanager的passive接收)
注意: 你也可以直接用./runInstaller运行,安装程序会检查和提示你一步一步的升级完成
3) 运行root.sh和changePerm.sh
ü 升级结束后, 以root用户执行$ORACLE_HOME下的root.sh(如有提示则一直回车):
# /u01/app/oracle/product/10.2.0/db_1/root.sh
安装PatchSet后新增的文件或目录是限制访问的, 其它用户或第三方工具要访问这些文件时会提示错误,
所以要修改权限:
# su – oracle
$ cd $ORACLE_HOME/install
$ ./changePerm.sh
$ tail -50f /tmp/changePerm_err.log
3、升级数据库
$ lsnrctl start
确保内存足够
SQL> ALTER SYSTEM SET SHARED_POOL_SIZE=’150M’ SCOPE=spfile;
SQL> ALTER SYSTEM SET JAVA_POOL_SIZE=’150M’ SCOPE=spfile;
$ sqlplus / as sysdba
SQL> startup upgrade; (以升级模式启动数据库)
SQL> SPOOL /tmp/patch102030.log
SQL> @?/rdbms/admin/catupgrd.sql (重建数据字典, 若有问题可重复执行)
SQL> SPOOL off
SQL> !egrep “ORA-|Error” /tmp/patch102050.log (查看是否有错误)
SQL> shutdown immediate;
SQL> startup;
SQL> @?/rdbms/admin/utlrp.sql (编译失效PLSQL包对象, 尽管第一次访问包是会自动编译, 还是推荐操作)
注意: 这个编译过程可能因为你数据库里面的对象问题,有一些错误,你需要在plsql下
执行: select * from UTL_RECOMP_ERRORS 检查无效的对象。有些是可以忽略的
4、开启OEM/isqlplus/监听
$ lsnrctl start
$ isqlplusctl start
$ emctl start dbconsole

Solaris 10安装oracle 10.2

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:Solaris 10安装oracle 10.2

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

1、检查包
pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
如果提示:ERROR: information for “SUNWi1cs” was not found类似信息请执行2
2、安装缺少包
cd /cdrom/sol_10_910_x86/Solaris_10/Product
pkgadd -d . SUNWi1cs
3、修改内核参数
vi /etc/system
set noexec_user_stack=1
set semsys:seminfo_semmni = 100
set semsys:seminfo_semmns = 1024
set semsys:seminfo_semmsl = 256
set semsys:seminfo_semvmx = 32767
set shmsys:shminfo_shmmax = 4294967295
set shmsys:shminfo_shmmin = 1
set shmsys:shminfo_shmmni = 100
set shmsys:shminfo_shmseg = 10
4、创建用户和组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d /export/home/oracle -m -s /bin/bash oracle
passwd oracle
5、创建文件夹
mkdir -p /u01/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
6、修改用户环境变量
vi .profile
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=orcl
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=$PATH:$ORACLE_HOME/bin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin
TEMP=/tmp
TMPDIR=/tmp
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/lib64:/usr/local/lib
export TMPDIR TEMP PATH NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
7、开始安装
su – oracle
export DISPLAY=192.168.1.1:0.0
/tmp/database/runInstaller
note:使用xmanager映射出图形界面

linux上安装oracle10g注意事项

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:linux上安装oracle10g注意事项

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

1、如果hosts文件中不含localhost,在启动listener是报错:
TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
Linux Error: 29: Illegal seek
需要在 Listener文件中添加SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF,这个为oracle10g上的bug,有补丁可以解决
2、修改主机名步骤
第一步:
#hostname oratest
第二步:
修改/etc/sysconfig/network中的hostname
第三步:
修改/etc/hosts文件
3、listener中的ip地址不能为127.0.0.1/localhost(最好直接使用网卡ip地址),不然不能被该主机外的其他主机访问
4、修改主机名后,要在hosts文件中做对应修改,不然重启oracle后会报错:
ORA-00600: internal error code, arguments: [keltnfy-ldmInit], [46], [1], [], [], [], [], []

Ubuntu10.4安装oracle 11gR2

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:Ubuntu10.4安装oracle 11gR2

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

1、安装Ubuntu并升级至最新
安装省略
升级:
sudo su -(-必须的,重新启动一个新回话,主要就是环境变量)
apt-get update
apt-get dist-upgrade
reboot—-完成后重启
2、安装必要的包(不知道在deb中是否叫做包)
sudo su –
apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
3、建立一些链接
sudo su –
ln -sf bash /bin/sh
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename
mkdir /etc/rc.d
for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
4、创建组、用户和相关文件夹
addgroup oinstall
addgroup dba
addgroup nobody
usermod -g nobody nobody
useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
passwd -l oracle
mkdir /home/oracle
chown -R oracle:dba /home/oracle
mkdir -p /u01/oracle
chown -R oracle:dba /u01
5、相关参数修改
1)/etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
2)/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
3)/etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
4)执行sysctl -p,使得刚刚修改的参数生效
6、修改环境变量/etc/profile文件中添加
ORACLE_SID=orcl
ORACLE_BASE=/u01
ORACLE_HOME=/u01/oracle
NLS_LANG=AMERICAN_AMERICA.UTF8
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH NLS_LANG
7、oracle11g安装文件准备
unzip解压
chown -R oracle:dba database(解压的安装文件夹)
8、开始安装
sudo su –
xhost +127.0.0.1(或者使用oracle图形化界面登录安装)
su – oracle
export LANG=en_US(采用英文界面安装,中文乱码,因为jdk问题,不想配置)
./runInstaller -ignoreSysPrereqs(忽略安装时的版本检查)
9、安装过程中
检查的时候,会有错误和警告,全部忽略(不是oracle支持的版本,没有办法)
注意选择数据库编码为utf8,不然会出现乱码(因为在环境变量中设置了数据库客户端编码为utf8)
还有选择地区等信息(建议先安装数据库软件,然后使用dbca创建数据库)
信息比较多,如果不能选择清楚,在网上找些资料,配置起中文正常显示(这样很多变量不用人工去选择)
10、安装结束后执行提示脚本
提示:使用root用户权限执行
11、总体感觉:
因为Ubuntu不是oracle官方支持的linux版本,所以在安装过程中会有很多多于的步骤,如有些是采用链接方式进行的;还在版本检查被强行忽略,安装检查错误提示被忽略,还有和jdk不一致产生乱码问题等。因为在安装过程中忽略了很多警告和错误,到底会不会产生什么影响现在还不知道,只是做了简单的测试工作正常。个人感觉,Ubuntu不是很适合做oracle服务器,至少是在oracle官方没有正式支持前不是很时候,很多东西都是靠网友总结出来的。
我对比了下上次在centos上安装oracle的过程,感觉这里有些东西就是为了模仿redhat的操作系统而执行的操作,而且有些就算是模仿了,也还是没有redhat下面好,如环境变量的地方,在Ubuntu中是全局的(所有用户都有效),而redhat中是oracle单个用户(感觉更安全),当然我linux功底有限,也许说了很多错话。
CentOs 5安装oracle 11g R2数据库