Centos6.5 下静默安装oracle11.2.0.4 打PSU补丁步骤
——–仅供参考———
安装centos6.5操作系统忽略
由于本人在vbox虚拟机安装,新增了一块vdi虚拟磁盘用于存储数据文件
安装过程如下:
操作系统环境:
[root@aixo ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[root@aixo ~]# uname -a
Linux aixo 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@aixo ~]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 21G 9.2G 11G 46% /
tmpfs 1.6G 230k 1.6G 1% /dev/shm
/dev/sda1 204M 36M 157M 19% /boot
/dev/sda3 4.3G 143M 3.9G 4% /home
[root@aixo ~]# vi /etc/inittab id:3:initdefault: ~
分区及创建pv vg lv
[root@aixo /]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xc983830b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc983830b
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@aixo /]# ls -la /dev/sd*
brw-rw----. 1 root disk 8, 0 8月 2 10:41 /dev/sda
brw-rw----. 1 root disk 8, 1 8月 2 10:41 /dev/sda1
brw-rw----. 1 root disk 8, 2 8月 2 10:41 /dev/sda2
brw-rw----. 1 root disk 8, 3 8月 2 10:41 /dev/sda3
brw-rw----. 1 root disk 8, 4 8月 2 10:41 /dev/sda4
brw-rw----. 1 root disk 8, 5 8月 2 10:41 /dev/sda5
brw-rw----. 1 root disk 8, 16 8月 2 10:46 /dev/sdb
brw-rw----. 1 root disk 8, 17 8月 2 10:45 /dev/sdb1
[root@aixo /]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@aixo /]# vgcreate vgdb /dev/sdb1
Volume group "vgdb" successfully created
[root@aixo /]# lvcreate -L +19G -n lv_database vgdb
Logical volume "lv_database" created
[root@aixo /]# mkfs.ext4 /dev/vgdb/lv_database
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1245184 inodes, 4980736 blocks
249036 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
152 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@aixo /]# vi /etc/fstab
新增/dev/vgdb/lv_database /oradata ext4 defaults 0 0
[root@aixo /]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 21G 9.2G 11G 46% /
tmpfs 1.6G 0 1.6G 0% /dev/shm
/dev/sda1 204M 36M 157M 19% /boot
/dev/sda3 4.3G 143M 3.9G 4% /home
/dev/mapper/vgdb-lv_database 21G 181M 19G 1% /oradata
[root@aixo /]# free -m
total used free shared buffers cached
Mem: 3038 278 2759 0 26 96
-/+ buffers/cache: 155 2883
Swap: 4095 0 4095
以下是安装oracle前环境准备
1.cat /etc/security/limits.conf
#####add by Wxq on 20170526
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
2.[root@nmzhd-db1 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
#####add by Wxq on 20170526
session required /lib/security/pam_limits.so
session required pam_limits.so
3.cat /etc/sysctl.conf
#####add by Wxq on 20170526
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
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
sysctl -p ---参数生效
4.cat /etc/profile
#####add by Wxq on 20170526
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
建oracle用户组及用户
[root@aixo ~]# groupadd oinstall
[root@aixo ~]# groupadd dba
[root@aixo ~]# useradd -g oinstall -G dba -m oracle
修改oracle环境变量
Vi.bash_profile
export PATH
export LANG=C
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=testdb
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:/sbin:$PATH:$PRODDIR/bin
export LC_ALL="zh_CN.GBK"
umask 022
Chown –R oracle:oinstall /u01
用于静默安装的响应文件
[oracle@aixo ~]$ cat database11g.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=aixo
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/oracle/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES
静默安装
[oracle@aixo database]$ ./runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /home/oracle/database11g.rsp -showProgress
正在启动 Oracle Universal Installer...
检查临时空间: 必须大于 120 MB。 实际为 7203 MB 通过
检查交换空间: 必须大于 150 MB。 实际为 4095 MB 通过
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2017-08-02_12-45-34PM. 请稍候...
[oracle@aixo database]$ [WARNING] [INS-32055] 主产品清单位于 Oracle 基目录中。
原因: 主产品清单位于 Oracle 基目录中。
操作: Oracle 建议将此主产品清单放置在 Oracle 基目录之外的位置中。
可以在以下位置找到本次安装会话的日志:
/u01/oracle/app/oraInventory/logs/installActions2017-08-02_12-45-34PM.log
准备 正在进行中。
.................................................. 9% 完成。
准备成功。
复制文件 正在进行中。
.................................................. 14% 完成。
.................................................. 20% 完成。
.................................................. 26% 完成。
.................................................. 31% 完成。
.................................................. 36% 完成。
.................................................. 41% 完成。
.................................................. 47% 完成。
.................................................. 52% 完成。
.................................................. 57% 完成。
.................................................. 63% 完成。
.................................................. 68% 完成。
.................................................. 73% 完成。
.................................................. 78% 完成。
.................................................. 83% 完成。
..............................
复制文件成功。
链接二进制文件 正在进行中。
..........
链接二进制文件成功。
安装程序文件 正在进行中。
.................................................. 88% 完成。
.................................................. 94% 完成。
安装程序文件成功。
Oracle Database 11g 的 安装 已成功。
请查看 '/u01/oracle/app/oraInventory/logs/silentInstall2017-08-02_12-45-34PM.log' 以获取详细资料。
执行 Root 脚本 正在进行中。
以 root 用户的身份执行以下脚本:
1. /u01/oracle/app/oraInventory/orainstRoot.sh ---*root执行,注意别漏掉执行*
2. /u01/oracle/product/11.2.0/db_1/root.sh ---*root执行,注意别漏掉执行*
.................................................. 100% 完成。
执行 Root 脚本成功。
Successfully Setup Software.
注意:一定要记着root执行那两个脚本重点内容
验证:
[oracle@aixo ~]$ sqlplus -v
SQL*Plus: Release 11.2.0.4.0 Production
补丁文件
unzip p6880880_112000_Linux-x86-64.zip
[root@aixo oracle]# su - oracle
[oracle@aixo ~]$ mv /u01/oracle/product/11.2.0/db_1/OPatch /u01/oracle/product/11.2.0/db_1/OPatch.bak
[root