在数据库系统上打开端口
您可以使用以下步骤打开数据库系统上的端口。
根据需要在数据库系统上打开以下端口:
- 6200 - 用于 Oracle Notification Service (ONS)。
- 1158 - 对于 Enterprise Manager Cloud Control。1158 是默认端口,但数据库系统上启用的每个附加控制台将具有不同的端口。有关详细信息,请参阅使用 Oracle Enterprise Manager 监视。
有关关键防火墙规则的重要信息,请参见 Security Rules for the DB System 中的基本防火墙规则。
过程
-
通过 SSH 连接到数据库系统。
ssh -i <private_key_path> opc@<db_system_ip_address> -
以 opc 身份登录,然后向 root 用户执行 sudo。
login as: opc sudo su - -
将 iptables 的副本保存为备份。
iptables-save > /tmp/iptables.orig(如有必要,可以使用命令
iptables-restore < /tmp/iptables.orig恢复原始文件。) -
向 iptables 动态添加规则以允许控制台端口上的入站流量,如以下示例所示。根据需要更改端口号和注释。
iptables -I INPUT 8 -p tcp -m state --state NEW -m tcp --dport 1158 -j ACCEPT -m comment --comment "Required for Enterprise Manager Database Control." -
确保已添加规则。
service iptables status -
将更新后的文件保存到
/etc/sysconfig/iptables。/sbin/service iptables save更改将立即生效,并在重新引导节点时保持有效。
-
按 Update the Security List for the DB System 中所述更新数据库系统的安全列表。