Blog

How to Install MySQL on Unix/Linux Using Generic Binaries

Another way to Install MySQL on Unix/Linux.

1) Download “V74396-01.zip” which contains:

V74396-01

There are two files – ASC and MD5 for “mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz”.

a: Verify MD5 checksum:

$ cat mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz.md5
f2ace50e757f1a63736e8dcbf5cfeb19 mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

$ md5sum mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
f2ace50e757f1a63736e8dcbf5cfeb19 mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

b) Signature Checking Using GnuPG.

To obtain a copy of our public GPG build key by copying or download from http://pgp.mit.edu/( The key is” mysql-build@oss.oracle.com”) to file mysql_pubkey.asc.

To import the build key into your personal public GPG keyring:

[root@racnote1 .gnupg]# gpg --import mysql_pubkey.asc
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no ultimately trusted keys found
[root@racnote1 .gnupg]# ls -ltr
total 28
-rw-r--r--. 1 root root 5968 Mar 24 12:02 mysql_pubkey.asc
-rw-------. 1 root root 0 Mar 24 13:07 secring.gpg
-rw-------. 1 root root 4434 Mar 24 13:07 pubring.gpg~
-rw-------. 1 root root 4434 Mar 24 13:07 pubring.gpg
-rw-------. 1 root root 1200 Mar 24 13:07 trustdb.gpg

To  verify the signature for the distribution file:

[root@racnote1 Patches]# gpg --verify mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz.asc
gpg: Signature made Fri 30 Jan 2015 17:49:39 AEDT using DSA key ID 5072E1F5
gpg: Good signature from "MySQL Release Engineering <mysql-build@oss.oracle.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5

2) Remove the previous MySQL installation.

a. Stop MySQL server

$service mysqld stop

b. Remove mysql-community-server and RPM packages.

[root@racnote1 Patches]# yum remove mysql-community-server
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: mysql-compat-server for package: akonadi-mysql-1.9.2-4.0.1.el7.x86_64
--> Running transaction check
---> Package akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 will be erased
--> Finished Dependency Resolution
adobe-linux-x86_64 | 951 B 00:00:00 
mysql-connectors-community/x86_64 | 2.5 kB 00:00:00 
mysql-tools-community/x86_64 | 2.5 kB 00:00:00 
mysql56-community/x86_64 | 2.5 kB 00:00:00 
ol7_UEKR3/x86_64 | 1.2 kB 00:00:00 
ol7_latest/x86_64 | 1.4 kB 00:00:00 
ol7_latest/x86_64/updateinfo | 349 kB 00:00:00 
ol7_latest/x86_64/primary | 8.4 MB 00:00:10 

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Removing:
 mysql-community-server x86_64 5.6.23-3.el7 @mysql56-community 244 M
Removing for dependencies:
 akonadi-mysql x86_64 1.9.2-4.0.1.el7 @ol7_latest 9.6 k

Transaction Summary
======================================================================================================================================================
Remove 1 Package (+1 Dependent package)

Installed size: 244 M
Is this ok [y/N]: Y 
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Erasing : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 1/2 
 Erasing : mysql-community-server-5.6.23-3.el7.x86_64 2/2 
 Verifying : mysql-community-server-5.6.23-3.el7.x86_64 1/2 
 Verifying : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 2/2 

Removed:
 mysql-community-server.x86_64 0:5.6.23-3.el7 

Dependency Removed:
 akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 

Complete!


[root@racnote1 Patches]# rpm -qa |grep -i mysql
mysql-community-client-5.6.23-3.el7.x86_64
perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
qt-mysql-4.8.5-8.0.1.el7.x86_64
mysql-community-common-5.6.23-3.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-libs-5.6.23-3.el7.x86_64

[root@racnote1 Patches]# yum remove mysql-community-common-5.6.23-3.el7.x86_64
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.23-3.el7 for package: mysql-community-libs-5.6.23-3.el7.x86_64
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-5.7.2-18.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:qt-mysql-4.8.5-8.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 1:qt-mysql-4.8.5-8.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.0.1.el7.x86_64
--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.23-3.el7 for package: mysql-community-client-5.6.23-3.el7.x86_64
--> Processing Dependency: mysql-libs for package: 1:net-snmp-5.7.2-18.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.23-3.el7 will be erased
---> Package net-snmp.x86_64 1:5.7.2-18.el7 will be erased
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.0.1.el7 will be erased
---> Package postfix.x86_64 2:2.10.1-6.0.1.el7 will be erased
---> Package qt-mysql.x86_64 1:4.8.5-8.0.1.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Removing:
 mysql-community-common x86_64 5.6.23-3.el7 @mysql56-community 2.1 M
Removing for dependencies:
 mysql-community-client x86_64 5.6.23-3.el7 @mysql56-community 87 M
 mysql-community-libs x86_64 5.6.23-3.el7 @mysql56-community 9.1 M
 net-snmp x86_64 1:5.7.2-18.el7 @anaconda/7.0 850 k
 perl-DBD-MySQL x86_64 4.023-5.0.1.el7 @ol7_latest 323 k
 postfix x86_64 2:2.10.1-6.0.1.el7 @ol7_latest 12 M
 qt-mysql x86_64 1:4.8.5-8.0.1.el7 @ol7_latest 74 k

Transaction Summary
======================================================================================================================================================
Remove 1 Package (+6 Dependent packages)

Installed size: 112 M
Is this ok [y/N]: Y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Erasing : 1:net-snmp-5.7.2-18.el7.x86_64 1/7 
 Erasing : 2:postfix-2.10.1-6.0.1.el7.x86_64 2/7 
 Erasing : 1:qt-mysql-4.8.5-8.0.1.el7.x86_64 3/7 
 Erasing : mysql-community-client-5.6.23-3.el7.x86_64 4/7 
 Erasing : perl-DBD-MySQL-4.023-5.0.1.el7.x86_64 5/7 
 Erasing : mysql-community-libs-5.6.23-3.el7.x86_64 6/7 
 Erasing : mysql-community-common-5.6.23-3.el7.x86_64 7/7 
 Verifying : mysql-community-libs-5.6.23-3.el7.x86_64 1/7 
 Verifying : perl-DBD-MySQL-4.023-5.0.1.el7.x86_64 2/7 
 Verifying : mysql-community-client-5.6.23-3.el7.x86_64 3/7 
 Verifying : 1:qt-mysql-4.8.5-8.0.1.el7.x86_64 4/7 
 Verifying : 2:postfix-2.10.1-6.0.1.el7.x86_64 5/7 
 Verifying : 1:net-snmp-5.7.2-18.el7.x86_64 6/7 
 Verifying : mysql-community-common-5.6.23-3.el7.x86_64 7/7 

Removed:
 mysql-community-common.x86_64 0:5.6.23-3.el7 

Dependency Removed:
 mysql-community-client.x86_64 0:5.6.23-3.el7 mysql-community-libs.x86_64 0:5.6.23-3.el7 net-snmp.x86_64 1:5.7.2-18.el7 
 perl-DBD-MySQL.x86_64 0:4.023-5.0.1.el7 postfix.x86_64 2:2.10.1-6.0.1.el7 qt-mysql.x86_64 1:4.8.5-8.0.1.el7 

Complete!
[root@racnote1 Patches]# rpm -qa |grep -i mysql
mysql-community-release-el7-5.noarch

c. Stopping YUM from receiving  MySQL packages from  Third-Party, Nonnative Repositories.

 # view /etc/yum.repos.d/mysql-community.repo
# yum-config-manager --disable mysql-tools-community
# yum-config-manager --disable mysql-connectors-community
# yum-config-manager --disable mysql56-community

d. Check and delete /etc/my.cnf or  /etc/mysql files if any.

3) Install MySQL by unpacking the distribution.

#cd /usr/local
#tar zxvf /media/sf_Oracle12102/Patches/mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
# ln -s mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql
# cd mysql
# chown -R mysql .
# chgrp -R mysql .
#scripts/mysql_install_db --user=mysql
# chown -R root .
#chown -R mysql data
# bin/mysqld_safe --user=mysql &
[1] 3492
[root@racnote1 mysql]# 150324 16:33:40 mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.
150324 16:33:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

#cp support-files/mysql.server /etc/init.d/mysql.server

MySQL Installation Layout for Generic Unix/Linux Binary Package
DirectoryContents of Directory
bin,scriptsmysqld server, client and utility programs
dataLog files, databases
docsMySQL manual in Info format
manUnix manual pages
includeInclude (header) files
libLibraries
shareMiscellaneous support files, including error messages, sample configuration files, SQL for database installation
sql-benchBenchmarks

4) Perform Post-installation Set-up as per installation doc.

How to Install MySQL onto Linux Using MySQL Yum Repository

Install MySQL by Using MySQL Yum Repository

1) Update libaio to date because MySQL is depended on libaio.

[root@racnode1 ~]# yum install libaio
Loaded plugins: langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
adobe-linux-x86_64 | 951 B 00:00:00 
ol7_UEKR3 | 1.2 kB 00:00:00 
ol7_latest | 1.4 kB 00:00:00 
(1/5): adobe-linux-x86_64/primary | 1.2 kB 00:00:01 
(2/5): ol7_UEKR3/x86_64/updateinfo | 29 kB 00:00:01 
(3/5): ol7_latest/x86_64/updateinfo | 349 kB 00:00:03 
(4/5): ol7_UEKR3/x86_64/primary | 6.5 MB 00:00:26 
(5/5): ol7_latest/x86_64/primary | 8.4 MB 00:00:32 
adobe-linux-x86_64 2/2
ol7_UEKR3 158/158
ol7_latest 9212/9212
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Nothing to do

2) Go to “Download MySQL Yum Repository” to download the release package for Linux 7 “mysql-community-release-el7-5.noarch.rpm”.

3) Install the downloaded release package.

[root@racnode1 Patches]# yum localinstall mysql-community-release-el7-5.noarch.rpm
Loaded plugins: langpacks
Examining mysql-community-release-el7-5.noarch.rpm: mysql-community-release-el7-5.noarch
Marking mysql-community-release-el7-5.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-release.noarch 0:el7-5 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Installing:
 mysql-community-release noarch el7-5 /mysql-community-release-el7-5.noarch 4.3 k
Transaction Summary
======================================================================================================================================================
Install 1 Package
Total size: 4.3 k
Installed size: 4.3 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : mysql-community-release-el7-5.noarch 1/1 
 Verifying : mysql-community-release-el7-5.noarch 1/1

Installed:
 mysql-community-release.noarch 0:el7-5

Complete!
[root@racnode1 Patches]#

You can check that the MySQL Yum repository has been successfully added by the following command:

[root@racnode1 Patches]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community 13
mysql-tools-community/x86_64 MySQL Tools Community 15
mysql56-community/x86_64 MySQL 5.6 Community Server 124

4) Installing MySQL with Yum.

# sudo yum install mysql-community-server
This installs the package for MySQL server (mysql-community-server) and also packages for the components required to run the server, including:

  • packages for the client (mysql-community-client)
  • the common error messages and character sets for client and server (mysql-community-common)
  • the shared client libraries (mysql-community-libs)
[root@racnode1 Patches]# yum install mysql-community-server
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.41-2.el7_0 will be obsoleted
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
---> Package mysql-community-server.x86_64 0:5.6.23-3.el7 will be obsoleting
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.23-3.el7 for package: mysql-community-server-5.6.23-3.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) = 5.6.23-3.el7 for package: mysql-community-server-5.6.23-3.el7.x86_64
--> Running transaction check
---> Package akonadi-mysql.x86_64 0:1.9.2-4.el7 will be updated
---> Package akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 will be an update
--> Processing Dependency: akonadi(x86-64) = 1.9.2-4.0.1.el7 for package: akonadi-mysql-1.9.2-4.0.1.el7.x86_64
---> Package mariadb.x86_64 1:5.5.41-2.el7_0 will be obsoleted
---> Package mysql-community-client.x86_64 0:5.6.23-3.el7 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.23-3.el7 for package: mysql-community-client-5.6.23-3.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.23-3.el7 will be installed
--> Running transaction check
---> Package akonadi.x86_64 0:1.9.2-4.el7 will be updated
---> Package akonadi.x86_64 0:1.9.2-4.0.1.el7 will be an update
---> Package mariadb-libs.x86_64 1:5.5.41-2.el7_0 will be obsoleted
---> Package mysql-community-libs.x86_64 0:5.6.23-3.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Installing:
 mysql-community-client x86_64 5.6.23-3.el7 mysql56-community 19 M
 replacing mariadb.x86_64 1:5.5.41-2.el7_0
 mysql-community-libs x86_64 5.6.23-3.el7 mysql56-community 2.0 M
 replacing mariadb-libs.x86_64 1:5.5.41-2.el7_0
 mysql-community-server x86_64 5.6.23-3.el7 mysql56-community 57 M
 replacing mariadb-server.x86_64 1:5.5.41-2.el7_0
Installing for dependencies:
 mysql-community-common x86_64 5.6.23-3.el7 mysql56-community 256 k
Updating for dependencies:
 akonadi x86_64 1.9.2-4.0.1.el7 ol7_latest 724 k
 akonadi-mysql x86_64 1.9.2-4.0.1.el7 ol7_latest 15 k

Transaction Summary
======================================================================================================================================================
Install 3 Packages (+1 Dependent package)
Upgrade ( 2 Dependent packages)

Total download size: 79 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
(1/6): akonadi-mysql-1.9.2-4.0.1.el7.x86_64.rpm | 15 kB 00:00:02 
warning: /var/cache/yum/x86_64/7Server/mysql56-community/packages/mysql-community-common-5.6.23-3.el7.x86_64.rpm: V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.6.23-3.el7.x86_64.rpm is not installed
(2/6): mysql-community-common-5.6.23-3.el7.x86_64.rpm | 256 kB 00:00:02 
(3/6): akonadi-1.9.2-4.0.1.el7.x86_64.rpm | 724 kB 00:00:03 
(4/6): mysql-community-libs-5.6.23-3.el7.x86_64.rpm | 2.0 MB 00:00:05 
(5/6): mysql-community-client-5.6.23-3.el7.x86_64.rpm | 19 MB 00:00:54 
(6/6): mysql-community-server-5.6.23-3.el7.x86_64.rpm | 57 MB 00:01:43 
------------------------------------------------------------------------------------------------------------------------------------------------------
Total 722 kB/s | 79 MB 00:01:52 
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package : mysql-community-release-el7-5.noarch (@/mysql-community-release-el7-5.noarch)
 From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : mysql-community-common-5.6.23-3.el7.x86_64 1/11 
 Installing : mysql-community-libs-5.6.23-3.el7.x86_64 2/11 
 Installing : mysql-community-client-5.6.23-3.el7.x86_64 3/11 
 Installing : mysql-community-server-5.6.23-3.el7.x86_64 4/11 
 Updating : akonadi-1.9.2-4.0.1.el7.x86_64 5/11 
 Updating : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 6/11 
 Cleanup : akonadi-mysql-1.9.2-4.el7.x86_64 7/11 
 Erasing : 1:mariadb-server-5.5.41-2.el7_0.x86_64 8/11 
 Erasing : 1:mariadb-5.5.41-2.el7_0.x86_64 9/11 
 Erasing : 1:mariadb-libs-5.5.41-2.el7_0.x86_64 10/11 
 Cleanup : akonadi-1.9.2-4.el7.x86_64 11/11 
 Verifying : mysql-community-server-5.6.23-3.el7.x86_64 1/11 
 Verifying : mysql-community-client-5.6.23-3.el7.x86_64 2/11 
 Verifying : akonadi-1.9.2-4.0.1.el7.x86_64 3/11 
 Verifying : mysql-community-libs-5.6.23-3.el7.x86_64 4/11 
 Verifying : mysql-community-common-5.6.23-3.el7.x86_64 5/11 
 Verifying : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 6/11 
 Verifying : 1:mariadb-5.5.41-2.el7_0.x86_64 7/11 
 Verifying : akonadi-1.9.2-4.el7.x86_64 8/11 
 Verifying : akonadi-mysql-1.9.2-4.el7.x86_64 9/11 
 Verifying : 1:mariadb-server-5.5.41-2.el7_0.x86_64 10/11 
 Verifying : 1:mariadb-libs-5.5.41-2.el7_0.x86_64 11/11 

Installed:
 mysql-community-client.x86_64 0:5.6.23-3.el7 mysql-community-libs.x86_64 0:5.6.23-3.el7 mysql-community-server.x86_64 0:5.6.23-3.el7 

Dependency Installed:
 mysql-community-common.x86_64 0:5.6.23-3.el7 

Dependency Updated:
 akonadi.x86_64 0:1.9.2-4.0.1.el7 akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 

Replaced:
 mariadb.x86_64 1:5.5.41-2.el7_0 mariadb-libs.x86_64 1:5.5.41-2.el7_0 mariadb-server.x86_64 1:5.5.41-2.el7_0 

Complete!
[root@racnode1 Patches]#

5) Start and Stop MySQL Server.

[root@racnode1 Patches]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
mysqld.service - MySQL Community Server
 Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
 Active: inactive (dead)

Redirecting to /bin/systemctl start mysqld.service

[root@racnode1 Patches]# service mysqld status

Redirecting to /bin/systemctl status mysqld.service
mysqld.service - MySQL Community Server
 Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
 Active: active (running) since Sun 2015-03-22 15:24:56 AEDT; 13s ago
 Process: 22242 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)
 Process: 22181 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 22241 (mysqld_safe)
 CGroup: /system.slice/mysqld.service
 ├─22241 /bin/sh /usr/bin/mysqld_safe
 └─22390 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --...

Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: Support MySQL by buying support/licenses at http://shop.mysql.com
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: Note: new default config file not created.
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: Please make sure your config file is current
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: WARNING: Default config file /etc/my.cnf exists on the system
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: This file will be read by default by the MySQL server
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: If you do not want to use this, either remove it, or use the
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: --defaults-file argument to mysqld_safe when starting the server
Mar 22 15:24:55 racnode1 mysqld_safe[22241]: 150322 15:24:55 mysqld_safe Logging to '/var/log/mysqld.log'.
Mar 22 15:24:55 racnode1 mysqld_safe[22241]: 150322 15:24:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Mar 22 15:24:56 racnode1 systemd[1]:Started MySQL Community Server


[root@racnode1 Patches]# service mysqld stop

Redirecting to /bin/systemctl stop mysqld.service
[root@racnode1 Patches]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
mysqld.service - MySQL Community Server
 Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
 Active: inactive (dead) since Sun 2015-03-22 15:27:37 AEDT; 5s ago
 Process: 22242 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)
 Process: 22241 ExecStart=/usr/bin/mysqld_safe (code=exited, status=0/SUCCESS)
 Process: 22181 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 22241 (code=exited, status=0/SUCCESS)

Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: WARNING: Default config file /etc/my.cnf exists on the system
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: This file will be read by default by the MySQL server
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: If you do not want to use this, either remove it, or use the
Mar 22 15:24:54 racnode1 mysql-systemd-start[22181]: --defaults-file argument to mysqld_safe when starting the server
Mar 22 15:24:55 racnode1 mysqld_safe[22241]: 150322 15:24:55 mysqld_safe Logging to '/var/log/mysqld.log'.
Mar 22 15:24:55 racnode1 mysqld_safe[22241]: 150322 15:24:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Mar 22 15:24:56 racnode1 systemd[1]: Started MySQL Community Server.
Mar 22 15:27:36 racnode1 systemd[1]: Stopping MySQL Community Server...
Mar 22 15:27:37 racnode1 mysqld_safe[22241]: 150322 15:27:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Mar 22 15:27:37 racnode1 systemd[1]: Stopped MySQL Community Server.
[root@racnode1 Patches]# 

Apply Database Patch Set Update 12.1.0.2.2 (Includes CPUJan2015) and Oracle JavaVM Component 12.1.0.2.2 Database PSU (Jan2015) onto CDB Database

Oracle suggests to apply the latest PSU as soon as possible.

1) Download and put in place opatch 12.1.0.1.6 as README required.

2)Download patch “p20132434_121020_Linux-x86-64.zip” which includes both database and JVM 12.1.0.2.2 PSU.

3)unzip p20132434_121020_Linux-x86-64.zip.

4) List files.

[oracle@racnode1 20132434]$ ls -ltr
drwxrwx---. 1 root vboxsf 0 Jan 21 01:09 19769480
-rwxrwx---. 1 root vboxsf 25 Jan 21 01:09 README.txt
drwxrwx---. 1 root vboxsf 0 Jan 21 01:09 19877336
-rwxrwx---. 1 root vboxsf 17979 Jan 21 01:18 README.htm

5) Pre-check.

$cd 19769480
$opatch prereq CheckConflictAgainstOHWithDetail -ph ./

 Oracle Interim Patch Installer version 12.1.0.1.6
 Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
 from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2015-03-16_21-05-16PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

6) Opatch apply.

[oracle@racnote1 19769480]$ opatch apply
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
 from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtollogs/opatch/19769480_Mar_16_2015_21_09_50/apply2015-03-16_21-09-50PM_1.log
Applying interim patch '19769480' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, insall and initiate Oracle Configuration Manager. Easier for you if you use your My Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0/dbhome_1')
Is the local system ready for patching? [y|n]y
User Responded with: Y
Backing up files...
Patching component oracle.rdbms.deconfig, 12.1.0.2.0...
Patching component oracle.xdk, 12.1.0.2.0...
Patching component oracle.tfa, 12.1.0.2.0...
Patching component oracle.rdbms.util, 12.1.0.2.0...
Patching component oracle.rdbms, 12.1.0.2.0...
Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...
Patching component oracle.xdk.parser.java, 12.1.0.2.0...
Patching component oracle.oraolap, 12.1.0.2.0...
Patching component oracle.xdk.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rsf, 12.1.0.2.0...
Patching component oracle.rdbms.rman, 12.1.0.2.0...
Patching component oracle.ldap.rsf, 12.1.0.2.0...
Patching component oracle.ldap.rsf.ic, 12.1.0.2.0...
Verifying the update...
Patch 19769480 successfully applied
Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/19769480_Mar_16_2015_21_09_50/apply2015-03-16_21-09-50PM_1.log

OPatch succeeded.

7) load modified SQL files into the database.

$sqlplus /nolog
SQL>connect / as sysdba
SQL> startup
$cd $ORACLE_HOME/OPatch
SQL> quit
SQL> alter pluggable database all open;

SQL> SELECT NAME,OPEN_MODE FROM V$PDBS;

NAME        OPEN_MODE
----------- ----------
PDB$SEED    READ ONLY
PDB2        READ WRITE
PDB2_2      READ WRITE
PDB_ORCL2   READ WRITE
PDB1_1      READ WRITE
PDB_SAMLES  READ WRITE

6 rows selected.

[oracle@racnote1 OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.2.0.0.0 on Mon Mar 16 22:01:39 2015
Copyright (c) 2014, Oracle. All rights reserved.

Connecting to database...OK
Note: Datapatch will only apply or rollback SQL fixes for PDBs
 that are in an open state, no patches will be applied to closed PDBs.
 Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
 (Doc ID 1585822.1)
catcon: ALL catcon-related output will be written to /tmp/sqlpatch_catcon__catcon_8643.lst
catcon: See /tmp/sqlpatch_catcon_*.log files for output generated by scripts
catcon: See /tmp/sqlpatch_catcon__*.lst files for spool files, if any
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series PSU:
 ID 2 in the binary registry and not installed in any PDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
 For the following PDBs: CDB$ROOT PDB$SEED PDB2 PDB2_2 PDB_ORCL2 PDB1_1 PDB_SAMLES
 Nothing to roll back
 The following patches will be applied:
 19769480 (Database Patch Set Update : 12.1.0.2.2 (19769480))

Installing patches...
Patch installation complete. Total patches installed: 7

Validating logfiles...
Patch 19769480 apply (pdb CDB$ROOT): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_CDBROOT_2015Mar16_22_02_28.log (no errors)
Patch 19769480 apply (pdb PDB$SEED): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDBSEED_2015Mar16_22_02_38.log (no errors)
Patch 19769480 apply (pdb PDB2): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDB2_2015Mar16_22_02_38.log (no errors)
Patch 19769480 apply (pdb PDB2_2): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDB2_2_2015Mar16_22_02_38.log (no errors)
Patch 19769480 apply (pdb PDB_ORCL2): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDB_ORCL2_2015Mar16_22_02_39.log (no errors)
Patch 19769480 apply (pdb PDB1_1): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDB1_1_2015Mar16_22_02_52.log (no errors)
Patch 19769480 apply (pdb PDB_SAMLES): SUCCESS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_CDB2_PDB_SAMLES_2015Mar16_22_02_51.log (no errors)
SQL Patching tool complete on Mon Mar 16 22:03:00 2015
[oracle@racnote1 OPatch]$ 


SQL> select VERSION,ACTION,STATUS,ACTION_TIME 
       from dba_registry_sqlpatch;

VERSION   ACTION  STATUS   ACTION_TIME
--------- ------- -------- -----------------------------
12.1.0.2  APPLY   SUCCESS  16-MAR-15 10.02.57.755324 PM

 Apply Oracle JavaVM Component 12.1.0.2.2 Database PSU (Jan2015)

1)Pre-check.

[oracle@racnode1 19877336]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.1.0.1.6
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2015-03-16_22-08-46PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

2)  opatch apply.

3)  load modified SQL files into the database.

$sqlplus /nolog
SQL>connect / as sysdba
SQL> startup
$cd $ORACLE_HOME/OPatch
SQL> quit

SQL> alter pluggable database all open;
SQL> SELECT NAME,OPEN_MODE FROM V$PDBS;
NAME         OPEN_MODE
------------ ----------
PDB$SEED     READ ONLY
PDB2         READ WRITE
PDB2_2       READ WRITE
PDB_ORCL2    READ WRITE
PDB1_1       READ WRITE
PDB_SAMLES   READ WRITE

6 rows selected.

[oracle@racnote1 OPatch]$ ./datapatch -verbose

-----------------------------------------------------
There is an error for PDB2 pluggable databbase
-----------------------------------------------------

Patch 19877336 apply (pdb PDB2): WITH ERRORS
 logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19877336/18313828/19877336_apply_CDB2_PDB2_2015Mar16_22_29_39.log (errors)
 Error at line 554: ORA-01652: unable to extend temp segment by 128 in tablespace TEMP_PDB2
 Error at line 555: ORA-06512: at line 10
----------------------------------------------------
----------------------------------------------------
To fix:
1) make tempfile autoextend on
2) rerun datapatch

SQL> alter session set container=pdb2;
Session altered.

SQL> show con_name
CON_NAME
------------
PDB2

SQL> select PATCH_ID,ACTION,STATUS,ACTION_TIME,DESCRIPTION
       from dba_registry_sqlpatch ;
 
PATCH_ID   ACTION   STATUS    ACTION_TIME                  DESCRIPTION
---------- -------- --------- ---------------------------  --------------
 19769480  APPLY    SUCCESS   16-MAR-15 10.02.58.791011 PM Database Patch Set Update : 12.1.0.2.2 (19769480)
 19877336  APPLY  WITH ERRORS 16-MAR-15 10.42.38.915032 PM Database PSU 12.1.0.2.2, Oracle JavaVM Component (
 19877336  APPLY     SUCCESS  16-MAR-15 11.34.24.408659 PM Database PSU 12.1.0.2.2, Oracle JavaVM Component ( 


SQL> alter session set container=cdb$root;
SQL> select PATCH_ID,ACTION,STATUS,ACTION_TIME,DESCRIPTION 
       from dba_registry_sqlpatch ;

PATCH_ID   ACTION   STATUS  ACTION_TIME                  DESCRIPTION
---------- -------- ------- ---------------------------  -------------

 19769480  APPLY   SUCCESS 16-MAR-15 10.02.57.755324 PM  Database Patch Set Update : 12.1.0.2.2 (19769480)
 19877336  APPLY   SUCCESS 16-MAR-15 10.42.37.649060 PM  Database PSU 12.1.0.2.2, Oracle JavaVM Component (

ORA-00845: MEMORY_TARGET not supported on this system

Make sure Oracle Databases are configured by using ASMM, AMM or HUGE PAGES correctly to avoid performance issues.

SYMPTOM

When start up a database, Database failed to be up with ORA-00845 error.

[oracle@racnode1 ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Sun Mar 15 21:08:17 2015

Copyright (c) 1982, 2014, Oracle. All rights reserved.

SQL> connect / as sysdba
Connected to an idle instance.

SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

The alert log has messages as below:

Sun Mar 15 21:08:31 2015
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 1073741824 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 659394560 and used is 499130368 bytes. Ensure that the mount point is /dev/shm for this directory.

SOLUTION

Please confirm that ORACLE_HOME is set correctly. This error sometimes happens when ORACLE_HOME is not set correctly.

Make sure that the /dev/shm size is configured large enough, like in:

# mount -t tmpfs shmfs -o size=2g /dev/shm

In this case, the size of the shared memory device is configured to be 2GB.

In order to make the same change persistent across system reboots, add an entry for this to the /etc/fstab mount table:

shmfs /dev/shm tmpfs size=2g 0 0

NOTE:

  1. You should check with your System Administrator what the “best” size for /dev/shm is, based on what has been reported in the alert file.
  2. Also, many best practices now suggest disabling AMM especially in Exa* Engineered boxes that have larger memory capability, and can use Huge / Large pages.
    This is because AMM and Huge / Large pages are mutually exclusive and overall performance will be better using Huge pages.

Apply OCT2014 DB PSU OJVM PSU and JDBC Patch Onto 11.2.0.4 ORACLE_HOME

Always apply the latest patches as soon as possible as Oracle recommended.

There is a requirement to apply Oct 2014 PSU onto 11.2.0.4 ORACLE_HOME.

From Oct 2014 onwards, Oracle JavaVM Component Database PSU is released as part of the Critical Patch Update program.

It consists of two separate patches:

  • One for JDBC clients – applicable to Client, Instant Client, Database and Grid ORACLE_HOMES. This is referred to as “JDBC Patch” .
  • One for Oracle JavaVM component within the Oracle Database – applicable to database ORACLE_HOMEs only. This is referred to as “OJVM PSU” .

The table below shows which Oracle JavaVM Component patches are required in the various ORACLE_HOMEs.

VersionType of HomeOctober 2014January 2015
12.1.0.2Database HomeOJVM PSU (Oct 2014)(or Mitigation Patch)OJVM PSU (Jan 2015)(or Mitigation Patch)
Grid HomeNoneNone
Client / Instant Client HomeNoneNone
12.1.0.1,
11.2.0.4,
11.2.0.3,
11.1.0.7
Database HomeOJVM PSU (Oct 2014)
and JDBC Patch (Oct 2014)(or Mitigation Patch and JDBC Patch)
OJVM PSU (Jan 2015) [includes JDBC fixes](or Mitigation Patch and JDBC Patch)
Grid HomeJDBC Patch (Oct 2014) JDBC Patch (Oct 2014)
Client / Instant Client HomeJDBC Patch (Oct 2014) JDBC Patch (Oct 2014)
Other VersionsDatabase HomeMitigation PatchMitigation Patch

OJVM PSU

  • packaged separately from the Database PSU (or equivalent) as they cannot be installed in a RAC Rolling manner, nor in Standby First manner.
  • Oracle has also released “Combo” patches that bundle the OJVM PSU in the same ZIP file as DB PSU and/or GI PSU for ease of download. The OJVM component in these “Combo” patches is in a separate subdirectory with its own install steps still required. October 2014 “Combo” patches do not include the JDBC Patch.
  • are applicable to all database installations regardless of which patching model is used (DB PSU, GI PSU, Security Patch Update (SPU), Windows Bundle Patch or Database Patch for Exadata)
  • require the database home to be patched to at least October 2014 DB PSU (or equivalent)
  • include binary changes to be applied to each Database ORACLE_HOME, and “post install” steps to be execute on each database running from the ORACLE_HOME
  • from January 2015 onwards: include the JDBC fixes
  • For situations where the latest OJVM PSU cannot be installed immediately there is a “Mitigation Patch” that can be used.

MITIGATION PATCH

For situations where the latest OJVM PSU cannot be installed immediately there is a “Mitigation Patch” that can be used. The “Mitigation Patch” is an interim solution to protect against all currently known (Jan 2015) Oracle JavaVM security vulnerabilities in the database until such time as the OJVM PSU can be installed. It can also be used to protect database versions no longer covered by error correction support.

  • is applicable only to database homes, not client nor Grid homes
  • is only applicable to databases that have JavaVM installed
  • has no dependency on the DB PSU (or equivalent) level
  • can be installed in a RAC Rolling manner
  • is a SQL only patch that needs to be installed and activated in each database, hence it can be installed standby first but it requires SQL steps to be executed to be effective, which cannot be done on a read only standby
  • affects use of Java and Java development in the database
    has been reviewed for January 2015 and provides mitigation against all currently known OJVM vulnerabilities
  • can be downloaded here: Patch:19721304

Applying the Mitigation Patch

1. Download and apply the relevant version of Patch:19721304 to each database ORACLE_HOME
2. Execute the patch post install steps against all databases running from each ORACLE_HOME. See the README supplied with the patch for post install steps relevant to the database version.
3. Check the patch logs for any errors and correct as required
4. Run the following step as a SYSDBA user to DISABLE Java development in the database:
      SQL> exec dbms_java_dev.disable
Temporarily Enabling Creation/Update of Stored Java Objects

If you need to allow the creation/update of stored Java objects, including application of patches that affect stored Java or the Oracle JavaVM:

Connect to the database as a SYSDBA user

SQL> exec dbms_java_dev.enable;

Perform the steps required to create or replace Java objects, apply Java related patches.

SQL> exec dbms_java_dev.disable;

Be sure to end the steps with the call to “dbms_java_dev.disable” in order to protect the database.

Applying an “Oracle JavaVM Component Database PSU” Patch with the Mitigation Patch Already Installed

You must “enable” Java development prior to installing the OJVM PSU patch.

Disconnect users and prevent user access to the databases running from the ORACLE_HOME to be patched

“exec dbms_java_dev.enable;” in each database

Shutdown the databases

Follow the full steps to apply the OJVM PSU patch, including running post install steps against each database

You do not need to “disable” Java development after patching with the latest OJVM PSU patch, unless you wish to do so.

JDBC PATCH

  • JDBC patch is separately from the OJVM PSU and Database PSU (or equivalent) for ease of deployment to client environments
  • are applicable to Client, Instant Client and Grid ORACLE_HOMES The JDBC fixes are also applicable to the Database home regardless of whether Oracle JavaVM is used in a database or not:

For October 2014 the JDBC Patch should also be installed in the Database home.
For January 2015 the OJVM PSU includes the JDBC fixes and so the JDBC patch does not need to be installed in the Database home unless OJVM PSU is not being installed

  • are applicable to all installations regardless of which patching model is used (DB PSU, GI PSU, Security Patch Update (SPU), Windows Bundle Patch or Database Patch for Exadata)
  • have no dependency on OJVM PSU nor Database PSU (or equivalent) patch level
  • can be installed in database server homes in a RAC Rolling manner
  • do not require the database and listeners to be shutdown for patching in non-RAC environments
  • do not require any post install steps be executed against individual databases

 APPLY PATCHES

The Oct 2014 PSU patches include:

1) Patch 19121551 -- Database Patch Set Update 11.2.0.4.4( Includes CPUOCT2014)
2) Patch 19282021 - Oracle JavaVM Component 11.2.0.4.1 Database PSU (Oct2014)
3) Patch 19852360: ORACLE JAVAVM COMPONENT 11.2.0.4.1 DATABASE PSU - GENERIC JDBC PATCH (OCT2014)
  1. Shutdown databases and services on all nodes
  2. Apply DB PSU Patch 19121551, but do NOT run DB PSU post install steps
  3. Apply OJVM PSU Patch 19282021.
  4. October 2014 only for DB versions below 12.1.0.2: Apply the JDBC Patch 19852360
  5. Run post install steps on all DBs in the patched home:
    • For 11.2.0.3 and 11.2.0.4 run the OJVM PSU post install steps followed by the DB PSU  post install steps.
    • For 11.1.0.7 run the OJVM PSU post install steps, then shutdown/restart the database before following the DB PSU (or equivalent) post install steps. [see note-4 below]
  6. Re-start any stopped databases / services running from this ORACLE_HOME.

REFERENCE:

Oracle Recommended Patches — “Oracle JavaVM Component Database PSU” (OJVM PSU) Patches (Doc ID 1929745.1)