2011年10月20日 星期四

SQL Server 交易日誌清除

情境1.因為壓力測試的關係,交易紀錄長到接近2TB ,系統效能受到影響,資料備份也受到嚴重影響。

情境2.使用資料庫複寫進行資料備份,導致產生大量交易日誌。

SQL Server 2008 :
方法一
1.將資料庫還原模式切換至簡單模式  (簡單模式不會記錄交易紀錄,所以交易紀錄會被截斷)
2.執行資料庫壓縮
3.將資料庫還原模式切換至完整模式(恢復正常交易紀錄)

方法二
1.將資料庫還原模式切換至簡單模式
2.在要清除交易日誌的資料庫上新增查詢

select * from sys.database_files
查出NAME後
3.改下DBCC命令

DBCC SHRINKFILE ( 帶入剛剛查到的NAME , 2)


以往我們都只有做完整備份,而完整備份會將資料庫以及交易日誌進行完整備份,
但是不會進行交易日誌截斷,所以會有越備份越大的問題。

而做了完整備份卻沒有做交易紀錄備份跟資料庫壓縮,自然交易紀錄不會被截斷,當然會越長越大。

所以標準做法應該是在維護計畫中,做完完整備份後,再做一次交易紀錄備份,
把交易紀錄截斷,然後再接著執行資料庫壓縮,就不會發生爆資料庫的問題了。



未完待續..

資料庫複寫設定筆記

這是土法煉鋼出來的筆記,或許有誤。

1.資料庫基礎結構 必須有完善的主鑰 P-Key (快照式除外)
2.複寫端資料庫還原模式最好選簡單模式或是限制交易日誌大小,不然很快就爆了。
3.代理程式帳密必須一致。
4.快照式複寫的複寫端無法寫入但是可以讀取,交易式可以在複寫端讀寫。



SQL 2008 資料庫鏡像(無仲裁)


1. 來源資料庫 完整備份及交易日誌備份 並複製到 鏡射端

2. 鏡射資料庫 還原完整備份 還原狀態選 RESTORE WITH NORECOVERY  記得覆蓋資料

3. 鏡射資料庫 還原交易日誌備份 還原狀態選 RESTORE WITH NORECOVERY

4. 啟動鏡射設定精靈




可能需求:
A.資料庫的DNS對應,可由修改Hosts檔達成
B.出現1418錯誤,確認不是防火牆問題可以將 DB server, Agent權限提升後解決

2011年10月19日 星期三

Mac OSX Kernel info

http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html


The BSD portion of the Mac OS X kernel is derived primarily from FreeBSD, a version of 4.4BSD that offers advanced networking, performance, security, and compatibility features. BSD variants in general are derived (sometimes indirectly) from 4.4BSD-Lite Release 2 from the Computer Systems Research Group (CSRG) at the University of California at Berkeley. BSD provides many advanced features, including the following: Preemptive multitasking with dynamic priority adjustment. Smooth and fair sharing of the computer between applications and users is ensured, even under the heaviest of loads. Multiuser access. Many people can use a Mac OS X system simultaneously for a variety of things. This means, for example, that system peripherals such as printers and disk drives are properly shared between all users on the system or the network and that individual resource limits can be placed on users or groups of users, protecting critical system resources from overuse. Strong TCP/IP networking with support for industry standards such as SLIP, PPP, and NFS. Mac OS X can interoperate easily with other systems as well as act as an enterprise server, providing vital functions such as NFS (remote file access) and email services, or Internet services such as HTTP, FTP, routing, and firewall (security) services. Memory protection. Applications cannot interfere with each other. One application crashing does not affect others in any way. Virtual memory and dynamic memory allocation. Applications with large appetites for memory are satisfied while still maintaining interactive response to users. With the virtual memory system in Mac OS X, each application has access to its own 4 GB memory address space; this should satisfy even the most memory-hungry applications. Support for kernel threads based on Mach threads. User-level threading packages are implemented on top of kernel threads. Each kernel thread is an independently scheduled entity. When a thread from a user process blocks in a system call, other threads from the same process can continue to execute on that or other processors. By default, a process in the conventional sense has one thread, the main thread. A user process can use the POSIX thread API to create other user threads. SMP support. Support is included for computers with multiple CPUs. Source code. Developers gain the greatest degree of control over the BSD programming environment because source is included. Many of the POSIX APIs.

2011年7月22日 星期五

FreeBSD VLAN Setup

/etc/rc.conf


cloned_interfaces="vlan01 vlan02 vlan03 vlan04 vlan05 vlan06"
ifconfig_em0="up"
ifconfig_vlan01="inet 10.10.10.1 netmask 255.255.255.0 vlan 11 vlandev em0"
ifconfig_vlan02="inet 10.10.20.1 netmask 255.255.255.0 vlan 22 vlandev em0"
ifconfig_vlan03="inet 10.10.30.1 netmask 255.255.255.0 vlan 33 vlandev em0"
ifconfig_vlan04="inet 10.10.40.1 netmask 255.255.255.0 vlan 44 vlandev em0"
ifconfig_vlan05="inet 10.10.50.1 netmask 255.255.255.0 vlan 55 vlandev em0"
ifconfig_vlan06="inet 10.10.60.1 netmask 255.255.255.0 vlan 66 vlandev em0"

2011年4月11日 星期一

Install oracle vm 's guest addtions on centos using yum

1. yum install gcc -y
2. yum install kernel-devel -y
3. export KERN_DIR=/usr/src/kernels/xxxxxxx
4. execute guest addtions on temp dir

2010年8月22日 星期日

Honda Accord 7th 耗材及規格記錄

近燈9006(HB4)
遠燈9005(HB3)
霧燈H11
近遠霧燈泡最低限度要有防/降紫外線設計車燈罩才不會很快就霧化
前方小燈(示寬燈) +方向燈 * 1157A / 1157NA / 7528雙蕊 
*方向燈更換為LED 建議換繼電器才不會快閃
車門燈 T10
後行李廂燈 T10
室內燈 雙尖31mm

倒車燈 T15(未確認)
第三剎車燈 7440(T20單蕊) W21W
後小燈+剎車燈 7443 / 7443-SCK / 7443LL (T20雙蕊)
後小燈 T10
後方向燈 7440NA / WY21W (T20單蕊)/21W
*方向燈更換為LED 建議換繼電器才不會快閃
參考 amazon.JP  輕輕撥一下會閃三次< 閃爍的頻率跟速度都可以調整


------
7440NA = WY21W =W21W
7443 = 7443-SCK = 7443LL
9006 = HB4
9005 = HB3
1157A = 1157NA = 7528
------
電瓶規格 55D23L(目前使用75D23L)

發電機輸出120A


DB1481-MKT 前
DB1230-MKT 後
上面兩種煞車皮很吵粉塵也很多,磨耗完後換回原廠,煞車感覺比較軟

輪胎 205/60/R16
CPC2 96V
CPC5
CEC5 (滾動噪音比CPC5大聲..整個超後悔)
Dunlop VEURO VE302 

輪胎 215/55/R17
Bluearth A34

雨刷規格
原廠 左26 右18
可升級為左28 右18(加壓雨刷不建議放大會有聲音)

長寬高:4815×1820×1455mm