Wednesday, July 30, 2014

How to Modify SCAN Setting or SCAN Listener Port after Installation (Doc ID 972500.1)

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.

Goal

This note provides steps to update 11gR2 Grid Infrastructure (CRS) Single Client Access Name (SCAN) setting or SCAN listener port setting if it's not setup properly or if it's changed after setup.

Note:

1. This procedure does not apply when GNS is being used
2. Even though clustername and SCAN name is set to the same during 'typical' installation, changing SCAN name will not affect clustername as change of clustername requires deconfigure and reconfigure of the entire cluster.

Solution

 

A. To update SCAN setting

1. As per documentation "Oracle Grid Infrastructure Installation Guide", Oracle strongly recommend to configure SCAN name in either DNS or GNS as /etc/hosts file can only resolve to one IP address.

SCAN IP must be in same subnet as public and VIP. If the new SCAN IP will be in different subnet, refer to note 276434.1 to change nodeapps/network resource first.

1a. If you intend to use /etc/hosts for SCAN name resolution, the same and only entry for SCAN name must exist on all nodes.

1b. If you intend to use DNS for SCAN name resolution, remove entries for SCAN name from /etc/hosts on all nodes, and make sure nslookup returns good result on all nodes, for example:

$ nslookup pay-scan.us.oracle.com
..
Name:   pay-scan.us.oracle.com
Address: 10.4.0.201
Name:   pay-scan.us.oracle.com
Address: 10.4.0.202
Name:   pay-scan.us.oracle.com
Address: 10.4.0.203


2. Once #1a or #1b is configured properly, execute the following to modify:

If name resolution for SCAN is being switched from local hosts file to DNS, be sure to remove SCAN name in local hosts file on all nodes prior to execute below commands.

2.1. To modify SCAN name or SCAN VIP addresses:

2.1.1. As grid user stop resources:

$ $GRID_HOME/bin/srvctl stop scan_listener
$ $GRID_HOME/bin/srvctl stop scan


2.1.2. As root user modify SCAN:

# $GRID_HOME/bin/srvctl modify scan -n pay-scan.us.oracle.com 

### For 11.2.0.1 only, if you intend to change SCAN name, due to bug 9603829, execute the following:

# $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=<new SCAN name>"

### Example:
# $GRID_HOME/bin/crsctl modify type ora.scan_vip.type -attr "ATTRIBUTE=SCAN_NAME,DEFAULT_VALUE=pay-scan.us.oracle.com"


Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one.

2.1.3. As grid user modify and start resources:

$ $GRID_HOME/bin/srvctl modify scan_listener -u
$ $GRID_HOME/bin/srvctl start scan_listener


2.1.4. To confirm the change

$ $GRID_HOME/bin/srvctl config scan
SCAN name: pay-scan.us.oracle.com, Network: 1/10.4.0.0/255.255.255.0/eth1
SCAN VIP name: scan1, IP: /10.4.0.201/120.0.0.201
SCAN VIP name: scan2, IP: /10.4.0.202/120.0.0.202
SCAN VIP name: scan3, IP: /10.4.0.203/120.0.0.203

$ $GRID_HOME/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521



2.2. To change SCAN to be on second network:

By default, SCAN will be configured on first public network (ora.net1.network), however in multiple public network environment, SCAN can run on second or other network.

There's no option to modify SCAN to use non-first network, to change to second or other network, scan_listener and scan resources need to be removed and added back.

In this example, we'll move SCAN from net1 to net2

$ $GRID_HOME/bin/srvctl config network
Network exists: 1/10.1.0.0/255.255.255.128/eth3, type static
Network exists: 2/10.1.1.0/255.255.255.128/eth4, type static


2.2.1. As grid user stop resources and remove scan_listener:

$ $GRID_HOME/bin/srvctl stop scan_listener$ $GRID_HOME/bin/srvctl stop scan
$ $GRID_HOME/bin/srvctl remove scan_listener -f


2.2.2. As root user remove and add SCAN:

# $GRID_HOME/bin/srvctl remove scan -f
#$GRID_HOME/bin/srvctl add scan -n <scan-name> -k 2


Once SCAN name is changed, update database init.ora/spfile parameter remote_listener to the new one.

2.2.3. As grid user add scan_listener and start resources:

$ $GRID_HOME/bin/srvctl add scan_listener-p <port>
$ $GRID_HOME/bin/srvctl start scan_listener



B. To modify SCAN listener port

As grid user:

1. Modify SCAN listener port:

$GRID_HOME/bin/srvctl modify scan_listener -p <new-SCAN-port>

Update 11gR2 database init.ora parameter: alter system set remote_listener='<SCAN-name>:<new-port-number>' scope=both;



2. Restart SCAN listener so the new port will be effective:

$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl start scan_listener



3. Confirm the change:

$GRID_HOME/bin/srvctl config scan_listener


--
With metta
Quang Phan

11g Grid Control: How to Re-configure the OMS After Port Change for the Listener Servicing the Grid Control Repository Database? (Doc ID 1268439.1)

Click to add to Favorites To BottomTo Bottom

May 22, 2013HOWTO
Rate this document Email link to this document Open document in new window Printable Page

In this Document


Goal

Solution
 Re-configuring the Oracle Management Service (OMS) 
 Re-configuring the 'OMS and Repository' Target
 Re-configuring the Listener Target

References


Applies to:

Enterprise Manager Base Platform - Version 11.1.0.1 to 11.1.0.1 [Release 11.1]
Information in this document applies to any platform.

Goal

This documents explains how to re-configure the 11g OMS when the listener port of the database holding the Grid Control Repository is changed.

Note: This document assumes that the port for the Listener has already been modified at the Repository Database machine. If needed, steps suggested in Document 359277.1: Changing Default Listener Port Number
can be followed.

For instructions on how to achieve this for a 10g Grid Control setup, refer to
Note 369997.1: How to Re-configure the OMS After Port Change for the Listener Servicing the Grid Control Repository Database.

Solution

Re-configuring the Oracle Management Service (OMS) 

1. Stop the OMS

cd <OMS_HOME>/bin
emctl stop oms

Note: Do not use 'emctl stop oms -all', the Admin server needs to be 'Up' for the changes to be recorded.

2. Modify the connect descriptor for the Repository Database in the Weblogic Credential Store using:

cd <OMS_HOME>/bin
emctl config oms –store_repos_details -repos_conndesc <connect descriptor> -repos_user sysman

Note: The value of the connect descriptor input string needs to be enclosed in quotes twice i.e "'connect_descriptor'" or '"connect_descriptor"'

OR

emctl config oms -store_repos_details -repos_host <host> -repos_port <port> -repos_sid <sid> -repos_user <username> [-repos_pwd <pwd>] [-no_check_db]

Examples:

emctl config oms –store_repos_details -repos_conndesc "'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=repomachine.domain)(PORT=1522))(@ CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=rep11g)))'" -repos_user sysman

OR

emctl config oms -store_repos_details -repos_host repomachine.domain -repos_port 1522 -repos_sid rep11g -repos_user sysman

3. Start the OMS(s) using the command

cd <OMS_HOME>/bin
emctl start oms.

Re-configuring the 'OMS and Repository' Target

The 'OMS and Repository' target is used for monitoring the overall health of the Grid Control environment. You also need to change the configuration of this target in order to reflect the new port number:

1. Open the Grid Console in a browser
2. Navigate to Targets -> All targets -> Search -> 'OMS and Repository' -> Go
3. Click Configure
4. Enter the new port number in the 'Repository port' field
5. Click OK

Or execute: 

cd <OMS_HOME>/bin
emctl config emrep -conn_desc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=<new_port>)))(CONNECT_DATA=(SID=<sid>)))"

For example:

emctl config emrep -conn_desc "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=repomachine.domain)(PORT=1522)))(CONNECT_DATA=(SID=rep11g)))"

Re-configuring the Listener Target

The Database holding the Repository of Grid Control is just like any other Database target as far as the Agent is concerned. We need to inform the Agent of the port change in order to allow it to monitor the Database. You need to perform the following in order to do this:

1. Open the Grid Console in a browser.
2. Navigate to Targets -> Databases
3. Select the radio button next to the Repository Database target and click configure.
4. Enter the new listener port in the 'Port' field and press the 'Test Connection' button. This should be successful.
5. Click Next till the end of the Wizard
6. You can verify that the changes made it to the Agent by checking the <AGENT_HOME>/sysman/emd/targets.xml . This should contain the new listener port for the repository database.

Note: You also need to do this for any other database that may have been impacted by the port change.


--
With metta
Quang Phan

How do we change the default listener (TCP) port number ?

There are two ways to achieve this: through the configuration tools or by manually adjusting the appropriate configuration files. The preferred way is to use the configuration tools.

A. Using Configuration Tools

Before changing the listener configuration you should stop it  run the following command: "lsnrctl stop".

Launch Oracle Net Manager (execute "netmgr" at the command line) and follow these steps:

  • Select Local / Listeners / LISTENER in the left pane
  • Select Listening Locations in the right pane upper selection button
  • Browse through the AddressX tabs and choose the one with Protocol TCP/IP
  • Change the value in the Port: field to your desired port number.
  • In the left pane select Local / Service Naming
  • Create a new Net Service Name:
    • Click the green plus ("+") icon on the leftmost toolbar; dialog will appear
    • Type a name for the new Service Name (e.g. MYLISTENER); press Next
    • Select TCP/IP (Internet Protocol); press Next
    • Type your hostname in Hostname: field and the same port number you chose in the previous steps in the Port Number: field; press Next
    • Type the name of an existent database (e.g. ORCL); press Next
    • Optionally you may Test the new connection
    • Press Finish
  • Select from menus File / Save Network Configuration and close the Net Manager

Restart the listener by running the following commands at the command prompt: "lsnrctl start".

However, after you changed the default listener port number, the database instances will not be able to register themselves with this new listener as the database will contact the listener(s) on the default port 1521. To fix this problem you need to add/change the "local_listener" initialization parameter for each database.

Use Oracle Enterprise Manager to change the "local_listener" initialization parameter to have the value "MYLISTENER" for the database(s) you work with or create in the future. Make sure you make this change permanent by storing it in the SPFile, in which case you need to restart the database instance to take effect.

B. Using Configuration Files

Before changing the listener configuration you should stop it by running the following command: "lsnrctl stop".

The Oracle Listener is configured through the LISTENER.ORA file, which, by default is located in ORACLE_HOME under the NETWORK / ADMIN subdirectory. Edit this file with you preferred text editor and change the (PORT=1521) from under the default LISTENER profile to your desired value. If you do not have this file then you may use the following sample:

LISTENER =      (ADDRESS_LIST =          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))          (ADDRESS = (PROTOCOL = TCP)(HOST = myhostname)(PORT = myport))      )


Please replace "myhostname" with your system hostname and "myport" with your desired port number. After changing the LISTENER.ORA file you need to restart the listener. To do that run the following commands at the command prompt: "lsnrctl start".

However, if you are changing the default listener port number, the database instances will not be able to register themselves with this new listener as the database will contact the listener(s) on the default port 1521.

To fix this problem you need to add/change the "local_listener" initialization parameter for each database. This can be achieved in two steps: creating a alias name for the new listener and adjusting the LOCAL_LISTENER initialization parameter.

In the TNSNAMES.ORA file (in the same location as LISTENER.ORA) add the following entry:

MYLISTENER =      (DESCRIPTION =          (ADDRESS = (PROTOCOL = TCP)(HOST = myserver )(PORT = myport))  )


Please replace the "myhostname" and "myport" with the values used for listener configuration in LISTENER.ORA.

Now adjust the LOCAL_LISTENER parameter — use the following SQL statement as SYSDBA:

ALTER SYSTEM SET LOCAL_LISTENER='MYLISTENER' SCOPE=BOTH
Please take into consideration the effect of the SCOPE argument (as shown above it will also save the change in the spfile); also you may want to restrict the change to a certain instance with the help of the SID='<db_sid>' argument, if you employ a common spfile for many instances.

Please note that you may need to run this command for each Oracle database you have or which you will create on the server.


For the reference documentation see Oracle Database Net Services Administrator's Guide, Chapter "Configuring and Administering the Listener".



--
With metta
Quang Phan

How To Reconfigure 12c OMS After Changing Listener Port For Repository Database (Doc ID 1514319.1)


Click to add to Favorites To BottomTo Bottom

Mar 25, 2013HOWTO
Rate this document Email link to this document Open document in new window Printable Page

In this Document


Goal

Fix

References


Applies to:

Enterprise Manager Base Platform - Version 12.1.0.1.0 and later
Information in this document applies to any platform.

Goal

This document explains how to reconfigure the Enterprise Manager 12c OMS when the port changes for the Repository Database's Listener. 

Fix

  1. Please take a valid backup of the OMS and the Repository DB
  2. On each OMS, do the following:
    1. Stop the OMS  using 'emctl stop oms'
    2. Run 'emctl config oms -store_repos_details
      eg: emctl config oms -store_repos_details (-repos_host -repos_port -repos_sid | -repos_conndesc ) -repos_user [-repos_pwd]
    3. Restart AdminServer and the OMS using 'emctl stop oms -all' and 'emctl start oms'
  3. Logon to the EM 12c Console 
  4. Change the port numbers in the repository data by:
              Clicking on Setup -> Management Services and Repository
              Next Click on OMS and Repository dropdown box
              Select Target Setup -> Monitorig Configuration
              Provide the new port number
  5. Since this database may also appear as a managed target aside from being the EM Repository, you will also want to change the listener port number under:
              Target-> Databases -> Click on the Database name and provide the new port number.


--
With metta
Quang Phan