圖解 Mac+VMwareFusion+Oracle12cR1+PSU 單例項安裝
環境介紹
宿主機 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. 更多選項,繼續
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.
全文結束!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29047826/viewspace-1431654/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Redis單例項安裝Redis單例
- 19C 單例項資料庫安裝單例資料庫
- ORACLE-LINUX環境字元介面單例項安裝OracleLinux字元單例
- Oracle 11G資料庫單例項安裝Oracle資料庫單例
- 【PSU】Oracle打PSU及解除安裝PSU(單例項)Oracle單例
- Linux下安裝 Docker例項LinuxDocker
- Memcached安裝與使用例項
- oracle 11g 單例項資料庫的安裝Oracle單例資料庫
- 【Oracle】ASM例項安裝入門OracleASM
- 11.2.0.4單例項ASM安裝報錯ohasd failed to ... line 73.單例ASMAI
- oracle11g安裝 單例項 系統centos7Oracle單例CentOS
- EventBus詳解及簡單例項單例
- oracle19c安裝 單例項 系統centos7 非cdbOracle單例CentOS
- Python裝飾器例項講解(三)Python
- MySQL安裝圖解MySql圖解
- 【爬蟲】Heritrix 3.2安裝和執行例項爬蟲
- Argo 安裝和 workflow 例項配置檔案解析Go
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- 從例項出發,瞭解單例模式和靜態塊單例模式
- CentOS 8 安裝 Docker 以及常用命令例項CentOSDocker
- 滴滴雲伺服器上安裝Oracle12cR2單例項資料庫伺服器Oracle單例資料庫
- CentOS 8 安裝圖解CentOS圖解
- 用圖表和例項解釋 Await 和 AsyncAI
- PHP 完整表單例項PHP單例
- Manjaro 18.1(KDE)安裝圖解JAR圖解
- rac恢復到單例項單例
- 單例項mysql.yaml kubernetes單例MySqlYAML
- opengl簡單入門例項
- Spark 簡單例項(基本操作)Spark單例
- RAC+DG(asm單例項)ASM單例
- ORACLE11GR2 RAC解除安裝ASM例項步驟OracleASM
- js圖片切換例項JS
- UML類圖繪製例項
- JFreeChart圖表製作例項
- RoboWare Studio安裝及依賴項解決
- 如何讀懂火焰圖?+ 例項講解程式效能優化優化
- 元件例項 $el 詳解元件
- [知識圖譜構建] 一.Neo4j圖資料庫安裝初識及藥材供應圖譜例項資料庫
- Python實現簡單網頁圖片抓取完整程式碼例項Python網頁