赞
踩
近日,工信部印发了关于贯彻落实《推进IPv6规模部署行动计划》的通知,额。。。不好意思,跑题了!其实也没有跑题,本篇就是想要讲跟IPV6有关的东西。现在很多最新版的组件都默认支持IPV6了,比如Nginx、PHP、MySQL等等。那么本篇专门讲解一下Oracle 19C如何开启对IPV6的支持,从安装到配置、到IPV6监听的配置,一文打尽。
关于IPV6的基础知识,笔者后续会找时间,专门输出一篇文章分享给大家。
Oracle OUI 静默安装,即 Oracle OUI Silent Installations,之所以能实现静默,是因为底层通过三个 response files 指定了一些必需的配置项的具体设置,管理员可以通过修改这三个 response file,针对自己的情况进行定制配置,从而实现静默安装。
这三个 response files,说明如下:
$ORACLE_HOME/install/response/db_install.rsp: 静默式安装或升级 oracle 二进制包时使用;
$ORACLE_HOME/assistants/dbca/dbca.rsp: 静默式安装、配置、删除数据库实例时使用;
$ORACLE_HOME/assistants/netca/netca.rsp: 静默式配置 oracle 数据库的网络监听时使用;
在执行静默安装前,最好备份这三个文件。
># yum localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
># id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
># mkdir /opt/u01
># mkdir /opt/u02
># ln -s /opt/u01 /
># ln -s /opt/u02 /
># mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
># mkdir -p /u02/oradata
># mkdir /u02/flash_recovery_area
># chown -R oracle:oinstall /opt/u01 /opt/u02
># chmod -R 775 /opt/u01 /opt/u02
># su - oracle
>$ touch /home/oracle/scripts/setEnv.sh
>$ touch /home/oracle/scripts/start_all.sh
>$ touch /home/oracle/scripts/stop_all.sh
>$ chown -R oracle:oinstall /home/oracle/scripts
>$ chmod u+x /home/oracle/scripts/*.sh
cat > /home/oracle/scripts/setEnv.sh <<EOF # Oracle Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=oracle19csvr export ORACLE_UNQNAME=cdb1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1 export ORA_INVENTORY=/u01/app/oraInventory export ORACLE_SID=zabbix export PDB_NAME=pdb1_zabbix export DATA_DIR=/u02/oradata export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib EOF
cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbstart \$ORACLE_HOME
EOF
cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbshut \$ORACLE_HOME
EOF
>$ echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile
>$ source .bash_profile
注意:
上述环境变量辅助脚本 setEnv 中的配置项 ORACLE_SID=zabbix 和 PDB_NAME=pdb1_zabbix,跟后文 dbca 配置文件$oracle_home/assistants/dbca/dbca.rsp 中的配置项sid=zabbix 和pdbName=pdb1_zabbix 是一一呼应的。
cd /u01/app/oracle/product/19.0.0/dbhome_1
unzip LINUX.X64_193000_db_home.zip
cd /u01/app/oracle/product/19.0.0/dbhome_1/install/response/
cp -a db_install.rsp {,db_install.rsp.bak.20220202}
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=oinstall
oracle.install.db.OSOPER_GROUP=oinstall
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
oracle.install.db.OSDGDBA_GROUP=oinstall
oracle.install.db.OSKMDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=oinstall
oracle.install.db.rootconfig.executeRootScript=false
>$ /u01/app/oracle/product/19.0.0/dbhome_1/runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
Launching Oracle Database Setup Wizard...
Prerequisite checks executed successfully.
Moved the install session logs to:
/u01/app/oraInventory/logs/InstallActions2022-02-02_11-06-47AM
>$ /u01/app/oracle/product/19.0.0/dbhome_1/runInstaller -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
>$ sh /u01/app/oraInventory/orainstRoot.sh
>$ sh /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
>$ netca -silent -responseFile $ORACLE_HOME/assistants/netca/netca.rsp
>$ vim /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = fd15:4ba5:5a2b:1008::5)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.8)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ZABBIX.DB) (ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1) (SID_NAME = zabbix) ) (SID_DESC = (GLOBAL_DBNAME = PDB1_ZABBIX.DB) (SID_NAME = zabbix) ) ) ADR_BASE_LISTENER=/u01/app/oracle
>$ lsnrctl start # 启动
>$ lsnrctl status
gdbName=zabbix.db sid=zabbix createAsContainerDatabase=true pdbName=pdb1_zabbix pdbAdminPassword=Root.123456 templateName=General_Purpose.dbc sysPassword=Root.123456 systemPassword=Root.123456 dbsnmpPassword=Root.123456 datafileDestination=/u02/oradata recoveryAreaDestination=/u02/flash_recovery_area characterSet=UTF8 nationalCharacterSet=UTF8 listeners=LISTENER databaseType=OLTP sampleSchema=true
>$ dbca -silent -createDatabase -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/dbca.rsp
[oracle@oracle19csvr admin]$ lsnrctl status LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 05-FEB-2022 10:20:57 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=fd15:4ba5:5a2b:1008::5)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 02-FEB-2022 22:16:06 Uptime 2 days 12 hr. 4 min. 51 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/oracle19csvr/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fd15:4ba5:5a2b:1008::5)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.8)(PORT=1521))) Services Summary... Service "86b637b62fdf7a65e053f706e80a27ca.db" has 1 instance(s). Instance "zabbix", status READY, has 1 handler(s) for this service... Service "d70b94075c19d292e055000000000005.db" has 1 instance(s). Instance "zabbix", status READY, has 1 handler(s) for this service... Service "pdb1_zabbix.db" has 1 instance(s). Instance "zabbix", status READY, has 1 handler(s) for this service... Service "zabbix.db" has 1 instance(s). Instance "zabbix", status READY, has 1 handler(s) for this service... Service "zabbixXDB.db" has 1 instance(s). Instance "zabbix", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@oracle19csvr admin]$
[oracle@oracle19csvr admin]$ sqlplus sys/Root.123456@zabbix as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 5 10:17:47 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
ZABBIX = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.8)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = fd15:4ba5:5a2b:1008::5)(PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ZABBIX) ) ) PDB1_ZABBIX.DB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.8)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = fd15:4ba5:5a2b:1008::5)(PORT = 1521) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PDB1_ZABBIX.DB) ) )
[oracle@oracle19csvr admin]$ tnsping pdb1_zabbix
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 05-FEB-2022 10:49:34
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.8)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = fd15:4ba5:5a2b:1008::5)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1_zabbix)))
OK (20 msec)
好了,终于结束了,整个过程下来可以说是“千辛万苦”啊!不断的碰到问题,解决问题。不断的掉到坑里,再从坑里爬出来。在本篇中笔者并没有把所遇到的问题分享出来。因为碰到的问题是五花八门呀!如果您也想在Oracle 19C将IPV6的监听玩起来,说不定遇到的问题会和笔者不一样,那就仁者见仁,智者见智了。本文只是抛砖引玉,望能和广大朋友一起交流哈。非常感谢您的关注,望多多点赞、转发。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。