ORACLE DATABASE INSTALLATION GUIDE ON LINUX TABLE OF CONTENTS 1. Prerequisites 1.1 Hardware Requireme Requirements nts……………………………………………………………………….. 1 1.2 Software Requirements………………………………………………………………………… 1 1.3 Package Requirements………………………………………………………………………… 1 2. Database Installation and Configuration 2.1 Oracle Installation………………………………………………………………………… Error! Bookmark not defined. ……4 2.2 Network Configuration………………………………………………………………………..17 2.3 Database Configuration……………………………………………………………………….21 2.4 Installatio Installation n Validation………………………………………………………………………….28 3. Troubleshooting steps 4. References
PREREQUISITES
1.1 HARDWARE REQUIREMENTS:
At least 1 GB of RAM To determine the RAM size, use the below command: $grep MemTotal /proc/meminfo /proc/meminfo 1.2 SOFTWARE REQUIREMENTS
Oracle Linux binary based on the system processor bit. Download it from, http://www.oracle.com/tec http://www.oracl e.com/technetwork/databa hnetwork/database/enterprise-e se/enterprise-edition/downloa dition/downloads/index.htm ds/index.htmll
1.3 PACKAGE REQUIREMENTS
Install the below packages using the below command: $yum install packagename
Packages: binutils-2.15.92.0.2 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.97 elfutils-libelf-devel-0.97 gcc-3.4.5 gcc-c++-3.4.5 glibc-2.3.4-2.19 glibc-2.3.4-2.19 (32 bit) glibc-common-2.3.4 glibc-devel-2.3.4 glibc-devel-2.3.4 glibc-devel-2.3.4 (32-bit) libaio-0.3.105 libaio-0.3.105 (32 bit) libaio-devel-0.3.105 libgcc-3.4.5 libgcc-3.4.5 (32-bit) libstdc++-3.4.5 libstdc++-3.4.5 (32 bit) libstdc++-devel 3.4.5 make-3.80 numactl-0.6.4.x86_64 sysstat-5.0.5 DATABASE INSTALLATION AND CONFIGURATION
1. Login to the system with ‘root’ user and copy the oracle installer(comprises 2 parts of zip)to the /mnt directory (Note: Copy to the respective partition partition which has enough space) 2. Create Oracle Primary Group & Owner[user]: i) Create Group $ groupadd -g 800 dba $ groupadd -g 1000 oinstall Params: groupadd – add the group -g – group 800, 1000 – group unique id[any number which shouldn’t be used already] dba, oinstall – group name Note: check for group existence $ cat /etc/group
Packages: binutils-2.15.92.0.2 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.97 elfutils-libelf-devel-0.97 gcc-3.4.5 gcc-c++-3.4.5 glibc-2.3.4-2.19 glibc-2.3.4-2.19 (32 bit) glibc-common-2.3.4 glibc-devel-2.3.4 glibc-devel-2.3.4 glibc-devel-2.3.4 (32-bit) libaio-0.3.105 libaio-0.3.105 (32 bit) libaio-devel-0.3.105 libgcc-3.4.5 libgcc-3.4.5 (32-bit) libstdc++-3.4.5 libstdc++-3.4.5 (32 bit) libstdc++-devel 3.4.5 make-3.80 numactl-0.6.4.x86_64 sysstat-5.0.5 DATABASE INSTALLATION AND CONFIGURATION
1. Login to the system with ‘root’ user and copy the oracle installer(comprises 2 parts of zip)to the /mnt directory (Note: Copy to the respective partition partition which has enough space) 2. Create Oracle Primary Group & Owner[user]: i) Create Group $ groupadd -g 800 dba $ groupadd -g 1000 oinstall Params: groupadd – add the group -g – group 800, 1000 – group unique id[any number which shouldn’t be used already] dba, oinstall – group name Note: check for group existence $ cat /etc/group
ii) Create user for the dba[primary] group $useradd -u 800 -g dba -G oinstall -d /mnt/oracle oracle Params: Useradd – add the user -u – unique number or id -g- group dba – primary group oinstall – secondary group -d – path /mnt/oracle – path where oracle user going to exist oracle – username
verify the user ‘oracle’ has created or not by, Ex: cat /etc/passwd Test Output for the above command: oracle:x:800:800::/mnt/oracle:/bin/bash
iii) Set the password for ‘oracle’ user by, $passwd oracle [FYI : please create strong strong password to avoid hacking & software software vulnerabilities while installing on cloud machines especially] 3) Unpack Files: $unzip filename.zi filename.zip p [First unzip the part1 of oracle, then oracle part2 zip] 4) After unzipping, logon as an oracle user. Then go to the location where you have just unzipped the oracle. Copy the database folder from the present directory to another directory which is having enough space Note: change the ownership to oracle user in dba group by $ chown oracle:dba foldername Params: Chown – change ownership Oracle – oracle user Dba – group Foldername – which needs ownership 5) Please install XMING on your windows system for communication between client applications running on remote. [You can download it from http://www.soft http://www.softpedia.com/ pedia.com/get/Internet/Se get/Internet/Servers/Otherrvers/OtherServers/Xming.shtml [for windows]] At the sametime sametime download ‘x windows windows utility’ in in linux also through $ yum groupinstall "X Window System"
Now, open the xming on windows system, then follow the below.
2.1 ORACLE INSTALLATION
6) Run the installer which is in /mnt directory using below command $ ./runinstaller Create swap file if you face memory issue at this step:
Steps : i)Create swap file for faster performance with available memory $dd if=/dev/zero of=/mnt/swapfile bs=1024 count=8290304 Param: /mnt – folder has enough space [The above will create 8GB of swap space in /mnt folder in the name of swapfile] ii)Give the permissions for the swapfile $chmod 600 swapfile iii)Make the swap through below, $mkswap swapfile $swapon swapfile iv)check the amount of available free memory after creating the swap $free –m
Optional: To enable at boot time: edit /etc/fstab file, then input the entry of partition.
Follow the below GUI for further steps.
Any folder you can choose as Oracle Base:
Select the dba group:
7) Install all the above mentioned failed packages through ‘yum’ utility command from the root/oracle user as below yum install gcc-3 o yum install gc o yum install gcc o yum install compat-libstdc++ o yum install compat-libstd o o yum install compat-libstdc o yum install libstdc++ o yum install elfutils-libelf-devel o yum install glibc-headers o yum install gcc-c++ o yum install libaio-devel yum install libstdc++-devel o yum install sysstat o yum install unixODBC o yum install unix-ODBC-devel o yum install pdksh o After installing all the required packages click on ‘back’ and check it again till it succeeds.
.
8) Now switch to the ‘oracle’ user which has created above $ su – oracle
Then press enter, if it prompt for a password, Enter Password : (password which has set for the oracle user ) 9) Set path for ORACLE_HOME & ORACLE_BASE in ‘oracle’ user bash_profile as below Command: $ vi ~/.bash_profile (open the bash_profile in vi mode to edit) Add below statements in ‘bash_profile’ file by modifying the paths as per yours and save the File. ORACLE_BASE=/mnt/oracle/app/oracle [which you have specified during installation of database] – Refer ORACLE_HOME=/mnt/oracle/app/oracle/product/11.2.0/dbhome_1 PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE export ORACLE_HOME export PATH /*The path which you gave while installing oracle. Please refer the screenshot [No.6] oracle base* / 9) Run below command to check/validate the paths set above. Command : $ env 10) Run netca (Oracle Network Configuration Wizard) after opening the XMing [Step 5], To create the oracle listener and service by, $netca [You can set the listener for the oracle through the below steps]
2.3 NETWORK CONFIGURATION
11)Set the service name through Local net service name configuration: Run netca again, then select the third option for service name, [Continue after opening the XMing[Step 5]] $netca
Give the Public ip address in host name
2.3 DATABASE CONFIGURATION
12) Run dbca (Database configuration wizard) after opening the xming. $dbca
SID Should be unique:
14)Start the listener services through, $lsnrctl start If it is not starting then fix ur ~/.ash_profile Then go to the from oracle user to /home/oracle Then run below command. - source .bash_profile Then try to connect with db Sample o/p: STATUS of the LISTENER -----------------------Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 26-FEB-2013 09:51:48 Uptime 0 days 0 hr. 3 min. 9 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /mnt/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /mnt/oracle/app/oracle/product/11.2.0/dbhome_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server-1361379715-az-1-region-a-geo1)(PORT=1521))) Services Summary... Service "ORCL" has 1 instance(s). Instance "ORCL", status READY, has 1 handler(s) for this service... Service "ORCLXDB" has 1 instance(s). Instance "ORCL", status READY, has 1 handler(s) for this service... The command completed successfully
2.4 INSTALLATION VALIDATION
15)Connect to sqlplus, $sqlplus 'system/password@ORCL' Params: System – user Password – administrative password which we already set in dbca conf ORCL – SID(service identifier)
Note: If you don’t have permission to access sqlplus with the corresponding library, then try to execute the below command,
chcon -t textrel_shlib_t '/u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1' '/u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1' – Path of the library file. 16) After entering into sqlplus, make sure of tables existence through, select * from user_tables; TROUBLESHOOTING STEPS
1) Input the host in case of network failures,
Hosts File: The "/etc/hosts" file must contain a fully qualified name for the server.
For example, 127.0.0.1 localhost.localdomain localhost 192.168.2.181 ol5-11gr2. http://www.oracle-base.com/articles/11g/oracle-db-11gr2-installation-onoracle-linux-5.phplocaldomain ol5-11gr2 (or) 127.0.0.1
hostname
2) If you get the below error, please try it out with various options to resolve it, Error:
i.
TNS: no listener Check for environment variables which include ORA[related to oracle]
$env | grep ORA Ex o/p: ORACLE_SID=dev1 ORACLE_BASE=/u01/app/oracle ORACLE_TERM=xterm ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1 ii.
Verify the .ora file matches with below entries a. listerner.ora (Path: oracle_home/11.1.2/db_1/network/admin)
LISTENER =
(DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = server-1361379715-az-1-region-a-geo1)(PORT = 1521)) ) )/* server-1361379715-az-1-region-a-geo-1 – server hostname i.e Give private ip address if applicable 1521 – Port */ ADR_BASE_LISTENER = /mnt/oracle/app/oracle /*Directory path which you gave while installing database*/ SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=ORCL) /*global database name*/ (ORACLE_HOME=/mnt/oracle/app/oracle/product/11.2.0/dbhome_1) (SID_NAME=ORCL)) (SID_DESC= (SID_NAME=plsextproc) (ORACLE_HOME=/mnt/oracle/app/oracle/product/11.2.0/dbhome_1) (PROGRAM=extproc))) b. Tnsnames.ora (Path: oracle_home/11.1.2/db_1/network/admin)
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = server-1361379715-az-1-region-a-geo1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ORCL) ) )/* Params: server-1361379715-az-1-region-a-geo-1 – server hostname i.e Give private ip address if applicable 1521 – Port */
3) Try to start the listener once by,
$lsnrctl start