Solaris 10下安裝Oracle11r2

xingfei80發表於2010-07-08

Solaris 10下安裝Oracle11r2

轉自:http://yangtingkun.itpub.net/post/468/501814

前一段時間本打算安裝Solaris上的Oracle,可惜一是沒有安裝文件,二是作業系統版本不夠高,最近下載了一個最新的Solaris 10,安裝一下Oracle 11.2.0.1 for Solaris 10 sparc

[@more@]

首先檢查硬體情況:

# /usr/sbin/prtconf | grep "Memory size"
Memory size: 4096 Megabytes
# /usr/sbin/swap -l
交換檔案 dev swaplo blocks free
/dev/dsk/c2t0d0s1 118,9 16 8389632 8389632
# /bin/isainfo -kv
64-bit sparcv9 kernel modules
# df -k /tmp
檔案系統 千位元組 用了 可用 容量 掛接在

swap 7109504 80 7109424 1% /tmp
# df -k /data
檔案系統 千位元組 用了 可用 容量 掛接在
/dev/dsk/c2t1d0s7 35024906 1282138 33392519 4% /data

硬體一般都不是問題,連這個N年的老480都能滿足要求。

下面看軟體要求:

# uname -r
5.10
# more /etc/release
Solaris 10 10/09 s10s_u8wos_08a SPARC
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 16 September 2009

Oracle要求的系統版本必須是U6以上,0810月之後的版本。

檢查系統包:

# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWcsl Core Solaris, (Shared Libs)
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
錯誤: 未發現"SUNWi1cs"的資訊錯誤: 未發現"SUNWi15cs"的資訊

這裡缺少了SUNWi1csSUNWi15cs兩個包,不過記得以前的版本似乎確實這兩個包也能安裝成功,這裡暫時忽略這個問題。

下面檢查系統patch資訊:

120753-06
139574-03
119963-14
124861-15
125555-03
140796-01
140899-01
141016-01
139555-08
141414-10
141736-05

對於SPARC晶片的CPU,確保作業系統安裝的補丁大於上面補丁號,可以透過patchadd –p | grep來檢查補丁安裝情況:

# patchadd -p | grep 120753
Patch: 120753-07 Obsoletes: Requires: Incompatibles: Packages: SUNWlibmsr SUNWlibm

其中前面兩個是必須的,隨後的兩個對於編譯C/C++ OCI等程式所需。

最後的幾個是Database Smart Flash Cache所需的。

下面建立組和使用者:

# groupadd oinstall
# groupadd -g 502 dba
# groupadd -g 503 oper
# groupadd -g 504 asmadmin
# groupadd -g 505 asmoper
# groupadd -g 506 asmdba
# useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
# passwd -r files oracle

# mkdir /export/home/oracle
# chown -R oracle:dba /export/home/oracle
# usermod -d /export/home/oracle oracle

Oracle使用者下檢查SHELL的限制:

# su – oracle
$ ulimit -t -f -d -s -n -v
時間() 沒有限制檔案() 沒有限制資料(千位元組) 沒有限制(千位元組) 8192檔案數(描述符) 256儲存區(千位元組) 沒有限制

堆疊和檔案數設定比推薦值小,對這兩個引數進行設定

編輯Oracle的啟動shell指令碼:

$ vi .profile
".profile"
[新檔案]
ulimit -s 32768
ulimit -n 65536

ORACLE_SID=ora112
export ORACLE_SID
ORACLE_BASE=/data/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
DISPLAY=172.25.0.115:1.0
export DISPLAY

利用root建立OracleORACLE_BASE目錄,並授權:

# mkdir -p /data/oracle/product/11.2
# chown -R oracle:oinstall /data

最後修改系統的引數限制:

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_shmmni=100

/etc/system檔案中新增上面的配置。如果願意可以重新系統使配置生效,不過11gr2的安裝程式,可以自動調整系統的配置。

下面解壓檔案後,用root登陸圖形介面設定xhost +後,就可以開始安裝過程了:

# xhost +
access control disabled, clients can connect from any host
# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ cd /data/database
$ ./runInstaller

安裝介面最開始的部分就是提供給Oracle支援的郵件地址資訊以及metalink帳號,Oracle把支援部分的內容放到了第一個頁面,其中深意不言而喻了。這裡如果不提供使用者資訊,Oracle還會彈出一個告警的對話方塊。

安裝選項部分可以選擇安裝配置資料庫、只安裝軟體和升級已經存在的資料庫。這裡選擇了只安裝軟體,一會打算手工啟動DBCA來安裝資料庫。

接著是網格配置,選擇單例項資料庫還是RAC環境。

語言選擇新增簡體中文。

然後安裝版本選擇企業版。

在安裝位置設定合適的ORACLE_BASEORACLE_HOME目錄。

確認組選項後,開始作業系統、硬體的檢查。

這裡檢查出作業系統的核心設定不滿足要求,不過可以利用安裝程式自動修復。點選修補並再次檢查後,彈出對話方塊,要求用root執行一個指令碼:

# /var/tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
/usr/bin/id
Response file being used is :/var/tmp/CVU_11.2.0.1.0_oracle/fixup.response
Enable file being used is :/var/tmp/CVU_11.2.0.1.0_oracle/fixup.enable
Log file location: /var/tmp/CVU_11.2.0.1.0_oracle/orarun.log
Setting Kernel Parameters...
99

修復後,還有一個補丁的錯誤,這裡選擇忽略。

最後執行兩個指令碼後,安裝順利完成:

# /data/oraInventory/orainstRoot.sh更改許可權/data/oraInventory.新增組的讀取和寫入許可權。刪除全域性的讀取, 寫入和執行許可權。

更改組名/data/oraInventory oinstall.指令碼的執行已完成。
# /data/oracle/product/11.2/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /data/oracle/product/11.2

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Creating /usr/local/bin directory...
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...


Creating /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/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.
Finished product-specific root actions.

首先利用NETCA配置監聽和本地服務命令,然後利用dbca完成建庫操作。

bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 7 7 15:15:15 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from v$version;

BANNER
------------------------------------------------------------------------------
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 Solaris: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

官方文件說改這個
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_shmmni=100
用下面的方式:
projadd -U oracle user.oracle
projmod -a-K "project.max-shm-memory=(priv,10g,deny)" user.oracle
projmod -a-K "project.max-sem-ids=(priv,100,deny)" user.oracle
projmod -a-K "process.max-sem-nsems=(priv,500,deny)" user.oracle
projmod -a-K "project.max-shm-ids=(priv,100,deny)" user.oracle
修改之後只要切換到oracle使用者設定就生效了,重啟之後也不會丟失

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

相關文章