Sep 3, 2014

Delete all files and subfolders under specify folder

-- delete all files and subfolders under specify folder.
FOR /D %%p IN ("D:\temp\*.*") DO rmdir "%%p" /s /q
del /q /f D:\temp\*

Oct 18, 2012

Oracle Performance Tunning Practice - INDEX RANGE SCAN with CPU high utilization

1. set autotrace on  and execute sql .
   Using index by "INDEX RANGE SCAN"
2. Through AWR report found the sql is top1 in  SQL ordered by CPU Time part.
3.  alter session set events '10046 trace name context forever, level 8';
    Execute sql again  and found  STAT line for the traced query contains 'cnt=xxx' problem.
4. Check table records found the value are skewed cause by program bug.
5. Remove abnormal data and  analyze index column .

  execute dbms_stats.gather_table_stats('xxx','xxxxxxx',method_opt=>'FOR COLUMNS xxx');
6. High CPU utilization was solved.
    

Sep 6, 2012

SQL Server Error: 5132 ,Error: 17207 when attach DB

SQL Server Error: 5132 , Error: 17207, Severity: 16
Loss SQL Server 2005 .LDF file , when try to attach MDF/NDF facing problem.
Step 0) Copy MDF/LDF to another location for backup purpose.
Step 1) Create DB with same DB/MDF/NDF/LDF Name
Step 2) Stop SQL Service
Step 3) Replace new DB MDF/NDF file with old MDF/NDF file
Step 4) Start SQL Server
Step 5) SQL Server 2005

ALTER DATABASE  YourDB SET EMERGENCY
go
select * from sysdatabases
go
ALTER DATABASE YourDB SET SINGLE_USER
go
DBCC CHECKDB(YourDB, REPAIR_ALLOW_DATA_LOSS)
go
ALTER DATABASE SFC SET MULTI_USER

CheckDB complained about the missing log then went and rebuilt the log 


#Remark - SQL Server 2000 update system tables
EXEC sp_configure 'allow updates'1
RECONFIGURE WITH OVERRIDE;
 
-- do some modification to system tables
 -- Ex.Put the DB in suspect mode:
 -- update sysdatabases set status = 32768 where name ='YourDB'
 
EXEC sp_configure 'allow updates'0
RECONFIGURE WITH OVERRIDE;

Aug 31, 2012

帶狀皰疹

水痘與帶狀皰疹同樣都是由同一病毒所引起。水痘是原發性感染,而帶狀皰疹是原來潛伏性感染的再活動。此病毒能夠逃避身體的免疫反應 , 即使在正常的宿主中。可能再出現在日後的生活中,特別是利用免疫力降低時出現 

1. 治療必須儘早開始, 我的經驗是看診時皮膚科醫生提到三天之內塗藥與吃藥治療最有效,超過此時間治療比較無效,就需等二到三星期內消失.

2. 帶狀皰疹是否會傳染?若對水痘無免疫力者,接觸帶狀皰疹可能會感染到水痘。而對已有水痘抵抗力者,則絲毫無損。也就是說帶狀皰疹會傳染,但只傳染給一些對水痘沒有免疫力者,而受感染者亦只是發水痘而已。 

3. 帶狀皰疹俗稱「皮蛇」,實因其發皰疹分佈情形成帶狀而與「皮蛇」相似而命名。看過以上帶狀皰疹的病因後,可見砍「皮蛇」能治療此病是無稽之談。

 4. 「蛇」環繞全身就沒命了嗎?帶狀皰疹大多只發生於身體單側,左邊或右邊,只有約二%~十%會超過範圍到另一側,甚至全身散佈,這樣情況大都是患者原來就有其它惡性疾病,或免疫不全,其死亡的機率當然較高。因此,「沒命」的原因是來自原有的疾病,而非被「蛇」纏死了。

Jul 13, 2012

讓身體內蠢蠢欲動的癌細胞多多睡覺

讓身體內蠢蠢欲動的癌細胞多多睡覺。 1. 咖哩的重要成份「薑黃」(抗癌成份是「薑黃素」) 2. 辣椒(抗癌成份是「辣椒素」) 3. 姜(抗癌成份是「薑油」) 4. 綠茶(抗癌成份是「兒茶素」) 5. 大豆(抗癌成份是「異黃酮」) 6. 蕃茄(抗癌成份是「茄紅素」) 7. 葡萄(抗癌成份是「白黎蘆醇」) 8. 大蒜(抗癌成份是「硫化物」) 9. 高麗菜(抗癌成份是「indole」) 10. 花椰菜(抗癌成份是「硫化物」)

May 24, 2012

sharepoint 2010 user name not updating after AD display name changed

sharepoint 2010 user name not updating after AD display name changed Try using following step to solve it.: 1. Open "Sharepoint 2010 Management Shell" 2. Set-SPUser -identity "[domain]\[useraccount]” -SyncFromAD -web http://sharepointwebsite