Friday, April 28, 2017

Exclude:

Rsync /usr/ but exclude /usr/local to remote host /
Command:
rsync --exclude='local' /usr targethost:/

Tar:
tar --exclude 'cvsroot' -zcvf  home.tar.gz /home


Friday, November 15, 2013

Netapp Ontap IPSEC

Storage IP:172.172.1.1

options ip.ipsec.enable on
#Allow 10.10.10.10
ipsec policy add -s 10.10.10.10  -t 172.172.1. -p esp -e 3des -a md5 -d in -l permit
#Deny subnet 10.10.10 
ipsec policy add -s 10.10.10.0 -t 172.172.1.1 -p esp -e 3des -a md5 -d in -l restrict

Monday, September 23, 2013

Drop Uniq Key on Racktables DB

mysql> show databases;

+----------------------------+
| Database                   |
+----------------------------+
| information_schema |
| mysql                          |
| racktables_db           |
+----------------------------+
5 rows in set (0.00 sec)
use racktables_db;
mysql> describe Object;
+--------------------+-----------------------+------+-------+---------+---------------------+
| Field                 | Type                     | Null | Key    | Default | Extra                |
+--------------------+-----------------------+------+-------+---------+---------------------+
| id                       | int(10) unsigned | NO   | PRI   | NULL | auto_increment |
| name                | char(255)             | YES |          | NULL |                            |
| label                  | char(255)            | YES |          | NULL |                             |
| objtype_id        | int(10) unsigned | NO    | MUL | 1        |                            |
| asset_no          | char(64)              | YES  | UNI   | NULL |                            |
| has_problems | enum('yes','no')   | NO   |           | no      |                            |
| comment          | text                       | YES |           | NULL |                           |
+--------------------+-----------------------+------+--------+---------+--------------------+
7 rows in set (0.00 sec)

mysql> show create table Object;
+--------+----------------------------------------------------------------------------------------------------+
| Table  | Create Table                                                                                                       |
+--------+----------------------------------------------------------------------------------------------------+
| Object | CREATE TABLE `Object` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` char(255) default NULL,
`label` char(255) default NULL,
`objtype_id` int(10) unsigned NOT NULL default '1',
`asset_no` char(64) default NULL,
`has_problems` enum('yes','no') NOT NULL default 'no',
`comment` text,
PRIMARY KEY (`id`),
UNIQUE KEY `asset_no` (`asset_no`),
KEY `id-tid` (`id`,`objtype_id`),
KEY `type_id` (`objtype_id`,`id`)
) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 |
+--------+----------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter table Object drop index asset_no;
Query OK, 101 rows affected (0.05 sec)
Records: 101 Duplicates: 0 Warnings: 0

Wednesday, March 20, 2013

Extract DB2 Audit Content Command:
(Sample)
db2audit extract delasc to . from files ~/sqllib/security/auditdata/db2audit.instance.log.0.20130320085414

DB2 Memo

Structure low - > high

Physical Page * 4 ( or * 8) = Extent * 1
Multi Extent = Table * 1

!! 1 Extent only contain 1 Table data !!


normal table with Single dimensional Clustering only can be sort by 1 column. ( command: organie by (column1) )
Multidimensional Clustering Table can be sort by more thane 1 column. ( command: organie by (column1,column2,..,columnX) )
Multidimensional Clustering Index will automatic create when Table create.

Wednesday, January 30, 2013

How to add IBM DB2 App Driver in SQuirreL

How to add IBM DB2 App Driver in SQuirreL IBM DB2 App Driver Add to Extra Class Path db2jcc.jar db2jcc_license_cu.jar Fix COM.ibm.db2.jdbc.app.DB2Driver -> com.ibm.db2.jcc.DB2Driver

Tuesday, May 24, 2011

[DB2] Scripts for Reorg DB , Can't use it on production DB

db2 list tables for schema tpasadm |grep TPASADM | awk '{print $1}' | while read tblname
do
db2 connect to tpas
db2 reorgchk current statistics on table TPASADM.$tblname |grep "Index:" | awk '{print $2}' |while read idxname
do
db2 connect to tpas > /dev/null
printf "Reorg Table $tblname Index $idxname \n"
db2 reorg table TPASADM.$tblname index $idxname inplace allow write access > /dev/null
db2 terminate > /dev/null
done
done

Wednesday, January 12, 2011

Step of DB2 reorg

Table name:SIVIEW.FRLOTNOTE
Index name:siview.IRCAST_LOT

1.runstat
db2 runstats on table SIVIEW.FRLOTNOTE and index all allow write access
2.reorgchk
db2 reorgchk current statistics on table all(or SIVIEW.FRLOTNOTE)
3.reorg
db2 "reorg table SIVIEW.FRCAST_LOT index siview.IRCAST_LOT inplace allow write access"
4.reorg status check
db2pd -d tpas -reorgs |grep FRCAST_LOT
5.reorgchk again(check)
db2 reorgchk current statistics on table all
6.done