Recently, when we set up a test environment, we found that after the firewall for listening to port 1521 is enabled, the remote connection still cannot be connected, and the database can be normally connected only when the ip address is not limited to the port. The reason is as follows: first, this database is MTS, that is, the sharing mode: SQLshowparametershared_servers; NAMETYPEVALUE ----------------
Recently, when we set up a test environment, we found that after the firewall for listening to port 1521 is enabled, the remote connection still cannot be connected, and the database can be normally connected only when the ip address is not limited to the port. The reason is as follows: first, this database is MTS, that is, the sharing mode: SQL show parameter shared_servers; NAME TYPE VALUE ----------------
Recently, when we set up a test environment, we found that after the firewall for listening to port 1521 is enabled, the remote connection still cannot be connected, and the database can be normally connected only when the ip address is not limited to the port.
The reason is as follows:
First, this database is MTS, that is, the sharing mode:
SQL> show parameter shared_servers;NAME TYPE VALUE------------------------------------ ----------- ------------------------------max_shared_servers integershared_servers integer 1
The connection mode in the shared mode is that the client will redirect to the dispatcher after listening for a connection such as 1521, And the dispatcher port is random. If you only activate 1521, you will not be able to connect to the database. You will find that the telnet ip address is 1521, but the database cannot be connected.
In this case, you can solve the problem as follows:
You can perform Dedicated mode connection on the client and add the SERVER = DEDICATED configuration in tnsnames. ora:
test = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.97.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test) ) )
Then fix the dispatcher Port
# vi initSID.ora*.dispatchers="(address=(protocol=tcp)(port=49316))(dispatchers=3)"
Restart an instance
You can view the dispatcher port and then activate the Firewall:
SQL> select name,network from v$dispatcher;NAME----NETWORK--------------------------------------------------------------------------------D000(ADDRESS=(PROTOCOL=tcp)(HOST=auto_oracle.dmc.com)(PORT=49316))
Configure the firewall to allow access to the port 49316.
In this case, you need to activate two ports: 1521 and 49316.
Original article address: how to activate the firewall in oracle MTS mode, thanks to the original author for sharing.