/opt/freeware/lib/libintl.a(libintl.so.8) Error while installing RPM on AIX 7.1

While installing some RPM’s on AIX we got below dependency error.  Now without resolving this error you cannot even proceed further.

[octst3:root:/aixbackup:]rpm -ivh rsync-3.1.2-2.aix6.1.ppc.rpm
exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors:
0509-150 Dependent module /opt/freeware/lib/libintl.a(libintl.so.8) could not be loaded.
0509-152 Member libintl.so.8 is not found in archive

After scourging through the internet and spending half the day, our system admin almost gave up on it. And in come’s the DBA, as they say smart work is better than hard work. Instead of re-inventing the wheel i asked him for a server where the RPM installation works. I logged into the server, copied the file to the same path in the server where it isn’t installing and it worked like a charm. Now i cannot guarantee this method will work 100% with all enviroments but just a refresh of the library from another source worked for us.

[ocptst3:root:/aixbackup:]rpm -vh rsync-3.1.2-2.aix6.1.ppc.rpm
rpm: –hash (-h) may only be specified during package installation and erasure
[ocprd3:root:/aixbackup:]rpm -ivh rsync-3.1.2-2.aix6.1.ppc.rpm
Preparing… ################################# [100%]
Updating / installing…
1:rsync-3.1.2-2 ################################# [100%]

I’m attaching the library for the purpose of any one who wants to do this on AIX 7.1 on Power7 CPU architecture.

https://drive.google.com/open?id=1rL5YbinDHgBOlVNybSHGJEZnh19aLwtm

 

Advertisements

Simple Shell Script to Check Diskspace and Send Email on AIX

The below simple shell script will check all filesystems and create output file for only filesystems which are more than 80% full and send the log by email.

The below has been checked on AIX7.1 , not too Sure if it works on Solaris. I suppose the -P flag does not work on Solaris.


#!/bin/ksh
df -P | grep -v Capacity | awk '{if ($5 >= 80) {print $5 $6;}}' > /home/root/diskspacelog
mailx -s "DiskSpace for Server Esb1" </home/root/diskspacelog sysadmin@company.com

Shell Script to Monitor AIX Filesystem and Send Email

The Below Shell Script checks the Filesystem mount points and using AWK outputs all filesystem exceeding 90% space to a file called diskspacepoll. Once that is done the sed command removes any special character like ‘%’ from the output file and cleans it to a file called output.log

The next important logic is in the AWK block. Here a variable called pattern is defined using the threshold of 90%. Another variable called var is defined. This is your baseline metric. So it value of pattern exceeds var then the mail is dispatched else the script does nothing. You can put this in crontab as a every 5 minute job to continuously poll the filesystems and incase the threshold is exceed it will dispatch an email immediately to the admin


#!/bin/ksh
df -P | grep -v Capacity | awk '{if ($5 >= 90) {print $5;}}' > /home/root/diskspacepoll
sed 's/[!@#\$%^&*()]//g' /home/root/diskspacepoll > /home/root/output.log
####### AWK LOGICAL BLOCK #########
pattern=$(awk '$1 > 90 {print $1}' /home/root/output.log)
var=90
if [[ $pattern > $var ]]
then
echo "Please Check with System Administrator" | mailx -s "90% Threshold of DiskSpace exceeded on Server 1 (ESB1)" sysadmin@company.com
fi

Top command AIX

AIX doesn’t have a top command what it has a better tool called topas. Just write topas from a shell prompt and it opens a beautiful colored stats window where you can get the top consuming sessions as well as few other useful information.

# topas

Join AIX to DNS

# vi /etc/resolv.conf

— If file doesn’t exist, create it

Add the below entries into resolv.conf file of your DNS server and domain name

nameserver 127.0.0.1
domain yourdomainname.com

# nslookup nameofyourserver

Create Logical Volume Group and JFS2 filesystem AIX

We had a new Oracle installation on an AIX 6.1 Power7 server. Our organization doesn’t have an AIX admin. So to faciliate the lack of resources, I decided to be the makeshift Aix admin and create the mountpoints for the Oracle installation. It was easier than I thought. The Smitty tool is very easy and powerful in doing day-to-day tasks on Aix.

The local hard disks can be found at /dev/hdisk* location. First we will create a Volume group.

1. Create Logical Volume Group
mkvg -y oradata hdisk2

2. Create Logical Volume
prmdb[/dev] # mklv -t jfs2log oradata 1
loglv01

3. List the volume group (our new volume group is called oradata)
prmdb[/dev] # lsvg
rootvg
oravg
oradata

4. Check the status of the volume group
prmdb[/dev] # lsvg -l oradata
oradata:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv01 jfs2log 1 1 1 closed/syncd N/A

5. Goto smitty and create the journal filesystem for the logical volume we just created.

prmdb[/dev] # smitty jfs2

– Add an Enhanced Journaled File System
– Select the Volume Group Name “oradata” we previously created
– Put the unit size in your choice of megabytes or gigabytes(to find out size command is “lsvg oradata”
– Select mount at restart as yes
– Save and Exit

prmdb[/dev] # lsvg
rootvg
oravg
oradata

prmdb[/dev] # lsvg oradata
VOLUME GROUP: oradata VG IDENTIFIER: 00f7abf000004c000000013b046eb8c2
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 799 (102272 megabytes)
MAX LVs: 256 FREE PPs: 798 (102144 megabytes)
LVs: 1 USED PPs: 1 (128 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no

prmdb[/dev] # smitty jfs2

Create the file system as “Add a new enchanced journal filesystem”
New File System size is 207618048
COMMAND STATUS

Command: OK stdout: yes stderr: no

Before command completion, additional instructions may appear below.

File system created successfully.
103805652 kilobytes total disk space.
New File System size is 207618048

List all mounted file systems from smitty

Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/hd4 — / jfs2 4194304 rw yes no
/dev/hd1 — /home jfs2 1048576 rw yes no
/dev/hd2 — /usr jfs2 6291456 rw yes no
/dev/hd9var — /var jfs2 6291456 rw yes no
/dev/hd3 — /tmp jfs2 6291456 rw yes no
/dev/hd11admin — /admin jfs2 262144 rw yes no
/proc — /proc procfs — rw yes no
/dev/hd10opt — /opt jfs2 2097152 rw yes no
/dev/livedump — /var/adm/ras/livedump jfs2 524288 rw yes no
/dev/cd0 — /cdrom cdrfs — ro no no
/dev/locallv — /usr/local jfs2 1048576 rw yes no
/dev/fslv00 — /oracle jfs2 102760448 rw yes no
/dev/fslv01 — /oradata jfs2 207618048 rw yes no

6. Create a mount point and mount the filesystem on it (Check the device name from the above entry in smitty)

prmdb[/dev] # mkdir /oradata
prmdb[/dev] # mount /dev/fslv01 /oradata
prmdb[/dev] # df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.80 11% 10247 3% /
/dev/hd2 3.00 0.43 86% 56419 36% /usr
/dev/hd9var 3.00 2.63 13% 8462 2% /var
/dev/hd3 3.00 0.74 76% 6017 4% /tmp
/dev/hd1 0.50 0.39 23% 60 1% /home
/dev/hd11admin 0.12 0.12 1% 5 1% /admin
/proc – – – – – /proc
/dev/hd10opt 1.00 0.69 32% 9968 6% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/locallv 0.50 0.50 1% 128 1% /usr/local
/dev/fslv00 49.00 38.92 21% 5661 1% /oracle
/dev/fslv01 99.00 98.98 1% 4 1% /oradata

7. Test the mountpoint by creating a text file

prmdb[/dev] # cd /oradata
prmdb[/oradata] # touch abc.txt
prmdb[/oradata] # rm -rf abc.txt

8. Check the entries in the filesystems file. if it doesnt exists then create it

prmdb[/oradata] # vi /etc/filesystems
prmdb[/oradata] #

/oradata:
dev = /dev/fslv01
vfs = jfs2
log = /dev/loglv02
mount = true
options = rw
account = false

And Voila your done configuring a persistent file system using the JFS2 filesystem on Aix for your oracle installation. From their on it is a standard Oracle installation with creating users, groups etc.

—————————————————————————————————-

Prepare Raw Devices for ASM on AIX 6.1 (RAC 11gR2)

To Configure RAC 11gR2 on AIX 6.1 using ASM. You need to prepare the raw devices like below. The general location for raw devices on AIX is /dev. The disk names are like /dev/rhdisk*

# lsattr -E -l hdisk3 | grep reserve_
reserve_policy no_reserve
#chdev -l hdisk3 -a [ reserve_lock=no | reserve_policy=no_reserve ]
reserve_policy is for AIX storage, rreserve_lock is for EMC and other storage. You need to change the
reserve option on every storage device you will be using in ASM

prmdb[/dev] # /usr/sbin/chdev -l hdisk3 -a pv=clear
hdisk3 changed
prmdb[/dev] # /usr/sbin/chdev -l hdisk2 -a pv=clear
hdisk2 changed
prmdb[/dev] # /usr/sbin/chdev -l hdisk4 -a pv=clear
hdisk4 changed

prmdb[/dev] # chmod 660 rhdisk4
prmdb[/dev] # chmod 660 rhdisk3
prmdb[/dev] # chmod 660 rhdisk2

prmdb[/dev] # chown grid:asmadmin rhdisk2
prmdb[/dev] # chown grid:asmadmin rhdisk4
prmdb[/dev] # chown grid:asmadmin rhdisk3

If you get error that you cannnot create the disk group then clear the raw devices using below command( this generally happens when you had previously configured an ASM instance to use these raw devices and it was a failed installation and you are installing again)

chdev -l hdisk4 -a pv=yes
chdev -l hdisk3 -a pv=yes
chdev -l hdisk2 -a pv=yes