Thursday, December 18, 2014

How to change subnet mask in Oracle Clusterware (grid infrastructure)

Change subnet mask on RAC databases:

Task: Changing  Subnet Mask from 255.255.255.0 to 255.255.254.0 on 10gR2 2-node RAC database running on HP-UX 11.31 boxes.

We followed Note: Doc ID 276434.1. However Case III was not clear for our case.
Case III says :

"If the change involves different subnet(netmask) or interface, delete the existing interface information from OCR and add it back with the correct information is required. In the example here, the subnet is changed from 10.2.156.0  to 10.2.166.0 via two separate commands - first a 'delif'  followed by a 'setif':
% $CRS_HOME/bin/oifcfg/oifcfg delif -global <if_name>[/<subnet>] % $CRS_HOME/bin/oifcfg/oifcfg setif -global <if_name>/<subnet>:public
For example: % $CRS_HOME/bin/oifcfg delif -global eth0/10.2.156.0  % $CRS_HOME/bin/oifcfg setif -global eth0/10.2.166.0:public"

However, changing subnet mask from 255.255.255.0 to 255.255.254.0 is not changing public network. So, we raise an SR and we suggested to skip Case III and apply Case IV.


Here is the steps that we use:


1.     First gather the existing setup:

racdb1> srvctl config nodeapps -n racdb1 -a
VIP exists.: /racdb1-vip/10.255.0.167/255.255.255.0/lan900

racdb1> srvctl config nodeapps -n racdb2 -a
VIP exists.: /racdb2-vip/10.255.0.168/255.255.255.0/lan900

racdb1> crs_stat -t                       
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    ONLINE    ONLINE    racdb1     
ora....E2.inst application    ONLINE    ONLINE    racdb2     
ora.prod.db    application    ONLINE    ONLINE    racdb2     
ora....SM1.asm application    ONLINE    ONLINE    racdb1      
ora....B1.lsnr application    ONLINE    ONLINE    racdb1     
ora.racdb1.gsd application    ONLINE    ONLINE    racdb1     
ora.racdb1.ons application    ONLINE    ONLINE    racdb1     
ora.racdb1.vip application    ONLINE    ONLINE    racdb1      
ora....SM2.asm application    ONLINE    ONLINE    racdb2     
ora....B2.lsnr application    ONLINE    ONLINE    racdb2     
ora.racdb2.gsd application    ONLINE    ONLINE    racdb2     
ora.racdb2.ons application    ONLINE    ONLINE    racdb2     
ora.racdb2.vip application    ONLINE    ONLINE    racdb2 
   
racdb1> netstat -in
Name      Mtu  Network         Address         Ipkts              Ierrs Opkts              Oerrs Coll
lo0      32808 127.0.0.0       127.0.0.1       1973468007         0     1973470399         0     0  
lan900:8  1500 10.255.0.0      10.255.0.167    25546968404        0     59117886           0     0  
Warning: The above name 'lan900:801' is truncated, use -w to show the output in wide format
lan901    1500 192.168.56.0    192.168.56.160  95623379768        82    42023362181        0     0  
lan900    1500 10.255.0.0      10.255.0.160    42141072728        0     95058720682        0     0  
racdb1> ./crs_stat -p ora.racdb1.vip
NAME=ora.racdb1.vip
TYPE=application
ACTION_SCRIPT=/u01/oraprod/prod/proddb/crshome/bin/racgwrap
ACTIVE_PLACEMENT=1
AUTO_START=1
CHECK_INTERVAL=30
DESCRIPTION=CRS application for VIP on a node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=racdb1
OPTIONAL_RESOURCES=
PLACEMENT=favored
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=0
SCRIPT_TIMEOUT=60
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=lan900
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=255.255.255.0
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=10.255.0.167

            2.   Stop the resources:

racdb1> srvctl stop instance -d prod -i prod1
racdb1> ps -ef|grep pmon
 oraprod  5136     1  0  Dec  8  ?        161:51 asm_pmon_+ASM1
 oraprod  5277 27140  1 22:07:17 pts/2     0:00 grep pmon
racdb1> srvctl stop instance -d prod -i prod2

racdb1> srvctl stop asm -n racdb1
racdb1> ps -ef|grep pmon
 oraprod  7266 27140  0 22:10:50 pts/2     0:00 grep pmon
racdb1>  srvctl stop asm -n racdb2
racdb1> srvctl stop nodeapps -n racdb1
racdb1> ./crs_stat -t                
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    OFFLINE   OFFLINE              
ora....E2.inst application    OFFLINE   OFFLINE              
ora.prod.db    application    OFFLINE   OFFLINE              
ora....SM1.asm application    OFFLINE   OFFLINE              
ora....B1.lsnr application    OFFLINE   OFFLINE              
ora.racdb1.gsd application    OFFLINE   OFFLINE              
ora.racdb1.ons application    OFFLINE   OFFLINE              
ora.racdb1.vip application    OFFLINE   OFFLINE              
ora....SM2.asm application    OFFLINE   OFFLINE              
ora....B2.lsnr application    OFFLINE   OFFLINE              
ora.racdb2.gsd application    OFFLINE   OFFLINE              
ora.racdb2.ons application    OFFLINE   OFFLINE              
ora.racdb2.vip application    OFFLINE   OFFLINE 

         3.       Modify VIP

Run as root:

#./srvctl modify nodeapps -n racdb1 -A racdb1-vip/255.255.254.0/lan900
#./srvctl modify nodeapps -n racdb2 -A racdb2-vip/255.255.254.0/lan900

Verify:

racdb1:/u01/oraprod/prod/proddb/crshome/bin#./crs_stat -p ora.racdb2.vip
NAME=ora.racdb2.vip
TYPE=application
ACTION_SCRIPT=/u01/oraprod/prod/proddb/crshome/bin/racgwrap
ACTIVE_PLACEMENT=1
AUTO_START=1
CHECK_INTERVAL=30
DESCRIPTION=CRS application for VIP on a node
FAILOVER_DELAY=0
FAILURE_INTERVAL=0
FAILURE_THRESHOLD=0
HOSTING_MEMBERS=racdb2
OPTIONAL_RESOURCES=
PLACEMENT=favored
REQUIRED_RESOURCES=
RESTART_ATTEMPTS=0
SCRIPT_TIMEOUT=60
START_TIMEOUT=0
STOP_TIMEOUT=0
UPTIME_THRESHOLD=7d
USR_ORA_ALERT_NAME=
USR_ORA_CHECK_TIMEOUT=0
USR_ORA_CONNECT_STR=/ as sysdba
USR_ORA_DEBUG=0
USR_ORA_DISCONNECT=false
USR_ORA_FLAGS=
USR_ORA_IF=lan900
USR_ORA_INST_NOT_SHUTDOWN=
USR_ORA_LANG=
USR_ORA_NETMASK=255.255.254.0
USR_ORA_OPEN_MODE=
USR_ORA_OPI=false
USR_ORA_PFILE=
USR_ORA_PRECONNECT=none
USR_ORA_SRV=
USR_ORA_START_TIMEOUT=0
USR_ORA_STOP_MODE=immediate
USR_ORA_STOP_TIMEOUT=0
USR_ORA_VIP=10.255.0.168


racdb1:/u01/oraprod/prod/proddb/crshome/bin#./srvctl config nodeapps -n racdb1 -a
VIP exists.: /racdb1-vip/10.255.0.167/255.255.254.0/lan900

racdb1:/u01/oraprod/prod/proddb/crshome/bin#./srvctl config nodeapps -n racdb2 -a
VIP exists.: /racdb2-vip/10.255.0.168/255.255.254.0/lan900

           4.       Start resources:

racdb1> srvctl start nodeapps -n racdb1
racdb1> srvctl start nodeapps -n racdb2
racdb1> srvctl start asm -n racdb1
racdb1> srvctl start asm -n racdb2
racdb1> srvctl start instance -d prod -i prod1
racdb1> srvctl start instance -d prod -i prod2
racdb1> ./crs_stat -t                        
Name           Type           Target    State     Host       
------------------------------------------------------------
ora....E1.inst application    ONLINE    ONLINE    racdb1     
ora....E2.inst application    ONLINE    ONLINE    racdb2     
ora.prod.db    application    ONLINE    ONLINE    racdb2     
ora....SM1.asm application    ONLINE    ONLINE    racdb1     
ora....B1.lsnr application    ONLINE    ONLINE    racdb1     
ora.racdb1.gsd application    ONLINE    ONLINE    racdb1     
ora.racdb1.ons application    ONLINE    ONLINE    racdb1     
ora.racdb1.vip application    ONLINE    ONLINE    racdb1     
ora....SM2.asm application    ONLINE    ONLINE    racdb2     
ora....B2.lsnr application    ONLINE    ONLINE    racdb2     
ora.racdb2.gsd application    ONLINE    ONLINE    racdb2     
ora.racdb2.ons application    ONLINE    ONLINE    racdb2     
ora.racdb2.vip application    ONLINE    ONLINE    racdb2

Saturday, May 24, 2014

FIFA / PES / Championship Tool

You can use this tool to record and track your tournaments. Tool is created with the help of excel macros. It's free, enjoy.

Tool developer: Ahmet Bolluk

Download Championship Tool here:
ChampionshipTool.xlsm

*** You should enable editing and enable content to see excel macos.


1 . Enter player names:




2. Choose Fixture with/without rematch as you wish.


3. Enter scores as below screenshot


4. Click standings whenever you like. It will calculate and sort player standings


5. When the tournament is over, click add to championship button to add this standings to Championship sheet. 


Wednesday, June 5, 2013

How to install cloud controll 12c agent in silent mode

Installing Oracle Management Agent in Silent Mode


I will use agentDeploy scipt for installing agent. (Installing Using agentDeploy Script).
First we need the management agent software. 

If you are using online mode in OMS( Oracle Management Server) ( you can easily download agent from internet, if you are using offline mode (in this mode you did not enter oracle support id or your oms is not open to internet) you need some additional steps to download management agent software.After downloading management agent software, you need to upload this zip to client which we install agent. Then install in silent mode.


Lets start with emcli command which query OMS repository for agent software . 
Then download example agent software for windwos 64 bit platform and apply this software to OMS reposiyory for future installations. 
Finally install management agent to client machine in silent mode.

  


  • Download agent  software from OMS repository: Download the Management Agent Software onto the OMS Host Using EMCLI



Login successful
[oracle@grid12c bin]$ ./emcli login -username=sysman
Enter password :

Login successful
[oracle@grid12c bin]$ ./emcli get_supported_platforms
Getting list of platforms ...
Check the logs at /u01/app/oracle/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log
About to access self-update code path to retrieve the platforms list..
Getting Platforms list  ...
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = HP-UX Itanium
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Microsoft Windows (32-bit)
-----------------------------------------------
Platforms list displayed successfully.

Note: If you don't have the software for required platform, you need additional steps for downloading from internet and appliying to OMS. Here we have 3 platforms which are downloaded previously, I will add windows 64 bit software to illustrate.



  • Download agent software from internet: (Acquiring Management Agent Software in Offline Mode)


If you run grid12c server on offline mode, you have to perform additional steps before download the agent install software:




  1. From the Setup menu, select Extensibility, then select Self Update.



2. On the Self Update home page, click Check Updates. A message is displayed that contains the URL to be accessed to download a catalog of all updates.



3. From an Internet-enabled computer, download the catalog file using the aforementioned URL.
Note:
                           Do not unzip the file.



4. Copy the downloaded file to OMS host machine.

5. Navigate to the home/bin directory on OMS and log in to EMCLI, run the command as the install user, for example:

Login successful
[oracle@grid12c bin]$ ./emcli login -username=sysman
Enter password :

Login successful
[oracle@grid12c bin]$ ./emcli sync
Synchronized successfully
[oracle@grid12c bin]$ ./emcli import_update_catalog -omslocal  -file=/home/oracle/p9348486_112000_Generic.zip
Processing catalog for Provisioning Bundle
Processing catalog for Agent Software
Processing catalog for Management Connector
Processing catalog for Plug-in
Processing update: Plug-in - Enterprise Manager for Oracle Virtual Desktop Infrastructure
Processing update: Plug-in - Enterprise Manager for Oracle Virtual Desktop Infrastructure
Processing update: Plug-in - Enterprise Manager for Sun Ray Software
Processing update: Plug-in - Management Plug-in for the Sun ZFS Storage Appliance Family
Processing update: Plug-in - Enterprise Manager for Oracle Tuxedo
Processing update: Plug-in -
                Enterprise Manager for Pillar Axiom

Processing catalog for Middleware Profiles and Gold Images
Processing catalog for Informational
Processing update: Informational - Oracle Audit Vault Plug-in (12.1.0.3) to be Withdrawn
Processing update: Informational - Announcing New and Updated Cloud Management Capabilites for Database, Infrastructure, and Testing
Processing update: Informational - Enterprise Manager Cloud Control 12c Release 2 Plug-in Update 1 (12.1.0.2) now available on OTN
Processing catalog for Extensibility Development Kit
Processing update: Extensibility Development Kit - 'Extensibility Development Kit (EDK) is a standalone tool designed to help development of Enterprise Manager extensions (For example: Plug-ins)'

Operation completed successfully. Self Update catalog has been uploaded to Enterprise Manager. Please use the Self Update Home to view and manage updates.

6. Return to the Self Update home page and do a refresh to see a count of new updates in the Available Updates column. Here you can compare plugin row with section 2 picture. Here it has 28 available updates, at section 2  it was 22. This means repository is refreshed !



7. For Type, select Agent Software, then select Open from the Actions menu. The Agent Software Updates page appears to show the Management Agent software available for different platforms

8. Select an update from the list of available updates. All entries other than the one that matches the platform of the OMS host should show their status asAvailable.

9. Click Download. A message displays with a URL and instructions.



10.  After downloading zip file and uploading to oms server run command:

[oracle@grid12c bin]$ ./emcli import_update -omslocal -file=/home/oracle/p14570373_112000_Generic.zip
Processing update: Agent Software - Agent Software (12.1.0.2.0) for Microsoft Windows x64 (64-bit)
Operation completed successfully. Update has been uploaded to Enterprise Manager. Please use the Self Update Home to manage this update.


11. On grid control self update page, click refresh. And press apply button .



12. After job finishes you can see that agent software is applied



Now we can run the emcli commd again and see that windows 64 bit software is available on OMS repository.

[oracle@grid12c bin]$ ./emcli get_supported_platforms
Getting list of platforms ...
Check the logs at /u01/app/oracle/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log
About to access self-update code path to retrieve the platforms list..
Getting Platforms list  ...
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = HP-UX Itanium
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Microsoft Windows (32-bit)
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

Now we can download agent software from OMS repository to any directory on host, for example /tmp.

[oracle@grid12c bin]$ ./emcli get_agentimage -destination=/tmp -platform="Linux x86-64" -version=12.1.0.2.0
Platform:Linux x86-64
Destination:/tmp
 === Partition Detail ===
Space free : 31 GB
Space required : 1 GB
Check the logs at /u01/app/oracle/Middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2013-06-05_11-30-42-AM.log
Setting property ORACLE_HOME to:/u01/app/oracle/Middleware/oms
calling pulloneoffs with arguments:/u01/app/oracle/Middleware/oms/u01/app/oracle/Middleware/oms/sysman/agent/12.1.0.2.0_AgentCore_226.zip12.1.0.2.0linux_x64
Check this logs for more information: /u01/app/oracle/Middleware/oms/sysman/prov/agentpush/logs
[oracle@grid12c bin]$ ls -l /tmp/*.zip
-rw-r----- 1 oracle oinstall 240091482 Jun  5 11:30 /tmp/12.1.0.2.0_AgentCore_226.zip




  • Installing management agent software to clients: (Install the Management Agent Using the agentDeploy Script)



1. Unzip the file on a stage directory on client that agent will be installed. 

 $ unzip 12.1.0.2.0_AgentCore_226.zip

2. Fill the agent.rsp file as following:

$ cat agent.rsp 
####################################################################
## copyright (c) 1999, 2012 Oracle. All rights reserved.          ##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## identifies the variable type.                                  ##
##                                                                ##
## Please specify the values in the following format:             ##
##                                                                ##
##         Type         Example                                   ##
##         String       "Sample Value"                            ##
##         Boolean      True or False                             ##
##         Number       1000                                      ##
##         StringList   {"String value 1","String Value 2"}       ##
##                                                                ##
## The values that are given as <Value Required> need to be       ##
## specified for a silent installation to be successful.          ##
##                                                                ##
##                                                                ##
## This response file is generated by Oracle Software             ##
## Packager.                                                      ##
###################################################################

RESPONSEFILE_VERSION=2.2.1.0.0


#-------------------------------------------------------------------------------
#OMS_HOST:<String> OMS host info required to connect to OMS
#EM_UPLOAD_PORT:<String> OMS port info required to connect to OMS
#AGENT_REGISTRATION_PASSWORD:<String> Agent Registration Password needed to 
#     establish a secure connection to the OMS.
#AGENT_INSTANCE_HOME:<String> Agent instance home is the location of agent state directory.
#AGENT_PORT:<String> Agent port on which the agent process should be started.
#b_startAgent:<boolean> Agent will not be started after configuration if the value specified is false.
#ORACLE_HOSTNAME:<String> Fully qualified domain name of host where is the agent is deployed.
#s_agentHomeName:<String>Customized Oracle home name for the agent home. Example: s_agentHomeName="agent12gR1"
#-------------------------------------------------------------------------------
OMS_HOST=grid12c.xxx.com
EM_UPLOAD_PORT=4904
AGENT_REGISTRATION_PASSWORD=xxxxxxxx
#AGENT_INSTANCE_HOME=<Value Unspecified>
#AGENT_PORT=3872
b_startAgent=true
ORACLE_HOSTNAME=xxxx.xxx.com
#s_agentHomeName=<Value Unspecified>
#-------------------------------------------------------------------------------
#s_agentServiceName:<String> Sets the agent Service Name and this variable can be
#      used to overrite the agent service name calculated by the install. This is
#      required for only Windows.
#      Example: 
#      s_agentServiceName = "Oracleagent12gAgent"      ;  default value
#      s_agentServiceName = "GridAgent"                 ;  User specified value 
#-------------------------------------------------------------------------------
#s_agentServiceName=""

####################################################################################
#Please Don't change the values of these variables
####################################################################################
#-------------------------------------------------------------------------------
#EM_INSTALL_TYPE:<STRING> install type
#-------------------------------------------------------------------------------
EM_INSTALL_TYPE="AGENT"


3. Execute the following command:

./agentDeploy.sh AGENT_BASE_DIR=/u01/app/agent12c RESPONSE_FILE=/u01/app/agent12c_install/agent.rsp


where agent_base_dir is installation directory of management agent.


4. Run root.sh scipt