Saturday, September 08, 2007

我的私人世界

今天GG公司搬家,我自己也不需要加班,于是到公司找点儿好玩的事情。拿着自己喜欢的杂志,随便的idle,这样的周末我已经很满足 (:
有一点郁闷的是,想来玩second life的,结果发现两台机器都不能跑,severity 1
还有现在发现yahoo中国和sohu忽然间走的是完全不同的两条路线,yahoo还是全力投入搜索,相比之下sohu显得跟这个时代的web风格格格不入;但是在我看来,yahoo的退出,对sohu未尝不是一件好事。

Saturday, September 01, 2007

8.22 memo

上次和Janice的mentoring session的记录:
1.
a) 打好基础,在日常的工作中,要选难的、复杂的东西来做,让自己得到必要的锻炼;
b) 把手头已有的事情能做到更好的,要做到更好;
2. 向Janice咨询了我困扰已久的learning activity的问题
回答是:跟自己生活比较接近的人,自己身边的人学到的东西更多;
3. Janice建议我:一定要有自己的focus,多去听其他人在做什么来开阔自己的视野;

和Young的谈话:
要对自己的Todo list 进行sorting才能更有效

Saturday, June 23, 2007

试验两个月

上周和Janice的交流让我受益良多,觉得自己还有很多地方需要改善,那就让我开始计划,来试验自己的改变吧:
首先我想做的是Time management:
1. 按照Joyce的方法统计每天的工作效率,要提高工作效率而不是延长工作时间;
2. 事先把必须做的事情排进calendar防止自己拖拖拉拉;
3. 让自己有紧急工作加班的时间,也要有relax的时间,可以去跑步,一周保证三次30分钟到45分钟的跑步或者Yoga;
4. 让自己stay focused 的时间延长;
5.每周抽时间来清理自己的文件;
暂时写到这里.....

Saturday, February 10, 2007

Web activities are devided into two type

Alex Iskold at Read/WriteWeb writes about "The Art, Science and Business of Recommendation Engines".
here are two fundamental activities online -- Search and Browse. When a consumer knows exactly what she is looking for, she searches for it. But when she is not looking for anything specific, she browses.

It is the browsing that holds the golden opportunity for a recommendation system, because the user is not focused on finding a specific thing -- she is open to suggestions.

During browsing, the user's attention (and their money) is up for grabs. By showing the user something compelling, a web site maximizes the likelihood of a transaction. So if a web site can increase the chances of giving users good recommendations, it makes more money.

Amazon is considered a leader in online shopping and particularly recommendations. Over the last decade the company has invested a lot of money and brain power into building a set of smart recommendations that tap into your browsing history, past purchases and purchases of other shoppers -- all to make sure that you buy things.

The Amazon system is phenomenal. It is a genius of collaborative shopping and automation that might not be possible to replicate. This system took a decade for Amazon to build and perfect. It relies on a massive database of items and collective behavior that also "remembers" what you've done years and minutes ago.

Friday, February 02, 2007

Keep on moving

我亲爱的Rachel,要keep on moving, 永不放弃

工作面貌是什么样子的?

最近三个星期,基本都在加班,周六周日从1:00开始到晚上9:00回家,每天忙的不亦乐乎; 但却还是看到每天老板摆着脸,我摸不着头脑,不知道哪里做的不好,或者说:辛苦一点无所谓,但是我需要得到认可,这样我的努力才有价值...
做regular跟做intern的一个最大的区别就是: 做Regular的时候不能每天单纯的考虑技术问题了,杂七杂八的事情一堆,而自己的技术兴趣却没有时间去实践,不知道是否别人也有这个问题的?也许该读一下Getting Things Done!
lisa准备跳槽了,小齐刚刚找到工作,我心中暗想:是不是我的工作也需要注入新的血液了?
但是心里首先想的是: Rachel不是一个遇到困难就退缩的人,Rachel应该迎难而上,见鬼杀鬼!
Come on, Rachel!
I believe I can do the best!!!!

对于现在得我来说,每天晚上最享受的事情就是看看我的google reader,看看行业的变化,读读牛人的blog了

Sunday, January 21, 2007

我的青春

周末加了两天班,process,management review忙的不亦乐乎,虽然新的project还没有start,但是上周却不是一般的忙碌,因此只好把周末全部用来干活。虽然说GAS很苦很累,但是我却记得每天的感觉都非常棒,不知道为什么到了公司却没有了那么棒的感觉?也许是觉得自己的工作还没有得到认可吧,总之,我相信我的明天。
今天从地铁站买了两个小熊,他们的名字叫:肥仔&Rachel

Tuesday, December 26, 2006

DB2: How to stop DB2 instance

SQL1025N The database manager was not stopped because databases are still active.
Often I met this problem when I want to stop the db2 instance using "db2stop"
Here is the solution:http://safari5.bvdep.com/0130463884/app07

This appendix describes the necessary steps to stop and start a DB2 instance. There are many ways to stop and start a DB2 instance, but the following steps will guide you to stop a DB2 instance to ensure that any defunct DB2 processes, interprocess communications, and defunct DARI processes have been removed successfully.

Current configuration:

Instance:db2inst1
Database:sample
Server:phantom

  1. Stop the DB2 instance.

    • Check existing applications that are currently connected to the database by logging on to phantom server as DB2 instance owner db2inst1:

      $ db2 list applications

      Auth Id Appl. Name Appl.. Handle Appl. Id DB Name # of Agents
      ------- ---------- ------------- ---------------------------- ------- -----------
      DB2INST1 db2bp 207 *LOCAL.db2inst1.010824003917 SAMPLE 1
      DB2INST1 java 276 CCF21FFC.E5D8.010829004049 SAMPLE 1
      DB2INST1 java 51 CCF21FFC.E5D9.010829004051 SAMPLE 1


    • If there is any application connected to the database, you can tell who is currently connected and from which location they are connected. In this case, there is one local connection from db2inst1 user ID, and there are two remote connections from IP address: 204.242.31.252 converted from hex to decimal: CCF21FFC.

    • For remote connections, after you get the IP address, you can get the hostname by issuing the nslookup command:

      $ /usr/sbin/nslookup 204.242.31.252

      Server: charter.phantom.com
      Address: 204.242.31.83

      Name: phantom.phantom.com
      Address: 204.242.31.252
    • If there are any applications connected to the database, verify that they are not currently executing:

      $ db2 list applications show detail | egrep –i "executing|pending" 
    • If there are applications executing or pending, you can now force them off. Then verify to make sure there is no application connected to the database. If you see the following message, you're ready to stop the DB2 instance:

      $ db2 force application all

      DB20000I The FORCE APPLICATION command completed successfully.
      DB21024I This command is asynchronous and may not be effective immediately.

      $ db2 list applications

      SQL1611W No data was returned by Database System Monitor. SQLSTATE=00000


    • Now you can stop the DB2 instance. When you get the message "SQL1064N DB2STOP processing was successful" you're ready to do the next step. If you get the message below, you must start this step again:

      $ db2stop

      SQL1025N The database manager was not stopped because databases are still active.


    • LAST RESORT. If for some reason you cannot stop the DB2 instance or DB2 commands are hung, you must run this utility to remove the DB2 engine and client's IPC resources for that instance. This is your lifesaver:

      $ ipclean

      ipclean: Removing DB2 engine and client's IPC resources for db2inst1.
  2. Stop the DB2 Administration Server instance.

    • Skip this step if DB2 Admin instance is not running; otherwise, execute this command:

    $ db2admin stop 
  3. Remove defunct DARI processes, DB2 background processes, or other defunct threads.

    • List all DB2 processes for this instance:

      $ ps –ef | grep db2

      db2as 23797 23796 0 Aug 28 ? 0:00 db2sysc
      db2as 23800 23798 0 Aug 28 ? 0:00 db2sysc
      db2inst1 22229 1 0 13:08:01 pts/5 0:00 /db2/dbhome/db2inst1/sqllib/bin/db2bp 20580 5
      db2as 23802 23797 0 Aug 28 ? 0:00 db2sysc
      db2as 23801 23797 0 Aug 28 ? 0:00 db2sysc
      db2as 23799 23797 0 Aug 28 ? 0:00 db2sysc


    • From the list above, we notice that there are processes belonging to the DB2 Admin services instance, so you must leave them alone. There is only one process that belongs to db2inst1, and that is a DB2 background process that did not get cleaned up after executing ipclean. Get the PID number and kill that process:

      $ kill –9 22229 
    • Most of the time, you will see many defunct processes, and to save time, you should execute the following command instead of executing the kill -9 ${PID} command many times:

      $ ps –ef | grep db2inst1 | awk '{print "kill –9 "$2}' > /tmp/kpid
      $ chmod +x /tmp/kpid
      $ /tmp/kpid
    • Verify that no defunct processes are left. Repeat this step if necessary:

      $ ps –ef | grep db2inst1 
  4. Remove defunct interprocess communication segments.

    • List all memory segments:

      $ ipcs –am | grep db2inst1

      IPC status from as of Thu Aug 30 13:16:55 2001
      T ID KEY MODE OWNER GROUP
      Shared Memory:
      m 9910 0x74006380 --rw-rw-rw- db2inst1 db2grp
      m 59714 0x61006380 --rw------- db2inst1 db2grp
    • From the list above, you notice that there are two memory segments that were not removed when executing ipclean. You must remove them manually:

      $ ipcrm –m 9910
      $ ipcrm –m 59714
    • List all semaphore segments:

      $ ipcs –as | grep db2inst1

      IPC status from as of Thu Aug 30 13:16:55 2001
      T ID KEY MODE OWNER GROUP
      Shared Memory:
      s 1900549 0x74006380 --ra-ra-ra- db2inst1 db2grp 1
      s 1310727 00000000 --ra-ra---- db2inst1 db2grp 1
      s 2031624 0x73006380 --ra-ra-ra- db2inst1 db2grp 1
    • From the list above, notice that there are three semaphore segments that were not removed after executing ipclean. You must remove them manually:

      $ ipcrm –s 1900549
      $ ipcrm –s 1310727
      $ ipcrm –s 2031624
    • List all message queue segments:

      $ ipcs –aq | grep db2inst1

      IPC status from as of Thu Aug 30 13:16:55 2001
      T ID KEY MODE OWNER GROUP
      Shared Memory:
      q 1572868 0x01dadd16 -Rrw------- db2inst1 db2grp 65535
      q 901125 0x01eba5ed --rw------- db2inst1 db2grp 65535
      q 1609739 00000000 --rw------- db2inst1 db2grp 65535
      q 659468 00000000 -Rrw------- db2inst1 db2grp 65535
    • From the list above, notice that there are four message queue segments that were not removed after executing ipclean. You must remove them manually:

      $ ipcrm –q 1572868
      $ ipcrm –q 901125
      $ ipcrm –q 1609739
      $ ipcrm –q 659468
    • Verify that there are no defunct interprocess communications left. Repeat this step if necessary:

      $ ipcs –a | grep db2inst1 
  5. Before you start the DB2 instance, it is best practice to back up the previous db2diag.log, any event logs, notification log, and the associated trap files, and start with a fresh copy.

    • Move the current db2diag.log to the backup directory:

      $ mkdir –p /db2/backup/db2inst1/diaglogSep12
      $ cd /db2/dbhome/db2inst1/sqllib/db2dump
      $ mv db2diag.log /db2/backup/db2inst1/diaglogSep12/
      $ mv db2eventlog* /db2/backup/db2inst1/diaglogSep12/
      $ mv db2inst1.nfy /db2/backup/db2inst1/diaglogSep12/
      $ touch db2diag.log db2inst1.nfy db2eventlog.nnn where nnn is the database partition number
      $ chmod 666 db2diag.log db2inst1.nfy db2eventlog.*


    • If there are any trap files, group them together:

      $ cd /db2/dbhome/db2inst1/sqllib/db2dump
      $ tar –cvf /db2/backup/db2inst1/diaglog/trapAug292001.tar t* c* l* [0-9]*
    • Or execute this keepDiagLog.sh script:

      #!/bin/ksh
      #
      # Clean up db2diag.log, trap files, dump files, etc
      #
      # Usage: keepDiagLog.sh
      #
      # Execute as DB2 instance owner
      #
      LOGTIME=`date '+%y%m%d%H%M%S'`
      DIAGDIR=${HOME}/sqllib/db2dump
      typeset instname=${1-db2inst1}
      typeset ROOTDIR=${2-/dbbackup}
      typeset dbname=${3-sample}
      typeset OLDDIR=${4-${ROOTDIR}/${instname}/${dbname}/db2diag${LOGTIME}}
      mkdir –p ${OLDDIR}
      cd ${DIAGDIR}
      cp –r * ${OLDDIR}/
      for j in `ls`
      do
      if [ -d "${j}" ]; then
      rm –r ${j}
      else
      rm ${j}
      fi
      done
      touch db2diag.log ${instname}.nfy
      chmod 666 db2diag.log ${instname}.nfy
      exit 0
      # You need to add the steps for the event log files based on the
      # number of database partitions defined on your server.


  6. Now you're ready to start the DB2 instance.

    • Start the DB2 instance:

      $ db2start

      SQL1063N DB2START processing was successful.
  7. And you're ready to start the DB2 Admin instance.

    • Start the DB2 Admin instance:

      $ db2admin start 
  8. Verify the database connection.

    • Connect to the sample database:

      $ db2 connect to sample

      Database Connection Information
      Database server = DB2/SUN 8.1.0
      SQL authorization ID = DB2INST1
      Local database alias = SAMPLE
    • Disconnect from the sample database:

      $ db2 terminate 
  9. Reactivate the database to improve performance.

    • Activate the sample database:

      $ db2 activate database sample

      DB20000I The ACTIVATE DATABASE command completed successfully.