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
//服务器时间同步
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分区
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
image.png
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服务端:
service vncserver restart
image.png
//验证VNC服务端是否成功启动:
ss -tunlp | grep vnc
image.png
//设定VNC服务端开机自启:
chkconfig vncserver on
chkconfig vncserver --list
本地Windows 10中使用VNC客户端工具VNC Viewer,输入VNC服务端的IP地址:1即可进行连接。默认第一个端口是5901,第二个端口是5902,以此类推
image.png
- Oracle准备
//创建运行Oracle时所需的用户和组:
groupadd dba //dba组中的成员用于管理、操作数据库
groupadd oinstall //oinstall组中的成员用于管理Oracle数据库软件,即各种Oracle物理文件
useradd -m -g oinstall -G dba oracle
echo "D111@oracle-111yao!@#$" | passwd --stdin oracle
id oracle
//创建安装Oracle时所需的目录,并设置权限:
mkdir -pv /oracle /oraInventory
chown -R oracle.oinstall /oracle
chmod -R 755 /oracle
chown -R oracle.oinstall /oraInventory
chmod -R 755 /oraInventory
//设定oracle用户的环境变量
su - oracle
vim .bash_profile //末尾追加如下内容:
export ORACLE_BASE=/oracle/data
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=TESTDB //此名称要与之后新建数据库时输入的SID名称一致
export PATH=$ORACLE_HOME/bin:$PATH
. .bash_profile
//调整系统及内核参数(root用户操作):
vim /etc/security/limits.conf //末尾追加如下内容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vim /etc/pam.d/login //末尾追加内容:
session required pam_limits.so
vim /etc/profile //末尾追加如下内容:
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 //末尾追加如下内容(等号左右两边都有空格):
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数据库安装
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(提示没有填写邮箱)
image.png -
勾选“Skip software updates”不更新
image.png -
勾选“install database software only”只安装软件
image.png -
勾选“single instance database installtion” 创建单实例的数据库安装
image.png -
安装语言 使用默认英文
image.png -
勾选 “Enterprise Edition(4.5G)”安装企业版
image.png -
Oracle安装路径自动识别到了配置的变量,下一步,如果没有识别,请查看oracle用户得.bash_profile是否生效
image.png -
安装文件的路径文件目录,自动识别
image.png -
选择组的所属
image.png -
开始检查安装的系统的文件的参数信息
image.png -
以上是需要调整的一些内核和缺少的包体信息,需要完成后,再继续 下一步
image.png -
显示的安装进度信息
image.png - 需要root的用户下依次执行以上的脚本
#: /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.
-
执行完成后点击 OK
image.png -
提示你软件已经安装成功了
image.png -
配置oracle数据的监听
在图形界面的vnc中,命令行中 输入netca
1.[oracle@iZ28ubyqhl0Z ~]$netca
image.png -
点击下一步 下一步 完成即可
image.png
以上提示监听配置成功,且是启动了
image.png
网友评论