1. 程式人生 > >centos 7.5安裝oracle10.2.0.4

centos 7.5安裝oracle10.2.0.4

1.當前OS資訊,

[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[[email protected] ~]# uname -a
Linux qht174 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

2.關閉防火牆

 預設是開啟的,需要關閉

[[email protected] ~]# firewall-cmd --state    #檢視預設防火牆狀態
running
[
[email protected]
~]# systemctl stop firewalld.service #停止firewall [[email protected] ~]# systemctl disable firewalld.service #禁止firewall開機啟動 Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. [
[email protected]
~]# firewall-cmd --state not running

iptables防火牆也檢查一下

[[email protected] ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.

3.接下來修改SELINUX=disabled

[[email protected] ~]# cat /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 three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

4.編寫關閉服務指令碼

[[email protected] ~]# cat serverstop.sh
chkconfig iptables off
chkconfig ip6tables off
chkconfig cups off
chkconfig firstboot off
chkconfig wpa_supplicant off
chkconfig postfix off
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config

執行一下,關閉掉這些服務

[[email protected] ~]# chmod a+x serverstop.sh
[[email protected] ~]# sh serverstop.sh

5.安裝所需要的包

安裝常用包

[[email protected] ~]#yum -y install autoconf automake binutils-devel bison cpp dos2unix ftp gcc gcc-c++ lrzsz python-devel

確保這些包已安裝

[[email protected] yum.repos.d]# rpm -q autoconf automake binutils-devel bison cpp dos2unix ftp gcc gcc-c++ lrzsz python-devel
autoconf-2.69-11.el7.noarch
automake-1.13.4-3.el7.noarch
binutils-devel-2.27-28.base.el7_5.1.x86_64
bison-3.0.4-1.el7.x86_64
cpp-4.8.5-28.el7_5.1.x86_64
dos2unix-6.0.3-7.el7.x86_64
ftp-0.17-67.el7.x86_64
gcc-4.8.5-28.el7_5.1.x86_64
gcc-c++-4.8.5-28.el7_5.1.x86_64
lrzsz-0.12.20-36.el7.x86_64
python-devel-2.7.5-69.el7_5.x86_64
[[email protected] ~]# yum -y install compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 glibc-* glibc-*.i686 libXpm-*.i686 libXp.so.6 libXt.so.6 libXtst.so.6 libgcc_s.so.1 ksh libXp libaio-devel numactl numactl-devel unixODBC unixODBC-devel

 有以下幾個包無法安裝

[[email protected] yum.repos.d]# rpm -q compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 glibc-* glibc-*.i686 libXpm-*.i686 libXp.so.6 libXt.so.6 libXtst.so.6 libgcc_s.so.1 ksh libXp libaio-devel numactl numactl-devel unixODBC unixODBC-devel
compat-db-4.7.25-28.el7.x86_64
package compat-gcc-34 is not installed
package compat-gcc-34-c++ is not installed
compat-libstdc++-33-3.2.3-72.el7.x86_64
compat-libstdc++-33-3.2.3-72.el7.i686
glibc-2.17-222.el7.x86_64
glibc-2.17-222.el7.i686
glibc-2.17-222.el7.i686
libXpm-3.5.12-1.el7.i686
package libXp.so.6 is not installed
package libXt.so.6 is not installed
package libXtst.so.6 is not installed
package libgcc_s.so.1 is not installed
ksh-20120801-137.el7.x86_64
libXp-1.0.2-2.1.el7.x86_64
libXp-1.0.2-2.1.el7.i686
libaio-devel-0.3.109-13.el7.x86_64
libaio-devel-0.3.109-13.el7.i686
numactl-2.0.9-7.el7.x86_64
numactl-devel-2.0.9-7.el7.x86_64
unixODBC-2.3.1-11.el7.x86_64
unixODBC-devel-2.3.1-11.el7.x86_64

 安裝oracle所需要的包 

或者一起安裝(推薦再執行一次,以免遺漏,不費力)

yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make syssta 

確保這些包都已安裝好:

[[email protected] yum.repos.d]# rpm -q binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat
binutils-2.27-28.base.el7_5.1.x86_64
compat-libstdc++-33-3.2.3-72.el7.x86_64
compat-libstdc++-33-3.2.3-72.el7.i686
compat-libstdc++-33-3.2.3-72.el7.i686
elfutils-libelf-0.170-4.el7.x86_64
elfutils-libelf-devel-0.170-4.el7.x86_64
gcc-4.8.5-28.el7_5.1.x86_64
gcc-c++-4.8.5-28.el7_5.1.x86_64
glibc-2.17-222.el7.x86_64
glibc-2.17-222.el7.i686
glibc-2.17-222.el7.i686
glibc-common-2.17-222.el7.x86_64
glibc-devel-2.17-222.el7.x86_64
glibc-devel-2.17-222.el7.i686
glibc-devel-2.17-222.el7.i686
glibc-headers-2.17-222.el7.x86_64
ksh-20120801-137.el7.x86_64
libaio-0.3.109-13.el7.x86_64
libaio-0.3.109-13.el7.i686
libaio-0.3.109-13.el7.i686
libaio-devel-0.3.109-13.el7.x86_64
libaio-devel-0.3.109-13.el7.i686
libaio-devel-0.3.109-13.el7.i686
libgcc-4.8.5-28.el7_5.1.x86_64
libgcc-4.8.5-28.el7_5.1.i686
libgcc-4.8.5-28.el7_5.1.i686
libstdc++-4.8.5-28.el7_5.1.x86_64
libstdc++-4.8.5-28.el7_5.1.i686
libstdc++-4.8.5-28.el7_5.1.i686
libstdc++-devel-4.8.5-28.el7_5.1.x86_64
make-3.82-23.el7.x86_64
sysstat-10.1.5-13.el7.x86_64

6.增加組和使用者

[[email protected] ~]#groupadd oinstall
[[email protected] ~]#groupadd dba
[[email protected] ~]#useradd –g oinstall –G dba oracle 
[[email protected] ~]#passwd oracle 

7.建立目錄,更改許可權

[[email protected] ~]# mkdir -p /u01/app/oracle/product/10201/
[[email protected] ~]# mkdir -p /u01/app/oracle/admin/
[[email protected] ~]# mkdir -p /u01/oradata/
[[email protected] ~]# chown -R oracle.oinstall /u01

8.配置核心引數檔案/etc/sysctl.conf

# vi /etc/sysctl.conf

並輸入以下內容:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152  //表示系統一次可以使用的共享記憶體總量(以頁為單位)。預設值就是2097152,通常不需要修改
kernel.shmmax = 2147483648  //定義了共享記憶體段的最大尺寸(以位元組為單位)。預設為32M,對於oracle來說,該預設值太低了,通常將其設定為2G
kernel.shmmni = 4096  //用於設定系統範圍內共享記憶體段的最大數量。該引數的預設值是 4096 。通常不需要更改
kernel.sem = 250 32000 100 128  //表示設定的訊號量
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144  //預設的接收視窗大小
net.core.rmem_max = 4194304  //接收視窗的最大大小
net.core.wmem_default = 262144  //預設的傳送視窗大小
net.core.wmem_max = 1048586  //傳送視窗的最大大小
vm.hugetlb_shm_group = 1002  //這裡1002是oracle使用者組dba的gid,將dba組新增到系統核心中,給予建立共享記憶體的許可權

使設定立即生效: 

[[email protected] ~]# sysctl -p

9.編輯/etc/security/limits.conf

加下以下內容:

# For Oracle10g
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

10.編輯/etc/pam.d/login

加以下內容:

session required /lib64/security/pam_limits.so
session required pam_limits.so

11.修改Linux發行版本資訊

由於Oracle 10g發行的時候,CentOS 6和7都沒有發行,所以Oracle 10g並沒有對CentOS 6確認支援,需要修改檔案讓Oracle 10g支援CentOS 6 和7。 我們需要手工修改Linux的發行註記,讓Oracle 10g支援CentOS 6和7。

[[email protected] ~]# cat /etc/redhat-release
redhat 4
#CentOS Linux release 7.5.1804 (Core)

12.修改/home/oracle/.bash_profile環境變數

[[email protected] ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10201
ORACLE_SID=orcl
OADMIN=$ORACLE_BASE/admin/$ORACLE_SID
ORACLE_TERM=vt100
BDUMP=$OADMIN/bdump
UDUMP=$OADMIN/udump
TERM=vt100
TNS_ADMIN=$ORACLE_HOME/network/admin
NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252

export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export OADMIN
export ODATA
export OARCH
export OSCRIPTS
export ORACLE_TERM
export BDUMP
export UDUMP
export TERM
export TNS_ADMIN
export NLS_LANG

# Set PATH variable with Oracle and Veritas NetBackup Parameters:
PATH=.:$HOME:$ORACLE_HOME/bin:/bin:/usr/ccs/bin:/usr/bin:/usr:/usr/local/bin:/usr/sbin:/usr/openv/netbackup/bin:$ORACLE_HOME/OPatch
export PATH

# Set LD_LIBRARY_PATH variable
LD_LIBRARY_PATH=/u01/app/oracle/product/10201/lib:/u01/app/oracle/product/10201/ctx/lib:/usr/openwin/lib:/usr/dt/lib:/usr/ccs/lib:/usr/lib:/usr/ucblib:
export LD_LIBRARY_PATH

# Set CLASSPATH variable
CLASSPATH=$ORACLE_HOME/JRE/lib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/assistants/jlib:$ORACLE_HOME/owm/jlib
export CLASSPATH

unset USERNAME

13.解壓縮原始檔

[[email protected] resource]$ zcat 10201_database_linux_x86_64.cpio.gz | cpio -idmv

14.開始安裝資料庫軟體

[[email protected] database]$ cat /home/oracle/resource/database/response/enterprise01.rsp
RESPONSEFILE_VERSION=2.2.1.0.0
FROM_LOCATION="../stage/products.xml"
ORACLE_HOME="/u01/app/oracle/product/10201"
ORACLE_HOME_NAME="OraDbHome1"
TOPLEVEL_COMPONENT={"oracle.server","10.2.0.1.0"}
DEINSTALL_LIST={"oracle.server","10.2.0.1.0"}
SHOW_SPLASH_SCREEN=false
SHOW_WELCOME_PAGE=false
SHOW_COMPONENT_LOCATIONS_PAGE=false
SHOW_CUSTOM_TREE_PAGE=false
SHOW_SUMMARY_PAGE=false
SHOW_INSTALL_PROGRESS_PAGE=false
SHOW_REQUIRED_CONFIG_TOOL_PAGE=false
SHOW_CONFIG_TOOL_PAGE=false
SHOW_RELEASE_NOTES=false
SHOW_ROOTSH_CONFIRMATION=false
SHOW_END_SESSION_PAGE=false
SHOW_EXIT_CONFIRMATION=false
NEXT_SESSION=false
NEXT_SESSION_ON_FAIL=false
SHOW_DEINSTALL_CONFIRMATION=false
SHOW_DEINSTALL_PROGRESS=false
ACCEPT_LICENSE_AGREEMENT=true
COMPONENT_LANGUAGES={"en"}
CLUSTER_NODES=
INSTALL_TYPE="EE"
s_nameForDBAGrp=dba
s_nameForOPERGrp=dba
b_oneClick=false
SHOW_DATABASE_CONFIGURATION_PAGE=false
b_createStarterDB=false
[[email protected] database]$ ./runInstaller -silent -responseFile /home/oracle/resource/database/response/enterprise01.rsp

不過安裝結束時出現了錯誤:

Installation in progress (Thu Sep 27 14:42:32 CST 2018)
...............................................................  10% Done.
...............................................................  20% Done.
...............................................................  30% Done.
...............................................................  40% Done.
...............................................................  50% Done.
................................................                 57% Done.
Install successful

Linking in progress (Thu Sep 27 14:43:08 CST 2018)
.                                                                57% Done.
Link successful

Setup in progress (Thu Sep 27 14:45:05 CST 2018)
.........................                                       100% Done.
Setup successful

End of install phases.(Thu Sep 27 14:45:05 CST 2018)
Starting to execute configuration assistants
Configuration assistant "Oracle Net Configuration Assistant" succeeded
Configuration assistant "Oracle Database Configuration Assistant" failed
SEVERE:OUI-10104:Some of the configuration assistants failed. It is strongly recommended that you retry the configuration assistants at this time. Not successfully running any "Recommended" assistants means your system will not be correctly configured. Select the failed assistants and click the 'Retry' button to retry them.
--------------------------------------
The "/u01/app/oracle/product/10201/cfgtoollogs/configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
The "/u01/app/oracle/product/10201/cfgtoollogs/configToolAllCommands" script contains all commands to be executed by the configuration assistants. This file may be used to run the configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.

--------------------------------------
The installation of Oracle Database 10g was successful, but some optional configuration assistants failed, were cancelled or skipped.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2018-09-27_02-42-25PM.log' for more details.

檢視日誌檔案如下:

silentInstall2018-09-27_02-42-25PM.log
Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/10201/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2018-09-27_02-42-25PM.log' for details.
Error in invoking target 'collector' of makefile '/u01/app/oracle/product/10201/sysman/lib/ins_emdb.mk'. See '/u01/app/oracle/oraInventory/logs/installActions2018-09-27_02-42-25PM.log' for details.
SEVERE:OUI-10104:Some of the configuration assistants failed. It is strongly recommended that you retry the configuration assistants at this time. Not successfully running any "Recommended" assistants means your system will not be correctly configured. Select the failed assistants and click the 'Retry' button to retry them.
A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/u01/app/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.

The following configuration scripts
/u01/app/oracle/product/10201/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts and the configuration tools after exiting the OUI.

The installation of Oracle Database 10g was successful, but some optional configuration assistants failed, were cancelled or skipped.

在網上搜得時候,都說是缺少32位的包,包括metalink都是這樣解釋的,要裝:

glibc-32bit glibc-devel-32bit

一般情況都是缺包,用yum 把需要的包全部打上之後,再次安裝就沒有問題了。 yum install libXp.i686 libXp-devel.i686 libXt.i686 libXt-devel.i686 libXtst.i686 libXtst-devel.i686 make.x86_64 gcc.x86_64 libaio.x86_64 glibc-devel.i686 libgcc.i686 glibc-devel.x86_64 compat-libstdc++-33 -y yum install glibc* gcc* make* compat-db* libstdc* libXp* libXtst* compat-libstdc++* -y  

[[email protected] ~]# rpm -q autoconf  binutils.x86_64 compat-db.x86_64 compat-gcc-34-c++ compat-gcc-34.x86_64  compat-libstdc++-296.i386  compat-libstdc++-33.i386  compat-libstdc++-33.x86_64  elfutils-libelf-devel.x86_64  elfutils-libelf.x86_64  gcc-c++.x86_64 gcc.x86_64  gdb  gdbm  glib-common.x86_64  glibc-devel.i386  glibc-devel.x86_64  glibc-headers.x86_64  glibc.x86_64  glibc.i686  libaio-devel.x86_64  libaio.x86_64  libaio.i386 libgcc.x86_64  libgcc.i386  libgomp.x86_64  libstdc++.x86_64  libstdc++-devel.x86_64  libXp.x86_64  libXp.i386  libXtst.i386  make  libgnome.x86_64   libgnomeui.x86_64  openmotif  openssl.i686  openssh-clients  openssh  pdksh  screen  setarch  sysstat.x86_64  unixODBC  unixODBC-devel  unixODBC.i386  unixODBC-devel.i386  unzip  util-linux.x86_64  vim-enhanced  xdpyinfo  xorg-x11-server-Xorg  xorg-x11-xinit
autoconf-2.69-11.el7.noarch
binutils-2.27-28.base.el7_5.1.x86_64
compat-db-4.7.25-28.el7.x86_64
package compat-gcc-34-c++ is not installed
package compat-gcc-34.x86_64 is not installed
package compat-libstdc++-296.i386 is not installed
package compat-libstdc++-33.i386 is not installed
compat-libstdc++-33-3.2.3-72.el7.x86_64
elfutils-libelf-devel-0.170-4.el7.x86_64
elfutils-libelf-0.170-4.el7.x86_64
gcc-c++-4.8.5-28.el7_5.1.x86_64
gcc-4.8.5-28.el7_5.1.x86_64
gdb-7.6.1-110.el7.x86_64
gdbm-1.10-8.el7.x86_64
package glib-common.x86_64 is not installed
package glibc-devel.i386 is not installed
glibc-devel-2.17-222.el7.x86_64
glibc-headers-2.17-222.el7.x86_64
glibc-2.17-222.el7.x86_64
glibc-2.17-222.el7.i686
libaio-devel-0.3.109-13.el7.x86_64
libaio-0.3.109-13.el7.x86_64
package libaio.i386 is not installed
libgcc-4.8.5-28.el7_5.1.x86_64
package libgcc.i386 is not installed
libgomp-4.8.5-28.el7_5.1.x86_64
libstdc++-4.8.5-28.el7_5.1.x86_64
libstdc++-devel-4.8.5-28.el7_5.1.x86_64
libXp-1.0.2-2.1.el7.x86_64
package libXp.i386 is not installed
package libXtst.i386 is not installed
make-3.82-23.el7.x86_64
libgnome-2.32.1-9.el7.x86_64
libgnomeui-2.24.5-8.el7.x86_64
package openmotif is not installed
package openssl.i686 is not installed
openssh-clients-7.4p1-16.el7.x86_64
openssh-7.4p1-16.el7.x86_64
package pdksh is not installed
screen-4.1.0-0.25.20120314git3c2946.el7.x86_64
package setarch is not installed
sysstat-10.1.5-13.el7.x86_64
unixODBC-2.3.1-11.el7.x86_64
unixODBC-devel-2.3.1-11.el7.x86_64
package unixODBC.i386 is not installed
package unixODBC-devel.i386 is not installed
unzip-6.0-19.el7.x86_64
util-linux-2.23.2-52.el7_5.1.x86_64
vim-enhanced-7.4.160-4.el7.x86_64
package xdpyinfo is not installed
xorg-x11-server-Xorg-1.19.5-5.el7.x86_64
xorg-x11-xinit-1.3.4-2.el7.x86_64

12.先忽略這個錯誤,升級到10.2.0.4 

修改升級的引數檔案

[[email protected] ~]# sed '/^ *#/d'   /home/oracle/resource/Disk1/response/10204_patch.rsp | sed '/^$/d'
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME="oinstall"
FROM_LOCATION=<Value Required>
NEXT_SESSION_RESPONSE=<Value Unspecified>
ORACLE_HOME="/u01/app/oracle/product/10201"
ORACLE_HOME_NAME="OraDbHome1"
TOPLEVEL_COMPONENT={"oracle.patchset.db","10.2.0.4.0"}
SHOW_SPLASH_SCREEN=false
SHOW_WELCOME_PAGE=false
SHOW_COMPONENT_LOCATIONS_PAGE=false
SHOW_CUSTOM_TREE_PAGE=false
SHOW_SUMMARY_PAGE=false
SHOW_INSTALL_PROGRESS_PAGE=true
SHOW_REQUIRED_CONFIG_TOOL_PAGE=false
SHOW_OPTIONAL_CONFIG_TOOL_PAGE=false
SHOW_CONFIG_TOOL_PAGE=false
SHOW_XML_PREREQ_PAGE=false
SHOW_RELEASE_NOTES=false
SHOW_END_OF_INSTALL_MSGS=true
SHOW_ROOTSH_CONFIRMATION=true
SHOW_END_SESSION_PAGE=false
SHOW_EXIT_CONFIRMATION=false
NEXT_SESSION=false
NEXT_SESSION_ON_FAIL=false
SHOW_DEINSTALL_CONFIRMATION=false
SHOW_DEINSTALL_PROGRESS=false
ACCEPT_LICENSE_AGREEMENT=true
RESTART_SYSTEM=false
CLUSTER_NODES={}
OUI_HOSTNAME=qht174
REMOVE_HOMES={}
COMPONENT_LANGUAGES={"en"}
sl_userNodeList=<Value Unspecified>
b_acceptLicense=<Value Unspecified>
b_useRegistration=<Value Unspecified>
s_csiNumber=<Value Unspecified>
s_metaLink=<Value Unspecified>
s_countryName=<Value Unspecified>
b_proxyused=<Value Unspecified>
s_serverName=<Value Unspecified>
s_portNumber=<Value Unspecified>
s_userName=<Value Unspecified>
s_proxyPassword=<Value Unspecified>
b_authenticationused=<Value Unspecified>

執行升級命令: 

[[email protected] Disk1]$ ./runInstaller -silent -force -ignoreSysPrereqs -responseFile /home/oracle/resource/Disk1/response/10204_patch.rsp

Deinstall in progress (Friday, October 5, 2018 4:03:47 PM CST)
...............................................................   0% Done.
...............................................................  14% Done.
...............................................................  29% Done.
...............................................................  44% Done.
...............................................................  59% Done.
...............................................................  74% Done.
..............................................                  100% Done.

Deinstall successful

Installation in progress (Friday, October 5, 2018 4:03:47 PM CST)
...............................................................  14% Done.
...............................................................  29% Done.
...............................................................  44% Done.
...............................................................  59% Done.
...............................................................  74% Done.
......................................................           87% Done.
Install successful

Linking in progress (Friday, October 5, 2018 4:04:19 PM CST)
...                                                              87% Done.
Link successful

Setup in progress (Friday, October 5, 2018 4:06:35 PM CST)
.........                                                       100% Done.
Setup successful

End of install phases.(Friday, October 5, 2018 4:06:36 PM CST)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/u01/app/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10201/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts

The installation of Oracle Database 10g Release 2 Patch Set 3 was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2018-10-05_04-03-40PM.log' for more details.

登入root使用者,執行這兩個指令碼完成升級。

[[email protected] ~]# sh /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete
[[email protected] ~]# sh /u01/app/oracle/product/10201/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/10201

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

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.sh script.
Now product-specific root actions will be performed.

12.接著安裝資料庫

vi /home/oracle/database/response/dbca.rsp

根據資料庫建立方式的不同編輯不同的資料庫庫選項。

比如在本次安裝過程中設定了下列引數:( 注意下面引數視情況而定)

RESPONSEFILE_VERSION = "10.0.0" 

OPERATION_TYPE = "createDatabase" 

GDBNAME = "orcl"  # 資料庫全域性名稱

SID = "orcl"

TEMPLATENAME = "New_Database.dbt"

SYSPASSWORD = "system"  # SYS 使用者的初始密碼

SYSTEMPASSWORD = "system"   #SYSTEM 使用者的初始密碼

DATAFILEDESTINATION ="/u01/app/oracle/oradata/"

RECOVERYAREADESTINATION="/u01/app/oracle/flash_recovery_area"

STORAGETYPE=FS

CHARACTERSET = "WE8MSWIN1252"

MEMORYPERCENTAGE = "40"

SCRIPTDESTINATION ="/u01/app/oracle/admin/orcl/scripts"

EMCONFIGURATION=”LOCAL”

SYSMANPASSWORD = "system"

DBSNMPPASSWORD = "system"
[[email protected] response]$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/resource/database/response/dbca.rsp
Creating and starting Oracle instance
1% complete
4% complete
Creating database files
8% complete
Creating data dictionary views
9% complete
10% complete
12% complete
13% complete
14% complete
15% complete
17% complete
18% complete
20% complete
21% complete
Adding Oracle JVM
22% complete
28% complete
34% complete
40% complete
42% complete
Adding Oracle Data Mining
43% complete
44% complete
46% complete
Adding Oracle Text
47% complete
49% complete
50% complete
Adding Oracle XML DB
52% complete
53% complete
54% complete
58% complete
Adding Oracle Intermedia
59% complete
60% complete
71% complete
Adding Oracle OLAP
72% complete
73% complete
74% complete
75% complete
Adding Oracle Spatial
76% complete
77% complete
78% complete
83% complete
Adding Enterprise Manager Repository
84% complete
86% complete
88% complete
Completing Database Creation
89% complete
90% complete
91% complete
95% complete
99% complete
100% complete
Look at the log file "/u01/app/oracle/product/10201/cfgtoollogs/dbca/orcl/orcl2.log" for further details.
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Oct 5 16:29:38 2018

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE

資料庫的版本是10.2.0.4,已正常開啟。