上传安装包至对应路径

安装
sudo tar -zxvf /opt/softapp/jdk-8u333-linux-x64.tar.gz -C /usr/local/
echo 'export JAVA_HOME=/usr/local/jdk1.8.0_333' >> ~/.bashrc
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar' >> ~/.bashrc
source ~/.bashrc
java -version*上传到安装包到/opt/softapp/oracle/,然后解压
cd /opt/softapp/oracle
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zipvim /etc/selinux/config设置SELINUX=disabled
SELINUX=disabled
使命令生效
setenforce 0service iptables stop
systemctl stop firewalld
systemctl disable firewalldyum install yum install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel -ygroupadd oinstall
groupadd dba
useradd -m -g oinstall -G dba oracle
passwd oracle编辑/etc/security/limits.conf
vim /etc/security/limits.conf在文件末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240vim /etc/sysctl.conf在文件在最后添加
vm.max_map_count = 655360
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
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 = 1048576配置生效
sysctl -pmkdir -p /module/oracle/product/11.2.0
mkdir /module/oracle/oradata
mkdir /module/inventory
mkdir /module/oracle/fast_recovery_area
chown -R oracle:oinstall /module/oracle
chown -R oracle:oinstall /module/inventory
chmod -R 775 /module/oraclesu - oracle
vim .bash_profile在文件末尾添加以下内容
# oracle配置
ORACLE_BASE=/module/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH使之生效
source .bash_profile切换root
su rootcopy到oracle目录下交有oracle管理
cp -r /opt/softapp/oracle/database /home/oracle/编辑db_install.rsp
vim /opt/softapp/oracle/database/response/db_install.rsp修改以下内容
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/module/oracle/product/11.2.0
ORACLE_BASE=/module/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true授权
chown -R oracle:oinstall /home/oracle/database
chmod -R 775 /home/oracle/databasesu oracle
cd /home/oracle/database
./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp -ignorePrereq
sh /module/inventory/orainstRoot.sh
sh /module/oracle/product/11.2.0/root.sh
su - oracle
netca /silent /responsefile /home/oracle/database/response/netca.rsp
成功运行后,在/u01/app/oracle/product/11.2.0/network/admin/中生成listener.ora和sqlnet.ora

编辑dbca.rsp文件
vim /home/oracle/database/response/dbca.rspdbca -silent -responseFile /home/oracle/database/response/dbca.rsp
ps -ef | grep ora_ | grep -v grep
lsnrctl status
sqlplus / as sysdba登上之后执行
select status from v$instance;退出
exit;
修改 /module/oracle/product/11.2.0/bin路径下的dbstart dbshut脚本,将两个脚本中的ORACLE_HOME_LISTNER=$1,修改为ORACLE_HOME_LISTNER=$ORACLE_HOMEvim /etc/oratab
chmod 755 /etc/rc.d/rc.local
vim /etc/rc.d/rc.local在rc.local中添加:
su oracle -lc "/module/oracle/product/11.2.0/bin/lsnrctl start" #加上引号才能把空格后的
su oracle -lc /module/oracle/product/11.2.0/bin/dbstart4)重启机器后执行
netstat -tplnsqlplus / as sysdbaalter user SYSTEM account unlock;rm -rf /tmp/OraInstall*删除安装目录重新新建把/module/inventory移出/module/oracle/inventory解决方法:通过搜索查找解决方法都提示是Java的问题。但Oracle会先解压出jdk包在自己的tmp目录下,所以该问题不是由PATH、CLASSPATH、JAVA_HOME这几个Java环境变量引起的。
unset DISPLAY原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。