I will show how to round up a number by protecting 2 decimal. When I use round or ceil function, I can not have correct result. I want to round a number upwards with calculate 2 decimal. I want result like below examples. 1.2445 > 1.25 1.21 > 1.21 1.521 > 1.53 1.1 > 1.1…
How to Create Linked Server From SQL Server To SQL Server Database
You can connect another SQL Server database or different type database from SQL Server database with Linked Server feature. You can use below operations to create new linked server for SQL Server database to SQL Server database. Create Linked Server Steps Create a user on remote database to use connection and give permission on which…
How to Find Required Missing Indexes For Performance Tuning in SQL Server Database
Indexes play vital role for performance tuning on database systems. When you adjust correct indexes on tables, queries can run faster. Otherwise, a proper index can improve the performance and a bad index can hamper the performance. You can find missing indexes with below query. But, result of the query do not mean that you…
Check Service Status With Python on OEL 7 / Centos 7
I write a python code to check mysql service open or close. It is simple and you can change service_name parameter in the code to check another services. You can download from here check_service_status.py Below code maybe can not run because of python language format is tab structure. You can use with download original code…
Update Another Column On The Same Table With Trigger While Updating Table in Oracle
If you want to do update another column when execute an update on table, you can use before update trigger. If you use after update trigger, you can get some errors. if you use pragma autonomous_transaction parameter as declare in trigger you can get errors like that are “ORA-00060: deadlock detected while waiting for resource”, “ORA-06512:…
Change Hostname on OEL 7 CentOS 7
You can use hostnamectl command to list and change hostname of operating system on OEL 7 or CentOS 7 version. List Hostname Status [root@localhost ~]# hostnamectl Static hostname: localhost.localdomain Icon name: computer-vm Chassis: vm Machine ID: 6f021291e2384a219e1f23ca39eadc9a Boot ID: ec195c69cfde417b88b86f4d7419cf24 Virtualization: vmware Operating System: Oracle Linux Server 7.3 CPE OS Name: cpe:/o:oracle:linux:7:3:server Kernel: Linux 4.1.12-61.1.28.el7uek.x86_64…
PostgreSQL Upgrade From 9.5 Version To 9.6 Version With PG_UPGRADE
pg_upgrade (formerly called pg_migrator) allows data stored in PostgreSQL data files to be upgraded to a later PostgreSQL major version without the data dump/reload typically required for major version upgrades, e.g. from 8.4.7 to the current major release of PostgreSQL. It is not required for minor version upgrades, e.g. from 9.0.1 to 9.0.4. Major PostgreSQL…
Change Hostname in RHEL 7
Changing hostname is different from RHEL 6 version in RHEL 7. You can use few method to change hostname. I will demonstrate useful and easy method that is hostnamectl command. Show Current Hostname [root@localhost ~]# hostname localhost.localdomain or [root@localhost ~]# hostnamectl status Static hostname: localhost.localdomain Icon name: computer-vm Chassis: vm Machine ID: 418f684e1a5c45c9a22f76065c732de3 Boot ID:…
Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7
What is firewalld Firewalld provides a dynamically managed firewall with support for network/firewall zones that define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings, ethernet bridges and IP sets. There is a separation of runtime and permanent configuration options. It also provides an interface for services or…
MsSQL Server 2012 Availability Groups (AG) Manual Failover
If primary side of Availability Groups (AG) is down and can not be online, you can perform failover operation. When primary side is down, probably, you can see state of Availability Groups at the secondary side like below. Failover Steps If you get an error after click Failover button, probably your AG has a problem….