unzip linuxamd64_12102_database_1of2.zip
unzip linuxamd64_12102_database_2of2.zip
关闭selinux:
vim /etc/selinux/config
systemctl stop firewalld
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 sysstat ld-linux.so.2 unixODBC unixODBC-devel
yum -y install compat-libcap1.x86_64
yum install libXp.i686
1.添加分组和创建用户
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo "abcdef" | passwd --stdin oracle
mkdir -p /soft/database/oracle/product/12.1.0.2.0/dbhome_1
chown -R oracle:oinstall /soft/database/oracle
chmod -R 775 /soft/database/oracle
vim /etc/sysctl.conf
将下面的配置加入到sysctl.conf配置文件中
在文件最后加入
fs.aio-max-nr=1048576
fs.file-max=6815744
kernel.sem=250 32000 100 128
kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
net.core.rmem_default=1048576
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
net.ipv4.ip_local_port_range=9000 65500
sysctl -p
vim /etc/security/limits.conf
在文件最后加入
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
vim /etc/pam.d/login
在文件最后加入
session required /lib64/security/pam_limits.so
session required pam_limits.so
vim /etc/profile
添加至文件最后
#oracle config
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
切换用户,并且进入home目录下
su - oracle
cd ~
vim .bash_profile
添加在文件的末尾
umask 022
ORACLE_BASE=/soft/database/oracle
ORACLE_HOME=$ORACLE_BASE/product/12.1.0.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_TERM=xterm
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/12.1.0.2.0/lib:$LD_LIBRARY_PATH
LANG=C
export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM PATH LD_LIBRARY_PATH LANG
首先卸载掉系统自带的openJDK,运行命令“yum remove openjdk”,出现“complete”则删除
yum remove *openjdk*
mkdir -p /install/java/jdk
cd /install/java/jdka
rz
ls
2)创建安装目录
mkdir -p /soft/java/jdk
tar -xvf ./jdk-8u231-linux-x64.tar.gz -C /soft/java/jdk/
vim /etc/profile
#jdk8 config
export JAVA_HOME=/soft/java/jdk/jdk1.8.0_231
export PATH=.:$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -version
yum groupinstall "X Window System"
yum install -y xterm
使用Xmanager6进行图形化安装(需要另行安装)
1)开启Xstart
2)新建会话
3)写入命令
/usr/bin/xterm -ls -display $DISPLAY
cd /install/database/oracle/Linux/12.1.0.2.0/database
./runInstaller
1)不设置邮箱,取消设置My Oracle support password
选择yes
2)选择创建和配置一个数据库
3)选择安装类型为服务器类型
4)选择只安装实例数据库
5)选择高级安装
6)选择产品语言:英文和简体中午
7)下一步
8)前面就配置好了直接下一步
9)建立库存
选择为/home/oracle/oraInventory
还执行以下命令
chown -R oracle:oinstall /home/oracle/oraInventory
chmod -R 775 /home/oracle/oraInventory
19.检查
出现如下图所示的错误说明swap空间不足,配置swap空间的方法参考:
https://blog.csdn.net/hzh839900/article/details/79215703
dd if=/dev/zero of=swapfree bs=32k count=65515
mkswap swapfree
chmod 0600 swapfree
swapoff swapfree
swapon swapfree
free
vim /etc/fstab
在配置文件中加上
/dec/hdb5 swap swap defaults 0 0
/tmp/swapfree swap swap defaults 0 0
su - root
/home/oracle/oraInventory/orainstRoot.sh
/soft/database/oracle/product/12.1.0.2.0/dbhome_1/root.sh
执行完点击ok
su - oracle
lsnrctl status
sqlplus sys as sysdba