FATAL-4001: Could not open port 0.0.0.0:7901 for listening, error: Address already in use
Change APPLY and MINE interface Ports, when it complains that the port is already in use, this happens when running setup wizard.
Problem Details
Problem Statement
Change APPLY and MINE interface Ports
Applicable Error Code
FATAL-4001: Could not open port 0.0.0.0:7901 for listening, error: Address already in use
Affected Versions
Replicate 2.7.x, 2.8.x
Affected Platforms
Platform Independent
Solution
While running setup wizard we get the error
FATAL-4001: Could not open port 0.0.0.0:7901 for listening, error: Address already in use
Perhaps, the dbvrep is already running. Check what is running on the port first before you move on.
- Linux based platform
netstat -tupln|grep 7901
- OR for Windows
netstat -ano|findstr "7901"
There are two ways of resolving this issues.
Running setup wizard again and changing the APPLY and MINE remote interface ports in Step4.
Edit the onetime.DDC file and change the ports
Option#1: Setup wizard
You can Run the setup wizard again and choose the replication you want to modify. In this example, MEEE is the name of my Replication which I would want to edit
(DDC_NAME) - Please enter a name for this replication: [] MEEE
Step 1 to Step 3 would be the same no changes required and when you move to Step 4, you can change the interface by typing yes in the option.
Checking that these settings are valid...
Do you want to change any of the settings? [No] Yes
(MINE_REMOTE_INTERFACE) - For each process, the address and port is needed on which it can be reached for commands: [source:7901] source:7905
(MINE_DATABASE) - Enter database TNS alias for target database: [ttorcl_src]
Below is the Example
Step 4 - Process configuration
========================================
The fourth step is to configure the replication processes for each replication.
Following processes are defined:
1: MINE on ttorcl_src
Host: source, SMTP: No, SNMP: No
2: APPLY on ttorcl_trg
Host: target, SMTP: No, SNMP: No
Enter number of process to modify it, or "done": [done] 1
Fully qualified name of the server for the process (usually co-located with the database, unless mine is offloaded using fetcher): [source]
Server type (Windows/Linux/Unix): [Linux]
Enable email notifications about problems? (Yes/No) [No]
Enable SNMP traps/notifications about problems? (Yes/No) [No]
Directory with DDC file and default where to create log files etc. (recommended: same as global setting, if possible)? [/u01/app/oracle/MEEE]
Following settings were pre-filled with defaults or your reloaded settings:
----------------------------------------
[MINE_REMOTE_INTERFACE]: Network remote interface: source:7901
[MINE_DATABASE]: Database TNS: ttorcl_src
[TNS_ADMIN]: tnsnames.ora path: /u01/app/oracle/product/11.2.0/xe/network/admin
[MINE_PLOG]: Filemask for generated plogs: /u01/app/oracle/MEEE/mine/%S.%E (%S is sequence, %T thread, %F original filename (stripped extension), %P process
type, %N process name, %E default extension)
[LOG_FILE]: General log file: /u01/app/oracle/MEEE/log/dbvrep_%N_%D.%E
[LOG_FILE_TRACE]: Error traces: /u01/app/oracle/MEEE/log/trace/dbvrep_%N_%D_%I_%U.%E
Checking that these settings are valid...
Do you want to change any of the settings? [No] Yes
(MINE_REMOTE_INTERFACE) - For each process, the address and port is needed on which it can be reached for commands: [source:7901] source:7905
(MINE_DATABASE) - Enter database TNS alias for target database: [ttorcl_src]
Network configuration files were detected on this system in these locations:
/u01/app/oracle/product/11.2.0/xe/network/admin
(TNS_ADMIN) - Enter the path of the tnsnames.ora to be used: [/u01/app/oracle/product/11.2.0/xe/network/admin]
(MINE_PLOG) - Enter the plog file name including location where the plogs should be located: [/u01/app/oracle/MEEE/mine/%S.%E]
(LOG_FILE) - General process logfile (%N = process name, %D = DDC name, %E = log extension): [/u01/app/oracle/MEEE/log/dbvrep_%N_%D.%E]
(LOG_FILE_TRACE) - Error traces (%I = process PID, %U = unique 4-char string): [/u01/app/oracle/MEEE/log/trace/dbvrep_%N_%D_%I_%U.%E]
Following processes are defined:
1: MINE on ttorcl_src
Host: source, SMTP: No, SNMP: No
2: APPLY on ttorcl_trg
Host: target, SMTP: No, SNMP: No
Enter number of process to modify it, or "done": [done] 2
Fully qualified name of the server for the process (usually co-located with the database, unless mine is offloaded using fetcher): [target]
Server type (Windows/Linux/Unix): [Linux]
Enable email notifications about problems? (Yes/No) [No]
Enable SNMP traps/notifications about problems? (Yes/No) [No]
Directory with DDC file and default where to create log files etc. (recommended: same as global setting, if possible)? [/u01/app/oracle/MEEE]
Following settings were pre-filled with defaults or your reloaded settings:
----------------------------------------
[APPLY_REMOTE_INTERFACE]: Network remote interface: target:7902
[APPLY_DATABASE]: Database TNS: ttorcl_trg
[TNS_ADMIN]: tnsnames.ora path: /u01/app/oracle/product/11.2.0/xe/network/admin
[APPLY_STAGING_DIR]: Directory for received plogs: /u01/app/oracle/MEEE/apply
[LOG_FILE]: General log file: /u01/app/oracle/MEEE/log/dbvrep_%N_%D.%E
[LOG_FILE_TRACE]: Error traces: /u01/app/oracle/MEEE/log/trace/dbvrep_%N_%D_%I_%U.%E
Checking that these settings are valid...
Do you want to change any of the settings? [No] Yes
(APPLY_REMOTE_INTERFACE) - For each process, the address and port is needed on which it can be reached for commands: [target:7902] target:7906
(APPLY_DATABASE) - Enter database TNS alias for target database: [ttorcl_trg]
Network configuration files were detected on this system in these locations:
/u01/app/oracle/product/11.2.0/xe/network/admin
(TNS_ADMIN) - Enter the path of the tnsnames.ora to be used: [/u01/app/oracle/product/11.2.0/xe/network/admin]
(APPLY_STAGING_DIR) - Enter the directory on the apply server (target) where apply stores plogs received from mine: [/u01/app/oracle/MEEE/apply]
(LOG_FILE) - General process logfile (%N = process name, %D = DDC name, %E = log extension): [/u01/app/oracle/MEEE/log/dbvrep_%N_%D.%E]
(LOG_FILE_TRACE) - Error traces (%I = process PID, %U = unique 4-char string): [/u01/app/oracle/MEEE/log/trace/dbvrep_%N_%D_%I_%U.%E]
Following processes are defined:
1: MINE on ttorcl_src
Host: source, SMTP: No, SNMP: No
2: APPLY on ttorcl_trg
Host: target, SMTP: No, SNMP: No
Enter number of process to modify it, or "done": [done]
Option#2: Editing onetime.ddc. You can also change the ports by editing the onetime.DDC file located inside config directory of your DDC replication folder.
Example:
RQ465 -- is the name of my replication
/u01/app/oracle/RQ465 - my replicate DDC directory
Take a backup of existing RQ465-onetime.ddc - there should be a onetime DDC file with the name of your replication.
2. Edit the file and change the appropriate port numbers in the below parameters.
Change the default ports 7902 / 7901 to some other ports that are open.
3. Run all.sh script