1. Open Jmeter.bat
2. Creating a Thread Group Element
SELECT @@servername as servername,getdate() as TimeCollect,sqlserver_start_time, DATEDIFF(Day, sqlserver_start_time,getdate()) as sql_uptime_day ,
DATEDIFF(hour, sqlserver_start_time,getdate()) as sql_uptime_hours,DATEDIFF(minute, sqlserver_start_time,getdate()) as sql_uptime_minutes,
DATEDIFF(second, sqlserver_start_time,getdate()) as sql_uptime_second,DATEDIFF(millisecond, sqlserver_start_time,getdate()) as sql_uptime_milisecond
FROM sys.dm_os_sys_info;
UPDATE mysql.user SET host='%' WHERE user='root';
FLUSH PRIVILEGES;select * from pembelian order by KODE_PEMBELIAN; select * from pembelian order by KODE_PEMBELIAN offset 5 rows;
select * from pembelian order by KODE_PEMBELIAN offset 5 rows FETCH NEXT 2 ROWS ONLY; select * from pembelian order by KODE_PEMBELIAN offset 0 rows FETCH NEXT 2 ROWS ONLY;
https://www.sqlservertutorial.net/sql-server-basics/sql-server-offset-fetch/
SELECT @@servername as ServerName,db_name() as DbName, o.type_desc AS Object_Type
, s.name AS Schema_Name
, o.name AS Object_Name,object_id
, o.name AS ObjectName
FROM sys.objects o
JOIN sys.schemas s
ON s.schema_id = o.schema_id
WHERE o.type NOT IN ('S' --SYSTEM_TABLE
,'PK' --PRIMARY_KEY_CONSTRAINT
,'D' --DEFAULT_CONSTRAINT
,'C' --CHECK_CONSTRAINT
,'F' --FOREIGN_KEY_CONSTRAINT
,'IT' --INTERNAL_TABLE
,'SQ' --SERVICE_QUEUE
,'TR' --SQL_TRIGGER
,'UQ' --UNIQUE_CONSTRAINT
)
ORDER BY Object_Type
, SCHEMA_NAME
, Object_Name
-- Query Get CPU Utilization History for last 60 minutes SQL Server
DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info);
SELECT TOP(60) SQLProcessUtilization AS [SQL Server Process CPU Utilization],
SystemIdle AS [System Idle Process],
100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization],
DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] , @@SERVERNAME as ServerName,@@servicename as ServiceName
FROM (
SELECT record.value('(./Record/@id)[1]', 'int') AS record_id,
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')
AS [SystemIdle],
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]',
'int')
AS [SQLProcessUtilization], [timestamp]
FROM (
SELECT [timestamp], CONVERT(xml, record) AS [record]
FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
AND record LIKE '%<SystemHealth>%') AS x
) AS y
ORDER BY record_id DESC;
SELECT TOP 10
1. Check Database ID on Linked Server
select @@Servername as LocalServer,@@servername as ServerName_Link, name as dbname,database_id from sys.databases