有志者事竟成 破釜沉舟百二秦關(guān)終屬楚 苦心人天不負(fù) 臥薪嘗膽三千越甲可吞吳
這次安裝oracle可謂是一路坎坷...再此記錄一下,以后按照這個(gè)來(lái),少走彎路吧
- 系統(tǒng)環(huán)境與安裝介質(zhì)說(shuō)明
系統(tǒng)環(huán)境
[root@oracledb admin]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.6 (Santiago)
Release: 6.6
Codename: Santiago
安裝介質(zhì) oracle
Release 11.2.0.3.0 Production on Tue Jan 16 06:17:30 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved. - 準(zhǔn)備工作
1 修改hosts 文件
[root@oracledb oraclesoft]# vi /etc/hosts
127.0.0.1 oracledb
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.254.104 oracledb
2 修改主機(jī)名
[root@oracledb oraclesoft]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oracledb
或使用hostname命令來(lái)修改(重啟服務(wù)器后將失效)
3 修改內(nèi)核參數(shù)
[root@oracledb ]# vi /etc/sysctl.conf
文件末尾添加如下內(nèi)容以下
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576 --文件系統(tǒng)最大異步io
fs.file-max = 6815744 --文件系統(tǒng)中最大文件個(gè)數(shù)
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096 --最小共享內(nèi)存大小 bytes
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
修改完成后執(zhí)行: /sbin/sysctl -p 命令
4 修改 /etc/security/limits.conf 文件
[root@oracledb ]# vi /etc/security/limits.conf
在文件末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
5 添加oracle用戶組
[root@oracledb ]# groupadd oinstall
[root@oracledb ]# groupadd dba
[root@oracledb ]# useradd -g oinstall -G dba oracle
修改oracle用戶密碼
passwd oracle
6 創(chuàng)建目錄與授權(quán)
[root@oracledb ]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@oracledb ]# chown -R oracle:oinstall /u01/app/oracle
[root@oracledb ]# chmod -R 775 /u01
7 添加oracle 環(huán)境變量
切換用戶
[root@oracledb ]# su - oracle
[oracle@oracledb ~] vi .bash_profile
在文件末尾添加以下內(nèi)容
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin
export TMP=/tmp
export TMPDIR=$TMP
umask 022 - 安裝oracle
1 檢查依賴(root用戶執(zhí)行)
[root@oracledb oraclesoft]# rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel
binutils-2.20.51.0.2-5.42.el6.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64
elfutils-libelf-0.158-3.2.el6.x86_64
elfutils-libelf-devel-0.164-2.el6.x86_64
gcc-4.4.7-11.el6.x86_64
gcc-c++-4.4.7-11.el6.x86_64
glibc-2.12-1.149.el6.x86_64
glibc-common-2.12-1.149.el6.x86_64
glibc-devel-2.12-1.149.el6.x86_64
glibc-headers-2.12-1.149.el6.x86_64
kernel-headers-2.6.32-504.el6.x86_64
package ksh is not installed
libaio-0.3.107-10.el6.x86_64
libaio-devel-0.3.107-10.el6.x86_64
libgcc-4.4.7-11.el6.x86_64
libgomp-4.4.7-11.el6.x86_64
libstdc++-4.4.7-11.el6.x86_64
libstdc++-devel-4.4.7-11.el6.x86_64
make-3.81-20.el6.x86_64
package numactl-devel is not installed
sysstat-9.0.4-20.el6.x86_64
package unixODBC is not installed
package unixODBC-devel is not installed
xxxxxxx-------is not installed 說(shuō)明此包未安裝
可通過(guò)yum -y xxxx(包名)來(lái)安裝
或者去其他網(wǎng)站下載rpm包,使用rpm -ivh xxxx(包名)來(lái)安裝
2 修改響應(yīng)文件模板
找到軟件包梭纹,解壓
解壓后進(jìn)入database---》response 目錄下有三個(gè)文件(這里注意恋技,一定是database目錄下的response,而不是其他目錄)
修改db_install.rsp文件(參照以下文件進(jìn)行修改)
https://pan.baidu.com/s/1eTwZ80E
3 修改完成后執(zhí)行
[oracle@oracledb database]$ ./runInstaller -ignorePrereq -silent -responseFile /opt/oraclesoft/database/response/db_install.rsp
database/response/
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 344984 MB Passed
Checking swap space: must be greater than 150 MB. Actual 15999 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-01-11_09-02-41PM. Please wait ...[oracle@localhost database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
You can find the log of this install session at:
/u01/app/oracle/oraInventory/logs/installActions2018-01-11_09-02-41PM.log
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2018-01-11_09-02-41PM.log' for more details.
As a root user, execute the following script(s):
1./u01/app/oracle/oraInventory/orainstRoot.sh
2./u01/app/oracle/product/11.2.0/db_1/root.sh
Successfully Setup Software.
切換root用戶,執(zhí)行上一步驟1.2 兩個(gè)腳本崇裁,執(zhí)行完成后匕坯,及安裝成功
測(cè)試
[oracle@oracledb database]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 16 08:06:09 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> - 創(chuàng)建oracle 實(shí)例
1 .修改安裝介質(zhì) database---》response目錄下dbca.rsp 文件
可參照以下文件進(jìn)行修改
https://pan.baidu.com/s/1kVXgVwN
2 .修改完成后執(zhí)行
[oracle@oracledb ~]$ dbca -silent -responseFile /opt/oraclesoft/database/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
至此,數(shù)據(jù)庫(kù)實(shí)例創(chuàng)建完成拔稳,在此步驟中葛峻,由于主機(jī)名問(wèn)題,導(dǎo)致了一堆問(wèn)題巴比,在此標(biāo)記 問(wèn)題諸多术奖,安裝過(guò)程中未作記錄,如有按本教程操作的同學(xué)遇到問(wèn)題請(qǐng)咨詢QQ844357411 - 配置監(jiān)聽
1 創(chuàng)建監(jiān)聽文件轻绞,
[oracle@oracledb admin]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin/
在samples文件夾下有個(gè)listener.ora文件采记,將其復(fù)制到/u01/app/oracle/product/11.2.0/db_1/network/admin/目錄下
[oracle@oracledb admin]$ cp listener.ora /u01/app/oracle/product/11.2.0/db_1/network/admin/
- 修改文件內(nèi)容
[oracle@oracledb admin]$ vi /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
#BEQUEATH CONFIG
(GLOBAL_DBNAME=orcl)
(SID_NAME=orcl)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
#PRESPAWN CONFIG
(PRESPAWN_MAX=20)
(PRESPAWN_LIST=
(PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
)
)
)
3.修改完成后執(zhí)行命令: netca -silent -responsefile /opt/oraclesoft/database/response/netca.rsp - 啟動(dòng)監(jiān)聽
[oracle@oracledb bin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 16-JAN-2018 05:25:28
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 16-JAN-2018 05:25:28
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
The listener supports no services
The command completed successfully
至此,所有工作已完成
若有疑問(wèn)政勃,請(qǐng)加QQ844357411進(jìn)行咨詢