Quick Reference to shell

Command Description Example
& Run the previous command in the background ls &
&& Logical AND if [ "$foo" -ge "0" ] && [ "$foo" -le "9"]
|| Logical OR if [ "$foo" -lt "0" ] || [ "$foo" -gt "9" ] (not in Bourne shell)
^ Start of line grep "^foo"
$ End of line grep "foo$"
= String equality (cf. -eq) if [ "$foo" = "bar" ]
! Logical NOT if [ "$foo" != "bar" ]
$$ PID of current shell echo "my PID = $$"
$! PID of last background command ls & echo "PID of ls = $!"
$? exit status of last command ls ; echo "ls returned code $?"
$0 Name of current command (as called) echo "I am $0"
$1 Name of current command’s first parameter echo "My first argument is $1"
$9 Name of current command’s ninth parameter echo "My ninth argument is $9"
$@ All of current command’s parameters (preserving whitespace and quoting) echo "My arguments are $@"
$* All of current command’s parameters (not preserving whitespace and quoting) echo "My arguments are $*"
-eq Numeric Equality if [ "$foo" -eq "9" ]
-ne Numeric Inquality if [ "$foo" -ne "9" ]
-lt Less Than if [ "$foo" -lt "9" ]
-le Less Than or Equal if [ "$foo" -le "9" ]
-gt Greater Than if [ "$foo" -gt "9" ]
-ge Greater Than or Equal if [ "$foo" -ge "9" ]
-z String is zero length if [ -z "$foo" ]
-n String is not zero length if [ -n "$foo" ]
-nt Newer Than if [ "$file1" -nt "$file2" ]
-d Is a Directory if [ -d /bin ]
-f Is a File if [ -f /bin/ls ]
-r Is a readable file if [ -r /bin/ls ]
-w Is a writable file if [ -w /bin/ls ]
-x Is an executable file if [ -x /bin/ls ]
parenthesis:
( … )
Function definition function myfunc() { echo hello }

Unique VLAN ID for SEA failover control channel setup

Always select unique VLAN ID – which dosn’t exist on any of your organization network to avoid conflict when setting up dual VIOS with a control channel for SEA failover.. failure to follow this  may result in a network storm. ( Very important and I couldn’t find any note on IBM site about it)

Requirements for Configuring SEA Failover

  • One SEA on one VIOS acts as the primary (active) adapter and the second SEA on the second VIOS acts as a backup (standby) adapter.
  • Each SEA must have at least one virtual Ethernet adapter with the “Access external network” flag (previously known as “trunk” flag) checked. This enables the SEA to provide bridging functionality between the two VIO servers.
  • This adapter on both the SEAs has the same PVID, but will have a different priority value.
  • A SEA in ha_mode (Failover mode) might have more than one trunk adapters, in which case all should have the same priority value.
  • The priority value defines which of the two SEAs will be the primary and which will be the backup. The lower the priority value, the higher the priority, e.g. an adapter with priority 1 will have the highest priority.
  • An additional virtual Ethernet adapter , which belongs to a unique VLAN on the system, is used to create the control channel between the SEAs, and must be specified in each SEA when configured in ha_mode.
  • The purpose of this control channel is to communicate between the two SEA adapters to determine when a fail over should take place.

Upgrading PowerPath in a dual VIO server environment

When upgrading PowerPath in a dual Virtual I/O (VIO) server environment, the devices need to be unmapped in order to maintain the existing mapping information.

To upgrade PowerPath in a dual VIO server environment:
1. On one of the VIO servers, run lsmap -all.
This command displays the mapping between physical, logical,
and virtual devices.

$ lsmap -all
SVSA Physloc Client Partition ID
————— ————————————– ——————–
vhost1 U8203.E4A.10B9141-V1-C30 0x00000000
VTD vtscsi1
Status Available
LUN 0x8100000000000000
Backing device hdiskpower5
Physloc U789C.001.DQD0564-P1-C2-T1-L67

2. Log in on the same VIO server as the padmin user.

3. Unconfigure the PowerPath pseudo devices listed in step 1 by
running:
rmdev -dev <VTD> -ucfg
where <VTD> is the virtual target device.
For example, rmdev -dev vtscsil -ucfg
The VTD status changes to Defined.
Note: Run rmdev -dev <VTD> -ucfg for all VTDs displayed in step 1.

4. Upgrade PowerPath

=======================================================================

1. Close all applications that use PowerPath devices, and vary off all
volume groups except the root volume group (rootvg).

In a CLARiiON environment, if the Navisphere Host Agent is
running, type:
/etc/rc.agent stop

2. Optional. Run powermt save in PowerPath 4.x to save the
changes made in the configuration file.

Run powermt config.
5. Optional. Run powermt load to load the previously saved
configuration file.
When upgrading from PowerPath 4.x to PowerPath 5.3, an error
message is displayed after running powermt load, due to
differences in the PowerPath architecture. This is an expected
result and the error message can be ignored.
Even if the command succeeds in updating the saved
configuration, the following error message is displayed by
running powermt load:
host1a 5300-08-01-0819:/ #powermt load Error loading auto-restore value
Warning:Error occurred loading saved driver state from file /etc/powermt.custom

host1a 5300-08-01-0819:/ #powermt load Error loading auto-restore value
Warning:Error occurred loading saved driver state from file /etc/powermt.custom

Loading continues…
Error loading auto-restore value
When you upgrade from an unlicensed to a licensed version of
PowerPath, the load balancing and failover device policy is set to
bf/nr (BasicFailover/NoRedirect). You can change the policy by
using the powermt set policy command.

=======================================================================

5. Run powermt config.

6. Log in as the padmin user and then configure the VTD
unconfigured from step 3 by running:
cfgdev -dev <VTD>
Where <VTD> is the virtual target device.
For example, cfgdev -dev vtscsil
The VTD status changes to Available.
Note: Run cfgdev -dev <VTD> for all VTDs unconfigured in step 3

7. Run lspath -h on all clients to verify all paths are Available.

8. Perform steps 1 through 7 on the second VIO server.

A sample ASM install process using EMC PowerPath (Symmetrix) with AIX 5.3

Basic System Setup
1. Install AIX 5.3 + latest maintenance level, and check metalink note 282036.1 for any additional
system prerequisites for Oracle
2. Verify the following filesets are installed, or install if not present:
•bos.adt.base
•bos.adt.lib
•bos.adt.libm
•bos.adt.syscalls
•bos.perf.libperfstat
•bos.perf.perfstat
•bos.perf.proctools
•bos.perf.gtools
•rsct.basic
•rsct.basic.compat
3. Create dba and oinstall groups with the same GID across all cluster nodes
4. Create oracle user with the same UID across all cluster nodes, primary group dba
5. set date and timezone (smit system)
6. start xntpd (smit xntpd)
implement tuning parameters from the Tuning Parameters and Settings for ASM section of this
document

Configure Network Settings & Services
1. Set up tcpip on the en0 adapter
# smitty tcpip
– Minimum configuration and startup for en0 ** public network **
– rac1: 10.1.1.101
– rac2: 10.1.1.102
– rac3: 10.1.1.103
– Minimum configuration and startup for en1 ** RAC Interconnect **
– rac1-en1: 10.1.10.101
– rac2-en1: 10.1.10.102
– rac3-en1: 10.1.10.103

2. Update /etc/hosts with all IP/DNS entries
3. Create entries in /etc/hosts.equiv for the oracle user
rac1 oracle
rac2 oracle
rac3 oracle
rac1-en1 oracle
rac2-en1 oracle
rac3-en1 oracle

Logical Volumes & Filesystems
1. Increase filesystem sizes:
– / = 256 MB

– /tmp = > 500 MB free
– /var = 512 MB
2. Make filesystems for Oracle SW ($ORACLE_HOME), ASM ($ORACLE_ASM_HOME) and
CRS ($ORA_CRS_HOME),
– $ORACLE_HOME, eg /opt/oracle/product/10.2.0, should be ~ 5-6 GB
– $ORA_CRS_HOME, eg /crs/oracle/product/10.2.0, should be ~ 2 GB
– mount filesystems after creation
– change ownerships & permissions, example:
– chown -R oracle:oinstall /opt/oracle
– chown -R 775 /opt/oracle
– mkdir -p /crs/oracle/product/10.2.0
– chown -R oracle:oinstall /crs/oracle
– chmod -R 755 /crs/oracle
3. Add $ORA_CRS_HOME/bin to root’s PATH

POWERPATH installation
See the EMC Host Connectivity Guide for IBM AIX, P/N 300-000-608, for full details
1. Install EMC ODM support package
– 5.3.0.2 from ftp://ftp.emc.com/pub/elab/aix/ODM_DEFINITIONS/EMC.AIX.5.3.0.2.tar.Z
– uncompress and extract the tar ball into a new directory
– install using smit install
2. remove any existing devices attached to the EMC
# rmdev –dl hdiskX
3. run /usr/lpp/EMC/Symmetrix/bin/emc_cfgmgr to detect devices
4. Install PowerPath using smit install
5. register PowerPath
# emcpreg –install
6. initialize PowerPath devices
# powermt config
7. verify that all PowerPath devices are named consistently across all cluster nodes
# /usr/lpp/EMC/Symmetrix/bin/inq.aix64 | grep hdiskpower
– compare results. Consistent naming is not required for ASM devices, but LUNs used
for the OCR and VOTE functions must have the same device names on all rac systems6:
8. On all hdiskpower devices to be used by Oracle for ASM, voting, or the OCR, the reserve_lock
attribute must be set to “no”
# chdev -l hdiskpowerX -a reserve_lock=no
9. Verify the attribute is set
# lsattr –El hdiskpowerX

10. Identify two small luns to be used for OCR and voting
11. Set permissions on all hdiskpower drives to be used for ASM, voting, or the OCR as follows:
# chown oracle:dba /dev/rhdiskpowerX
# chmod 660 /dev/rhdiskpowerX
The Oracle Installer will change these permissions and ownership as necessary during the
CRS install process.

Oracle 10g RAC installation
1. Add the following to the oracle user’s .profile:
ORACLE_BASE=<oracle base directory>; export ORACLE_BASE
ORA_CRS_HOME=<ora crs home>; export ORA_CRS_HOME
AIXTHREAD_SCOPE=S; export AIXTHREAD_SCOPE7
umask 022
2. Run the Oracle installer to install CRS
$ export LOG=/tmp/orainstall.log
$ export ORACLE_HOME=/crs/oracle/product/10.2.0
Load the CRS install cd
run rootpre.sh on ALL nodes
$ runInstaller –ignoreSysPrereqs
3. Check crs install for the correct number of nodes and interfaces
[rac1]/crs/oracle/product/10.1.0/bin> # ./olsnodes -n
rac1 1
rac2 2
rac3 3
[rac1]/crs/oracle/product/10.1.0/bin> # ./oifcfg getif
en0 10.1.3.0 global public
en1 10.1.30.0 global cluster_interconnect
4. Install Oracle Binaries
$export ORACLE_HOME=/home/oracle/product/10.2.0
$ cd <10g DVD directory, Disk1>
$ runInstaller –ignoreSysPrereqs
5. Install latest 10g patchset
6. Install any additional Oracle patches listed in the PowerPath for AIX installation guide.
7. For Clariion systems, refer to the “Requirements for Oracle 10g RAC with ASM on AIX
5L” document from EMC to set the miscount settings appropriately.
8. Run DBCA to set up ASM instances and create database
Create Data and Recovery disk groups, each with external redundancy
use /dev/rhdisk* as the disk discovery path
Choose option to Use Oracle-Managed Files

WebLogic 10.3 onAIX 6.1 java 6 reqs

Downloading and Installing IBM SDK Java 6 with Service Release 2, Service Refresh 4+IZ48590

Complete the following procedure to download and install IBM SDK Java 6 with Service Release 2.

  1. Go to the IBM Support: Fix Center download site at the following URL:
  2. http://www.ibm.com/developerworks/java/jdk/aix/service.html

  3. Click the Fix Info link for your JDK version:
  4. Select your APAR/SR number from the table and follow the instructions and/or prompts displayed on the screen to download and install the fix package on your system.
  5. For SR2 (32-bit), use IZ30723.

    For SR2 (64-bit), use IZ30726.

    For SR4+IZ48590 (32-bit), use IZ50170.

    For SR4+IZ48590 (64-bit), use IZ50167.

  6. Select your APAR from the list and follow the instructions and/or prompts displayed on the screen to download and install the specified APAR on your system.
  7. Set the JAVA_HOME environment variable to the directory in which IBM Java 6 is installed, and export JAVA_HOME. For example:
  8. export JAVA_HOME=/usr/java6

  9. Set the PATH variable to include $JAVA_HOME/bin. For example:
  10. export PATH=$JAVA_HOME/bin:$PATH

Downloading and Installing IBM SDK Java 6 64-bit with Service Refresh 2 + iFixes (IZ51489 + IZ32747 + IZ45701 + IZ26955 + IZ33606 + IZ52413) (Applicable to WebLogic Integration 10.3 Only)

This is applicable to WebLogic Integration 10.3 only. Complete the following procedure to download and install IBM SDK Java 6 with Service Refresh 2 + iFixes.

  1. Go to the IBM site:
  2. https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-ibmjavaisv

  3. Register for a valid IBM ID if necessary.
  4. Click on Sign In button.
  5. Login using your IBM ID and password.
  6. Enter the Access Key MJ3D7TQGMK
  7. Click Submit.
  8. From “IBM SDK FOR AIX on 64-bit iSeries/pSeries” select the following tar file to download:
  9. Java6_64.0.0.58.tar.gz (SR2+IZ51489+IZ32747+IZ45701+IZ26955+IZ33606+IZ52413) Java6_64.0.0.58.tar.gz (119 MB)

  10. Click I Confirm to start the file download.
  11. Set the JAVA_HOME environment variable to the directory in which IBM Java 6 is installed, and export JAVA_HOME. For example:
  12. export JAVA_HOME=/usr/java6_64

  13. Set the PATH variable to include $JAVA_HOME/bin. For example:
  14. export PATH=$JAVA_HOME/bin:$PATH

http://www.ibm.com/developerworks/java/jdk/aix/faqs.html