A. Check Table SQL Server
select * from barang;
B. Install & Enable SSRS Service
Monday, December 27, 2021
.::: Performance Compare 4 CPU vs 1 CPU In SQL Server Using Execution Plan (Setting MaxDop Max Degree Of Parallelism) :::.
1. Download & restore AdventureWorks2019
2. Open New Query and run Query below & Execute
set Statistics io, time on
use AdventureWorks2019
-- Query running on 4 logical processors
Tuesday, December 21, 2021
.::: Lab Integration SSIS with SQL Server using SQL Jobs Agent :::.
.::: Configure Enable NTP Server & Client Windows Server using Group Policy Editor :::.
.::: Cannot Remote Desktop Connection : An Authentication error has Occured. Due to CredSSP Encryption Oracle Remedian :::.
1. Open Registry
2. Open Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters
3. Double-click the AllowEncryptionOracle DWORD to open its Edit DWORD window.
Enter the value ‘2‘ in the Value data text box, and press the OK button.
Friday, December 10, 2021
Wednesday, November 24, 2021
.::: Install Database Oracle 19C in Linux Centos 7 :::.
Friday, October 22, 2021
.::: Latihan SSIS convert csv file to SQL / MSSQL :::.
.::: Configure log shipping SQL Server :::.
to monitor log shipping
http://teguhth.blogspot.com/2023/09/monitor-transaction-log-shipping-using.html
1. Enable Log Shipping on Database 1
Wednesday, October 13, 2021
Monday, September 27, 2021
.::: SQL Server: how to simulate and catch deadlock :::.
Thursday, September 23, 2021
.::: How to Sample Simulation Blocking SQL Server & Trouble shoot :::.
Thursday, September 16, 2021
.::: Install PAF (PostgreSQL Automatic Failover ) on centos7 ( base on pacemaker, pcs, corosys ):::.
Thursday, September 2, 2021
.::: How To Set Up Redis as a Cache for MariaDB / MySQL with PHP :::.
Tuesday, August 31, 2021
.::: How To Install Database Redis on Centos 7 :::.
Thursday, August 5, 2021
.:: How To Replicate Set (Redundant /Mirroring) MongoDB 5.0 on Centos 7 :::.
.::: Install MongoDB 5.x on Centos/Redhat 7 using repository :::.
Monday, August 2, 2021
.::: Change Standby Slave Database to Master/Normal on PostgreSQL ERROR: cannot execute CREATE DATABASE in a read-only transaction :::.
.::: How to Setting Streaming replication Redundant / Mirroring (Master Slave) postgreSQL 13 on Centos 7 :::.
Saturday, July 24, 2021
.::: Install postgreSQL Linux using Repository Centos 7 & PostgreSQL 14 :::.
Thursday, July 8, 2021
.::: Importing Exsiting server or cluster MySQL/MariaDB using Severalnines :::.
1. Generate an SSH key to be used by ClusterControl when connecting to all managed hosts. In this example, we are using the root user to connect to the managed hosts. To generate an SSH key for the root user
Wednesday, July 7, 2021
.::: Install & Configuration Cluster control Severalnines for HA MariaDB, MySQL :::.
1. Manually import the Severalnines repository public key into your RPM keyring:
[root@teguhth data]# wget http://repo.severalnines.com/severalnines-repos.asc
[root@teguhth data]# rpm --import severalnines-repos.asc
[root@teguhth data]#
Tuesday, July 6, 2021
.::: How to Create HA (High Availability) MariaDB/MySQL uting Galera Cluster on Linux (Include trouble shoot Crash case :::.
1. Disable selinux
[root@teguhth01 ~]# sestatus
SELinux status: disabled
[root@teguhth01 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@teguhth01 ~]#
Wednesday, June 30, 2021
.::: Implementation Store Procedure on Datawarehouse SQL Server ( Sample table barang, customer, suplier, pasok & pembelian) :::.
1. add table barang
-- if using Query SQL
select * from barang;
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-01','RICE COOKER','BUAH',20);
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-02','LEMARI ES','UNIT',8);
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-03','TELEVISI','UNIT',30);
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-04','RADIO/TAPE','BUAH',35);
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-05','KOMPUTER','UNIT',28);
insert into barang(KODE_BARANG,NAMA_BARANG,SATUAN_BARANG,STOK_BARANG) values('ELK-06','KIPAS ANGIN','BUAH',38);
select * from barang;
.::: Create table Inventory Datawarehouse SQL Server Original (Converting script from SQL Studio :::.
A. Create Database & Table
create database teguhth
go
1. Table barang
-- table barang with index
CREATE TABLE [dbo].[barang](
[KODE_BARANG] [char](6) NOT NULL,
[NAMA_BARANG] [varchar](25) NULL,
[SATUAN_BARANG] [varchar](20) NULL,
[STOK_BARANG] [decimal](4, 0) NULL,
PRIMARY KEY CLUSTERED ([KODE_BARANG] ASC))
Monday, June 28, 2021
.::: Create Stored Procedure & Function Using SQL Server (Sample database moonton Mobile Legend) :::.
create database mobile_legend
go
Thursday, June 24, 2021
.::: Basic Store Procedure SQL Server :::.
1. Sample 1
-- SQL Query 1
select kode_barang, stok_barang from barang;
-- Store Procedure 1
create procedure kodestokbarang
as
select kode_barang, stok_barang from barang;
Thursday, May 20, 2021
.::: Create Linked Server MSSQL to use Open Query (to another MSSQL) insert, update, delete :::.
2. create Linked Server
Server Objects -> Linked Servers -> New Linked Server
General
Linked Server: MSSQL
Server Type: SQL Server
or
Linked Server: MSSQL\instance
Linked Server: IP_SQLServer\instance
.::: Create Linked Server MSSQL to use Open Query (Oracle) insert, update, delete :::.
2. create Linked Server
Server Objects -> Linked Servers -> New Linked Server
General
Linked Server: Oracle
Provider: Oracle Provider for OLE DB
Product name: Oracle
Data Source: localhost:1521/tka
Monday, May 3, 2021
.::: Create Linked Server MSSQL to use Open Query (MariaDB/MySQL) insert, update, delete :::.
1. Konfiguration ODBC Data Source (64)
system DSN > Add >> MySQL ODBC 5.3 ANSI Driver
Wednesday, April 14, 2021
.::: How to backup and restore table & database Oracle :::.
A. Backup & Restore table Oracle
1. Backup Table Database oracle
exp aisyah/hanin@tka tables=pasok file="D:\labolatorium\oracle\backup\pasok.dmp"
2. Restore Table Oracle
imp teguh/triharto@tka
imp teguh/triharto@tka tables=pasok file="D:\labolatorium\oracle\backup\pasok.dmp"
Thursday, April 8, 2021
.::: Sample Aljabar(Algebra) Iner join, normal join, equal join(=),left outer join and right outer join In SQL :::.:::.
1. join/normal join/equal join(=)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SELECT table-1.field-1,...,table-1.field-n,
table-2.field-1,...,table-2.field-n,
table-n.field-1,...,table-n.field-n,
FROM table-1,...,table-n
WHERE table-1.field_PK = table-2.field_PK AND
table-2.field_PK = table-n.field_PK
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Wednesday, April 7, 2021
.::: Sample Aljabar(Algebra): union(gabungan), intersection(irisan), MINUS (difference), distinct (proyeksi) In SQL :::.
1. UNION (Combine/gabungan)
union bertujuan menggabungkan dua query atau lebih menjadi satu kesatuan query dengan syarat query/subquery yang akan digabung harus memiliki domain kolom yang sama
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SELECT field 1,...,field n,[agregate function]
FROM table
[WHERE] [criteria]
[GROUP BY] [field 1,...,field n]
UNION
SELECT field 1,...,field n,[agregate function]
FROM table
[WHERE] [kriteria]
[GROUP BY] [field 1,...,field n]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Tuesday, April 6, 2021
.::: Sample Query, Sub Query from one table or More in SQL :::.
.::: Sample min, max, avg, sum, count, Group by, order by, Having, where, comparison (=,<>,>,<,>= atau <=), Between, In, like / not like on Grouping, Sorting & Criteria Data SQL :::.
1. pengelompokan data (group by) dan aggregation function
select * from PASOK;
select KODE_BARANG as KD_BRG, min(JUMLAH_PASOK) as MINIMUM_PASOK from PASOK group by KODE_BARANG;
select KODE_BARANG as KD_BRG, max(JUMLAH_PASOK) as MAXIMUM_PASOK from PASOK group by KODE_BARANG;
select KODE_BARANG as KD_BRG, avg(JUMLAH_PASOK) as AVERAGE_PASOK from PASOK group by KODE_BARANG;
select KODE_BARANG as KD_BRG, sum(JUMLAH_PASOK) as JUMLAH_PASOK from PASOK group by KODE_BARANG;
select KODE_BARANG as KD_BRG, count(JUMLAH_PASOK) as COUNT_PASOK from PASOK group by KODE_BARANG;
Tuesday, March 30, 2021
.::: How To Add Column, Update, Insert & Delete row table on SQL example MariaDB :::.
Thursday, March 18, 2021
.::: Migration Oracle to MSSQL using SQLines Data Migration :::.
A. Prepare software migration
1. Download SQLines Data & extract
http://www.sqlines.com/download
SQLines Data is a tool for data transfer, schema conversion and data migration validation/testing.
Note:
SQLines Data tool does not convert views, stored procedures, functions, and triggers, use SQLines SQL Converter to convert them.
2. Download SQLines SQL Converter (Optional)
SQLines SQL Converter
SQLines SQL Converter helps you convert database schema (DDL), queries and DML statements, views, stored procedures, packages, functions and triggers.
Wednesday, March 17, 2021
.::: Migration MariaDB/MySQL to MSSQL using SQLines Data Migration :::.
.::: Migration MariaDB/MySQL to Oracle using SQLines Data Migration :::.
1. Download SQLines Data & extract
http://www.sqlines.com/download
SQLines Data is a tool for data transfer, schema conversion and data migration validation/testing.
Note:
SQLines Data tool does not convert views, stored procedures, functions, and triggers, use SQLines SQL Converter to convert them.
2. Download SQLines SQL Converter (Optional)
SQLines SQL Converter
SQLines SQL Converter helps you convert database schema (DDL), queries and DML statements, views, stored procedures, packages, functions and triggers.
Tuesday, March 9, 2021
.::: Migration SQL Server (MSSQL) to Oracle using SQLines Data Migration :::.
Monday, March 8, 2021
.::: Migration SQL Server (MSSQL) to MariaDB/MySQL using SQLines Data Migration :::.
Tuesday, March 2, 2021
.::: Migration MariaDB / MySQL to Oracle Using SQL Developer and Metode Copy to Oracle (Only Table) :::.
A. Pre Upgrade
1. Download SQL Developer & Extract
2. To connect to third-party database (MySQL, Microsoft SQL Server, Sybase Adaptive Server, Microsoft Access, IBM DB2) using SQL Developer, we need jTDS driver. You can download needed jTDS driver from following link. http://sourceforge.net/projects/jtds/files/jtds/1.2/jtds-1.2-dist.zip/download . Extract the dowloaded zip file named jtds-1.2-dist.zip
Sunday, February 28, 2021
.::: Migration SQL Server to Oracle Using SQL Developer and Metode Copy to Oracle (Only Table) :::.
A. Pre Upgrade
1. Download SQL Developer & Extract
2. To connect to third-party database (MySQL, Microsoft SQL Server, Sybase Adaptive Server, Microsoft Access, IBM DB2) using SQL Developer, we need jTDS driver. You can download needed jTDS driver from following link. http://sourceforge.net/projects/jtds/files/jtds/1.2/jtds-1.2-dist.zip/download .
Extract the dowloaded zip file named jtds-1.2-dist.zip
3. Click “Tools” and then “Prefenrences”.
.::: Migration SQL Server to Oracle Using SQL Developer with Migration Metode :::.
A. Pre Upgrade
1. Download SQL Developer & Extract
2. To connect to third-party database (MySQL, Microsoft SQL Server, Sybase Adaptive Server, Microsoft Access, IBM DB2) using SQL Developer, we need jTDS driver. You can download needed jTDS driver from following link. http://sourceforge.net/projects/jtds/files/jtds/1.2/jtds-1.2-dist.zip/download .
Extract the dowloaded zip file named jtds-1.2-dist.zip
3. Click “Tools” and then “Prefenrences”.
Saturday, February 27, 2021
.::: Migration Oracle to MariaDB/MySQL using SQLines Data Migration :::.
A. Prepare software migration
1. Download SQLines Data & extract
http://www.sqlines.com/download
SQLines Data is a tool for data transfer, schema conversion and data migration validation/testing.
Note:
SQLines Data tool does not convert views, stored procedures, functions, and triggers, use SQLines SQL Converter to convert them.
SQLines SQL Converter
SQLines SQL Converter helps you convert database schema (DDL), queries and DML statements, views, stored procedures, packages, functions and triggers.
Saturday, January 30, 2021
.::: Migration Oracle Database to Microsoft SQL Server (MSSQL) using SSMA for Oracle :::.
A. Pre Migration
1. Download & Install SQL Server Migration Assistant for Oracle
SSMAforOracle_8.16.0.msi
SSMAforOracleExtensionPack_8.16.0.msi
.::: Configure Microsoft Distributed Transaction Coordinator (MSDTC). Trouble shoot Failed to restart the MS DTC Service :::.
Integration Services is based on Microsoft Distributed Transaction Coordinator (MSDTC). The MSDTC service is a component of modern versions of Microsoft Windows that are responsible for coordinating transactions that span multiple resource managers, such as databases, message queues, and file systems.
MSDTC needs to be configured only if your database and the Perspective application reside on separate servers.
Configure MSDTC
1. From Start, search for dcomcnfg and press Enter on your keyboard.
Friday, January 29, 2021
.::: Migration Microsoft SQL Server to MariaDB/MySQL using MySQL WorkBench :::.
A. Pree
1. capture mysql for destination/Target
show databases
2. capture MSSQL for source
use teguhth
select * from INFORMATION_SCHEMA.TABLES
exec sp_columns barang
select * from barang
Friday, January 15, 2021
.::: Migration MySQL/MariaDB to Microsoft SQL Server (MSSQL) :::.
Pre Migration
1. Download & Install SQL Server Migration Assistant for MySQL
https://docs.microsoft.com/id-id/sql/ssma/sql-server-migration-assistant?view=sql-server-2017
2. Download Driver Connector ODCB ( version 5.2 - 5.3.3) & Install
https://dev.mysql.com/downloads/connector/odbc/
3. Optional Backup Database MySQL/MariaDB
Wednesday, January 13, 2021
.::: Check Table Capacity & Size Report SQL Server on LocalServer & Linked Server (Open Query) :::.
1. Check Database_ID
select @@Servername as LocalServer,@@servername as ServerName_Link, name as dbname,database_id from sys.databases
select @@Servername as LocalServer,@@servername as ServerName_Link, name as dbname,database_id from sys.databases where name = 'teguhth';
Popular Posts
-
Sertifikasi profesional, kadang hanya disebut dengan sertifikasi atau kualifikasi saja, adalah suatu penetapan yang diberikan oleh ...
-
SQL atau Structured Query Language) adalah sebuah bahasa yang digunakan untuk mengakses data dalam basis data relasional. Bahasa ini sec...
-
bagaimana cara mengubah hostid di Solaris The Hostid is a globally unique ID for a Sun Solaris Machine. Sometimes, you need to change t...
-
DNSPerf and ResPerf are free tools developed by Nominum that make it simple to gather accurate latency and throughput metrics for Domain ...
-
1. Check Host ID Solaris The Hostid is a globally unique ID for a Sun Solaris Machine. Sometimes, you need to change this hostid for ...