Friday, July 31, 2015

Automatically Moving Archive to Backup Location

 

Linux – Shell Scripting
Automatically Moving Archive to Backup Location

Today I have been asked by one of my friend to write another script which automatically move archivelog to backup location once its going to full.  I wrote a script which periodically check (cron) every hours to check the free space in archive mount point and move to backup location if required.

#!/bin/ksh
 
printf "\n  Automatically move Archivelogs to other mountpoint once getting full ---  \n"
 
retcode=$?
 
filesize=`df -k |grep /u02 | awk '{ print $5 }'`
mname=`df -k | grep /u02 | awk '{ print $6 }'`
 
mpct=${filesize//%}
 
 
  if [ $retcode != '0' ]; then
     printf "FATAL ERROR \n"
     ERROR_FLG='1'
  else
     if [ $mpct -gt 50 ]; then
        printf "\n  Alert - Mountpoint - $mname is above 50 and  $mpct pct  - utilizezd ...\n"
 
        printf "\n  Message : Start Clearing Mount point ....... \n"
        printf "\n  Running ........... \n"
 
        mv /u02/Archive/*.arc /Backup/
 
        printf "\n  Finished ........... \n"
        newsize=`df -k |grep /u02 | awk '{ print $5 }'`
        nsize=${newsize//%}
        printf "\n Current Utilization $mname is $nsize\n"
     else
        printf "\n  Filesystem is stable and available is $mpct \n"
     fi
  fi
 

Create an entry in cron tab with periodically check every hour.

Archive Destination Switchover Automatically once gonna full


Linux – Shell Scripting
Archive Destination Switchover once gonna full

 
Today I have been asked by one of my friend to write a script which automatically change the Archive Destination once its going to full.  I wrote a script which periodically check (cron) every hours and change the archive destination if required when its reached to threshold value.  Here I have set 50%.
 

#!/bin/ksh
 
printf "\n  Archive Destination Switchover once mount point got full - SCRIPT ---  \n"
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=GISDB
 
retcode=$?
 
filesize=`df -k |grep /u02 | awk '{ print $5 }'`
mname=`df -k | grep /u02 | awk '{ print $6 }'`
 
mpct=${filesize//%}
 
filesize2=`df -k |grep /u03 | awk '{ print $5 }'`
mname2=`df -k | grep /u03 | awk '{ print $6 }'`
 
mpct2=${filesize2//%}
 
 
  if [ $retcode != '0' ]; then
     printf "FATAL ERROR:  \n"
     ERROR_FLG='1'
  else
     if [ $mpct -gt 50 ]; then
        printf "\n  Alert - Mountpoint - $mname is above 50 and  $mpct pct  - utilized ...\n"
 
        printf "\n  Message : Changing Archivelog Destination to u03 ....... \n"
        printf "\n  Running ........... \n"
 
        newsize=`df -k |grep /u02 | awk '{ print $5 }'`
        nsize=${newsize//%}
        printf "\n Current Utilization $mname is $nsize\n"
 
        /u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus -s '/ as sysdba' << eof
                ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/u03/Archive' ;
 
         ALTER SYSTEM SWITCH LOGFILE ;
        exit ;
eof
 
       printf "\n  Finished ........... \n"
 
     elif [ $mpct2 -gt 50 ]; then
        printf "\n  Alert - Mountpoint - $mname2 is above 50 and  $mpct2 pct  - utilized ...\n"
 
        printf "\n  Message : Switching Archivelog Destination to u02 ....... \n"
        printf "\n  Running ........... \n"
 
        newsize2=`df -k |grep /u03 | awk '{ print $5 }'`
 
        nsize2=${newsize2//%}
        printf "\n Current Utilization $mname2 is $nsize2\n"
 
        /u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus -s '/ as sysdba' << eof
 
         ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/u02/Archive' ;
 
         ALTER SYSTEM SWITCH LOGFILE ;
        exit;
eof
 
       printf "\n  Finished ........... \n"
 
     else
        printf "\n  Filesystem is stable and available is $mpct pct.\n"
        printf "\n  Filesystem is stable and available is $mpct2 pct.\n"
     fi
  fi

 
Create a entry in cron tab with periodically check every hour.

 

 

Thursday, July 30, 2015

Suppressing Alerts / Incidents and Problems in OEM 12c



Suppressing Incidents and Problems (Alerts)
Enterprise Manager Cloud Control 12c R4


Sometimes when it is convenient to hide an incident or problem from the list in the All Open Incidents page or the All Open Problems page.

For example, you need to defer work on the incident until a future date (for example, until maintenance window). In order to avoid having it appear in the UI, you want to temporarily hide or suppress the incident until a future date.

In order to find a suppressed incident, you must explicitly search for the incident using either the Show all or the Only show suppressed search option in MyView. In order to unhide a suppressed incident or problem, it must be manually unsuppressed.

To suppress an incident or problem:


Navigate to Incident Manager






From the Enterprise menu on the Enterprise Manager home page, select Monitoring, then select Incident Manager.

Select either the All Open Incidents view or the All Open Problems view.
In the resulting details region, click, Action, then select Suppress.



Choose the appropriate incident or problem


On the resulting Suppress pop-up, choose the appropriate suppression type.



Add a comment if desired.



Click OK






















You will see the selected alert has gone from Incident window for a day.


Verifying Suppressed Alerts :

 Click on My Views

In this window you will search your incident as per your choice.

Here I am searching only Suppressed incident.  I select “Only Show Suppressed” from Suppressed search column and will get the list of suppressed incident.



Wednesday, July 29, 2015

Modify SCAN Listener Port from 1521 to 1721 on Oracle 12c RAC


Modify Scan Listener Port from 1521 to 1721
on Oracle 12c RAC (12.1.0.1) Linux x64
 
 
Steps below will change the port from the default 1521 to 1721. I have done this configuration on 12c (12.1.0.1) Standard ASM.
 
·        Login with GI owner as Default listener is owned by Gird Infrastructure.  In this case user grid is our GI owner.
 
[grid@rac128 ~]$ . oraenv
ORACLE_SID = [+ASM1] ?
The Oracle base remains unchanged with value /grid/app/grid
 
[grid@rac128 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac130,rac129,rac128
 
[grid@rac128 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac128
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac130
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac129
 
·        Check the status of SCAN LISTENER on all Cluster Nodes

Node 1
 
 [grid@rac128 ~]$ lsnrctl status listener_scan1
 
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:10:40
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 22:54:28
Uptime                    0 days 8 hr. 16 min. 11 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac128/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.43)(PORT=1521)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
Node 2
 
 
[oracle@rac129 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:15:31
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN3
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 22:53:38
Uptime                    0 days 8 hr. 21 min. 53 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac129/listener_scan3/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.42)(PORT=1521)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
Node 3
 
[grid@rac130 ~]$ lsnrctl status listener_scan2
 
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:15:25
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 22:45:27
Uptime                    0 days 8 hr. 29 min. 57 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac130/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.41)(PORT=1521)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
·        Check the status of LISTENER on all Cluster Nodes
 
[grid@rac128 ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:18:23
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 22:54:29
Uptime                    0 days 8 hr. 23 min. 53 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac128/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.128)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.163)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=rac128.ora.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0.1/dbhome_1/admin/AMIT/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "AMIT.ora.com" has 1 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 1 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 1 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 1 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
The command completed successfully
 
 
[oracle@rac129 ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:18:17
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 16:10:25
Uptime                    0 days 15 hr. 7 min. 52 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac129/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.129)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.164)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=rac129.ora.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0.1/dbhome_1/admin/AMIT/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "AMIT.ora.com" has 1 instance(s).
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 1 instance(s).
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 1 instance(s).
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 1 instance(s).
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac129 ~]$
 
 
[grid@rac130 ~]$ lsnrctl status
 
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:18:10
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                28-JUL-2015 22:46:52
Uptime                    0 days 8 hr. 31 min. 18 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac130/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.130)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.165)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=rac130.ora.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0.1/dbhome_1/admin/AMIT/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM3", status READY, has 1 handler(s) for this service...
Service "-MGMTDBXDB" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "AMIT.ora.com" has 1 instance(s).
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 1 instance(s).
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 2 handler(s) for this service...
Service "fi_pdb.ora.com" has 1 instance(s).
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 1 instance(s).
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
·        Modify the Listener Port from 1521 to 1721 on any one of the node.
 
 
[grid@rac128 ~]$ srvctl modify listener -l LISTENER -p 1721
 
[grid@rac128 ~]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1721
 
 
·        Modify the SCAN LISTENER Port to 1721.
 
 
[grid@rac128 ~]$ srvctl modify scan_listener -p TCP:1721
 
[grid@rac128 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
 
 
[grid@rac128 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac128
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac130
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac129
 
 
·        Bounce the Listener in order to register with new assigned port (1721).
 
 
[grid@rac128 ~]$ srvctl stop listener
 
[grid@rac128 ~]$ srvctl start listener
 
[grid@rac128 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac130,rac129,rac128
[grid@rac128 ~]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1721
 
·         Bounce the SCAN LISTENER
 
 
[grid@rac128 ~]$ srvctl stop scan_listener
 
[grid@rac128 ~]$ srvctl start scan_listener
 
[grid@rac128 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac130
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac129
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac128
 
[grid@rac128 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1721
Registration invited nodes:
Registration invited subnets:
·         Verifying SCAN LISTENER port on all nodes
 
 
[grid@rac128 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:28:24
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias                     listener_scan3
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                29-JUL-2015 06:47:11
Uptime                    0 days 0 hr. 41 min. 12 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac128/listener_scan3/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.42)(PORT=1721)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
 
 
[oracle@rac129 ~]$ lsnrctl status listener_scan2
 
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:30:17
 
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                29-JUL-2015 07:25:44
Uptime                    0 days 0 hr. 4 min. 33 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac129/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.41)(PORT=1721)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
 
[grid@rac130 ~]$ lsnrctl status listener_scan1
 
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 07:30:52
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                29-JUL-2015 07:25:37
Uptime                    0 days 0 hr. 5 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/app/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/app/grid/diag/tnslsnr/rac130/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.43)(PORT=1721)))
Services Summary...
Service "AMIT.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "AMITXDB.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "fi_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
Service "hr_pdb.ora.com" has 3 instance(s).
  Instance "AMIT1", status READY, has 1 handler(s) for this service...
  Instance "AMIT2", status READY, has 1 handler(s) for this service...
  Instance "AMIT3", status READY, has 1 handler(s) for this service...
The command completed successfully
 
 
·         Still database is not occupying new port.  Bounce the database in order to capture new port.
 
 
[grid@rac128 ~]$ srvctl stop database -d AMIT
 
[grid@rac128 ~]$ srvctl start database -d AMIT
 
[grid@rac128 ~]$ srvctl config database -d AMIT
Database unique name: AMIT
Database name: AMIT
Oracle home: /u01/app/oracle/product/12.1.0.1/dbhome_1
Oracle user: oracle
Spfile: +DATA_DG/AMIT/spfileAMIT.ora
Password file: +DATA_DG/AMIT/orapwAMIT
Domain: ora.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: AMIT
Database instances: AMIT1,AMIT2,AMIT3
Disk Groups:
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is administrator managed
 
·         Verify listener port on database  
 
[grid@rac128 ~]$ su - oracle
Password:
[oracle@rac128 ~]$ . oraenv
ORACLE_SID = [oracle] ? AMIT1
The Oracle base has been set to /u01/app/oracle
[oracle@rac128 ~]$ sqlplus / as sysdba
 
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jul 29 08:19:10 2015
 
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
 
SQL> show parameter list
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
listener_networks                    string
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                                 192.168.1.163)(PORT=1721))
remote_listener                      string       rac-scan.ora.com:1721
 
·         Modify tnsnames.ora with new port on tns-aliases on all nodes.
 
 
SQL> !tnsping AMIT
 
TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 08:24:49
 
Copyright (c) 1997, 2013, Oracle.  All rights reserved.
 
Used parameter files:
 
 
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.ora.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AMIT.ora.com)))
TNS-12541: TNS:no listener
 
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
[oracle@rac128 ~]$ vi /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/
 
[oracle@rac128 ~]$ vi /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/tnsnames.ora
 
[oracle@rac128 ~]$ more /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
AMIT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.ora.com)(PORT = 1721))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = AMIT.ora.com)
    )
  )
 
[oracle@rac128 ~]$ ssh rac129
Last login: Tue Jul 28 23:31:48 2015 from rac128.ora.com
 
[oracle@rac129 ~]$ vi /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/tnsnames.ora
 
AMIT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.ora.com)(PORT = 1721))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = AMIT.ora.com)
    )
  )
 
 
 
[oracle@rac129 ~]$ ssh rac130
Last login: Tue Jul 28 23:31:37 2015 from rac128.ora.com
[oracle@rac130 ~]$ vi /u01/app/oracle/product/12.1.0.1/dbhome_1/network/admin/tnsnames.ora
 
AMIT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.ora.com)(PORT = 1721))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = AMIT.ora.com)
    )
  )
 
 
[oracle@rac130 ~]$ tnsping AMIT
 
TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 29-JUL-2015 08:30:33
 
Copyright (c) 1997, 2013, Oracle.  All rights reserved.
 
Used parameter files:
 
 
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.ora.com)(PORT = 1721)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AMIT.ora.com)))
OK (10 msec)
 
[oracle@rac130 ~]$ sqlplus system/oracle@AMIT
 
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jul 29 08:30:39 2015
 
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
 
 
SQL> sho parameter list
 
NAME                  TYPE        VALUE
--------------------- ----------- ------------------------------
listener_networks     string
local_listener        string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                   192.168.1.164)(PORT=1721))
remote_listener       string       rac-scan.ora.com:1721