Showing posts with label Database_Server. Show all posts
Showing posts with label Database_Server. Show all posts

Sunday, 27 August 2017

How to Install Oracle 12c Release 2 on CentOS/RHEL 6.X

Install Oracle 12c Release 2 on CentOS/RHEL 6.X

What is Oracle Database?
An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. A database server is the key to solving the problems of information management.

Requirements :-
*) For large-scale installation we need to use multicore processors with High availability.
*) Recommended minimum RAM needed for Oracle is 2GB or more.
*) Swap must be enabled double the size of RAM.
*) Disk space must be more than 20GB, its depends on edition which are we going to choose for installing.
*) /tmp directory must have free space more than 1GB for error free installation.
*) Supported Linux operating systems are RHEL, Centos, Oracle.
*) Both x86_64 and i686 packages are required for installation.

Step 1: Set up Hostname and bind it.
# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=int-oracle.indusnet.co.in

--- Save and Quit (:wq) ---

# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.14.151   int-oracle.indusnet.co.in      int-oracle

--- Save and Quit (:wq) ---

Step 2: Disable firewall and put selinux on permissisve or disabled mode.
# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

# 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 these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

--- Save and Quit (:wq) ---

# setenforce 0

**Remeber you need to restart the server for the changed selinux settings to put on effect.

Step 3: Install the Dependency required packages using YUM.
# yum -y install wget binutils compat-libcap1 smartmontools compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBC unixODBC-devel xorg* xterm

Step 4: Change the kernel parameters.
# vi /etc/sysctl.conf

## Add the lines at last of the file

# ORACLE 12c Configuration
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

--- Save and Quit (:wq) ---

# sysctl -p
# vi /etc/security/limits.conf

## Add the lines at the last of the file

# ORACLE 12c Configuration
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

--- Save and Quit (:wq) ---

# vi /etc/security/limits.d/90-nproc.conf

# Change number of process from 1024 to 16384
* soft    nproc    1024
# To this
    *  nproc 16384

--- Save and Quit (:wq) ---

Step 5: Create required groups and users for Oracle.
# groupadd -g 520 oinstall
# groupadd -g 521 dba
# groupadd -g 522 oper
# useradd -u 520 -g oinstall -G dba,oper oracle
# passwd oracle
Changing password for user oracle.
New password: *****
Retype new password: *****

Step 6: Create required directories and assign them proper permission / ownerships.
# mkdir -p /u01/app/oracle/product/12/dbhome_1
# chown -Rf oracle:oinstall /u01
# chmod -Rf 775 /u01

Step 7: Configure bash profile for oracle user.
# vi /home/oracle/.bash_profile

## Add these lines at the end of the file

# ORACLE 12c Configuration
PATH=$PATH:$HOME/bin
export TMP=/u01/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=int-oracle.indusnet.co.in
export ORACLE_UNQNAME=ora12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12/dbhome_1
export ORACLE_SID=ora12c
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

--- Save and Quit (:wq) ---

Step 8: Now switch to the directory where the installation file (download first) exists extract it.
# mkdir /u01/binaries/

** Download the Oracle 12c Installation Package from http://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip and Login with the Oracle Login Details and put the installation zip file to the /u01/binaries/ directory.

# unzip linuxx64_12201_database.zip

** Connect the Server with X-Manager and with oracle user that has been created in Step 5.

$ cd /u01/binaries/database/
$ ./runInstaller

In installation window
Step 1 : Configure security updates => Untick the option "I wish to receive security updates via My oracle support" & Provide an Email Address.
Step 2 : Installation option => Select Create & configure Database.(Incase if you want to configure database choose install database software only )
Step 3 : System Class => Select Server Class.
Step 4 : Grid installation option => Select Single instance database installation.
Step 5 : Install Type => Select Typical install
Step 6 : Typical installation =>
Make sure at this step we have following paths selected
Oracle_Base =/u01/app/oracle
Software location=/u01/app/oracle/product/12/dbhome_1
Storage type= File system
Database file location=/u01/app/oracle/oradata
OSDBA Group=dba
Global database name=ora12c
Password=<provide password>
Select option Pluggable Database name=pdbora12c
Step 7 : It should not make any issue regarding packages or other checks.
Step 8 : Install.

While the installation is going on it will ask to run following two scripts from root user.
/u01/app/oracle/product/12/dbhome_1/root.sh
/u01/app/oraInventory/oraInstroot.sh

** The whole process would take some time..

$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
ora12c

SQL> quit

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Friday, 22 January 2016

How to Install Mysql 5.7 on Centos 6.X/7.X


Mysql 5.7 on Centos 6.X/7.X

Step 1: Save the Repo File for The MySql 5.7 or Install the RPM for Mysql 5.7

# vi /etc/yum.repos.d/mysql-community.repo

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

--- save n quit (:wq) ---

or,

On RHEL/CentOS 7

# wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
# yum localinstall mysql57-community-release-el7-7.noarch.rpm

On RHEL/CentOS 6

# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
# yum localinstall mysql57-community-release-el6-7.noarch.rpm

Step 2: Install Mysql 5.7

# yum install mysql-community-server -y

Step 3: Reset the Mysql Temporary root Password and Chacge the password Policy

# vi /etc/my.cnf

add these lines below [mysqld]

validate_password_policy=LOW
validate_password_length=6
validate_password_dictionary_file=YES
validate_password_special_char_count =0
validate_password_mixed_case_count = 0

--- save and quit (:wq) ---

# service mysqld start


# cat /var/log/mysqld.log |grep "temporary password"
2015-09-06T16:46:46.109066Z 1 [Note] A temporary password is generated for root@localhost: <Password>

# mysql_secure_installation

Enter password for user root: <Enter the Temporary Password>

The existing password for the user account root has expired. Please set a new password.

New password: <New Password>

Re-enter new password: <Retype the Password>

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

Step 4: Check the Version and Mysql Once

# mysql -u root -p<password>

mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.10 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> \q
Bye

# mysql --version

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.