13cR2 Modify OMS HTTPS and HTTP Console And Upload Ports After 13c Cloud Control Installation

13cR2 Modify OMS HTTPS and HTTP Console And Upload Ports After 13c Cloud Control Installation

Cause:
The port is occupied, "em13c" directory had moved,but the process still active:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$netstat -apn | grep 7802
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 :::7802                     :::*                        LISTEN      6986/httpd.worker   
[oracle@trsen:/u01/app/em13cR2/middle/bin]$ps -aux | grep 6986
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
oracle    3893  0.0  5.4 4016748 669868 ?      Ss   Nov10   0:40 ora_p006_EMREP
oracle    6986  0.0  0.0 1998880  644 ?        Sl   Nov11   0:07 /u01/app/em13c/middleware/ohs/bin/httpd.worker -k start -f /u01/app/em13c/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/instances/ohs1/httpd.conf

Solution:
1.lists the current value of the https/http console/upload ports informations are followed:
Now port for oms:
HTTP Console Port          : 7790
HTTPS Console Port         : 7803
HTTP Upload Port           : 4890
HTTPS Upload Port          : 4904

we modify port to new port:
HTTP Console Port          : 7788
HTTPS Console Port         : 7802
HTTP Upload Port           : 4889
HTTPS Upload Port          : 4903

OMS property of ports:
HTTPS CONSOLE PORT:oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort
HTTPS UPLOAD PORT:oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort
HTTP CONSOLE PORT:oracle.sysman.emSDK.svlt.EMConsoleServerPort
HTTP UPLOAD PORT:oracle.sysman.emSDK.svlt.ConsoleServerPort

Changing HTTPS console port:
1. Verify the existing https console port:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl get property -name  oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Value for property oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort for oms trsen.em13c.cn:4890_Management_Service is 7803

2. Stop the OMS

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down

3.Change the https console port

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl set property -name oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort -value 7802 -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Property oracle.sysman.emSDK.svlt.EMConsoleServerHTTPSPort for oms trsen.em13c.cn:4890_Management_Service has been set to value 7802
OMS restart is required to reflect the new property value

4.Take a backup of file and update ssl.conf and emgc.properties :

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1]$cat ssl.conf | grep 7803
Listen 7803 #OHS_SSL_PORT
<VirtualHost *:7803> #OHS_SSL_VH

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1]$cat ssl.conf | grep 7802
Listen 7802 #OHS_SSL_PORT
<VirtualHost *:7802> #OHS_SSL_VH

[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 7803
EM_CONSOLE_HTTPS_PORT=7803

[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 7802
EM_CONSOLE_HTTPS_PORT=7802

5.restart oms:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms -all -force
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Already Stopped
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
Stopping BI Publisher Server...
BI Publisher Server Already Stopped
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
AdminServer Successfully Stopped
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up

Changing HTTPS Upload Port
1. Verify the OMS HTTPS upload port:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl get property -name oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Value for property oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort for oms trsen.em13c.cn:4890_Management_Service is 4904

2. Modify the HTTPS upload port to new value:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl set property -name oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort -value 4903 -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Property oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort for oms trsen.em13c.cn:4890_Management_Service has been set to value 4903
OMS restart is required to reflect the new property value

3. Take a backup of the file and update emgc.properties and httpd_em.conf(have two places) file:

[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 4904
EM_UPLOAD_HTTPS_PORT=4904
[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 4903
EM_UPLOAD_HTTPS_PORT=4903

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/instances/ohs1/moduleconf]$cat httpd_em.conf | grep 4904
    Listen 4904
    <VirtualHost *:4904>
[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/instances/ohs1/moduleconf]$cat httpd_em.conf | grep 4903
    Listen 4903
    <VirtualHost *:4903>

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1/moduleconf]$cat httpd_em.conf | grep 4904
    Listen 4904
    <VirtualHost *:4904>
[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1/moduleconf]$cat httpd_em.conf | grep 4903
    Listen 4903
    <VirtualHost *:4903>

4. Restart OMS:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms -force -all
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
Stopping BI Publisher Server...
BI Publisher Server Already Stopped
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
AdminServer Successfully Stopped
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up

NOTE:
If agents are configured with https upload port then perform the following on agent machines to reflect the new OMS https upload port:
1. Take a backup of <AGENT_INST_HOME>/sysman/config/emd.properties file
2. Edit the <AGENT_INST_HOME>/sysman/config/emd.properties file as below:
REPOSITORY_URL=https://omsmachine.domain.com:4903/empbs/upload
emdWalletSrcUrl=https://omsmachine.domain.com:4903/em/wallets/emd
3. Restart the agent:
<AGENT_INST_HOME>/bin>./emctl stop agent
<AGENT_INST_HOME>/bin>./emctl start agent

Changing HTTP console port
1. Verify the OMS HTTP console port:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl get property -name oracle.sysman.emSDK.svlt.EMConsoleServerPort -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Value for property oracle.sysman.emSDK.svlt.EMConsoleServerPort for oms trsen.em13c.cn:4890_Management_Service is 7790

2. Modify the HTTPS upload port to new value:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl set property -name oracle.sysman.emSDK.svlt.EMConsoleServerPort -value 7788 -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Property oracle.sysman.emSDK.svlt.EMConsoleServerPort for oms trsen.em13c.cn:4890_Management_Service has been set to value 7788
OMS restart is required to reflect the new property value

3. Take a backup of the file and update emgc.properties and httpd.conf file:

[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 7790
EM_CONSOLE_HTTP_PORT=7790 
[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 7788
EM_CONSOLE_HTTP_PORT=7788

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1]$cat httpd.conf | grep 7790
Listen 7790   #OHS_LISTEN_PORT
[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1]$cat httpd.conf | grep 7788
Listen 7788   #OHS_LISTEN_PORT

4. Restart OMS:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms -all -force
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
Stopping BI Publisher Server...
BI Publisher Server Already Stopped
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
AdminServer Successfully Stopped
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up

Changing HTTP upload port
1. Verify the OMS HTTP upload port:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl get property -name oracle.sysman.emSDK.svlt.ConsoleServerPort -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Value for property oracle.sysman.emSDK.svlt.ConsoleServerPort for oms trsen.em13c.cn:4890_Management_Service is 4890

2. Modify the HTTP upload port to new value:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl set property -name oracle.sysman.emSDK.svlt.ConsoleServerPort -value 4889 -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Property oracle.sysman.emSDK.svlt.ConsoleServerPort for oms trsen.em13c.cn:4890_Management_Service has been set to value 4889
OMS restart is required to reflect the new property value

3. Take a backup of the file and update /u02/em13c/gc_inst/em/EMGC_OMS1/emgc.properties file:

[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties | grep 4890
oracle.sysman.emSDK.svlt.ConsoleServerName=trsen.em13c.cn\:4890_Management_Service
EM_UPLOAD_HTTP_PORT=4890
[oracle@trsen:/u01/app/em13cR2/gc_inst/em/EMGC_OMS1]$cat emgc.properties  | grep 4889
oracle.sysman.emSDK.svlt.ConsoleServerName=trsen.em13c.cn\:4889_Management_Service
EM_UPLOAD_HTTP_PORT=4889

[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1/moduleconf]$cat httpd_em.conf | grep 4890
Listen 4890
<VirtualHost *:4890>
[oracle@trsen:/u01/app/em13cR2/gc_inst/user_projects/domains/GCDomain/config/fmwconfig/components/OHS/ohs1/moduleconf]$cat httpd_em.conf | grep 4889
Listen 4889
<VirtualHost *:4889>

4. Restart OMS:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms -all -force
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
Stopping BI Publisher Server...
BI Publisher Server Already Stopped
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
AdminServer Successfully Stopped
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up

NOTE:
If agents are configured with http upload port then perform the following on agent machines to reflect the new OMS http upload port:
1. Take a backup of <AGENT_INST_HOME>/sysman/config/emd.properties file
2. Edit the <AGENT_INST_HOME>/sysman/config/emd.properties file as below:
REPOSITORY_URL=http://omsmachine.domain.com:4889/empbs/upload
emdWalletSrcUrl=http://omsmachine.domain.com:4889/em/wallets/emd
3. Restart the agent:
<AGENT_INST_HOME>/bin>./emctl stop agent
<AGENT_INST_HOME>/bin>./emctl start agent

Verify OMS port informations:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl status oms -details -sysman_pwd em13c09
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Console Server Host        : trsen.em13c.cn
HTTP Console Port          : 7788
HTTPS Console Port         : 7802
HTTP Upload Port           : 4889
HTTPS Upload Port          : 4903
EM Instance Home           : /u01/app/em13cR2/gc_inst/em/EMGC_OMS1
OMS Log Directory Location : /u01/app/em13cR2/gc_inst/em/EMGC_OMS1/sysman/log
OMS is not configured with SLB or virtual hostname
Agent Upload is unlocked.
OMS Console is unlocked.
Active CA ID: 1
Console URL: https://trsen.em13c.cn:7802/em
Upload URL: https://trsen.em13c.cn:4903/empbs/upload

WLS Domain Information
Domain Name            : GCDomain
Admin Server Host      : trsen.em13c.cn
Admin Server HTTPS Port: 7103
Admin Server is RUNNING

Oracle Management Server Information
Managed Server Instance Name: EMGC_OMS1
Oracle Management Server Instance Host: trsen.em13c.cn
WebTier is Up
Oracle Management Server is Up
JVMD Engine is Up

BI Publisher Server Information
BI Publisher Managed Server Name: BIP
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command

The error may occur when "emctl status oms -details":

2016-11-14 13:22:12,507 [main] ERROR oms.PrintOMSSetupInfo main.343 – Failed to find OMS details: null
java.lang.NullPointerException
    at oracle.sysman.emctl.util.EmctlUtil.getOMSSetupInfo(EmctlUtil.java:978)
    at oracle.sysman.emctl.oms.PrintOMSSetupInfo.main(PrintOMSSetupInfo.java:155)

solution:

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl secure oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Securing OMS... Started.
Enter Enterprise Manager Root (SYSMAN) Password : 
Enter Agent Registration Password : 
Securing OMS... Successful
Restart OMS

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl stop oms -all -force
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
WebTier Successfully Stopped
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
Stopping BI Publisher Server...
BI Publisher Server Already Stopped
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
AdminServer Successfully Stopped
BI Publisher Server is Down
BI Publisher is disabled, to enable BI Publisher on this host, use the 'emctl config oms -enable_bip' command
[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.

[oracle@trsen:/u01/app/em13cR2/middle/bin]$./emctl start oms
Oracle Enterprise Manager Cloud Control 13c Release 2  
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up
JVMD Engine is Up