Posts

Showing posts from 2019

SQL Query Monitor

SELECT s.session_id, r.status, r.blocking_session_id 'Blk by', r.wait_type, wait_resource, r.wait_time / (1000 * 60) 'Wait M', r.cpu_time, r.logical_reads, r.reads, r.writes, r.total_elapsed_time / (1000 * 60) 'Elaps M', Substring(st.TEXT,(r.statement_start_offset / 2) + 1, ((CASE r.statement_end_offset   WHEN -1 THEN Datalength(st.TEXT) ELSE r.statement_end_offset   END - r.statement_start_offset) / 2) + 1) AS statement_text, Coalesce(Quotename(Db_name(st.dbid)) + N'.' + Quotename(Object_schema_name(st.objectid, st.dbid)) + N'.' + Quotename(Object_name(st.objectid, st.dbid)), '') AS command_text, r.command, s.login_name, s.host_name, s.program_name, s.last_request_end_time, s.login_time, r.open_transaction_count FROM sys.dm_exec_sessions AS s JOIN sys.dm_exec_requests AS r ON r.session_id = s.session_id CROSS APPLY sys.Dm_exec_sql_text(r.sql_handle) AS st WHERE r.session_id != @@SPID ORDER BY r.cpu_time de

Purge Device Queue

เมื่อใช้งานไปนานๆ แล้วเจอปัญหาช้า ลองมาทำการลบข้อมูลการพิมพ์ออกจากระบบ จะทำให้ระบบทำงานได้เร็วยิ่งขึ้น Menu :: Tools / Device Management / Device Queue / Purge Device Queue  แล้วทำการรันโปรแกรมดังกล่าว แต่เราสามารถเข้าไปดูข้อมูล Device Queue ได้ที่เมนู Device Queue ว่ามีเยอะมากขนาดไหน เพราะเนื่องจากบางทีใช้เวลานานมาก

Web was slow but SQL Management Studio is fast.

Run this command on the database. DBCC DROPCLEANBUFFERS  DBCC FREEPROCCACHE

Change Autorization of PDM Client

Image
Go to Administrator Program of PDM Client Go to Menu :: Help > About  Solidwork PDM Administrator Change Client Type and Press OK Log off and Login again.

WebApi Concept

Image
API Description Request body Response body GET /api/TodoItems Get all to-do items None Array of to-do items GET /api/TodoItems/{id} Get an item by ID None To-do item POST /api/TodoItems Add a new item To-do item To-do item PUT /api/TodoItems/{id} Update an existing item   To-do item None DELETE /api/TodoItems/{id}     Delete an item     None None Credit by  https://docs.microsoft.com/th-th/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.0&tabs=visual-studio

Weekday Algorithm

select getdate() as 'Current Date' ,datepart(dw,getdate()) as 'Day of Week (Sun=1)' ,dateadd(day,-(datepart(dw,getdate()) - 1),getdate()) as 'FirstDay'  ,dateadd(day,(7 - datepart(dw,getdate())),getdate()) as 'EndDay'

How to know about logon server

Command use: // Logon to Server Name?? # echo %logonserver% // Logon by User?? # whoami // Overall # set

Can't Activate License Key

Problem::      The Entitlement ID that you entered is already registered.  To add a Entitlement ID that was removed, click Show Removed Entitlement IDs. Solution ::  - Go to C:ProgramData\Veritas Shared\Licenses\Backup Exec\20.0 - Remove licenses have been same key. - Activate License again.

Export VM Problem

Problem :  Export VM by VMWare Console (Web) and download by browser that network error. Solution :  #Install ovftool on the platform of your choice https://www.vmware.com/support/developer/ovf/ #Syntax For the command. You will notice that I am exporting thin-provisioned .vmdk files ovftool -dm=thin "vi:// / " .ova For username, type root and press enter. For password, type the password and press enter. #Example ovftool -dm=thin "vi://xx.xx.xx.xx/vmname" vmname.ova When I tried importing this via the GUI, I noticed that at the final window of the Create/Register VM wizard, I would see an error that states  "A required disk image is missing." It did allow me to click Finish and the import would work without any issues. However, I did not want the error so I found that it was b/c the .ovf file contains references to the nvram file. The steps below walk you through extracting the .ova file, editing the .ovf file by removing any

Jquery Call WebServices

1. Web Service = HelloService.asmx     <System.Web.Script.Services.ScriptService()>     Public Class Employee         Public EmpFirstName As String         Public EmpLastName As String     End Class     <WebMethod()>     Public Function GetEmployeeDetail() As Object         Dim objEmp As New Employee()         objEmp.EmpFirstName = "Tech"         objEmp.EmpLastName = "Illumination"         Return objEmp         'Return "Hello World"     End Function 2. Page = Default.aspx     <input type="button" id="btnCallService" value="GetEmployeeDetail" />     <label id="lblData"></label> 3. JQuery = Default.asxp      <script src="Scripts/jquery-3.3.1.js"></script>     <script type="text/javascript">         $(function() {             $('#btnCallService').click(function() {                 $.ajax({                     ty

HP 3PAR - ReClaim Space

- Delete Virtual Volume - Compact CPGs ที่ได้ทำการลบ Virtual Volume ไป - Finished - วิธีการตรวจสอบว่า Storage ทำการ Compact ได้หมดแล้วหรือยังนั้น ให้ดูตรง Uninitialized ว่าคืนพื้นที่กลับมาที่ Initialized หรือไม่ # showsys -space ------------ System Capacity (MB) ------------- Total Capacity : 8536064 Allocated : 2808832 Volumes : 0 Non-CPGs : 0 User : 0 Snapshot : 0 Admin : 0 CPGs (TPVVs & TDVVs & CPVVs) : 0 User : 0 Used : 0 Unused : 0 Snapshot : 0 Used : 0 Unused : 0 Admin :