Monday, October 21, 2013
Create DB2 database in AIX
Following the steps create new DB2 database in AIX on new file system
mkvg -y dbdatavg hdisk8
mkdir /dbdata
crfs -v jfs2 -g dbdatavg -a size=5G -m /dbdata
chown db2inst1:db2iadm1 /dbdata
After that you need to login as DBA user
db2 create db testdb on /dbdata
If you need you can change log like following :
db2 update db cfg for testdb using newlogpath /dblog
(You need to create new file system for dblog before changing newlogpath)
mkvg -y dbdatavg hdisk8
mkdir /dbdata
crfs -v jfs2 -g dbdatavg -a size=5G -m /dbdata
chown db2inst1:db2iadm1 /dbdata
After that you need to login as DBA user
db2 create db testdb on /dbdata
If you need you can change log like following :
db2 update db cfg for testdb using newlogpath /dblog
(You need to create new file system for dblog before changing newlogpath)
Posted on 11:48 AM
DB2 restore archive logs from remote TSM server
You need to update logarchopt1 before using remote TSM server.
db2 update db cfg for istdb using logarchopt1 "'-fromnode=IST_DB_DB -fromowner=db2sdin3'"
db2 update db cfg for istdb using logarchopt1 "'-fromnode=IST_DB_DB -fromowner=db2sdin3'"
Posted on 11:34 AM
Export/Import BlOB data in db2
Export : You need to have directory to unload BLOB data : /ibm/qrep/switch/300813/lobs/
Export command creates a file "clob_test_export.txt" in current directory.
db2 "export to 'clob_test_export.txt' OF DEL LOBS TO '/ibm/qrep/switch/300813/lobs/' LOBFILE my_clob_export MODIFIED BY LOBSINFILE select * from clob_test"
Import : You need to specify unloaded file and BLOB data location :
db2 "import from clob_test_export.txt of DEL LOBS from '/opt/qrep/switch/300813/lobs/' modified by lobsinfile insert into clob_test"
Export command creates a file "clob_test_export.txt" in current directory.
db2 "export to 'clob_test_export.txt' OF DEL LOBS TO '/ibm/qrep/switch/300813/lobs/' LOBFILE my_clob_export MODIFIED BY LOBSINFILE select * from clob_test"
Import : You need to specify unloaded file and BLOB data location :
db2 "import from clob_test_export.txt of DEL LOBS from '/opt/qrep/switch/300813/lobs/' modified by lobsinfile insert into clob_test"
Posted on 11:24 AM
Sunday, January 29, 2012
Sri Lankan Calendar 2012
This is my first android application. You can use this as a Sri Lankan pocket calendar.
Download : Sri Lankan Calendar 2012
Download : Sri Lankan Calendar 2012
Posted on 11:19 AM
Friday, August 19, 2011
Countinous ping from windows and Solaris
Sometime you may need to do continuous ping from your machine to another machines :
You can use simply use ping command from Linux machines, But you have to do that in following ways in Windows and Solaris
Windows : ping <ipaddress< -t
Solaris : ping -s <ipaddress> or ping -s <ipaddress> <no_of_pings>
You can use simply use ping command from Linux machines, But you have to do that in following ways in Windows and Solaris
Windows : ping <ipaddress< -t
Solaris : ping -s <ipaddress> or ping -s <ipaddress> <no_of_pings>
Posted on 12:07 PM
Thursday, August 18, 2011
Find all the used ip address in LAN (single network)
You can use following command to find all the used ip address in LAN (single network
) from windows machine
FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">> c:\ipaddresses.txt
The "-n 1" is for only 1 ping packet to be sent to each computer.
Change 192.168.0 to match you own Network ID.
This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called IPADDRESSES.TXT in C:\, where it will list only the IP addresses that gave a reply.
You can use following script to find all the used ip address in LAN (single network
) from Linux/Unix machine
a=0
COUNT=4
IPRANGE="192.168.0"
while [ $a -le 254 ]
do
myHost=$IPRANGE""$a
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -ne 0 ]; then
echo $myHost >> ipaddress
fi
a=`expr $a + 1`
done
Change 192.168.0(IPRANGE) to match you own Network ID.
This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called ipaddress in current location, where it will list only the IP addresses that gave a reply.
) from windows machine
FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">> c:\ipaddresses.txt
The "-n 1" is for only 1 ping packet to be sent to each computer.
Change 192.168.0 to match you own Network ID.
This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called IPADDRESSES.TXT in C:\, where it will list only the IP addresses that gave a reply.
You can use following script to find all the used ip address in LAN (single network
) from Linux/Unix machine
a=0
COUNT=4
IPRANGE="192.168.0"
while [ $a -le 254 ]
do
myHost=$IPRANGE""$a
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -ne 0 ]; then
echo $myHost >> ipaddress
fi
a=`expr $a + 1`
done
Change 192.168.0(IPRANGE) to match you own Network ID.
This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called ipaddress in current location, where it will list only the IP addresses that gave a reply.
Posted on 4:31 PM
Subscribe to:
Posts (Atom)