Oracle Solaris11 上安装Oracle Database 19c

12C/18C/19C 专栏收录该内容
77 篇文章 3 订阅

solaris 中文参考文档
https://docs.oracle.com/cd/E56344_01/html/E53993/chapter2-16.html

参考文档:
在 Unix AIX,HP-UX,Linux,Solaris 和 MS Windows 操作系统上安装和配置 Oracle 数据库(RDBMS)的要求的快速参考(12.1/12.2/18c/19c) (Doc ID 2226599.1)
https://docs.oracle.com/en/database/oracle/oracle-database/19/ssdbi/minimum-parameter-settings-for-installation.html#GUID-732CF8A4-0157-4A05-B0A6-89CAB7FA3BA2
https://docs.oracle.com/en/database/oracle/oracle-database/19/ssdbi/supported-oracle-solaris-11-releases-for-x86-64-64-bit.html#GUID-DEA768BB-DC32-4207-8424-8DC6E8AEB79E
https://docs.oracle.com/en/database/oracle/oracle-database/19/ssdbi/configuring-additional-shared-memory-identifiers-limit.html#GUID-A655E968-61F2-441B-97B3-61BE6A6487C1
How to Create and Update a Solaris 11 Local Repository Server (Doc ID 1928542.1)

Kernel setup for Solaris 10 and Solaris 11 using project files (文档 ID 429191.1)

-- 查看swap大小

root@sun11-oracle19c:/soft# zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
rpool                             18.7G  59.6G  4.32M  /rpool
rpool/ROOT                        16.7G  59.6G    31K  none
rpool/ROOT/solaris                16.7G  59.6G  16.3G  /
rpool/ROOT/solaris/var             315M  59.6G   315M  /var
rpool/VARSHARE                    31.2M  59.6G  2.71M  /var/share
rpool/VARSHARE/kvol               27.7M  59.6G    31K  /var/share/kvol
rpool/VARSHARE/kvol/dump_summary  1.22M  59.6G  1.02M  -
rpool/VARSHARE/kvol/ereports      10.2M  59.6G  10.0M  -
rpool/VARSHARE/kvol/kernel_log    16.2M  59.6G  16.0M  -
rpool/VARSHARE/pkg                  63K  59.6G    32K  /var/share/pkg
rpool/VARSHARE/pkg/repositories     31K  59.6G    31K  /var/share/pkg/repositories
rpool/VARSHARE/sstore              623K  59.6G   623K  /var/share/sstore/repo
rpool/VARSHARE/tmp                  31K  59.6G    31K  /var/tmp
rpool/VARSHARE/zones                31K  59.6G    31K  /system/zones
rpool/dump                        1.00G  59.6G  1.00G  -
rpool/export                        63K  59.6G    32K  /export
rpool/export/home                   31K  59.6G    31K  /export/home
rpool/swap                        1.00G  59.6G  1.00G  -
root@sun11-oracle19c:/soft# 

zfs不支持mkfile的方式增加swap,需要使用zfs set的方式添加swap

root@sun11-oracle19c:/soft# zfs set volsize=3G rpool/swap
root@sun11-oracle19c:/soft# swap -l -h
swapfile                 dev            swaplo      blocks        free
/dev/zvol/dsk/rpool/swap 231,5              4K        1.0G        1.0G 
/dev/zvol/dsk/rpool/swap 231,5            1.0G        2.0G        2.0G 
root@sun11-oracle19c:/soft# 

-- 查看内存大小

root@sun11-oracle19c:/soft# prtconf | grep "Memory size"
Memory size: 2048 Megabytes
root@sun11-oracle19c:/soft# 

-- 查看系统架构

root@sun11-oracle19c:/soft# /bin/isainfo -kv
64-bit amd64 kernel modules
        prfchw bmi1 f16c fma rdrand avx xsave pclmulqdq aes movbe
        sse4_2 sse4_1 ssse3 amd_lzcnt popcnt amd_sse4a tscp ahf cx16
        sse3 sse2 sse fxsr amd_mmx mmx cmov amd_sysc cx8 tsc fpu
root@sun11-oracle19c:/soft# 

-- 创建本地 repo

# zfs create -o mountpoint=/export/repoSolaris11/  rpool/export/repoSolaris11
# zfs set atime=off  rpool/export/repoSolaris11

# zfs create -o mountpoint=/export/iso  rpool/export/iso
# mkdir /export/iso/GA
# cd /export/iso/GA

将repo包下载后,放在/export/iso/GA 目录下

root@sun11-oracle19c:/export/iso/GA# ls -l
]total 18817556
-rw-r--r--   1 root     root       12262 Jan  9 10:26 install-repo.ksh
-rw-r--r--   1 root     root     1968246581 Jan  9 11:16 sol-11_4-repo_1of5.zip
-rw-r--r--   1 root     root     1814619737 Jan  9 10:50 sol-11_4-repo_2of5.zip
-rw-r--r--   1 root     root     1772147401 Jan  9 10:31 sol-11_4-repo_3of5.zip
-rw-r--r--   1 root     root     2132702935 Jan  9 11:40 sol-11_4-repo_4of5.zip
-rw-r--r--   1 root     root     1939943920 Jan  9 12:48 sol-11_4-repo_5of5.zip
-rw-r--r--   1 root     root         495 Jan  9 10:26 sol-11_4-repo_digest.txt
root@sun11-oracle19c:/export/iso/GA# 

授予脚本权限,运行ksh脚本安装repo 

# ./install-repo.ksh -d /export/repoSolaris11/
root@sun11-oracle19c:/export/iso/GA# ./install-repo.ksh -d /export/repoSolaris11/
Using sol-11_4-repo download.
Uncompressing sol-11_4-repo_1of5.zip...done.
Uncompressing sol-11_4-repo_2of5.zip...done.
Uncompressing sol-11_4-repo_3of5.zip...done.
Uncompressing sol-11_4-repo_4of5.zip...done.
Uncompressing sol-11_4-repo_5of5.zip...done.
Repository can be found in /export/repoSolaris11/.
root@sun11-oracle19c:/export/iso/GA# 

-- 这个时候查看镜像,还是http的,需要更改成local的 (pkg参数 -G为删除publisher,-g为添加publisher)

root@sun11-oracle19c:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://pkg.oracle.com/solaris/release/
root@sun11-oracle19c:~# 

root@sun11-oracle19c:~# pkg set-publisher -g file:export/repoSolaris11 solaris
pkg: 0/1 catalogs successfully updated (1 partial):

1/2 repositories for publisher 'solaris' could not be refreshed.

Unable to contact valid package repository: http://pkg.oracle.com/solaris/release/
Encountered the following error(s):
  Framework error: code: E_MULTI_UNKNOWN_OPTION (6) reason: Could not resolve host: pkg.oracle.com
URL: 'http://pkg.oracle.com/solaris/release' (happened 4 times)


root@sun11-oracle19c:~# pkg set-publisher -G '*' -M '*' -g file:export/repoSolaris11 solaris   
root@sun11-oracle19c:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///export/repoSolaris11/
root@sun11-oracle19c:~# 


# pkg set-publisher -Pe -O http://pkg.oracle.com/solaris/release solaris    -- 恢复在线repo

-- 操作系统组

# /usr/sbin/groupadd -g 54327 asmdba
# /usr/sbin/groupadd -g 54328 asmoper
# /usr/sbin/groupadd -g 54322 dba
# /usr/sbin/groupadd -g 54323 oper
# /usr/sbin/groupadd -g 54324 backupdba
# /usr/sbin/groupadd -g 54325 dgdba
# /usr/sbin/groupadd -g 54326 kmdba
# /usr/sbin/groupadd -g 54329 oinstall
# /usr/sbin/groupadd -g 54330 racdba

-- 创建用户,并修改密码

useradd -d /export/home/oracle -m -s /bin/bash -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle  -- 要这样建立用户,否则,切换到oracle账号,
出现错误su: No directory!原因是建立oracle用户的时候,没有指定home目录
passwd -r files oracle

-- 创建文件夹

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

-- 配置环境变量,先看是的是那种shell (用的是bash shell)

$ echo $SHELL
$ vi .bash_profile
umask 022

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=test; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

-- 在oracle或者grid的用户下的.bashrc or .cshrc 做设置,主要目的是防止安装grid的时候,ssh的时候,makefile错误(这里没有安装GI,不需要) 。
--Bourne, Bash, or Korn shell:

if [ -t 0 ]; then
   stty intr ^C
fi

-- C shell 
test -t 0
if ($status == 0) then
   stty intr ^C
endif

-- 解压安装文件

$ mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
$ cd /u01/app/oracle/product/19.0.0/dbhome_1    -- 这样直接解压到Oracle_HOME
$ unzip -q /tmp/db_home.zip

-- 安装所需要的包(以下是手动安装配置Oracle,而不是使用oracle-database-preinstall-19c)

The following packages must be installed:

pkg://solaris/system/library/openmp
pkg://solaris/compress/unzip
pkg://solaris/developer/assembler
pkg://solaris/developer/build/make
pkg://solaris/system/dtrace
pkg://solaris/system/header
pkg://solaris/system/library
pkg://solaris/system/linker
pkg://solaris/system/xopen/xcu4 (If not already installed as part of standard Oracle Solaris 11 installation)
pkg://solaris/x11/diagnostic/x11-info-clients
pkg://solaris/system/kernel/oracka  (Only for Oracle Real Application Clusters installations)

Note:Starting with Oracle Solaris 11.2, if you have performed a standard Oracle Solaris 11 installation, 
and installed the Oracle Database prerequisites group package oracle-database-preinstall-19c, 
then you do not have to install these packages, as oracle-database-preinstall-19c installs them for you. 

--进行包的安装,(这里只安装一个,其他的略)

root@sun11-oracle19c:~# pkg install --accept pkg://solaris/system/library/openmp
           Packages to install:  2
       Create boot environment: No
Create backup boot environment: No

DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                2/2         17/17      0.5/0.5      --

PHASE                                          ITEMS
Installing new actions                         59/59
Updating package state database                 Done 
Updating package cache                           0/0 
Updating image state                            Done 
Creating fast lookup database                   Done 
Updating package cache                           1/1 
root@sun11-oracle19c:~# 

-- 内核参数,应该是一个最小值 (方法和solaris10类似,使用prctl)

project.max-sem-ids 	100
process.max-sem-nsems 	256
project.max-shm-memory 	-- This value varies according to the RAM size.See section “Requirements for Shared Memory Resources” for minimum values.
project.max-shm-ids  100  -- See section “Configuring Additional Shared Memory Identifiers Limit”.
tcp_smallest_anon_port 	9000
tcp_largest_anon_port 	65500
udp_smallest_anon_port 	9000
udp_largest_anon_port 	65500


prctl -n project.max-shm-memory -i project default

prctl -n project.max-sem-ids -v 300 -r -i project default
prctl -n project.max-shm-memory -v 3gb -r -i project default

-- 共享内存

RAM                                 project.max-shm-memory setting
1 GB to 16 GB                 Half the size of physical memory
Greater than 16 GB         At least 8 GB

从18c开始 Additional number of MGA segments (project.max-shm-ids) = MGA memory size / granule size 。 对应一个granule 。
所以,根据共享内存设置的大小以及granule粒度,可以计算出project.max-shm-ids的值
可以参考https://docs.oracle.com/en/database/oracle/oracle-database/19/ssdbi/configuring-additional-shared-memory-identifiers-limit.html#GUID-A655E968-61F2-441B-97B3-61BE6A6487C1

设置最大共享内存段为3G 

projmod -sK "project.max-shm-memory=(privileged,3G,deny)" default

正常应该是这样

root@sun11-oracle19c:/soft/repo# cat /etc/project 
system:0::::
user.root:1::::
noproject:2::::
default:3::::project.max-shm-memory=(privileged,3221225472,deny)
group.staff:10::::
root@sun11-oracle19c:/soft/repo# 

通过id和prctl检查结果

-bash-4.4$ prctl -n project.max-shm-memory -i process $$
process: 6934: -bash
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        usage               0B   
        privileged      3.00GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
-bash-4.4$ 

--设置tcp和udp内核参数
检查当前的值

# ipadm show-prop -p smallest_anon_port,largest_anon_port tcp

PROTO PROPERTY           PERM CURRENT PERSISTENT DEFAULT POSSIBLE
tcp   smallest_anon_port rw   32768       --     32768   1024-65535
tcp   largest_anon_port  rw   65500       --     65535   32768-65535

设置参数值

# ipadm set-prop -p smallest_anon_port=9000 tcp
# ipadm set-prop -p largest_anon_port=65500 tcp
# ipadm set-prop -p smallest_anon_port=9000 udp
# ipadm set-prop -p largest_anon_port=65500 udp

配置当前shell的值(这个没有找到在那里设置,安装的时候,也全部通过了)

安装 及 dbca  (dbca略)

$ cd /u01/app/oracle/product/19.0.0/dbhome_1
$ ./runInstaller

登录Oracle

-bash-4.4$ sqlplus /nolog

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 11 23:23:30 2021
Version 19.5.0.0.0

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

SQL> conn / as sysdba
Connected.
SQL> select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL>

--安装PSU,和Linux下一样 (略)

OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ld: warning: mapfile: text segment: section '.text%rwssid' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kdimod0' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kss_set_proc' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kturrur' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kturru' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kssocbg' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kkoadsTimeLimitFromSrc' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%dbglWriteLogMsgtoDisk' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kdmrExeKtsjTask' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kokl_pdbaware_kdlf_copy' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kkeapr' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kkjex1s' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kkjcjchk' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kudmro' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kudmrOpenCBK' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%sdbgrf_addpath_create' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%ksmem_alcpri' does not appear in any input file
ld: warning: mapfile: text segment: section '.text%kssdmp1' does not appear in any input file


Patch 31666885 successfully applied.
Sub-set patch [30125133] has become inactive due to the application of a super-set patch [31666885].
Please refer to Doc ID 2161861.1 for any possible further required actions.
OPatch Session completed with warnings.
Log file location: /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-01-12_00-32-52AM_1.log

OPatch completed with warnings.
-bash-4.4$

-- 参考文档(没有找到19c的)
Installation of 12c on Solaris 10 gives warnings "text segment: section '.text...........' does not appear in any input file" (Doc ID 2141496.1)
12cR1:"ld: warning: mapfile: text segment: section" Errors During Patching (Doc ID 1966625.1)

END

  • 1
    点赞
  • 0
    评论
  • 3
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

参与评论 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:技术工厂 设计师:CSDN官方博客 返回首页

打赏作者

文档搬运工

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值