Thursday, July 29, 2010

IBM AIX Commands for Oracle DBAs

Hi friends.. these are all the commands i collected for reference, hope it will be useful to you too.. 
i will be updating this post as soon as i come across new commands.. 
thanks for reading and keep in touch.

General Commands in AIX
oslevel:   Returns operating system level
bootinfo -y:To display if the hardware is 32-bit or 64-bit, type:
bootinfo –r
lsattr -E1 sys0 -a realmem: To display real memory in kilobytes (KB), type one of the following
bootinfo -k: To display if the kernel is 32-bit enabled or 64-bit enabled, type:
lscfg | grep proc:  to list the no of processors in the system

whence (program):    Returns full path of program
whereis (program): Returms full path of program
what (program):    Displays identifying info from the executable like version number, when

lslpp -L all:    list all installed software
lslpp -L (program set name): Check if software installed
lslpp -f:    Lists filesets vs packages
lslpp -ha:    Lists installation history of filesets
instfix -ik (fix number eg IX66617): Checks id fix is installed

Uname –p : Displays the chip type of the system. For example, PowerPC
Uname –r : Displays the release number of the operating system
Uname –s : Displays the system name. For example, AIX.
Uname –nDisplays the name of the node.
Uname –a : Displays the system name, nodename, version, machine ID.
Uname –M : Displays the system model name. For example, IBM, 9114-275.
Uname –v : Displays the operating system version.
Uname –m: Displays the machine ID number of the hardware running the system.
Uname  -u : Displays the system ID number.

• Examples :
instfix -ik 4330-02_AIX_ML

compress -c file.txt > file.Z: Create a compressed file.
ar -v -t (archive file):  List contents of an archive
ar -v -x (archive file): Extracts the archive.

alog -o -t boot: View the boot log
chtz (timezone eg GMT0BST): Change time zone.
chlang (language eg En_GB): Changes the language in /etc/environment file

Terminal Commands
tty:Displays what the tty/pty number of the terminal is.
chdev -l (device eg tty1) -a term=vt100: Sets tty to a vt100 terminal type
lscons: Displays the console device

Network Related Commands
host (ip or hostname): Resolves a hostname / ip address
hostname: Displays hostname
hostname (hostname): Sets the hostname until next reboot
chdev -l (device name) -a hostname=(hostname): Changes hostname permanently Examples :chdev -l inet0 -a hostname=thomas
ifconfig (device name): Displays network card settings
ifconfig (device name): up Turns on network card
ifconfig (device name): down Turns off network card
ifconfig (device name): detach Removes the network card from the network interface list
netstat –i: Displays interface statistics
traceroute (name or ipaddress): Displays all the hops from source to destination supplied.
ping -R (name or ipaddress): Same as traceroute except repeats.

Volume Management
Lspv: To display the number of hard disks on your system, type
Lspv hdisk1: To find details about hdisk1.

Crfs: create file system
            Eg: The following command will create, within volume group testvg, a jfs2 file system of 10MB with mounting point /fs2 and having read-only permissions:
crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2    

Chfs: change size of file system
                Eg: To increase the /usr file system size by 1000000 512-byte blocks, type:
chfs -a size=+1000000 /usr
Mount: command to display information about all currently mounted file systems:
Options--- examples
1.       Mount cd rom: mount -V cdrfs -o ro /dev/cd0  /cdrom
2.       Mount file system: mount /dev/fslv02 /test
3.       Unmount filesystem: umount /test
4.       Mount all filesystem:mount  {–a|all}
Defragfs: defragment file system

Performance Monitoring
Lsps –a : amount of paging space allocated and in use

increase a paging space:-
You can use the chps -s command to dynamically increase the size of a paging space. For example, if you want to increase the size of hd6 with 3 logical partitions, you issue the following command:
chps -s 3 hd6                                         
I reduce a paging space:-
You can use the chps -d command to dynamically reduce the size of a paging space. For example, if you want to decrease the size of hd6 with four logical partitions, you issue the following command:
chps -d 4 hd6                                         

No comments:

Post a Comment