Monday, September 27, 2021

.::: SQL Server: how to simulate and catch deadlock :::.


1. Create database 
create database dead_lock_lab
go 

2. create table & row data 
USE dead_lock_lab;
 
CREATE TABLE dbo.invoices (
   id int NOT NULL,
   num nvarchar(20) NOT NULL,
   customer nvarchar(100) NOT NULL,
   created_at datetime NOT NULL,
   updated_at datetime NOT NULL,
   CONSTRAINT PK_invoices PRIMARY KEY (id)
);
 

Thursday, September 23, 2021

.::: How to Sample Simulation Blocking SQL Server & Trouble shoot :::.

 
1. Login to database and create database

create database blocking;
go 

2. Open 1 Session to New Quary Windows

Begin Tran ;

select 'query 1'

CREATE TABLE ##Employees (
    EmpId INT IDENTITY,
    EmpName VARCHAR(16),
    Phone VARCHAR(16)
)
GO

INSERT INTO ##Employees (EmpName, Phone)
VALUES ('Martha', '800-555-1212'), ('Jimmy', '619-555-8080')
GO

CREATE TABLE ##Suppliers(
    SupplierId INT IDENTITY,
    SupplierName VARCHAR(64),
    Fax VARCHAR(16)
)
GO

INSERT INTO ##Suppliers (SupplierName, Fax)
VALUES ('Acme', '877-555-6060'), ('Rockwell', '800-257-1234')
GO

 

Thursday, September 16, 2021

.::: Install PAF (PostgreSQL Automatic Failover ) on centos7 ( base on pacemaker, pcs, corosys ):::.

 
A. Install PAF 

1. Prepare Node 
Node01 
10.10.10.241

Node02
10.10.10.242

Ip Virtual 
10.10.10.243

2. Install pacemaker, corosys, pacemaker & configuration 
insttal pcsd
https://teguhth.blogspot.com/2018/08/how-to-install-and-configuration-pcs.html

Popular Posts