1. 程式人生 > 資料庫 >Solaris10上安裝Oracle 11g

Solaris10上安裝Oracle 11g

平臺: Solaris 10 X86 (在VM下測試)

RDBMS: 11.2.0.4 for solaris X86平臺,64位

參考文件(官方文件寫的很詳細):

因為工作需要,在Solaris10上安裝11g。

首先,看Oracle 11g官方是否支援Solaris平臺。支援X86平臺下的solaris10.

在VM上安裝solaris 。(略)

-- 檢視solaris版本

# showrev
Hostname: sun11g
Hostid: 184a8c54
Release: 5.10
Kernel architecture: i86pc
Application architecture: i386
Hardware provider: 
Domain: 
Kernel version: SunOS 5.10 Generic_147148-26
# uname
SunOS
# cat /etc/release
                    Oracle Solaris 10 1/13 s10x_u11wos_24a X86
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013
# 
# uname -r
5.10
# 

檢視solaris的位數

# isainfo -v
64-bit amd64 applications
        avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 amd_lzcnt popcnt amd_sse4a 
        tscp cx16 sse3 sse2 sse fxsr amd_mmx mmx cmov amd_sysc cx8 tsc fpu bmi1 
        f16c fma rdrand 
32-bit i386 applications
        avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 amd_lzcnt popcnt amd_sse4a 
        tscp cx16 sse3 sse2 sse fxsr amd_mmx mmx cmov amd_sysc cx8 tsc fpu bmi1 
        f16c fma rdrand 
# 

-- solaris10上所需的package

Oracle Solaris 10

    SUNWarc
    SUNWbtool
    SUNWhea
    SUNWlibC
    SUNWlibm
    SUNWlibms
    SUNWsprot
    SUNWtoo
    SUNWi1of
    SUNWi1cs (ISO8859-1)
    SUNWi15cs (ISO8859-15)
    SUNWxwfnt
    SUNWcsl

--檢查Solaris是否已經安裝了這些包,檢查結果,是有2個包沒有安裝,需要安裝

# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl 

# 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
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
# 

把solaris安裝光碟mount上,進行安裝

cd /cdrom/sol_10_113_x86/Solaris_10/Product
pkgadd -d ./ SUNWi1cs SUNWi15cs

# pkgadd -d ./ SUNWi1cs SUNWi15cs

Processing package instance <SUNWi1cs> from </cdrom/sol_10_113_x86/Solaris_10/Product>

X11 ISO8859-1 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   8 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi1cs> [y,n,?] y

Installing X11 ISO8859-1 Codeset Support as <SUNWi1cs>

## Installing part 1 of 1.
232 blocks

Installation of <SUNWi1cs> was successful.

Processing package instance <SUNWi15cs> from </cdrom/sol_10_113_x86/Solaris_10/Product>

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   6 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi15cs> [y,n,?] y

Installing X11 ISO8859-15 Codeset Support as <SUNWi15cs>

## Installing part 1 of 1.
1460 blocks

Installation of <SUNWi15cs> was successful.
# 

再次檢視包是否已經安裝,所有的包已經安裝過了。

pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl
# 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      SUNWi15cs X11 ISO8859-15 Codeset Support
system      SUNWi1cs  X11 ISO8859-1 Codeset Support
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
# 

-- 安裝作業系統patch

4.5.1 Operating system-specific patches

Installation Type or ProductRequirement
All installationsPatches for Oracle Solaris 10:
  • 120754-06: SunOS 5.10_x86 libmtsk

  • 119961-05: SunOS 5.10_x86: Assembler

  • 119964-14: SunOS 5.10_x86 Shared library patch for C++_x86

  • 137104-02

  • 139575-03

  • 139556-08

  • 141415-04

  • 141445-09

Database Smart Flash Cache (An Enterprise Edition only feature.)The following patches are required for Oracle Solaris on x86-64 (64-bit) if you are using the flash cache feature:
140797-01
140900-01
141017-01
141415-10
141737-05

檢視作業系統patch是否安裝 ,這裡顯示結果,都已經全部安裝過了。如果沒有的話,需要在MOS上下載。

patchadd -p | grep 141445

-- 建立作業系統組 和 使用者

# groupadd oinstall
# groupadd dba
useradd -d /export/home/oracle -m -s /bin/bash -g oinstall -G dba oracle

# id oracle
uid=100(oracle) gid=100(oinstall)
# 

修改oracle使用者密碼,這裡碰到的錯誤

passwd -r files oracle

碰到了錯誤
passwd: Password cannot be circular shift of logonid.
解決方法:
修改/etc/default/passwd     NAMECHECK=NO   
passwd: The password must contain at least 1 numeric or special character(s).
解決方法:
MINSPECIAL=0
MINDIGIT=0

# passwd -r files oracle
New Password: 
Re-enter new Password: 
passwd: password successfully changed for oracle
# 

# id -p oracle
uid=100(oracle) gid=100(oinstall) projid=3(default)
# 

這裡是default,則需要新增proj配置
建立oracle使用者的project
#projadd group.dba
在/etc/user_attr檔案新增一行
oracle::::project=group.dba

修改後的結果

# id -p oracle
uid=100(oracle) gid=100(oinstall) projid=100(group.dba)
# 

修改資源限制 ,修改max-shm-memory 到 6 GB,修改max-sem-ids 到 256

-bash-3.2$ id -p
uid=100(oracle) gid=100(oinstall) projid=100(group.dba)
prctl -n project.max-shm-memory -v 6gb -r -i project group.dba
prctl -n project.max-sem-ids -v 256 -r -i project group.dba

設定最大共享記憶體為2G

# projmod -sK "project.max-shm-memory=(privileged,2G,deny)" group.dba
# 

確認最大共享記憶體

-bash-3.2$ prctl -n project.max-shm-memory -i process $$
process: 1242: -bash
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      2.00GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
-bash-3.2$ 

-- 檢視shell limit

# ulimit -s
10240
# ulimit -n
256
# 

-- 設定環境變數,使用的是bash環境變數,需要設定.bash_profile

-bash-3.2$ echo $SHELL
/bin/bash
-bash-3.2$

vi .bash_profile 
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=test; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

-- 建立安裝目錄

mkdir -p /u01/app/oracle
#mkdir /u02/oradata
chmod -R 775 /u01/app/oracle
# chown -R oracle:oinstall /u02/oradata
chmod -R 775 /u01/app/oracle
# chmod -R 775 /u02/oradata

-- 開始安裝(和在Linux下安裝是一樣的),這裡幾個引數有警告,可以修復下。

安裝後,dbca建庫(略)

登入到資料庫

-bash-3.2$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Sat Dec 26 10:59:30 2020

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

SQL> conn / as sysdba
sConnected.
SQL> elect banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Solaris: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL> 

END