Thursday, October 17, 2019

How to create and maintain users and roles, assign privileges mysql 8.0.

         How to create and maintain users and roles, assign privileges mysql 8.0.

mysql.user: User accounts, global privileges, and other non-privilege columns
mysql.db: Database-level privileges
mysql.tables_priv: Table-level privileges
mysql.columns_priv: Column-level privileges
mysql.procs_priv: Stored procedure and function privileges
mysql.proxies_priv: Proxy-user privileg

mysql> select DISTINCT User FROM mysql.user;
+------------------+
| User             |
+------------------+
| pankaj           |
| rpl_user         |
| mysql.infoschema |
| mysql.session    |
| mysql.sys        |
| root             |
+------------------+
6 rows in set (0.00 sec)

mysql> SELECT VALIDATE_PASSWORD_STRENGTH('weak');
+------------------------------------+
| VALIDATE_PASSWORD_STRENGTH('weak') |
+------------------------------------+
|                                 25 |
+------------------------------------+
1 row in set (0.17 sec)

mysql> create user pankaj@localhost identified by 'Pankajsingh_98765';
Query OK, 0 rows affected (0.15 sec)

mysql> GRANT ALL ON pankaj.* TO 'user'@'localhost';
   
Query OK, 0 rows affected (0.07 sec)

[root@master ~]# mysql -u user -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 287
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, 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 |
| pankaj             |
+--------------------+
2 rows in set (0.07 sec)

mysql> GRANT ALL ON *.* TO 'user'@'localhost';
Query OK, 0 rows affected (0.11 sec)

[root@master ~]# mysql -u user -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 290
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, 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              |
| pankaj             |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

mysql> GRANT SELECT ON pankaj.ram TO 'user'@'localhost';
Query OK, 0 rows affected (0.10 sec)

mysql> GRANT ALL ON *.* TO 'user'@'localhost' WITH MAX_QUERIES_PER_HOUR 90;
Query OK, 0 rows affected (0.11 sec)

mysql>GRANT SELECT, INSERT ON *.* TO 'user'@'localhost';

mysql>GRANT SELECT, INSERT ON mydb.* TO 'user'@'localhost';

mysql>GRANT SELECT, INSERT ON mydb.mytbl TO 'user'@'localhost';

mysql>GRANT SELECT (col1), INSERT (col1, col2) ON pankaj.emp TO 'user'@'localhost';

mysql>GRANT CREATE ROUTINE ON pankaj.* TO 'user'@'localhost';

mysql>GRANT EXECUTE ON PROCEDURE pankaj.emp TO 'user'@'localhost';

mysql> show grants for 'tiger'@'localhost';

mysql> REVOKE select ON pankaj.ram FROM 'tiger'@'localhost';

mysql> REVOKE select ON pankaj.* FROM 'tiger'@'localhost';

mysql> REVOKE select ON *.* FROM 'tiger'@'localhost';


mysql> SELECT host,user from mysql.user;
+-----------------+------------------+
| host            | user             |
+-----------------+------------------+
| 192.168.142.152 | rpl_user         |
| localhost       | mysql.infoschema |
| localhost       | mysql.session    |
| localhost       | mysql.sys        |
| localhost       | root             |
| localhost       | user             |
+-----------------+------------------+
6 rows in set (0.00 sec)


mysql> rename user 'user'@'localhost' to 'tiger'@'localhost';
Query OK, 0 rows affected (0.10 sec)

mysql> SELECT host,user from mysql.user;
+-----------------+------------------+
| host            | user             |
+-----------------+------------------+
| 192.168.142.152 | rpl_user         |
| localhost       | mysql.infoschema |
| localhost       | mysql.session    |
| localhost       | mysql.sys        |
| localhost       | root             |
| localhost       | tiger            |
+-----------------+------------------+
6 rows in set (0.00 sec)


mysql> SELECT Host, User FROM mysql.user WHERE User='rpl_user';
+-----------------+----------+
| Host            | User     |
+-----------------+----------+
| 192.168.142.152 | rpl_user |
+-----------------+----------+

mysql> SELECT Host, User FROM mysql.user;
+-----------------+------------------+
| Host            | User             |
+-----------------+------------------+
| 192.168.142.152 | pankaj           |
| 192.168.142.152 | rpl_user         |
| 192.168.142.153 | pankaj           |
| localhost       | mysql.infoschema |
| localhost       | mysql.session    |
| localhost       | mysql.sys        |
| localhost       | root             |
| localhost       | user             |
+-----------------+------------------+
8 rows in set (0.01 sec)

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.05 sec)



mysql> alter user 'rpl_user'@192.168.142.152 identified by 'Pankajsingh_98765';
Query OK, 0 rows affected (0.05 sec)


1.drop user

mysql> DROP USER 'slave_user'@'%';
Query OK, 0 rows affected (0.25 sec)




HOW TO CONFIGURE MYSQL 8.0 MASTER SLAVE REPLICATIN RHEL 8.

               HOW TO CONFIGURE MYSQL 8.0 MASTER SLAVE REPLICATIN RHEL 8.

Step 1: Configure the Master Server
The first configuration change to make is setting Server ID for the master database:


A complete simple configuration looks like below:

+++++++++++++++++++++++++++++++++++++++++++++++++++
[root@master ~]# vi /etc/my.cnf

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
server-id = 1
log-bin = /var/log/mysql/mysql-bin.log
tmpdir = /tmp
binlog_format = ROW
max_binlog_size = 500M
sync_binlog = 1
expire-logs-days = 7
slow_query_log


save and Restart mysql service for changes to take effect:

[root@master ~]# systemctl restart mysqld.service


Step 2: Create Replication user on Master database server
We now need to create a database user to be used by slaves when connecting. Login to MySQL database as root user and create the user:

[root@master ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, 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>create user rpl_user@192.168.142.152 identified by 'pankaj';
Query OK, 0 rows affected (0.08 sec)
Grant the user REPLICATION SLAVE privileges:

mysql> grant replication slave on *.* to rpl_user@192.168.142.152;
Query OK, 0 rows affected (0.09 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Confirm grants for created user:
mysql> select DISTINCT User FROM mysql.user;
+------------------+
| User             |
+------------------+
| slave_user       |
| pankaj           |
| rpl_user         |
| mysql.infoschema |
| mysql.session    |
| mysql.sys        |
| root             |
+------------------+
7 rows in set (0.08 sec)

mysql> show grants for rpl_user@192.168.142.152;
+----------------------------------------------------------------+
| Grants for rpl_user@192.168.142.152                            |
+----------------------------------------------------------------+
| GRANT REPLICATION SLAVE ON *.* TO `rpl_user`@`192.168.142.152` |
+----------------------------------------------------------------+
1 row in set (0.05 sec)

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000007 |      155 | pankaj       |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql> show master status\G
*************************** 1. row ***************************
             File: mysql-bin.000007
         Position: 155
     Binlog_Do_DB: pankaj
 Binlog_Ignore_DB:
Executed_Gtid_Set:
1 row in set (0.00 sec)

Take a note of current Master log file and position. Then configure Slave server with details obtained from the master status command:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Step 3: Install and Configure Slave Server
Install MySQL Server 8.0 on Slave server in a similar process used for the Master server. You can follow steps in the guide How to Install MySQL 8.0 on Ubuntu 18.04 / 16.04

When done with the installation, configure slave by editing the file:

[root@slave ~]# vi /etc/my.cnf
log_bin = /var/log/mysql/mysql-bin.log
server-id = 2
read_only = 1
tmpdir = /tmp
binlog_format = ROW
max_binlog_size = 500M
sync_binlog = 1
expire-logs-days = 7
slow_query_log   = 1
read_only = 1: This sets the slave to read-only mode. Only users with the SUPER privilege and the replication slave thread will be able to modify data on it. This ensures there are no applications that can accidentally modify data on the slave instead of master.

server-id = 2: This is a Unique server identification number. It will default to 1 if “master-host” is not set.

log_bin = /var/log/mysql/mysql-bin.log:  This enables binary logging. This is required for acting as a MASTER in a replication configuration. You also need the binary log if you need the ability to do point in time recovery from your latest backup.

Restart mysql server after you’ve finished making changes:

[root@slave ~]# systemctl restart mysqld.service

Step 4: Initialize Replication process
We should be ready to start Replication process on the slave server. Start by checking Status on the master:


[root@slave ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, 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>


mysql> CHANGE MASTER TO MASTER_HOST='192.168.142.153',
-> MASTER_USER='rpl_user',
-> MASTER_PASSWORD='pankaj',
-> MASTER_LOG_FILE='mysql-bin.000007',
-> MASTER_LOG_POS=155;
Query OK, 0 rows affected, 2 warnings (0.11 sec)
Then start replication on the slave:

mysql> start slave;
Query OK, 0 rows affected (0.06 sec)
To check slave status, use:

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.131.74.92
                  Master_User: rpl_user
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000002
          Read_Master_Log_Pos: 550
               Relay_Log_File: node-02-relay-bin.000002
                Relay_Log_Pos: 717
        Relay_Master_Log_File: mysql-bin.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 550
              Relay_Log_Space: 927
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: d62cd5d2-784a-11e8-9768-eacea5a1be5e
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
       Master_public_key_path:
        Get_master_public_key: 0
1 row in set (0.00 sec)
Slave IO and SQL should indicate running state:

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

Sunday, October 13, 2019

How to create database manually in oracle 11g R2


step.1.go to the cat /etc/oratab and edit it.

vi /etc/oratab

pankaj:/u01/app/oracle/product/11.2.0/dbhome_1:N

step.2.login to oracle user
[oracle@servera ~]$ . oraenv
ORACLE_SID = [orcl] ? pankaj
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle

note:-. oraenv command hit for oratab and pankaj is name of the database.

step.3.copy pfile

cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs

[oracle@servera dbs]$ cp initorcl.ora initpankaj.ora

step.4.edit pfile
current pfile

orcl.__db_cache_size=289406976
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=310378496
orcl.__sga_target=457179136
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=150994944
orcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.memory_target=765460480
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'


after some change pfile


orcl.__db_cache_size=289406976
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__oracle_base='/u03/app/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=310378496
orcl.__sga_target=457179136
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=150994944
orcl.__streams_pool_size=0
*.audit_file_dest='/u03/app/oracle/admin/pankaj/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u03/app/oracle/oradata/pankaj/control01.ctl','/u03/app/oracle/flash_recovery_area/pankaj/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='pankaj'
*.db_recovery_file_dest='/u03/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u03/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.memory_target=765460480
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'


step.5.create a directory for oracle user.


mkdir -p /u03/app/oracle/admin/pankaj/adump
mkdir -p /u03/app/oracle/oradata/pankaj
mkdir -p /u03/app/oracle/flash_recovery_area/pankaj
mkdir -p /u03/app/oracle/flash_recovery_area
mkdir -p /u03/app/oracle

step.6.change permission and change user and group for oracle user.
chown -R oracle:dba /u03/
chmod -R 775 /u03/

step.7.run this script for oracle user.

cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs

export ORACLE_SID=pankaj
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH

step.8.create passowrd file

cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs

orapwd file='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwpankaj' password=pankaj


step.8.login in oracle follow it.
[oracle@servera dbs]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 13 04:34:09 2019

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

Enter user-name: / as sysdba
Connected to an idle instance.

SQL>startup nomount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initpankaj.ora';

SQL>create spfile from pfile;

SQL>shut immediate

step.9.create a file .sql extension

[oracle@servera u03]$ touch create_db.sql
[oracle@servera u03]$ ll
total 4
drwxrwxr-x. 3 oracle dba        19 Oct 13 04:04 app
-rw-r--r--. 1 oracle oinstall 1261 Oct 13 04:12 create_db.sql

[oracle@servera u03]$ vi create_db.sql

CREATE DATABASE pankaj
USER SYS IDENTIFIED BY oracle3
USER SYSTEM IDENTIFIED BY oracle3
LOGFILE GROUP 1 ('/u03/app/oracle/oradata/pankaj/redo01a.log','/u03/app/oracle/oradata/pankaj/redo01b.log') SIZE 50M BLOCKSIZE 512,
GROUP 2 ('/u03/app/oracle/oradata/pankaj/redo02a.log','/u03/app/oracle/oradata/pankaj/redo02b.log') SIZE 50M BLOCKSIZE 512,
GROUP 3 ('/u03/app/oracle/oradata/pankaj/redo03a.log','/u03/app/oracle/oradata/pankaj/redo03b.log') SIZE 50M BLOCKSIZE 512
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u03/app/oracle/oradata/pankaj/system01.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 100K MAXSIZE UNLIMITED
SYSAUX DATAFILE '/u03/app/oracle/oradata/pankaj/sysaux01.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 100K MAXSIZE UNLIMITED
DEFAULT TABLESPACE USERS DATAFILE '/u03/app/oracle/oradata/pankaj/users01.dbf' SIZE 50M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u03/app/oracle/oradata/pankaj/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE UNDOTBS1 DATAFILE '/u03/app/oracle/oradata/pankaj/undotbs01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;

step.10. login in oracle run script

SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 13 04:34:09 2019

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

Enter user-name: / as sysdba
Connected to an idle instance.

SQL>startup nomount

SQL>@/u03/create_db.sql


step.11.after creating database and run this script

SQL>@?/rdbms/admin/catalog.sql

SQL>@?/rdbms/admin/catproc.sql

connect system/oracle3
@?/rdbms/admin/pupbld.sql





Friday, October 4, 2019

How To Configure Local YUM Server In RHEL 7

 How To Configure Local YUM Server In RHEL 7

Step.1.create a directory

#mkdir -p /var/ftp/pub/

Step.2.copy iso image 

#cp -rvf * /run/media/root/RHEL7/ /var/ftp/pub/

step.3.Go To Repo directory.

#cd /etc/yum.repo.d/
Create a blank file .repo extension
#touch server.repo
Edit file and write it
#vi server.repo
Press i to write someting 
[server]
Name=localyumserver
baseurl=file:///var/ftp/pub/
gpgcheck=09

Press ESC and :(colun) and wq to save and exit.


Note:-
name=you can write any name.
Baseurl=local find file
gpcheck =0 (0 indicate the rpm is disable and 1 it indicate the rpm is disable)

Step.4.clean yum sever

#yum clean all

Step.5.check it.

#yum repolist all
Display approx 4100 file.

Thank you.

How to install Oracle 11g R2 in RHEL 7 GUI Mode

how to install oracle 11g in Rhel7 linux GUI

step.1.Create a directory and copy file.
# mkdir /u01/
#linux.x64_11gR2_database_1of7.zip
#linux.x64_11gR2_database_2of7.zip

step.2.unzip the oracle 11g software.

#unzip linux.x64_11gR2_database_1of7.zip 
#unzip linux.x64_11gR2_database_2of7.zip 

Now you have a single Database folder which is have runInstaller file.

Step.3.Edit Hosts File

In the Hosts file you have to fully specify your hostname and your machine IP address.

#vi /etc/hosts
For Example.

<ip address >  <full name of machine >   <short name of your machine>
After update this file press Esc then shif+: then wq  then Enter.

Start configuration to install Oracle 11g R2

Step 4.

Edit /etc/sysctl.conf file and add below parameter in end of this file.

#vi /etc/sysctl.conf

 fs.aio-max-nr = 1048576
 fs.file-max = 6815744
 kernel.shmall = 2097152
 kernel.shmmax = 536870912
 kernel.shmmni = 4096
 # semaphores: semmsl, semmns, semopm, semmni
 kernel.sem = 250 32000 100 128
 net.ipv4.ip_local_port_range = 9000 65500
 net.core.rmem_default=262144
 net.core.rmem_max=4194304
 net.core.wmem_default=262144
 net.core.wmem_max=1048586
After that run below command for applying changes of sysctl file.

#/sbin/sysctl -p
Now Edit /etc/security/limits.conf and add following lines in end of this file.

#vi /etc/security/limits.conf

oracle              soft nproc 2047
oracle              hard nproc 16384
oracle              soft nofile 4096
oracle              hard nofile 65536
oracle              soft stack 10240


Step 5.

Now Edit /etc/pam.d/login file and end following parameter

#vi /etc/pam.d/login

session    required   pam_limits.so
Step 6.

Now install required packages for configuring Oracle Database for installing these rmp using YUM server for yum server configuration see my yum server configuration post.

yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y
Now add some group and add a user for Oracle installation.

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper


useradd -g oinstall -G dba,oper oracle
passwd oracle
Step 8.

Now create a Directory and change  directory permissions

mkdir -p /u01/app/oracle/product/11.2.0.4/db_1
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/
Step 9.

Now set selinux=permissive

#vi /etc/selinux/config
Step 10.

Now make firewall disabled using setup command. Following below steps.

 #systemctl disable firewalld


Step 11.

Now connect you oracle user using su command then open .bash_profile command and add following command in end of file.

#su – oracle

$vi .bash_profile

# Oracle Settings
 TMP=/tmp; export TMP
 TMPDIR=$TMP;

 export TMPDIR
 ORACLE_HOSTNAME='hostname'
 ORACLE_UNQNAME=db11g; export ORACLE_UNQNAME
 ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
 ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1; export ORACLE_HOME
 ORACLE_SID=db11g; export ORACLE_SID
 ORACLE_TERM=xterm; export ORACLE_TERM
 PATH=/usr/sbin:$PATH; export PATH
 PATH=$ORACLE_HOME/bin:$PATH; export PATH

 LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
 CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
 if [ $SHELL = "/bin/ksh" ]; then
 ulimit -p 16384
 ulimit -n 65536
 else
 ulimit -u 16384 -n 65536
 fi
 fi
Step 12.

Now reboot your pc and login with Oracle user and follow below steps.

$cd /u01/database

$./runInstaller


/u01/app/oraInventory/orainstRoot.sh

/u01/app/oracle/product/11.2.0/dbhome_1/root.sh

HOW TO TO CALCULATE TABLE SIZE IN MB AND CREATE EXCEL SHEET IN MYSQL 5.7 USING CENTOS 7

 HOW TO TO CALCULATE TABLE SIZE IN MB AND CREATE EXCEL SHEET IN MYSQL 5.7 USING CENTOS 7 1.Given command below:- SELECT       table_schema a...