10.2.0.1安裝並升級到10.2.0.5

shawnloong發表於2015-06-14
10.2.0.1->10.2.0.5->EM補丁->建立例項->修復EM中文亂碼問題
1.安裝cenots 6.5 注意磁碟規劃
記憶體大小建議1G以上

swap設定
RAM     Swap Space
Up to 512 MB     2 times the size of RAM
Between 1024 MB and 2048 MB     1.5 times the size of RAM
Between 2049 MB and 8192 MB     Equal to the size of RAM
More than 8192 MB     0.75 times the size of RAM

硬碟大小
臨時目錄可用大小大於400M
df -k /tmp

If there is less than 400 MB of free disk space available in the /tmp directory, then complete one of the following steps:

    Delete unnecessary files from the /tmp directory to meet the disk space requirement.

    Set the TEMP and TMPDIR environment variables when setting the oracle user's environment (described later).

    Extend the file system that contains the /tmp directory. If necessary, contact your system administrator for information
     about extending file systems.

安裝目錄大小(例如/u01目錄至少1.9剩餘空間)
# df -k

The following table shows the approximate disk space requirements for software files for each installation type:
Installation Type     Requirement for Software Files (GB)
Enterprise Edition     1.9
Standard Edition     1.9
Custom (maximum)     2.0

2.安裝所需包
設定hosts解析
[root@ora10g-1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.213.88 ora10g-1 ora10g-1.localdomain

[root@ora10g-1 ~]# export ORACLE_HOSTNAME=ora10g-1.localdomain
[root@ora10g-1 ~]#
如果出現以下錯誤
 Protected multilib versions: libXtst-1.2.2-2.1.el6.i686 != libXtst-1.2.1-2.el6.x86_64
Error: Protected multilib versions: libXt-1.1.4-6.1.el6.i686 != libXt-1.1.3-1.el6.x86_64
 You could try using --skip-broken to work around the problem
 
[root@ora10g-1 ~]# yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat libXp  libXt.i686 libXtst.i686 libXt.i686 libXtst.i686 --setopt=protected_multilib=false

3.修改核心檔案(/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 = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

sysctl -p

4.修改shell限制(/etc/security/limits.conf)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

5.Add or edit the following line in the /etc/pam.d/login file, if it does not already exists
vim /etc/pam.d/login新增以下行
session required pam_limits.so

6.Depending on the oracle user's default shell, make the following changes to the default shell start-up file:

    For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the /etc/profile.local file on SUSE systems):
vim /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

7.建立所需目錄
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
mkdir -p /u01/app/oracle/oraInventory
mkdir -p /u02/oradata
mkdir -p /u02/flash_recovery_area

8.建立需使用者及組並授權
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper
/usr/sbin/useradd -g oinstall -G dba,oper oracle
passwd oracle
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /u02
chmod 755 -R /u02/oradata
chmod 755 -R /u02/flash_recovery_area/

9.修改oracle使用者bash_profile,新增以下內容
export TMP=/tmp;

export TMPDIR=$TMP;

export ORACLE_BASE=/u01/app/oracle;

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;

export ORACLE_SID=netdata;

export ORACLE_TERM=xterm;

export PATH=/usr/sbin:$PATH;

export PATH=$ORACLE_HOME/bin:$PATH;
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.AL32UTF8'
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
TNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMIN
alias tlog='tail -f /u01/app/oracle/admin/netdata/bdump/alert_netdata.log'
umask 022

10.修改核心版本
root帳戶
[root@ora10g-1 ~]# cp /etc/redhat-release /etc/redhat-release.bak
[root@ora10g-1 ~]# vim /etc/redhat-release
[root@ora10g-1 ~]#
[root@ora10g-1 ~]#
[root@ora10g-1 ~]# cat /etc/redhat-release
redhat-4

11.重啟伺服器,並將oracle 軟體上傳至伺服器
[root@ora10g-1 ~]# mkdir -p /u02/soft
[root@ora10g-1 ~]# chown -R oracle:oinstall /u02/soft
用oracle 登入上傳至/u02/soft目錄

12.安裝oracle軟體
[oracle@ora10g-1 ~]$ cd /u02/soft
[oracle@ora10g-1 soft]$
[oracle@ora10g-1 soft]$ pwd
/u02/soft
[oracle@ora10g-1 soft]$
ls
10201_database_linux_x86_64.cpio.gz  p8202632_10205_Linux-x86-64.zip
解壓
gunzip 10201_database_linux_x86_64.cpio
cpio -idmv <10201_database_linux_x86_64.cpio

安裝
[oracle@ora10g-1 soft]$ cd database/
[oracle@ora10g-1 database]$ ./r
response/     runInstaller  
[oracle@ora10g-1 database]$ ./r
response/     runInstaller  
[oracle@ora10g-1 database]$ ./runInstaller
[oracle@ora10g-1 database]$ ./runInstaller
正在啟動 Oracle Universal Installer...

正在檢查安裝程式要求...

檢查作業系統版本: 必須是redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      透過


所有安裝程式要求均已滿足。

準備從以下地址啟動 Oracle Universal Installer /tmp/OraInstall2015-03-01_05-33-01PM. 請稍候...[oracle@ora10g-1 database]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2015-03-01_05-33-01PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at sun.security.action.LoadLibraryAction.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
    at sun.awt.DebugHelper.(Unknown Source)
    at java.awt.Component.(Unknown Source)
    
用root安裝以下包
[root@ora10g-1 ~]# yum -y install libXp.so.6

重新安裝,介面出現亂碼
[root@ora10g-1 ~]# mkdir -p /usr/share/fonts/zh_CN/TrueType
[root@ora10g-1 ~]# cd /usr/share/fonts/zh_CN/TrueType
將windows下黑體常規修改檔名並複製到以上目錄
選擇僅安裝軟體
安裝完成
 /u01/app/oracle/oraInventory/orainstRoot.sh
更改許可權/u01/app/oracle/oraInventory 到 770.
更改組名/u01/app/oracle/oraInventory 到 oinstall.
指令碼的執行已完成 以root帳戶執行以下指令碼
[root@ora10g-1 TrueType]# /u01/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 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]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
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.

13.打補丁
[oracle@ora10g-1 soft]$ ls
10201_database_linux_x86_64.cpio  database  p8202632_10205_Linux-x86-64.zip
[oracle@ora10g-1 soft]$ unzip p8202632_10205_Linux-x86-64.zip
[oracle@ora10g-1 Disk1]$ pwd
/u02/soft/Disk1
[oracle@ora10g-1 Disk1]$ ./runInstaller
[oracle@ora10g-1 Disk1]$ ./runInstaller
正在啟動 Oracle Universal Installer...

正在檢查安裝程式要求...

檢查作業系統版本: 必須是redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
                                      未透過 <<<<

正在退出 Oracle Universal Installer。您可以在 /u01/app/oracle/oraInventory/logs/installActions2015-03-01_05-51-37PM.log 中找到本次會話的日誌

vim /etc/redhat-release
Red Hat Enterprise Linux Server release 4 (Tikanga)
[oracle@ora10g-1 Disk1]$ ./runInstaller
安裝完成
[root@ora10g-1 TrueType]# /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]:
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:

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.

14.打EM補丁p8350262_10205_Generic
[oracle@ora10g-1 soft]$ unzip p8350262_10205_Generic.zip
[oracle@ora10g-1 8350262]$ pwd
/u02/soft/8350262
[oracle@ora10g-1 8350262]$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.4.9

Oracle 中間補丁程式安裝程式版本 10.2.0.4.9
版權所有 (c) 2009, Oracle Corporation。保留所有權利。


Oracle 主目錄       : /u01/app/oracle/product/10.2.0/db_1
主產品清單: /u01/app/oracle/oraInventory
   從           : /etc/oraInst.loc
OPatch 版本    : 10.2.0.4.9
OUI 版本       : 10.2.0.5.0
OUI 位置      : /u01/app/oracle/product/10.2.0/db_1/oui
日誌檔案位置 : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2015-03-01_18-03-20下午.log

Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession 將中間補丁程式 '8350262' 應用到 OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...

OPatch 從產品清單中檢測到非叢集 Oracle 主目錄, 將僅對本地系統打補丁。

為 Oracle 主目錄備份檔案和產品清單 (不是用於自動回退)
正在備份受補丁程式 '8350262' 影響的檔案以用於還原。此操作將需要一些時間...
正在備份受補丁程式 '8350262' 影響的檔案以用於回退。此操作將需要一些時間...

正在為元件 oracle.sysman.agent.core, 10.2.0.5.0a 打補丁...
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
用 "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class" 更新 jar 檔案 "/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar"
ApplySession 將中間補丁程式 '8350262' 新增到產品清單

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.

15.建立監聽不然EM啟動不了
 netca

Oracle Net Services 配置:
正在配置監聽程式:LISTENER
預設本地命名配置完成。
監聽程式配置完成。
Oracle Net 監聽程式啟動:
正在執行監聽程式控制:
      /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start LISTENER
   監聽程式控制完成。
監聽程式已成功啟動。
成功完成 Oracle Net Services 配置。退出程式碼是0

16.dbca建庫
例項名:netdata
flash_recovery路徑:/u02/flash_recovery_area
sga:1200*0.8*0.7=672
pga:sga*0.15=100
process=500
字符集:A32UTF-8
預設語言:簡體中文
預設語言格式:中國
連線模式:專有
control01:/u02/oradata/{DB_UNIQUE_NAME}/
control02:/u02/oradata/{DB_UNIQUE_NAME}/
control03:/u02/flash_recovery_area
最大資料檔案:300
最大重做日誌檔案數:40
最大成員數:4
資料檔案路徑
/u02/oradata/{DB_UNIQUE_NAME}/
重做日誌檔案路徑:/u02/oradata/{DB_UNIQUE_NAME}/ 生產環境儘量不要放到raid5上 而且儘量不和資料檔案放在不同IO裝置上,檔案至少100M 
儲存為模板及指令碼

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-1698704/,如需轉載,請註明出處,否則將追究法律責任。

相關文章