Nov 11 2016

PostgreSQL Upgrade From 9.5 Version To 9.6 Version With PG_UPGRADE

Category: AdministrationFatih Acar @ 11:03

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 releases regularly add new features that often change the layout of the system tables, but the internal data storage format rarely changes. pg_upgrade uses this fact to perform rapid upgrades by creating new system tables and simply reusing the old user data files. If a future major release ever changes the data storage format in a way that makes the old data format unreadable, pg_upgrade will not be usable for such upgrades. (The community will attempt to avoid such situations.)

pg_upgrade does its best to make sure the old and new clusters are binary-compatible, e.g. by checking for compatible compile-time settings, including 32/64-bit binaries. It is important that any external modules are also binary compatible, though this cannot be checked by pg_upgrade.

pg_upgrade supports upgrades from 8.4.X and later to the current major release of PostgreSQL, including snapshot and alpha releases.

Source : postgresql.org

Postgres_logo

Steps Of Upgrade

  • Install PostgreSQL new release packages
  • Create new directory for 9.6
  • Initialize 9.6 version in 9.6 directory
  • Configure pg_hba.conf and postgresql.conf regarding to changed parameters of 9.5 version
  • Stop 9.5 PostgreSQL service
  • Start pg_upgrade
  • Change PostgreSQL service name and start PostgreSQL 9.6

System Information

OS : Centos 7 x64
PG : 9.5
DIR : /pgdata/9.5/data/
SERVICE : postgresql.service

Install PostgreSQL new release packages

[root@testdb /tmp]# yum install postgresql96-libs.x86_64 postgresql96.x86_64 postgresql96-server.x86_64 postgresql96-contrib.x86_64 postgresql96-devel.x86_64 postgresql96-python.x86_64 postgresql96-plpython.x86_64

Create new directory for 9.6
Continue reading “PostgreSQL Upgrade From 9.5 Version To 9.6 Version With PG_UPGRADE”

490 total views, 5 views today

Tags: PostgreSQL, PostgreSQL Administration


Nov 01 2016

Change Hostname in RHEL 7

Category: Linux & UnixFatih Acar @ 10:29

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: 9b07d8a45e60437e9ef31164d394ad17
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.36.3.el7.x86_64
Architecture: x86-64

Change Hostname
Continue reading “Change Hostname in RHEL 7”

355 total views, 5 views today

Tags: Linux Administration, System Administration


Oct 31 2016

Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7

Category: Linux & UnixFatih Acar @ 16:32

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 applications to add firewall rules directly.

Benefits of using firewalld

Changes can be done immediately in the runtime environment. No restart of the service or daemon is needed.

With the firewalld D-Bus interface it is simple for services, applications and also users to adapt firewall settings. The interface is complete and is used for the firewall configuration tools firewall-cmd, firewallctl, firewall-config and firewall-applet.

The separation of the runtime and permanent configuration makes it possible to do evaulation and tests in runtime. The runtime configuration is only valid up to the next service reload and restart or to a system reboot. Then the permanent configuration will be loaded again. With the runtime environment it is possible to use runtime for settings that should only be active for a limited amount of time. If the runtime configuration has been used for evaluation, and it is complete and working, then it is possible to save this configuration to the permanent environment.

firewall

Add a Port to Firewalld as temporary

[root@test ~]# firewall-cmd –add-port=1521/tcp

Add a Port to Firewalld as permanent
Continue reading “Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7”

660 total views, 15 views today

Tags: Linux Administration, System Administration


Oct 21 2016

MsSQL Server 2012 Availability Groups (AG) Manual Failover

Category: AdministrationFatih Acar @ 09:57

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.

sqlserverfailoversteps1

Failover Steps

sqlserverfailoversteps2

sqlserverfailoversteps3

If you get an error after click Failover button, probably your AG has a problem. You can use force manual failover steps. Steps is here : http://www.fatihacar.com/blog/mssql-server-2012-availability-groups-ag-force-manual-failover/

sqlserverfailoversteps4
Continue reading “MsSQL Server 2012 Availability Groups (AG) Manual Failover”

485 total views, 5 views today

Tags: MsSQL Server, SQL Server Administration, SQL Server Availability Group


Oct 20 2016

MsSQL Server 2012 Availability Groups (AG) Force Manual Failover

Category: AdministrationFatih Acar @ 08:15

When you can not access primary side of AG and you can not run failover on second side (disaster side), you can perform force manual failover operation on second side. You have to know that force manual failover operation can cause loss data which is able to last some database operation.

Failover State

When primary side is down, you can see your Availability Groups and database on SQL Server Management Studio at the secondary (disaster side) like below.

sqlserverforcemanualfailover1

Failover Cluster Manager is down. Probably, you can not see any failover cluster on Failover Cluster Manager.

sqlserverforcemanualfailover2

Force Manual Failover

You can use the forced quorum procedure on a WSFC cluster node to override the safety controls that took the cluster offline. This effectively tells the cluster to suspend the quorum voting checks, and lets you bring the WSFC cluster resources and SQL Server back online on any of the nodes in the cluster.

You have to restart your WSFC (Quorum) with below commands.

Open a command prompt and execute below commands.

net.exe stop clussvc
net.exe start clussvc /forcequorum

Continue reading “MsSQL Server 2012 Availability Groups (AG) Force Manual Failover”

480 total views, 5 views today

Tags: MsSQL Server, SQL Server Administration, SQL Server Availability Group


Oct 17 2016

Obtain Surname, Last Name and Mid Name From Full Name in Oracle

Category: Procedure,SQLFatih Acar @ 13:43

If you have a column with full name data and you want to split this data, you can use below function to split operation.

Split Name ve Surname

Table : test
Data1 : Emin Fatih Acar
Data2 : Fatih Acar

SQL> select fullname,
substr(fullname,0,instr(fullname,’ ‘,Instr(fullname,’ ‘,-1))-1) name,
substr(fullname,Instr(fullname,’ ‘,-1)+1) surname
from test;

Result:

Data1
name : Emin Fatih
surname : Acar

Data2
name : Fatih
surname : Acar

Split Name,Midname and Surname

SQL> select fullname,
substr(fullname,0,instr(fullname,’ ‘)-1) name,
substr(fullname,instr(fullname,’ ‘)+1,Instr(fullname,’ ‘,-1,1)- instr(fullname,’ ‘)-1) midname,
substr(fullname,Instr(fullname,’ ‘,-1)+1) surname,
from test;

Result:

Data1
name : Emin
midname : Fatih
surname : Acar

Data2

name : Fatih
midname : null
surname : Acar

546 total views, no views today

Tags: Database Administration, Oracle Administration, Oracle SQL Query


Oct 12 2016

Turkey Stay Summer Time Zone and How to Implement TZDATA Package for Linux Systems

Category: Linux & UnixFatih Acar @ 15:59

Turkey is breaking step with Europe and keeping summer time through the winter. Instead of turning clocks back an hour as they do in the European Union in the autumn, Turkey will keep the clocks as they are and effectively change the country’s time zone. You have to implement new tzdata-2016g package on your systems to accommodate new decision.

You can install from Red Hat yum repository if you use Red Hat system. (Red Hat, Centos, Oracle Linux)

https://access.redhat.com/errata/RHEA-2016:1982

yum install tzdata*2016g*

Both tzdata-java-2016g and tzdata-2016g package installation will be useful.

Check New Adjustment

You check new time zone status with zdump command like below.

zdump -c 2016,2017 -v “Europe/Istanbul”

tzdataturkey

You have not to see Oct 30 date and gmtoff value 7200. You have to see gmtoff value 10800.

2,786 total views, no views today

Tags: System Administration


Oct 12 2016

Oracle 11g Oracle Checkpoint Not Complete, Cannot Allocate New Log Warning

Category: Administration,Errors and SolutionsFatih Acar @ 11:54

Error: Checkpoint not complete, Cannot Allocate New Log Warning

Thread 1 cannot allocate new log, sequence 125487
Checkpoint not complete

Solution: Checkpoint not complete messages are generated due to the logs are switching so fast that the checkpoint associated with the log switch isn’t complete. You should increase redo log file size and amount to resolve. Also, If you use archive_lag_target parameter as near zero for example like 1 or 2 minutes, you should change this parameter zero (no lag) or more than 10-15 min. Oracle recommends that redo log switch operation interval should be between 15-30 minutes.

oracle_redo_log_files

Show and change archive_lag_target parameter

SQL> show parameter archive_lag_target;
SQL> alter system set archive_lag_target=0 scope=both;
or
SQL> alter system set archive_lag_target=1800 scope=both;
1800 is 15 minutes. Parameter value as second.

If your archive_lag_target parameter is normal and you get checkpoint not complete error, you have to look your redo log file size and amount.
Continue reading “Oracle 11g Oracle Checkpoint Not Complete, Cannot Allocate New Log Warning”

951 total views, 5 views today

Tags: Oracle Error Solutions


Oct 11 2016

SQL Server 2012 AlwaysOn Availability Groups Insallation and Configuration

Category: AdministrationFatih Acar @ 09:00

Always On Availability Group is a new feature in SQL Server Database with 2012 release. Before this feature, we was using database mirroring feature in SQL Server 2005. But, mirroring has some limitations and weaknesses. and mirroring feature will be disabled near future.

AlwaysOn Availability Groups Features

  • Multi or Single Database Failovers
  • Multiple Secondaries
  • Active (Readably) Secondaries
  • Integrated HA Management

sqlserveravailabilitygroup

System Information

OS: Windows 2012 Server
DB: SQL Server 2012
Side 1: TESTDB1
Side 2: TESTDB2
Failover Cluster Name: TESTDB
Availability Group Name: TESTDB_AG
Listener Name: TESTDBVIP
Listener Port: 1433

AlwaysOn Availability Groups Installation Steps
Continue reading “SQL Server 2012 AlwaysOn Availability Groups Insallation and Configuration”

890 total views, no views today

Tags: Database Administration, MsSQL Server, SQL Server Administration, SQL Server Availability Group


Oct 02 2016

Unknown variable default character set utf8 MySQL 5.5 or MariaDB 5.5

Category: Errors and SolutionsFatih Acar @ 08:52

If you get an error like “Unknown variable default character set utf8” MySQL or MariaDB 5.5 in /var/log/mariadb/mariadb.log when I restart MySQL database, you can resolve this problem with change variable name.

Error

You can look for error /var/log/mariadb/mariadb.log
/usr/libexec/mysqld: unknown variable ‘default-character-set=utf8’
Aborting

mysql
Solution
Continue reading “Unknown variable default character set utf8 MySQL 5.5 or MariaDB 5.5”

35 total views, no views today

Tags: MySQL Administration, MySQL Error Solutions


Next Page »