Search This Blog

Friday, 30 June 2017

Oracle 12C Installation on centos

Oracle 12g Installation on centos
Install oracle 12c using xmanager.
create a database named orcl. Binaries should be installed inside /u01
Datafiles should be under /data01
Redolog files should be stored inside /redoA , /redoB , /redoC .Three different mount point for 3 diff groups.
All group must have 2 members in different mount point.
undo tablespace should be stored in /undotbs 
and temporary tablespace in /temptbs
1) First We have to disable selinux from this file
 
      This file controls the state of SELinux on the system.
# SELINUX= yum:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
edit the parameter and save :wq
 
[root@ab ~]# vi /etc/selinux/config
SELINUX=disable
[root@ab ~]# service iptables stop
[root@ab ~]# service iptables save
Disable the firewall.
Then restart the service
#service network restart

2) Edit host file & edit the following things at last line-
[root@ab ~]#  vi /etc/hosts
 192.168.100.115 ab.kmi.com  abhishek

3) We will configure the yum with .
Login as root and issue the following command.
(for eg... [root@ab ~]# yum install binutils-*)
[root@ab ~]# yum install <packages>
    yum install binutils -y
    yum install compat-libcap1 -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



After Successful installation of Linux/CentOS6. Update the yum with help of

... [root@ab ~]# yum update



4) First we will add groups by running the following commands

[root@ab ~]# groupadd oper
[root@ab ~]# groupadd dba
[root@ab ~]# groupadd oinstall


5)Then we will add user oracle, with primary group Oninstall & secondary group G dba,oper
[root@ab ~]# useradd -g oinstall -G dba,oper  oracle

6) Then we will assign password to this user. The password assigned to this user is oracle however you can choose your own password.
[root@ab ~]# passwd oracle
7) Now we will make a directory for all the oracle components.
[root@ab ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@ab ~]#mkdir - /redoa       #Redolog files should be stored inside /redoA , /redoB , /redoC .
[root@ab ~]#mkdir - /redob
[root@ab ~]#mkdir - /redoc
[root@ab ~]#mkdir - /undotbs_1    #undo tablespace should be stored in /undotbs
[root@ab ~]#mkdir - /temptbs_1   #temporary tablespace in /temptbs
[root@ab ~]#mkdir - /data_1        #Datafiles should be under /data01

8) Give permissions to the above created folder.
[root@ab ~]# chmod -R 777 /u01
[root@ab ~]# chmod -R 777 /redoa
[root@ab ~]# chmod -R 777 /redob
[root@ab ~]# chmod -R 777 /redoc
[root@ab ~]# chmod -R 777 /data_1
[root@ab ~]# chmod -R 777 /temptbs_1
[root@ab ~]# chmod -R 777 /undotbs_1



9) Choose the owner and group for that folder.
[root@ab ~]# chown -R oracle:oinstall /u01
[root@ab ~]# chown -R oracle:oinstall /redoa
[root@ab ~]# chown -R oracle:oinstall /redob
[root@ab ~]# chown -R oracle:oinstall /redoc
[root@ab ~]# chown -R oracle:oinstall / data_1
[root@ab ~]# chown -R oracle:oinstall / temptbs_1
[root@ab ~]# chown -R oracle:oinstall / undotbs_1



10) Correct the Default limit for number of user's processes to prevent.
[root@ab ~]# vi /etc/security/limits.d/90-nproc.conf
# Change number of process
* soft    nproc    1024
# To this
    *  nproc 16384

Prerequisites to installing Oracle 11gR2
11)Open the following file and add the kernel parameters to the last line.
[root@ab ~]# vi /etc/sysctl.conf
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
12)  This command are used  to change the current kernel parameters in the sysctl file
root@ab ~]# /sbin/sysctl -p

13)Update /etc/security/limits.conf#  "#soft" for enforcing the soft limits
                                                                  # "hard" for enforcing hard limits
Scroll to the bottom and above the “# End of file” line, add,and save with :wq
[root@ab ~]#  vi/etc/security/limits.conf
    oracle   soft   nofile    1024
    oracle   hard   nofile    65536
    oracle   soft   nproc    2047
    oracle   hard   nproc    16384
    oracle   soft   stack    10240
    oracle   hard   stack    32768

14) Setting up the bash profile. Add the following (use hostname from the command line to get your hostname and use the correct paths for your install)
 [root@ab ~]# su - oracle
[oracle@ab ~]$hostname
[oracle@ab ~]$vi .bash_profile
 
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
 
export PATH
 
ORACLE_HOSTNAME=(Set the host name); export ORACLE_HOSTNAME
ORACLE_UNQNAME=(set the uniquename); export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_SID=(Set the SID); export ORACLE_SID
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/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

                        then after save the information and exit.
Now we are ready to install the oracle software.
15) Make a folder in the /u01 folder as "soft" and  copy/unzip the oracle database files in that folder.
[root@ab ~] # /u01/soft
[root@ab ~] #chmod -R 777 /u01/soft
copy/unzip the oracle database files in that folder.
[root@ab ~] # cd /u01/soft
[root@ab /u01/soft~] # unzip linux.x64_11gR2_database_1of2_2.zip
[root@ab /u01/soft~] # unzip linux.x64_11gR2_database_2of2_2.zip

16) We will be install & used X-manager in window system to graphically export Linux screen  in window to install Oracle 11g.

after install a Xmanager then connect with.
window will be open and fill
Session name : oracle
Host : (ip of machine)
Set Protaocal : SSH
User name : root
Authentication
command  :  choose the 1xterm
                    xterm -ls -display $DISPLAY

then save and run.

17) Then the window are open and cd/u01/soft/databasego to the oracle directory.
[root@ab ~] # su - oracle
[oracle@ab ~] #cd /u01/soft/database/
[oracle@ab database]$ ls - ltr
[oracle@ab database]$ ./runInstaller * ( the installation process started) fallow the step one by one.

Final Step

18) When the oracle installation is finished it will ask to run two scripts as the root user.
open a new terminal and run the scripts exactly as they are written one by one. in root user

[root@ab ~]# /u01/app/oraInventory/orainstRoot.sh

[root@ab ~]# /u01/app/oracle/product/13.2.0/db_1/root.sh

after running the scripts click ok and exit the enterprise manager.
now your oracle software installation is finished.


Now we are ready to create  the database with the help of DBCA.
[oracle@ab /]$ dbca
Step 1
Sept to choose advance mode
Setp3 chosse genreal purpose
set 4 set gobal db name
 


step 5

step 6 set password





step 7
step 8 set file location variable
uncheck the user oracle-manage file box




step 8 set redo log destination
step 9





Step 10
step 11click coustamize storage location

set11 continue click on storage file and edit its location where we want to stored it.
edit control file location as per scenarios
edit data file location as per scenarios


edit redo file location as per scenarios




FInal Step

Way  to connect with Database and perform sum action.

[root@ab ~]# su - oracle
[oracle@ab ~]$ export ORACLE_SID=orcl
[oracle@ab ~]$ sqlplus / as sysdba

How to get the status of database.

SQL> select status from v$instance;
STATUS
------------
OPEN
How to get the databasename.
SQL> select dbid,name from v$database;
      DBID  NAME
----------    ---------
3450597470 ORCL
How to get the controlfile location.

SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u01/app/oracle/oradata/dborcl
                                                 /control01.ctl, /u01/app/oracl
                                                 e/oradata/dborcl/control02.ctl

How to get the redo log location.
SQL> select group#,member from v$logfile;

    GROUP#                   MEMBER
------------------------     --------------------------------------------------------
         3                         /redoc/dborcl/redo03.log

         2                         /redob/dborcl/redo02.log

         1                        /redoa/dborcl/redo01.log


How to get the redo log location.

SQL> select file_name,tablespace_name from dba_data_files;

FILE_NAME                                                                TABLESPACE_NAME
----------------                                                                   --------------
/u01/app/oracle/oradata/dborcl/users01.dbf               USERS
/undotbs_1/dborcl/undotbs01.dbf                                   UNDOTBS1
/u01/app/oracle/oradata/dborcl/sysaux01.dbf              SYSAUX
/u01/app/oracle/oradata/dborcl/system01.dbf             SYSTEM
/u01/app/oracle/oradata/dborcl/example01.dbf            EXAMPLE

How to get the Tempfile location.
SQL>  select file_name,tablespace_name from dba_temp_files;

FILE_NAME                                                                         TABLESPACE_NAME
--------------------------------------                                 ------------------------------------------
/temptbs_1/dborcl/temp01.dbf                                               TEMP


...................................................................Finish.......................................................................................

No comments:

Post a Comment