环境介绍
宿主机 Mac优胜美地
虚拟机软件 VMware Fusion 7.1
虚拟机系统 Oracle Linux 6.6
数据库软件 Oracle 12.1.0.2
OPatch 12.1.0.1.6
Patch 19769480
一 安装虚拟机系统Oracle Linux 6.6
1. 更多选项,继续
2. 创建自定义虚拟机,继续
3. Linux -> Oracle Enterpr Linux 64 位,继续
4. 自定设置
5. 新建虚拟磁盘,继续
6. 存储为“OEL_6_6_Oracle12c”,存储
6. 存储为“OEL_6_6_Oracle12c”,存储
8. 设置CPU为2核(可选项),内存设置为2048MB(根据主机配置情况酌情添加)
9. 设置磁盘大小为30GB
10. 设置网络连接方式为“仅主机模式”(hostonly)
11. 加载操作系统盘的iso,本次安装采用oracle官网下载的OracleLinuxR6 U6。ios名为V52218-01
12. Instarll or upgrade an existing system,回车
13. skip,回车
14. Next
15. English(English),Next
16. U.S.English,Next
17. Basic Storage Devices,Next
18. Yes,discard any data
19. 点击“Configure Network”配置网络信息,点击Add添加一个网卡
20. 勾选“Connect automatically”
在IPv4 Settings中将Method选择为Manual方式
设置网卡地址:172.16.228.12,子网掩码为255.255.255.0,网关为172.16.228.2
此部分根据自己的网路环境自行配制
配置结束后点击Apply确认
21. 时区随意,Next
22. 输入密码,Use Anyway,Next
23. Replace Existing Linux System(s),Next
24.Desktop,Next
25. 进度条100%后,Next
26. Reboot
27. Forward
28. Forward
29. No,I prefer to register at a later time. Forward
30. Forward
31. Forward
32. Forward
32. Forward
34. 输入密码进入操作系统
35. 登录时前选择加载光盘,为后续的工作做一下铺垫
二,安装数据库软件
[root@snow ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[root@snow ~]# grep MemTotal /proc/meminfo
MemTotal: 1774280 kB
[root@snow ~]# grep SwapTotal /proc/meminfo
SwapTotal: 3145724 kB
[root@snow ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_snow-lv_root
27228028 3207852 22614020 13% /
tmpfs 887140 76 887064 1% /dev/shm
/dev/sda1 487652 65654 392302 15% /boot
/dev/sr0 3762380 3762380 0 100% /media/OL6.6 x86_64 Disc 1 20141018
添加主机ip地址和域名
[root@snow ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.228.12 snow.oracle.com
mount操作系统光盘
[root@snow ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
移走现有的public-yum-ol6.repo
[root@snow ~]# mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.bak
创建本次使用的12c.repo
[root@snow ~]# vi /etc/yum.repos.d/snow12c.repo
[Oracle]
name=OEL-$releasever - Media
baseurl=file:///mnt
gpgcheck=0
enabled=1
采用oracle封装的简易配置包来安装rpm修改内核参数,系统限制,并且为我们创建了oracle用户和组
[root@snow ~]# yum install oracle-rdbms-server-12cR1-preinstall
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-12.el6 will be installed
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
---> Package gcc-c++.x86_64 0:4.4.7-11.el6 will be installed
---> Package ksh.x86_64 0:20120801-21.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
oracle-rdbms-server-12cR1-preinstall x86_64 1.0-12.el6 Oracle 16 k
Installing for dependencies:
compat-libcap1 x86_64 1.10-1 Oracle 17 k
compat-libstdc++-33 x86_64 3.2.3-69.el6 Oracle 183 k
gcc-c++ x86_64 4.4.7-11.el6 Oracle 4.7 M
ksh x86_64 20120801-21.el6 Oracle 758 k
libaio-devel x86_64 0.3.107-10.el6 Oracle 13 k
libstdc++-devel x86_64 4.4.7-11.el6 Oracle 1.6 M
Transaction Summary
=========================================================================================================
Install 7 Package(s)
Total download size: 7.3 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
---------------------------------------------------------------------------------------------------------
Total 35 MB/s | 7.3 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libstdc++-devel-4.4.7-11.el6.x86_64 1/7
Installing : gcc-c++-4.4.7-11.el6.x86_64 2/7
Installing : ksh-20120801-21.el6.x86_64 3/7
Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 4/7
Installing : libaio-devel-0.3.107-10.el6.x86_64 5/7
Installing : compat-libcap1-1.10-1.x86_64 6/7
Installing : oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64 7/7
Verifying : compat-libcap1-1.10-1.x86_64 1/7
Verifying : oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64 2/7
Verifying : gcc-c++-4.4.7-11.el6.x86_64 3/7
Verifying : libaio-devel-0.3.107-10.el6.x86_64 4/7
Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 5/7
Verifying : ksh-20120801-21.el6.x86_64 6/7
Verifying : libstdc++-devel-4.4.7-11.el6.x86_64 7/7
Installed:
oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-12.el6
Dependency Installed:
compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6
gcc-c++.x86_64 0:4.4.7-11.el6 ksh.x86_64 0:20120801-21.el6
libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.7-11.el6
Complete!
刚才的脚本已经将Oracle用户和组创建好了
[root@snow ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
设置oracle密码
[root@snow ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
内核参数也被设置好了
注意oracle-rdbms-server-12cR1-preinstall setting for… 的部分
[root@snow ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
# oracle-rdbms-server-12cR1-preinstall setting for fs.file-max is 6815744
fs.file-max = 6815744
# oracle-rdbms-server-12cR1-preinstall setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmni is 4096
kernel.shmmni = 4096
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmall is 1073741824 on x86_64
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104
# oracle-rdbms-server-12cR1-preinstall setting for kernel.panic_on_oops is 1 per Orabug 19642132
kernel.panic_on_oops = 1
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576
# oracle-rdbms-server-12cR1-preinstall setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576
# oracle-rdbms-server-12cR1-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500
手工添加安全限制内容
vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
关闭防火墙
[root@snow ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
禁用SELINUX
[root@snow ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
创建目录
[root@snow ~]# mkdir -p /u01/app/oracle
[root@snow ~]# chown -R oracle:oinstall /u01
[root@snow ~]# chmod -R 775 /u01
设置oracle环境变量,为了方便后面的PSU升级添加OPatch路径
[root@snow ~]# su - oracle
[oracle@snow ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=snow
export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
stty erase ^h
使环境变量生效并测试
[oracle@snow ~]$ . .bash_profile
[oracle@snow ~]$ env|grep ORA
ORACLE_SID=snow
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
上传介质安装介质到/tmp目录
[oracle@snow ~]$ ls -l /tmp
total 2814852
drwxr-xr-x. 3 oracle oinstall 4096 Feb 8 16:18 CVU_12.1.0.2.0_oracle
drwxr-xr-x. 2 oracle oinstall 4096 Feb 8 18:00 hsperfdata_oracle
drwx------. 2 root root 4096 Feb 8 13:22 keyring-Uy45if
-rw-r--r--. 1 root root 1673544724 Feb 8 13:53 linuxamd64_12102_database_1of2.zip
-rw-r--r--. 1 root root 1014530602 Feb 8 13:53 linuxamd64_12102_database_2of2.zip
drwx------. 2 gdm gdm 4096 Feb 8 13:22 orbit-gdm
drwx------. 2 root root 4096 Feb 8 14:28 orbit-root
-rw-r--r--. 1 root root 42075550 Feb 8 13:53 p19769480_121020_Linux-x86-64.zip
-rw-r--r--. 1 root root 99983417 Feb 8 13:53 p19877336_121020_Linux-x86-64.zip
-rw-r--r--. 1 root root 52216311 Feb 8 16:00 p6880880_121010_Linux-x86-64.zip
drwx------. 2 root root 4096 Feb 8 13:22 pulse-CVJbKuDjpRJL
drwx------. 2 gdm gdm 4096 Feb 8 13:22 pulse-yUx19YncqBHp
drwx------. 2 root root 4096 Feb 8 13:22 virtual-root.uvY7TA
-rw-------. 1 root root 0 Feb 8 13:07 yum.log
在oracle目录加压素介质
[oracle@snow ~]$ pwd
/home/oracle
[oracle@snow ~]$ unzip /tmp/linuxamd64_12102_database_1of2.zip
[oracle@snow ~]$ unzip /tmp/linuxamd64_12102_database_2of2.zip
解压后为database文件夹
[oracle@snow ~]$ ll
total 4
drwxr-xr-x. 7 oracle oinstall 4096 Jun 10 2013 database
通过x11来启动图形安装工具
此处可能是bug,用下面的方法修复
[root@snow ~]# find / -name *javavm12*
/u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk7/lib/libjavavm12.a
/u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk6/lib/libjavavm12.a
[root@snow ~]#
[root@snow ~]# su - oracle
[oracle@snow ~]$ cd $ORACLE_HOME/lib
[oracle@snow lib]$ cp /u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk7/lib/libjavavm12.a .
[oracle@snow lib]$ ls -l *java*
-rw-r--r--. 1 oracle oinstall 2574084 Jun 17 2014 libcorejava.so
-rw-r--r--. 1 oracle oinstall 32244110 Feb 8 14:06 libjavavm12.a
[oracle@snow lib]$
点击retry从重新尝试
[root@snow ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@snow ~]# /u01/app/oracle/product/12.1.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.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 script.
Now product-specific root actions will be performed.
执行完脚本后点击ok完成此次安装
查看当前数据库软件的版本
[root@snow ~]# su - oracle
[oracle@snow ~]$ cd $ORACLE_HOME/OPatch
[oracle@snow OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.3
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_14-10-14PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-02-08_14-10-14PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
注意:当前的OPatch版本不符合要求,需要升级到12.1.0.1.4以上
2.1 OPatch Utility
You must use the OPatch utility version 12.1.0.1.4 or later to apply this patch. Oracle recommends that you use the latest released OPatch version for 12.1, which is available for download from My Oracle Support patch 6880880 by selecting the 12.1.0.1.0 release.
更新OPatch,确认环境变量中加入OPatch路径
[oracle@snow ~]$ echo $PATH
/u01/app/oracle/product/12.1.0/db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/12.1.0/db_1/OPatch
解压缩OPatch补丁包
[oracle@snow ~]$ unzip /tmp/p6880880_121010_Linux-x86-64.zip
备份现有版本的OPatch
[oracle@snow ~]$ cd $ORACLE_HOME
[oracle@snow db_1]$ OPatch/opatch version
OPatch Version: 12.1.0.1.3
OPatch succeeded.
[oracle@snow db_1]$ mv OPatch OPatch12.1.0.1.3
更新新版本OPatch
[oracle@snow db_1]$ cp -Rp /home/oracle/OPatch .
[oracle@snow db_1]$ OPatch/opatch version
OPatch Version: 12.1.0.1.6
OPatch succeeded.
回到Oracle home目录,校验补丁的兼容性
[oracle@snow db_1]$ cd
[oracle@snow ~]$
[oracle@snow ~]$
[oracle@snow ~]$ cd 19769480/
[oracle@snow 19769480]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_16-08-00PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
开始应用opatch补丁程序
[oracle@snow 19769480]$ opatch apply
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/19769480_Feb_08_2015_16_10_46/apply2015-02-08_16-10-46PM_1.log
Applying interim patch '19769480' to OH '/u01/app/oracle/product/12.1.0/db_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 直接回车
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Patching component oracle.rdbms.deconfig, 12.1.0.2.0...
Patching component oracle.xdk, 12.1.0.2.0...
Patching component oracle.tfa, 12.1.0.2.0...
Patching component oracle.rdbms.util, 12.1.0.2.0...
Patching component oracle.rdbms, 12.1.0.2.0...
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...
Patching component oracle.xdk.parser.java, 12.1.0.2.0...
Patching component oracle.oraolap, 12.1.0.2.0...
Patching component oracle.xdk.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rman, 12.1.0.2.0...
Patching component oracle.ldap.rsf, 12.1.0.2.0...
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0...
Verifying the update...
Patch 19769480 successfully applied
Log file location: /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/19769480_Feb_08_2015_16_10_46/apply2015-02-08_16-10-46PM_1.log
OPatch succeeded.
升级后验证一下结果,Patch 19769480
[oracle@snow ~]$ cd $ORACLE_HOME/OPatch
[oracle@snow OPatch]$ ./opatch version
OPatch Version: 12.1.0.1.6
OPatch succeeded.
[oracle@snow OPatch]$ ./opatch lsinventory;
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_18-00-42PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-02-08_18-00-42PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 19769480 : applied on Sun Feb 08 16:14:40 EST 2015
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401
--------------------------------------------------------------------------------
OPatch succeeded.
DBCA创建数据库
[oracle@snow ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 8 17:57:06 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> @?/rdbms/admin/utlrp.sql
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2015-02-08 17:57:34
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
PL/SQL procedure successfully completed.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2015-02-08 17:57:36
DOC> The following query reports the number of objects that have compiled
DOC> with errors.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
...Database user "SYS", database schema "APEX_040200", user# "98" 17:58:00
...Compiled 0 out of 3014 objects considered, 0 failed compilation 17:58:01
...271 packages
...263 package bodies
...452 tables
...11 functions
...16 procedures
...3 sequences
...457 triggers
...1320 indexes
...211 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 17:58:01
...Completed key object existence check 17:58:01
...Setting DBMS Registry 17:58:01
...Setting DBMS Registry Complete 17:58:01
...Exiting validate 17:58:01
PL/SQL procedure successfully completed.
全文结束!
宿主机 Mac优胜美地
虚拟机软件 VMware Fusion 7.1
虚拟机系统 Oracle Linux 6.6
数据库软件 Oracle 12.1.0.2
OPatch 12.1.0.1.6
Patch 19769480
一 安装虚拟机系统Oracle Linux 6.6
1. 更多选项,继续
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234815729921.png?x-oss-process=style/bb)
2. 创建自定义虚拟机,继续
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234815787AA2.png?x-oss-process=style/bb)
3. Linux -> Oracle Enterpr Linux 64 位,继续
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234815861JQO.png?x-oss-process=style/bb)
4. 自定设置
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_142348159489Gl.png?x-oss-process=style/bb)
5. 新建虚拟磁盘,继续
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481602Ntc2.png?x-oss-process=style/bb)
6. 存储为“OEL_6_6_Oracle12c”,存储
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481609wXwT.png?x-oss-process=style/bb)
6. 存储为“OEL_6_6_Oracle12c”,存储
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234816196O1c.png?x-oss-process=style/bb)
8. 设置CPU为2核(可选项),内存设置为2048MB(根据主机配置情况酌情添加)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481622L3tB.png?x-oss-process=style/bb)
9. 设置磁盘大小为30GB
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481624aGtE.png?x-oss-process=style/bb)
10. 设置网络连接方式为“仅主机模式”(hostonly)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481626vCB4.png?x-oss-process=style/bb)
11. 加载操作系统盘的iso,本次安装采用oracle官网下载的OracleLinuxR6 U6。ios名为V52218-01
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481627KQ8X.png?x-oss-process=style/bb)
12. Instarll or upgrade an existing system,回车
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481636hPId.png?x-oss-process=style/bb)
13. skip,回车
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481640Bmr7.png?x-oss-process=style/bb)
14. Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481646GzIo.png?x-oss-process=style/bb)
15. English(English),Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481652gahy.png?x-oss-process=style/bb)
16. U.S.English,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234816587vo9.png?x-oss-process=style/bb)
17. Basic Storage Devices,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481664lDm0.png?x-oss-process=style/bb)
18. Yes,discard any data
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481671N8Oo.png?x-oss-process=style/bb)
19. 点击“Configure Network”配置网络信息,点击Add添加一个网卡
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481677qqR4.png?x-oss-process=style/bb)
20. 勾选“Connect automatically”
在IPv4 Settings中将Method选择为Manual方式
设置网卡地址:172.16.228.12,子网掩码为255.255.255.0,网关为172.16.228.2
此部分根据自己的网路环境自行配制
配置结束后点击Apply确认
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481680PiPp.png?x-oss-process=style/bb)
21. 时区随意,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481786q2Q4.png?x-oss-process=style/bb)
22. 输入密码,Use Anyway,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234817911r1i.png?x-oss-process=style/bb)
23. Replace Existing Linux System(s),Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481798um0q.png?x-oss-process=style/bb)
24.Desktop,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481804RA0a.png?x-oss-process=style/bb)
25. 进度条100%后,Next
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234818090yCY.png?x-oss-process=style/bb)
26. Reboot
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481815mD4I.png?x-oss-process=style/bb)
27. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481820C3C9.png?x-oss-process=style/bb)
28. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234818314es6.png?x-oss-process=style/bb)
29. No,I prefer to register at a later time. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481837f2jq.png?x-oss-process=style/bb)
30. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481844N75O.png?x-oss-process=style/bb)
31. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481850z6yA.png?x-oss-process=style/bb)
32. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481856byDJ.png?x-oss-process=style/bb)
32. Forward
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481864JTJ3.png?x-oss-process=style/bb)
34. 输入密码进入操作系统
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481881rcua.png?x-oss-process=style/bb)
35. 登录时前选择加载光盘,为后续的工作做一下铺垫
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481883i4yd.png?x-oss-process=style/bb)
二,安装数据库软件
[root@snow ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[root@snow ~]# grep MemTotal /proc/meminfo
MemTotal: 1774280 kB
[root@snow ~]# grep SwapTotal /proc/meminfo
SwapTotal: 3145724 kB
[root@snow ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_snow-lv_root
27228028 3207852 22614020 13% /
tmpfs 887140 76 887064 1% /dev/shm
/dev/sda1 487652 65654 392302 15% /boot
/dev/sr0 3762380 3762380 0 100% /media/OL6.6 x86_64 Disc 1 20141018
添加主机ip地址和域名
[root@snow ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.228.12 snow.oracle.com
mount操作系统光盘
[root@snow ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
移走现有的public-yum-ol6.repo
[root@snow ~]# mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.bak
创建本次使用的12c.repo
[root@snow ~]# vi /etc/yum.repos.d/snow12c.repo
[Oracle]
name=OEL-$releasever - Media
baseurl=file:///mnt
gpgcheck=0
enabled=1
采用oracle封装的简易配置包来安装rpm修改内核参数,系统限制,并且为我们创建了oracle用户和组
[root@snow ~]# yum install oracle-rdbms-server-12cR1-preinstall
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-12.el6 will be installed
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
---> Package gcc-c++.x86_64 0:4.4.7-11.el6 will be installed
---> Package ksh.x86_64 0:20120801-21.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
oracle-rdbms-server-12cR1-preinstall x86_64 1.0-12.el6 Oracle 16 k
Installing for dependencies:
compat-libcap1 x86_64 1.10-1 Oracle 17 k
compat-libstdc++-33 x86_64 3.2.3-69.el6 Oracle 183 k
gcc-c++ x86_64 4.4.7-11.el6 Oracle 4.7 M
ksh x86_64 20120801-21.el6 Oracle 758 k
libaio-devel x86_64 0.3.107-10.el6 Oracle 13 k
libstdc++-devel x86_64 4.4.7-11.el6 Oracle 1.6 M
Transaction Summary
=========================================================================================================
Install 7 Package(s)
Total download size: 7.3 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
---------------------------------------------------------------------------------------------------------
Total 35 MB/s | 7.3 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libstdc++-devel-4.4.7-11.el6.x86_64 1/7
Installing : gcc-c++-4.4.7-11.el6.x86_64 2/7
Installing : ksh-20120801-21.el6.x86_64 3/7
Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 4/7
Installing : libaio-devel-0.3.107-10.el6.x86_64 5/7
Installing : compat-libcap1-1.10-1.x86_64 6/7
Installing : oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64 7/7
Verifying : compat-libcap1-1.10-1.x86_64 1/7
Verifying : oracle-rdbms-server-12cR1-preinstall-1.0-12.el6.x86_64 2/7
Verifying : gcc-c++-4.4.7-11.el6.x86_64 3/7
Verifying : libaio-devel-0.3.107-10.el6.x86_64 4/7
Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 5/7
Verifying : ksh-20120801-21.el6.x86_64 6/7
Verifying : libstdc++-devel-4.4.7-11.el6.x86_64 7/7
Installed:
oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-12.el6
Dependency Installed:
compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6
gcc-c++.x86_64 0:4.4.7-11.el6 ksh.x86_64 0:20120801-21.el6
libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.7-11.el6
Complete!
刚才的脚本已经将Oracle用户和组创建好了
[root@snow ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
设置oracle密码
[root@snow ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
内核参数也被设置好了
注意oracle-rdbms-server-12cR1-preinstall setting for… 的部分
[root@snow ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
# oracle-rdbms-server-12cR1-preinstall setting for fs.file-max is 6815744
fs.file-max = 6815744
# oracle-rdbms-server-12cR1-preinstall setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmni is 4096
kernel.shmmni = 4096
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmall is 1073741824 on x86_64
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104
# oracle-rdbms-server-12cR1-preinstall setting for kernel.panic_on_oops is 1 per Orabug 19642132
kernel.panic_on_oops = 1
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576
# oracle-rdbms-server-12cR1-preinstall setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576
# oracle-rdbms-server-12cR1-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500
手工添加安全限制内容
vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
关闭防火墙
[root@snow ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
禁用SELINUX
[root@snow ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
创建目录
[root@snow ~]# mkdir -p /u01/app/oracle
[root@snow ~]# chown -R oracle:oinstall /u01
[root@snow ~]# chmod -R 775 /u01
设置oracle环境变量,为了方便后面的PSU升级添加OPatch路径
[root@snow ~]# su - oracle
[oracle@snow ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=snow
export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
stty erase ^h
使环境变量生效并测试
[oracle@snow ~]$ . .bash_profile
[oracle@snow ~]$ env|grep ORA
ORACLE_SID=snow
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1
上传介质安装介质到/tmp目录
[oracle@snow ~]$ ls -l /tmp
total 2814852
drwxr-xr-x. 3 oracle oinstall 4096 Feb 8 16:18 CVU_12.1.0.2.0_oracle
drwxr-xr-x. 2 oracle oinstall 4096 Feb 8 18:00 hsperfdata_oracle
drwx------. 2 root root 4096 Feb 8 13:22 keyring-Uy45if
-rw-r--r--. 1 root root 1673544724 Feb 8 13:53 linuxamd64_12102_database_1of2.zip
-rw-r--r--. 1 root root 1014530602 Feb 8 13:53 linuxamd64_12102_database_2of2.zip
drwx------. 2 gdm gdm 4096 Feb 8 13:22 orbit-gdm
drwx------. 2 root root 4096 Feb 8 14:28 orbit-root
-rw-r--r--. 1 root root 42075550 Feb 8 13:53 p19769480_121020_Linux-x86-64.zip
-rw-r--r--. 1 root root 99983417 Feb 8 13:53 p19877336_121020_Linux-x86-64.zip
-rw-r--r--. 1 root root 52216311 Feb 8 16:00 p6880880_121010_Linux-x86-64.zip
drwx------. 2 root root 4096 Feb 8 13:22 pulse-CVJbKuDjpRJL
drwx------. 2 gdm gdm 4096 Feb 8 13:22 pulse-yUx19YncqBHp
drwx------. 2 root root 4096 Feb 8 13:22 virtual-root.uvY7TA
-rw-------. 1 root root 0 Feb 8 13:07 yum.log
在oracle目录加压素介质
[oracle@snow ~]$ pwd
/home/oracle
[oracle@snow ~]$ unzip /tmp/linuxamd64_12102_database_1of2.zip
[oracle@snow ~]$ unzip /tmp/linuxamd64_12102_database_2of2.zip
解压后为database文件夹
[oracle@snow ~]$ ll
total 4
drwxr-xr-x. 7 oracle oinstall 4096 Jun 10 2013 database
通过x11来启动图形安装工具
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234818909ezp.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_142348189325lC.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481895OU21.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423481898q94M.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234820473797.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482051z3y8.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482054ZGf4.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482058c3C6.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482062IT1L.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482066C3Ie.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234820705P5j.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482074x783.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482080H0Rr.png?x-oss-process=style/bb)
此处可能是bug,用下面的方法修复
[root@snow ~]# find / -name *javavm12*
/u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk7/lib/libjavavm12.a
/u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk6/lib/libjavavm12.a
[root@snow ~]#
[root@snow ~]# su - oracle
[oracle@snow ~]$ cd $ORACLE_HOME/lib
[oracle@snow lib]$ cp /u01/app/oracle/product/12.1.0/db_1/javavm/jdk/jdk7/lib/libjavavm12.a .
[oracle@snow lib]$ ls -l *java*
-rw-r--r--. 1 oracle oinstall 2574084 Jun 17 2014 libcorejava.so
-rw-r--r--. 1 oracle oinstall 32244110 Feb 8 14:06 libjavavm12.a
[oracle@snow lib]$
点击retry从重新尝试
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234820853pQQ.png?x-oss-process=style/bb)
[root@snow ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@snow ~]# /u01/app/oracle/product/12.1.0/db_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.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 script.
Now product-specific root actions will be performed.
执行完脚本后点击ok完成此次安装
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482089ztiX.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482098ko0J.png?x-oss-process=style/bb)
查看当前数据库软件的版本
[root@snow ~]# su - oracle
[oracle@snow ~]$ cd $ORACLE_HOME/OPatch
[oracle@snow OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.3
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_14-10-14PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-02-08_14-10-14PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
注意:当前的OPatch版本不符合要求,需要升级到12.1.0.1.4以上
2.1 OPatch Utility
You must use the OPatch utility version 12.1.0.1.4 or later to apply this patch. Oracle recommends that you use the latest released OPatch version for 12.1, which is available for download from My Oracle Support patch 6880880 by selecting the 12.1.0.1.0 release.
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482102QrBB.png?x-oss-process=style/bb)
更新OPatch,确认环境变量中加入OPatch路径
[oracle@snow ~]$ echo $PATH
/u01/app/oracle/product/12.1.0/db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/12.1.0/db_1/OPatch
解压缩OPatch补丁包
[oracle@snow ~]$ unzip /tmp/p6880880_121010_Linux-x86-64.zip
备份现有版本的OPatch
[oracle@snow ~]$ cd $ORACLE_HOME
[oracle@snow db_1]$ OPatch/opatch version
OPatch Version: 12.1.0.1.3
OPatch succeeded.
[oracle@snow db_1]$ mv OPatch OPatch12.1.0.1.3
更新新版本OPatch
[oracle@snow db_1]$ cp -Rp /home/oracle/OPatch .
[oracle@snow db_1]$ OPatch/opatch version
OPatch Version: 12.1.0.1.6
OPatch succeeded.
回到Oracle home目录,校验补丁的兼容性
[oracle@snow db_1]$ cd
[oracle@snow ~]$
[oracle@snow ~]$
[oracle@snow ~]$ cd 19769480/
[oracle@snow 19769480]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_16-08-00PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
开始应用opatch补丁程序
[oracle@snow 19769480]$ opatch apply
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/19769480_Feb_08_2015_16_10_46/apply2015-02-08_16-10-46PM_1.log
Applying interim patch '19769480' to OH '/u01/app/oracle/product/12.1.0/db_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 直接回车
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/db_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Patching component oracle.rdbms.deconfig, 12.1.0.2.0...
Patching component oracle.xdk, 12.1.0.2.0...
Patching component oracle.tfa, 12.1.0.2.0...
Patching component oracle.rdbms.util, 12.1.0.2.0...
Patching component oracle.rdbms, 12.1.0.2.0...
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...
Patching component oracle.xdk.parser.java, 12.1.0.2.0...
Patching component oracle.oraolap, 12.1.0.2.0...
Patching component oracle.xdk.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rman, 12.1.0.2.0...
Patching component oracle.ldap.rsf, 12.1.0.2.0...
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0...
Verifying the update...
Patch 19769480 successfully applied
Log file location: /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/19769480_Feb_08_2015_16_10_46/apply2015-02-08_16-10-46PM_1.log
OPatch succeeded.
升级后验证一下结果,Patch 19769480
[oracle@snow ~]$ cd $ORACLE_HOME/OPatch
[oracle@snow OPatch]$ ./opatch version
OPatch Version: 12.1.0.1.6
OPatch succeeded.
[oracle@snow OPatch]$ ./opatch lsinventory;
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/db_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/opatch2015-02-08_18-00-42PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/12.1.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-02-08_18-00-42PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 19769480 : applied on Sun Feb 08 16:14:40 EST 2015
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401
--------------------------------------------------------------------------------
OPatch succeeded.
DBCA创建数据库
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234821063wv0.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234821108e8b.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482114C14l.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482118088h.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482122ezq4.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482126sWsR.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482131ZxzG.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482174i72Z.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482179a55x.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482183y9U4.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_14234821868ZqQ.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482189e3fm.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201502/9/29047826_1423482194O6mm.png?x-oss-process=style/bb)
[oracle@snow ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 8 17:57:06 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> @?/rdbms/admin/utlrp.sql
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2015-02-08 17:57:34
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
PL/SQL procedure successfully completed.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2015-02-08 17:57:36
DOC> The following query reports the number of objects that have compiled
DOC> with errors.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
0
DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
...Database user "SYS", database schema "APEX_040200", user# "98" 17:58:00
...Compiled 0 out of 3014 objects considered, 0 failed compilation 17:58:01
...271 packages
...263 package bodies
...452 tables
...11 functions
...16 procedures
...3 sequences
...457 triggers
...1320 indexes
...211 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 17:58:01
...Completed key object existence check 17:58:01
...Setting DBMS Registry 17:58:01
...Setting DBMS Registry Complete 17:58:01
...Exiting validate 17:58:01
PL/SQL procedure successfully completed.
全文结束!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29047826/viewspace-1431654/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29047826/viewspace-1431654/