1.配置本地yum源和epel源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
//centos6:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
//centos7:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//重新加載yum源
yum clean all
yum makecache
//安裝軟件
yum -y install unzip ntp binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp xorg-x11-utils
//服務(wù)器時間同步
ntpdate -u ntp.api.bz
//安裝pdksh
wget http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
//LVM分區(qū)
pvcreate /dev/vdb
vgcreate oracle /dev/vdb
lvcreate -L 475G -n data oracle
lvcreate -L 20G -n swap oracle
mkfs.xfs /dev/oracle/data
mkswap /dev/oracle/swap
mkdir /oracle
vim /etc/fstab
/dev/oracle/data /oracle xfs defaults 0 0
/dev/oracle/swap swap swap defaults 0 0
mount -a
swapon -a
2.oracle配置
- 配置主機名
echo "192.168.1.146 Oracle11gR2" >> /etc/hosts
vim /etc/sysconfig/network --> HOSTNAME=Oracle11gR2
hostname Oracle11gR2
- 配置JDK
java -version
rpm -qa | grep jdk
rpm -e java-1.7.0-openjdk //卸載原有低版本jdk
//下載jdk的rpm安裝包
rpm -ivh jdk-8u181-linux-x64.rpm
vim /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/java/jdk1.8.0_181-amd64
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile.d/jdk.sh
java -version
- VNC配置
yum -y groupinstall "Desktop"
yum -y groupinstall "X Window System"
yum -y install tigervnc tigervnc-server
vim /etc/inittab --> id:5:initdefault:
vncserver
vim /etc/sysconfig/vncservers
//修改代碼:
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1280x800"
vim /root/.vnc/xstartup
//注釋代碼:
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
//新增代碼:
gnome-session &
//重啟VNC服務(wù)端:
service vncserver restart
//驗證VNC服務(wù)端是否成功啟動:
ss -tunlp | grep vnc
//設(shè)定VNC服務(wù)端開機自啟:
chkconfig vncserver on
chkconfig vncserver --list
本地Windows 10中使用VNC客戶端工具VNC Viewer担租,輸入VNC服務(wù)端的IP地址:1即可進(jìn)行連接潦嘶。默認(rèn)第一個端口是5901巷屿,第二個端口是5902赃梧,以此類推
- Oracle準(zhǔn)備
//創(chuàng)建運行Oracle時所需的用戶和組:
groupadd dba //dba組中的成員用于管理滤蝠、操作數(shù)據(jù)庫
groupadd oinstall //oinstall組中的成員用于管理Oracle數(shù)據(jù)庫軟件,即各種Oracle物理文件
useradd -m -g oinstall -G dba oracle
echo "D111@oracle-111yao!@#$" | passwd --stdin oracle
id oracle
//創(chuàng)建安裝Oracle時所需的目錄授嘀,并設(shè)置權(quán)限:
mkdir -pv /oracle /oraInventory
chown -R oracle.oinstall /oracle
chmod -R 755 /oracle
chown -R oracle.oinstall /oraInventory
chmod -R 755 /oraInventory
//設(shè)定oracle用戶的環(huán)境變量
su - oracle
vim .bash_profile //末尾追加如下內(nèi)容:
export ORACLE_BASE=/oracle/data
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=TESTDB //此名稱要與之后新建數(shù)據(jù)庫時輸入的SID名稱一致
export PATH=$ORACLE_HOME/bin:$PATH
. .bash_profile
//調(diào)整系統(tǒng)及內(nèi)核參數(shù)(root用戶操作):
vim /etc/security/limits.conf //末尾追加如下內(nèi)容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vim /etc/pam.d/login //末尾追加內(nèi)容:
session required pam_limits.so
vim /etc/profile //末尾追加如下內(nèi)容:
if [ "$USER" == "oracle" ];then
if [ "$SHELL" == "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
. /etc/profile
vim /etc/sysctl.conf //末尾追加如下內(nèi)容(等號左右兩邊都有空格):
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 68719476736
kernel.shmmni = 4096
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 = 1048576
sysctl -p
- Oracle數(shù)據(jù)庫安裝
export DISPLAY=localhost:1
xdpyinfo | grep "name of display" --> name of display: localhost:1
xhost + --> access control disabled, clients can connect from any host
su - oracle
export DISPLAY=localhost:1
xdpyinfo | grep "name of display" --> name of display: localhost:1
cd database #oracle壓縮包解壓得位置
./runInstaller //彈出圖形安裝界面
-
取消溝-----下一步------yes(提示沒有填寫郵箱)
-
勾選“Skip software updates”不更新
-
勾選“install database software only”只安裝軟件
-
勾選“single instance database installtion” 創(chuàng)建單實例的數(shù)據(jù)庫安裝
-
安裝語言 使用默認(rèn)英文
-
勾選 “Enterprise Edition(4.5G)”安裝企業(yè)版
-
Oracle安裝路徑自動識別到了配置的變量,下一步,如果沒有識別蹄皱,請查看oracle用戶得.bash_profile是否生效
-
安裝文件的路徑文件目錄览闰,自動識別
-
選擇組的所屬
-
開始檢查安裝的系統(tǒng)的文件的參數(shù)信息
-
以上是需要調(diào)整的一些內(nèi)核和缺少的包體信息,需要完成后,再繼續(xù) 下一步
-
顯示的安裝進(jìn)度信息
- 需要root的用戶下依次執(zhí)行以上的腳本
#: /app/oraInventory/orainstRoot.sh
Changing permissions of /app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /app/oraInventory to oinstall.
The execution of the script is complete.
#: /app/oracle/product/11.2.0.3/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /app/oracle/product/11.2.0.3/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.
Finished product-specific root actions.
-
執(zhí)行完成后點擊 OK
-
提示你軟件已經(jīng)安裝成功了
-
配置oracle數(shù)據(jù)的監(jiān)聽
在圖形界面的vnc中芍阎,命令行中 輸入netca
1.[oracle@iZ28ubyqhl0Z ~]$netca
-
點擊下一步 下一步 完成即可
以上提示監(jiān)聽配置成功,且是啟動了