2010年11月30日 星期二

Bind9 採用view後,其slave同步問題

被莫名其妙了2天後,今天總算用到關鍵字,找到答案
不過,這個問題早在2004年就已明確的討論了!
http://www.study-area.org/tips/bind9_view.htm

2010年11月23日 星期二

該死的 dns cache~~


在新IP位址區L段啟用之前,應該先將舊DNS資料記錄的TTL(Time To Live)值設小
因為此值決定了該DNS資料記錄在其他DNS伺服器上存活的時間,如果此值設得很小,
則其他DNS伺服器就不會將前一次所查詢到的資料記錄cache太久。
當新的IP位址區段與DNS伺服器啟用之後,企業外面的人就不會因為仍然使用舊的DNS資料記錄,而造成網路不通的情況

2010年11月18日 星期四

Keyboard shortcuts

Gmail Keyboard shortcuts

查詢式小差異,查詢效率大不同

















根據執行計劃顯示,第1道查詢式是在join後,再進行top 10 * 的篩選,而第2道查詢式,則是先篩選出 top 10 *,再和另一表格去join。

當然,還是要視查詢的需求而定!

2010年7月18日 星期日

被另一個處理序鎖死並已被選擇作為死結的犧牲者

之前將維護資料筆數之動作,寫在ins trigger中
設想當資料有新增時,就檢查看是否有過舊的資料需要刪除
這也是相較於以往,以排程的方式,定期刪除過舊的資料,採用的新想法!
不過,看來並不是很理想! 在這樣的架構下,經常遭遇如下錯誤!

EOleException交易 (處理序識別碼 63) 在 鎖定 | 通訊緩衝區 資源上被另一個處理序鎖死並已被選擇作為死結的犧牲者。請重新執行該交易。

在停止此項Trigger後,就無再產生上述錯誤,
可是真正資源是如何的運用而產生死結,目前尚未明了!

2010年7月14日 星期三

SELECT TOP n WITH TIES

以往偶爾都會有這樣的需求,
但卻不知到可用 WITH TIES來獲得!

2010年7月13日 星期二

在 3Com Switch 4210系列上,使用WebGUI設定Mointor port

第一次在4210上使用WebGUI界面設定,和以前型號的使用經驗比較,感覺好多了!


2010年7月9日 星期五

變更索引名稱















透過SQL Server Management界面進行索引名稱修改,但實際上執行的動作是drop index, and rebuit。
因此,在有大量資料的talbe上,遭遇逾時無法儲存等問題!
後來是以 sp_name 預儲來完成

2010年6月8日 星期二

tcpdump example

[root@host dump]# less capture.sh


#!/bin/sh


MIP=172.17.100.41
MPORT=30002

FILE=/tmp/`date +'ap-%Y%m%d%H%M%S'`.pcap

tcpdump -i eth0 -s 0 -w $FILE tcp and port $MPORT

2010年6月7日 星期一

2010年5月5日 星期三

checktable可能自動修復一些系統問題

DBCC CHECKTABLE 會確認指定資料表的下列項目:
  • 已正確連結索引、in-row、LOB 和資料列溢位資料頁面。

  • 索引符合正確的排序順序。

  • 指標一致。

  • 每個頁面中的資料都是合理的,其中包括計算資料行。

  • 頁面位移合理。

  • 基底資料表的每個資料列在每個非叢集索引中都有相符的資料列,反之亦然。

  • 資料分割資料表或索引中的每個資料列都在正確的資料分割中。

2010年4月13日 星期二

about D-Link DFL-210 console arp command

D-Link DFL-210
console 操作界面
arp -show
arp -flush
arpsnoop wan -verbose

2010年4月6日 星期二

ARP announcements 機制

ARP announcements

因上架一台AscenLink 330 做 HA,發現 HA 生效換 MAC後,
D-Link DFL-210 竟然沒有刷新 ARP Cache,以致無法對外互動!

經過一番的查察,才找到如下文章!

結論:
AscenLink 330 的ARP announcements 機制不符慣例,
經調整DFL-210參數,放寬相關設限後,得以正常運作!

ARP may also be used as a simple announcement protocol. This is useful for updating other host's mapping of a hardware address when the sender's IP address or MAC address has changed. Such an announcement, also called a gratuitous ARP message, is usually broadcast as an ARP request containing the sender's protocol address (SPA) in the target field (TPA=SPA), with the target hardware address (THA) set to zero. An alternative is to broadcast an ARP reply with the sender's hardware and protocol addresses (SHA and SPA) duplicated in the target fields (TPA=SPA, THA=SHA).

An ARP announcement is not intended to solicit a reply; instead it updates any cached entries in the ARP tables of other hosts that receive the packet. The operation code may indicate a request or a reply because the ARP standard specifies that the opcode is only processed after the ARP table has been updated from the address fields.[4][5][6]

Many operating systems perform gratuitous ARP during startup. That helps to resolve problems which would otherwise occur if, for example, a network card was recently changed (changing the IP-address-to-MAC-address mapping) and other hosts still have the old mapping in their ARP caches.

Gratuitous ARP is also used by some interface drivers to effect load balancing for incoming traffic. In a team of network cards, it is used to announce a different MAC address within the team that should receive incoming packets.

ARP announcements can be used to defend link-local IP addresses in the Zeroconf protocol (RFC 3927), and for IP address takeover within high-availability clusters.


http://en.wikipedia.org/wiki/Address_Resolution_Protocol

2010年2月4日 星期四

EXCEL 快速多段隱藏資料及展開資料

此功能於 資料-->群組及大網 中

欄及列皆可使用

選取欲隱藏的列或欄-->資料-->群組及大網-->群組,此時該列或欄的次一列或欄,即為+,
欲展開資料列或欄,請直接點選左上之1或2即可。

不知簡易說明,是否能讓你明瞭,試試便知,
不用猛拉捲軸,好像還蠻好用的。

AscenLink 330

2010年1月12日 星期二

在excel中進行日期的加減運算

欲將EXCEL中一日期欄位,轉換為以西元年表示,並額外再加2年

找不到如VB的函數 "dateadd",最後採如下方式處理,不知可否有更簡便的方式?

  • A1="97/4/20"
  • B1=date(year(a1)+13,month(a1),day(a1)) 可得 B1=2010/4/20

僅查詢欄位名稱

欲查詢某一個資料表的所有"欄"的名稱,但不想要細部的資料
SELECT * FROM xxx_tab WHERE 1=2

2010年1月4日 星期一

資料庫 restore 至它台主機後,無法登入!

在資料庫轉移時,從原主機「卸載(Detach)」資料庫檔案,並移至新主機「附加(Attach)」上去,在「新主機」沒有預先設定 Login 的情況下,資料庫中的 User 將無法刪除,也無法新增同名的 Login,相信有些人有遇到這樣的困擾過!

會 出現這個問題並不是 SQL Server 有 Bug,而是因為你每次建立的登入帳號都會在 SQL Server 中對應一個 SID,資料庫的「使用者」與「登入」的對應是用 SID 來比對的,所以你還原資料庫到另一台機器後,該資料庫中的使用者的 sid 無法比對到該主機 SQL Server 登入帳號中的 sid 所致,所以即便你自己新增了一個「登入」帳號,因為 SID 不一樣,所以也是沒有該資料庫的權限。

http://The Will Will Web



use gps;
--ALTER USER gps with login = gps;
EXEC sp_change_users_login 'Auto_Fix', 'gps', NULL;
sql 2000 sp_change_users_login
http://msdn.microsoft.com/zh-tw/library/ms174378.aspx



執行後的結果敘述呈現如下:
  • 使用者 'mtaxi' 的資料列將會藉由更新它和現有登入的登入連結來修復。
    藉由更新使用者而修復的孤兒使用者數量為 1。
    藉由新增新的登入再更新使用者而修復的孤兒使用者的數量為 0。
  • 使用者 'maddr' 的資料列將會藉由更新它和現有登入的登入連結來修復。
    藉由更新使用者而修復的孤兒使用者數量為 1。
    藉由新增新的登入再更新使用者而修復的孤兒使用者的數量為 0。