赞
踩
配置hostname:
hostnamectl set-hostname p19c
配置hosts文件:
cat <<EOF>>/etc/hosts
#Public IP
192.168.229.150 p19c
EOF
yum -y install bc binutils compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make gcc gcc-c++ net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat
groupadd oinstall
groupadd dba
groupadd asmdba
groupadd backupdba
groupadd dgdba
groupadd kmdba
groupadd racdba
groupadd oper
useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper -m oracle
vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 896532
kernel.shmmax = 3672197038
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 -p
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
su - oracle
vim .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0
export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin
# 注意这里是你的主机,注意修改否则创建监听会出问题
export ORACLE_HOSTNAME=p19c
# 注意这里是你的主机,注意修改否则创建监听会出问题
export ORACLE_SID=p19c
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
# 环境变量生效
source .bash_profile
su - root
vim /etc/security/limits.conf
# Set Oracle Database Server
@oinstall soft nofile 2048
@oinstall hard nofile 65536
@oinstall soft nproc 16384
@oinstall soft stack 10240
我们首先需要下载Oracle安装文件
官网直达
百度网盘获取
链接:https://pan.baidu.com/s/1A6XztDF91rhvpoURL5NU5Q?pwd=6j5z
提取码:6j5z
我们需要手动将Oracle安装文件上传到/opt下
mkdir -p /u01/app/oracle/product/19.3.0
chown -R oracle:oinstall /u01
chmod -R 775 /u01
su - oracle
cd /opt/
ls
LINUX.X64_193000_db_home.zip
unzip -q LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
cd $ORACLE_HOME/install/response
cp db_install.rsp db_install.rsp.bak
sed -i 's/^oracle.install.option=/oracle.install.option=INSTALL_DB_SWONLY/g' db_install.rsp
sed -i 's/^UNIX_GROUP_NAME=/UNIX_GROUP_NAME=oinstall/g' db_install.rsp
sed -i 's#^INVENTORY_LOCATION=#INVENTORY_LOCATION=/u01/app/oraInventory#g' db_install.rsp
sed -i 's#^ORACLE_HOME=#ORACLE_HOME=/u01/app/oracle/product/19.3.0#g' db_install.rsp
sed -i 's#^ORACLE_BASE=#ORACLE_BASE=/u01/app/oracle#g' db_install.rsp
sed -i 's/^oracle.install.db.InstallEdition=/oracle.install.db.InstallEdition=EE/g' db_install.rsp
sed -i 's/^oracle.install.db.OSDBA_GROUP=/oracle.install.db.OSDBA_GROUP=dba/g' db_install.rsp
sed -i 's/^oracle.install.db.OSOPER_GROUP=/oracle.install.db.OSOPER_GROUP=oper/g' db_install.rsp
sed -i 's/^oracle.install.db.OSBACKUPDBA_GROUP=/oracle.install.db.OSBACKUPDBA_GROUP=backupdba/g' db_install.rsp
sed -i 's/^oracle.install.db.OSDGDBA_GROUP=/oracle.install.db.OSDGDBA_GROUP=dgdba/g' db_install.rsp
sed -i 's/^oracle.install.db.OSKMDBA_GROUP=/oracle.install.db.OSKMDBA_GROUP=kmdba/g' db_install.rsp
sed -i 's/^oracle.install.db.OSRACDBA_GROUP=/oracle.install.db.OSRACDBA_GROUP=racdba/g' db_install.rsp
sed -i 's/^oracle.install.db.rootconfig.executeRootScript=/oracle.install.db.rootconfig.executeRootScript=false/g' db_install.rsp
cat db_install.rsp | grep 'oracle.install.option'
cat db_install.rsp | grep 'UNIX_GROUP_NAME'
cat db_install.rsp | grep 'INVENTORY_LOCATION'
cat db_install.rsp | grep 'ORACLE_HOME'
cat db_install.rsp | grep 'ORACLE_BASE'
cat db_install.rsp | grep 'oracle.install.db.InstallEdition'
cat db_install.rsp | grep 'oracle.install.db.OSDBA_GROUP'
cat db_install.rsp | grep 'oracle.install.db.OSOPER_GROUP'
cat db_install.rsp | grep 'oracle.install.db.OSBACKUPDBA_GROUP'
cat db_install.rsp | grep 'oracle.install.db.OSDGDBA_GROUP'
cat db_install.rsp | grep 'oracle.install.db.OSKMDBA_GROUP'
cat db_install.rsp | grep 'oracle.install.db.OSRACDBA_GROUP'
cat db_install.rsp | grep 'oracle.install.db.rootconfig.executeRootScript'
cd $ORACLE_HOME
./runInstaller -silent -responseFile /u01/app/oracle/product/19.3.0/install/response/db_install.rsp
根据提示在root下执行下面两条命令
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/19.3.0/root.sh
检查上面输出的这个日志文件内容没有报错即可
# 这里后边是就看你执行完脚本的输出日志
cat /u01/app/oracle/product/19.3.0/install/root_p19c_2024-03-20_05-15-55-769180328.log
一切正常,没有报错
– 相应模板存放位置:
– 软件/u01/app/oracle/product/19.3.0/install/response/db_install.rsp
– 监听/u01/app/oracle/product/19.3.0/assistants/netca/netca.rsp
– 建库/u01/app/oracle/product/19.3.0/assistants/dbca/dbca.rsp
su - oracle
netca /silent /responseFile /u01/app/oracle/product/19.3.0/assistants/netca/netca.rsp
查看监听状态
lsnrctl status
cd /u01/app/oracle/product/19.3.0/assistants/dbca
cp dbca.rsp dbca.rsp.bak
# 这里两条配置的是数据库的名字和sid
sed -i 's/^gdbName=/gdbName=p19c/g' dbca.rsp
sed -i 's/^sid=/sid=p19c/g' dbca.rsp
sed -i 's/^databaseConfigType=/databaseConfigType=SI/g' dbca.rsp
sed -i 's/^templateName=/templateName=General_Purpose.dbc/g' dbca.rsp
# 这两条配置的是数据库的密码
sed -i 's/^sysPassword=/sysPassword=123/g' dbca.rsp
sed -i 's/^systemPassword=/systemPassword=123/g' dbca.rsp
sed -i 's/^emConfiguration=/emConfiguration=DBEXPRESS/g' dbca.rsp
sed -i 's/^dbsnmpPassword=/dbsnmpPassword=123/g' dbca.rsp
sed -i 's#^datafileDestination=#datafileDestination=/u01/app/oracle/oradata#g' dbca.rsp
sed -i 's/^characterSet=/characterSet=AL32UTF8/g' dbca.rsp
sed -i 's/^totalMemory=/totalMemory=3100/g' dbca.rsp
检查
cat dbca.rsp | grep 'gdbName'
cat dbca.rsp | grep 'sid'
cat dbca.rsp | grep 'databaseConfigType'
cat dbca.rsp | grep 'templateName'
cat dbca.rsp | grep 'sysPassword'
cat dbca.rsp | grep 'systemPassword'
cat dbca.rsp | grep 'emConfiguration'
cat dbca.rsp | grep 'dbsnmpPassword'
cat dbca.rsp | grep 'datafileDestination'
cat dbca.rsp | grep 'characterSet'
cat dbca.rsp | grep 'totalMemory'
执行安装
dbca -silent -createDatabase -responseFile /u01/app/oracle/product/19.3.0/assistants/dbca/dbca.rsp
这里警告内存有点小,不过不影响,只是安装的时候慢了点,也能正常安装成功
安装完成
sqlplus system/123@p19c
或
sqlplus / as sysdba
安装成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。