AIX Create Volume Group, Logical Volume dan File System From New Disk /LUN

Create Volume Group (VG)

Use the cfgmgr command to scan and identify all installed configurations.

#cfgmgr

Use lspv command to see the pv configuration.

#lspv

root@xxx:/>cfgmgr
root@xxx:/>lspv
hdisk18         00f86d5fa9781a05                    rootvg          active
hdisk27         00f86d5fa99e3994                    datavg          active
hdisk30         none                                None            active

Based on the example above, there is a hdisk30 on the system that has not been configured anything. Use the command bootinfo -s hdiskxx to find out the size of the LUN.

#bootinfo -s hdisk30

Continue reading AIX Create Volume Group, Logical Volume dan File System From New Disk /LUN

Backup, Restore and Check the History of DB2 AIX

Backup, restore and check history that I often use. Login using DB2 user.

Interactively backup database and logs:

db2 backup database <dbname> online to </filesystem> include logs

To submit into background job:

nohup db2 backup database <dbname> online to </filesystem> include logs &

To restore, you can use:

db2 restore database RP1 from </filesystem> taken at <yyyymmddhhmmss>
or for background job:
nohup db2 restore database RP1 from </filesystem> taken at <yyyymmddhhmmss> &

To check backup/restore process:

db2top and then press u
or
db2 list utilities show detail

To find out the history of backup activities by:

db2 list history backup since <yyyymmdd> for <dbname>

AIX HADR Reconfiguration

The assumption is that we are going to reconfigure an existing HADR replication.

PRIMARY :
   db2 update db cfg for dbname using HADR_LOCAL_HOST ip_addr_primary
   db2 update db cfg for dbname using HADR_LOCAL_SVC port1
   db2 update db cfg for dbname using HADR_REMOTE_HOST ip_addr_standby
   db2 update db cfg for dbname using HADR_REMOTE_SVC port2
   db2 update db cfg for dbname using HADR_REMOTE_INST instancename
   db2 update db cfg for dbname using HADR_SYNCMODE ASYNC
   db2 update db cfg for dbname using HADR_PEER_WINDOW 120
   
STANDBY :
   db2 update db cfg for dbname using HADR_LOCAL_HOST ip_addr_standby
   db2 update db cfg for dbname using HADR_LOCAL_SVC port2
   db2 update db cfg for dbname using HADR_REMOTE_HOST ip_addr_primary
   db2 update db cfg for dbname using HADR_REMOTE_SVC port1
   db2 update db cfg for dbname using HADR_REMOTE_INST instancename
   db2 update db cfg for dbname using HADR_SYNCMODE ASYNC
   db2 update db cfg for dbname using HADR_PEER_WINDOW 120
   
notes: Port antara DC dan DRC berbeda