=IF(ISNA(VLOOKUP(A1,$B$1:$B$6,1,FALSE)), "No", "Yes")
A is a list,
B is a List
if Values in A are in the B List, have Yes in the third column...
A is a list,
B is a List
if Values in A are in the B List, have Yes in the third column...
A B C
, they may not arrive in that same order if, for example, the intervening network distributes the messages across a cluster and then recombines them. But what if message order is vital to the functioning of the application?
Imagine a scenario in which message B
tells the application to ignore the previous message.
The meaning of the sequence would then be very different if the messages arrived in the order C B A
.A
, B
and C
as part of a group.
Each message in the group is assigned a sequence number starting at 1. The receiving application can then specify that it wishes to receive the messages
in this logical order, as opposed to the physical order in which the messages arrive at a destination. Now, even if message B
or C
arrives first, they will not be passed to the application immediately because they do not have sequence number 1.default
on the queue manager QM_host
:MQQueueManager queueManager = new MQQueueManager("QM_host"); MQQueue queue = queueManager.accessQueue("default", MQC.MQOO_OUTPUT); MQPutMessageOptions pmo = new MQPutMessageOptions(); pmo.options = MQC.MQPMO_LOGICAL_ORDER; for (int i = 1; i <= 5; i++) { MQMessage message = new MQMessage(); message.format = "MQSTR"; message.writeString("Message " + i); if (i < 5) { message.messageFlags = MQC.MQMF_MSG_IN_GROUP; } else { message.messageFlags = MQC.MQMF_LAST_MSG_IN_GROUP; } queue.put(message, pmo); } queue.close(); queueManager.disconnect();
MQPMO_LOGICAL_ORDER
is added to the put message options.
This value indicates to the queue manager that the application is going to put each of the messages in the group in sequential order
and that all of the messages in one group will be put by this client before any of the messages in the next.MQSTR
so that we may later receive the messages as JMS text messages.) For the first four messages, the message flag MQMF_MSG_IN_GROUP
is set to indicate that the message should be part of the current group.
The fifth message has the message flag MQMF_LAST_MSG_IN_GROUP
set to indicate that it is the final message in the group.
The next time a message is put with the MQMF_MSG_IN_GROUP
flag, a new group will automatically be started.MQPMO_LOGICAL_ORDER
put message option is purely for convenience. It is possible for an application
to not use this flag and to set the group identifier and sequence numbers explicitly, which may be necessary if messages are to be sent out of order
or interleaved with other message groups. The message flags should still be set to indicate that a message is in a group and whether it is the last message.
Another scenario where this may be useful is if the messages in a group are spread over a long period of time.
An application may send the first few messages in a group using logical message ordering, after which the system fails.
When the application restarts, it can continue with the message group by sending the next message without logical ordering and explicitly set the group identifier to be the one used for the earlier messages along with the next sequence identifier. At this point, it may switch back to using logical message ordering for the subsequent messages. The queue manager will then continue to use the same group identifier and increment the sequence number each time.MQQueueManager queueManager = new MQQueueManager("QM_host"); MQQueue queue = queueManager.accessQueue("default", MQC.MQOO_INPUT_AS_Q_DEF); MQGetMessageOptions gmo = new MQGetMessageOptions(); gmo.options = MQC.MQGMO_LOGICAL_ORDER | MQC.MQGMO_ALL_MSGS_AVAILABLE; gmo.matchOptions = MQC.MQMO_NONE; MQMessage message = new MQMessage(); do { queue.get(message, gmo); int dataLength = retrievedMessage.getDataLength(); System.out.println(message.readStringOfCharLength(dataLength)); gmo.matchOptions = MQC.MQMO_MATCH_GROUP_ID; } while (gmo.groupStatus != MQC.MQGS_LAST_MSG_IN_GROUP); queue.close(); queueManager.disconnect();
MQGMO_LOGICAL_ORDER
indicates that we wish to receive the messages in logical order, in other words, the message with sequence number 1 should be received first, then number 2, and so on. The second option,
MQGMO_ALL_MSGS_AVAILABLE
, indicates that we don't wish to receive any messages in a group until all of the messages are available.
This option prevents us from starting to process messages in a group only to discover that subsequent messages haven't been sent yet, let alone arrived.get
, we specify that no match options are required -- we are prepared to receive the first message in any group.
For subsequent iterations, we specify the MQMO_MATCH_GROUP_ID
option, which indicates that we only wish to receive a message
with a matching group identifier. We reuse the same message object for each iteration and consequently, for the second get, it will contain the group identifier
of the first message received. Each get updates the group status field of the get message options.
When it is set to MQGS_LAST_MSG_IN_GROUP
, we know that we have received all of the messages in the group.JMSXGroupID
and JMSXGroupSeq
,
and specifies that they represent the identity of the group a message is part of, and the sequence number within that group. The JMS specification does not, however, provide any support for using these properties.
All is not lost though -- with a few workarounds, we can still replicate our existing behavior using these properties.MQPMO_LOGICAL_ORDER
was simply an instruction to the queue manager to automatically allocate message group identifiers and sequence numbers. The example in Listing 3 below
demonstrates how, in the absence of this option in the JMS API, we can set these properties explicitly. MQConnectionFactory factory = new MQConnectionFactory(); factory.setQueueManager("QM_host") MQQueue destination = new MQQueue("default"); destination.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ); Connection connection = factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(destination); String groupId = "ID:" + new BigInteger(24 * 8, new Random()).toString(16); for (int i = 1; i <= 5; i++) { TextMessage message = session.createTextMessage(); message.setStringProperty("JMSXGroupID", groupId); message.setIntProperty("JMSXGroupSeq", i); if (i == 5) { message.setBooleanProperty("JMS_IBM_Last_Msg_In_Group", true); } message.setText("Message " + i); producer.send(message); } connection.close();
BigInteger
and converting it to a hexadecimal string.
As with message identifiers, the WebSphere MQ JMS API expects the group identifier to be prefixed by the string ID:
JMSXGroupId
string property and the sequence number to the JMSXGroupSeq
integer property. The API assumes that if the group identifier is set, then the message is part of a group.
Therefore all that remains is to indicate the last message in the group, which we do by setting the Boolean property
JMS_IBM_Last_Msg_In_Group
to true.MQJMS_CLIENT_NONJMS_MQ
in Listing 3 above,
which ensures that an RFH2 header is not added to the body of the message, which would confuse the non-JMS client.JMS_IBM_Last_Msg_In_Group
property set.
The hard part is trying to reproduce the behavior of the MQGMO_ALL_MSGS_AVAILABLE
option. Listing 4 shows one possible solution:MQConnectionFactory factory = new MQConnectionFactory(); factory.setQueueManager("QM_host") MQQueue destination = new MQQueue("default"); Connection connection = factory.createConnection(); connection.start(); Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE); MessageConsumer lastMessageConsumer = session.createConsumer(destination, "JMS_IBM_Last_Msg_In_Group=TRUE"); TextMessage lastMessage = (TextMessage) lastMessageConsumer.receiveNoWait(); lastMessageConsumer.close(); if (lastMessage != null) { int groupSize = lastMessage.getIntProperty("JMSXGroupSeq"); String groupId = lastMessage.getStringProperty("JMSXGroupID"); boolean failed = false; for (int i = 1; (i < groupSize) && !failed; i++) { MessageConsumer consumer = session.createConsumer(destination, "JMSXGroupID='" + groupId + "'AND JMSXGroupSeq=" + i); TextMessage message = (TextMessage)consumer.receiveNoWait(); if (message != null) { System.out.println(message.getText()); } else { failed = true; } consumer.close(); } if (failed) { session.rollback(); } else { System.out.println(lastMessage.getText()); session.commit(); } } connection.close();
JMS_IBM_Last_Msg_In_Group=TRUE
. If the messaging topology is such that ordering cannot be guaranteed, then we cannot be 100% sure that all of the other messages in the group have arrived. In a moment we'll see how we deal with the case when they have not all arrived.null
back from the receiveNoWait
method. At this point we set the failed
flag, which causes us to drop out of the loop.true
to indicate that the send and receive operations performed on this session should be performed as part of a local transaction.
This means that, if the failed
flag has been set because a message has not been received, we can roll back the transaction
and return all of the other messages in the group back to the queue. If we did successfully receive all of the messages,
then we must remember to commit the transaction. Otherwise, when we close the connection, the transaction will be rolled back on our behalf.JMS_IBM_Last_Msg_In_Group=TRUE
so that the MDB is always passed the last message in a group.
We need this first message to be received as part of a transaction, and therefore the MDB should also be configured to use Container Managed Transactions (CMT)
with a transaction attribute of RequiresNew
. Here is the code for the onMessage
method of our MDB:public void onMessage(Message lastMessage) { InitialContext context = new InitialContext(); ConnectionFactory factory = (ConnectionFactory) context.lookup("java:comp/env/jms/factory"); Destination destination = (Destination) context.lookup("java:comp/env/jms/destination"); Connection connection = factory.createConnection(); connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); int groupSize = lastMessage.getIntProperty("JMSXGroupSeq"); String groupId = lastMessage.getStringProperty("JMSXGroupID"); boolean failed = false; for (int i = 1; (i < groupSize) && !failed; i++) { MessageConsumer consumer = session.createConsumer(destination, "JMSXGroupID='" + groupId + "'AND JMSXGroupSeq=" + i); TextMessage message = (TextMessage) consumer.receiveNoWait(); if (message != null) { System.out.println(message.getText()); } else { failed = true; } consumer.close(); } if (failed) { _context.setRollbackOnly(); Thread.sleep(5000); } else { System.out.println(((TextMessage) lastMessage).getText()); } connection.close(); }
/unix
is a symbolic link to the booted kernel. To find out what kernel mode is running, enter ls -l /unix
and see what file /unix
it links to. The following are the three possible outputs from the ls -l /unix
command and their corresponding kernels:/unix -> /usr/lib/boot/unix_up # 32 bit uniprocessor kernel /unix -> /usr/lib/boot/unix_mp # 32 bit multiprocessor kernel /unix -> /usr/lib/boot/unix_64 # 64 bit multiprocessor kernel
ln -sf /usr/lib/boot/unix_64 /unix ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix bosboot -ad /dev/hdiskxx shutdown -r
lslv -m hd5
prtconf
command. If it is a CHRP machine, the string chrp
appears on the Model Architecture line.prtconf
command.lsattr -El sys0 -a realmem
lsattr -l rmt0 -E
lsattr -l rmt0 -D
tty0
, type:lsattr -l tty0 -a login -R
lsattr -E -l sys0
lscfg | grep proc
lspv
lspv hdisk1
lscfg
Option | Description |
---|---|
-p | Displays platform-specific device information. The flag is applicable to AIX V4.2.1 or later. |
-v | Displays the vital product data (VPD) found in the customized VPD object class. |
lscfg -vl rmt0
prtconf
command.uname
command provides details about your system.Command | Description |
---|---|
uname -p | Displays the chip type of the system. For example, IBM PowerPC®. |
uname -r | Displays the release number of the operating system. |
uname -s | Displays the system name. For example, AIX. |
uname -n | Displays 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. |
name -u | Displays the system ID number. |
oslevel -r lslpp -h bos.rte
lslpp -l "bos.rte.*"
oslevel -r -l 5300-01
oslevel -r -g 5300-01
oslevel -s
oslevel -sq
Known service packs ------------------- 6100-00-02-0750 6100-00-01-0748 6100-00-00-0000
oslevel -s -l 6100-00-01-0748
oslevel -s -g 6100-00-01-0748
crfs -v jfs -g testvg -a size=10M -m /fs1
crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2
crfs -v jfs -g rootvg -m /test -a \ size=32768 -a frag=512 -a nbpi=1024
crfs -v jfs -g rootvg -m /test -a size=16M -a frag=512 -a nbpi=1024
/usr
file system size by 1000000 512-byte blocks, type:chfs -a size=+1000000 /usr
chfs -a size=24576 /test
chfs -a size=+8192 /test
chfs -m /test2 /test
chfs -d account /home
chfs -a splitcopy=/backup -a copy=2 /testfs
chfs -a size=64M /test
chfs -a size=-16M /test
mount -V cdrfs -o ro /dev/cd0 /cdrom
mount /dev/fslv02 /test
mount {-a|all}
mount
mount -n nodeA /home/tom.remote /home/tom.local
VfsName parameter=remote
, which must be defined in the /etc/vfs file.mount -t remote
type=remote
attribute.mount -o snapshot /dev/snapsb /home/janet/snapsb
mount -o snapto=/dev/snapsb /dev/sb /home/janet/sb
mount –o remount,rw fsname
remount
option is not available in AIX 5.3.umount /test
umount -n nodeA
rmfs /test
defragfs
command can be used to improve or report the status of contiguous space within a file system. For example, to defragment the file system /home, use the following command:defragfs /home
defragfs -r /data1
defragfs -s /data1
/usr/bin/vmstat
, type:lslpp -w /usr/bin/vmstat
lslpp -w
installp
, type:lslpp -w "*installp*"
/usr/bin/svmon
, type:which_fileset svmon
lslpp -l
lslpp -l "bos.rte.*"
lslpp -La bos.rte.filesystem
lslpp -f bos.rte.lvm
installp
, type:lslpp -w "*installp*"
instfix -i | grep TL
instfix -i -k "IX38794 IX48523"
/dev/cd0
, for example, enter the command:instfix -k IY73748 -d /dev/cd0
instfix -k IX38794 -d /dev/rmt0.1
instfix -T -d /dev/rmt0.1 | instfix -d /dev/rmt0.1 -f-
lppchk -v
dump -Htv
dump -o a.out
dump -l a.out
dump -s a.out
dump -t a.out
# oslevel -s 6100-00-03-0808 # sysdumpdev -l primary /dev/lg_dumplv secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE dump compression ON type of dump traditional # oslevel -s 7100-00-00-0000 # sysdumpdev -l primary /dev/lg_dumplv secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE dump compression ON type of dump fw-assisted full memory dump disallow
# sysdumpdev -f require # sysdumpdev -l primary /dev/lg_dumplv secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE dump compression ON type of dump fw-assisted full memory dump require
# sysdumpdev -t traditional # sysdumpdev -l primary /dev/lg_dumplv secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE dump compression ON type of dump traditional
# sysdumpdev -t fw-assisted
lsps -a
chps -s
command to dynamically increase the size of a paging space. For example, if you want to increase the size of hd6 with three logical partitions, you issue the following command:chps -s 3 hd6
chps -s 4 myvg
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
smtctl
command without any options, it tells you if it is enabled or not.smtctl
command. The following is the syntax:smtctl [ -m off | on [ -w boot | now]]
Option | Description |
---|---|
-m off | Sets SMT mode to disabled |
-m on | Sets SMT mode to enabled |
-w boot | Makes the SMT mode change effective on next and subsequent reboots if you run the bosboot command before the next system reboot
|
-w now | Makes the SMT mode change immediately but will not persist across reboot |
-w boot
option nor the -w now
option is specified, then the mode change is made immediately. It persists across subsequent reboots if you run the bosboot
command before the next system reboot.smtctl -m off
bosboot
command before the next reboot.lparstat
command provides a report of partition information and utilization statistics. This command also provides a display of hypervisor information.lparstat 1 1
lparstat –h 1 1
lparstat -i
lparstat –H 1 1
lparstat –m
m
option is not available in AIX 5.3.lsvg, mkvg, chvg, extendvg,
and replacepv
described in the following sections support creation, extension, and maintenance of volume groups consisting of SSDs.lsvg
command on the volume group and look at the value for MAX PVs. The value is 32 for normal, 128 for big, and 1024 for scalable volume group.s
partition_size sets the number of megabytes (MB) in each physical partition where the partition_size
is expressed in units of MB from 1 through 1024. (It is 1 through 131072 for AIX V5.3.) The partition_size
variable must be equal to a power of 2 (for example: 1, 2, 4, 8). The default value for standard and big volume groups is the lowest value to remain within the limitation of 1016 physical partitions per physical volume. The default value for scalable volume groups is the lowest value to accommodate 2040 physical partitions per physical volume.mkvg -y name_of_volume_group -s partition_size list_of_hard_disks
mkvg -s 1 hdisk3 hdisk5 hdisk6
mkvg -S -v 2048 hdisk6
chvg
chvg -a y vg03
smit chvg
fast path to run this command.mklv -y name_of_logical_volume name_of_volume_group number_of_partition
mklv vg03 15 hdisk5 hdisk6 hdisk9
extendlv lv05 3
lsvg -l rootvg
lsvg -o
lsvg
lsvg vg02
lslv lv1
lslv -p hdisk2
LogicalVolume
parameter was included, the map does not contain logical partition numbers specific to any logical volume.lslv -l lv03
rmlv lv7
rmlv
command removes only the logical volume, but does not remove other entities, such as file systems or paging spaces that were using the logical volume.mklvcopy
LogicalVolumeName Numberofcopies
syncvg
VolumeGroupName
syncvg
command synchronizes the logical volume copies.lv01
logical volume, so that a total of three copies exist for each logical partition, enter:mklvcopy lv01 3
lv01
directory have three copies.rmlvcopy
command to remove copies of logical partitions of a logical volume. To reduce the number of copies of each logical partition belonging to the testlv
logical volume, enter:rmlvcopy testlv 2
lsvg
rootvg
, type:lsvg rootvg
rootvg
, type:lsvg -p rootvg
extendvg VolumeGroupName hdisk0 hdisk1 ... hdiskn
hdisk3
and hdisk8
to volume group vg3
, enter:extendvg vg3 hdisk3 hdisk8
lquerypv
command with the -M
flag. The output gives the LTG size in KB. For instance, the LTG size for hdisk0 in the following example is 256 KB./usr/sbin/lquerypv -M hdisk0 256
lspv
command on the hard disk and look at the value for MAX REQUEST.syncvg
command do?syncvg
command is used to synchronize stale physical partitions. It accepts names of logical volumes, physical volumes, or volume groups as parameters.hdisk4
and hdisk5
, use:syncvg -p hdisk4 hdisk5
testvg
, use:syncvg -v testvg
vg04
and vg05
, enter:syncvg -v vg04 vg05
extendvg
VolumeGroupName hdisk_new
migratepv
hdisk_bad hdisk_new
reducevg -d
VolumeGroupName hdisk_bad
migratepv
moves allocated physical partitions from one physical volume to one or more other physical volumes.reducevg
command removes physical volumes from a volume group. When all the physical volumes are removed from the volume group, the volume group is deleted.alt_disk_copy
command to copy the current rootvg to an alternate disk. The following example shows how to clone the rootvg to hdisk1.alt_disk_copy -d hdisk1
no
command sets or displays current or next boot values for network tuning parameters.no -o thewall
no -r -o tcp_sendspace=32768 no -r -o udp_recvspace=32768
no -o ipforwarding=1
no
command, type:no -L
ifconfig -a host Fully_Qualified_Host_Name
host cyclop.austin.ibm.com
lsdev -Cc if ifconfig -a
tr0
, run the command:ifconfig tr0
tr0
, run the command:ifconfig tr0 up
tr0
, run the command:ifconfig tr0 down
netstat -r -f inet
netstat -i -f inet
netstat -s -f inet
iptrace /tmp/nettrace
en0
from a remote host airmail over the Telnet port, enter:iptrace -i en0 -p telnet -s airmail /tmp/telnet.trace
mkwpar -n temp -N address= xxx.yyy.zzz.nnn
mkwpar -f /tmp/wpar1.spec
wpar1
, type:mkwpar -e wpar1 -o /tmp/wpar2.spec -w
temp
, type:startwpar temp
temp
, type:stopwpar temp
lswpar Name State Type Hostname Directory --------------------------------------------------------------------------------- bar A S bar.austin.ibm.com /wpars/bar bar A S bar.austin.ibm.com /wpars/bar foo D S foo.austin.ibm.com /wpars/foo trigger A A trigger /
wpar1
as user foo
, type:clogin wpar1 -l foo
howdy
, type:clogin howdy -l root /usr/bin/ps
temp
, type:rmwpar temp
temp
preserving data on its file system, type:rmwpar -p -s temp
iostat
command described below has been enhanced in AIX 6.1 TL6 and AIX 7.1 to capture useful data to help analyze I/O issues and identify and correct the problem quicker. A new flag, -b
, is available for the iostat
command to display block I/O device utilization statistics.vmstat
vmstat 2 5
vmstat scdisk13 scdisk14
vmstat -t
vmstat -vs
vmstat -@ ALL
vmstat -vs -@ ALL
iostat
disk1
, type:iostat -d disk1 2
disk1
, type:iostat disk1 2 6
iostat -d 2 6
disk1
, disk2
, disk3
, enter the following command:iostat disk1 disk2 disk3 2 6
iostat -s
iostat -a 5
iostat -sat 20 10
iostat -sad hdisk0 hdisk7 30
iostat
, enter the following command:iostat -T 60
iostat -F -@ ALL
iostat -s -@ ALL
topas
topas -P
topas -L
topas -D
topas -F
abc
, enter the following command:topas -@ abc
topas
WPAR mode, enter the following command:topas -@
sar
sar -y -r 2 20
sar -@ wparname
sar -P ALL 1 1
sar -u -P 0,1
cpu %usr %sys %wio %idle 0 45 45 5 5 1 27 65 3 5