Install Oracle 12C Release 1 (12.1) on Oracle Linux 7 (OEL7)
Install Oracle 12C Release 1 (12.1) on Oracle Linux 7 (OEL7)
Posted on May 3, 2014
This article presents how to install Oracle 12C(12.1) Release 1 on Oracle Enterprise Linux 7 (OEL7).
Read following article how to install Oracle Enterprise Linux 7: Install Oracle Linux 7 (OEL7) (for comfort set 4G memory for your virtual machine before proceeding with Oracle software installation).
Software
Software for 12CR1 is available on OTN or edelivery
OTN: Oracle Database 12c Release 1 (12.1.0.2) Software (64-bit).
edelivery: Oracle Database 12c Release 1 (12.1.0.2) Software (64-bit)
Database software
linuxamd64_12102_database_1of2.zip linuxamd64_12102_database_2of2.zip
OS configuration and preparation
OS configuration is executed as root. To login as root just execute following command in terminal.
su - root
The “/etc/hosts” file must contain a fully qualified name for the server.
<IP-address> <fully-qualified-machine-name> <machine-name>
For example.
127.0.0.1 oel7 oel7.dbaora.com localhost.localdomain localhost
Set hostname
hostnamectl set-hostname oel7.dbaora.com --static
Add groups
#groups for database management groupadd -g 54321 oinstall groupadd -g 54322 dba groupadd -g 54323 oper groupadd -g 54324 backupdba groupadd -g 54325 dgdba groupadd -g 54326 kmdba groupadd -g 54327 asmdba groupadd -g 54328 asmoper groupadd -g 54329 asmadmin
Add user Oracle for database software
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba oracle
Change password for user Oracle
passwd oracle
Packages
Check which packages are installed and which are missing
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \ compat-libcap1 \ compat-libstdc++-33 \ gcc \ gcc-c++ \ glibc \ glibc-devel \ ksh \ libaio \ libaio-devel \ libgcc \ libstdc++ \ libstdc++-devel \ libXi \ libXtst \ make \ sysstat
You can install missing packages from dvd. Just mount it and install missing packages using rpm -Uvh command from directory <mount dvd>/Packages or by using yum install command.
NOTE – I’m using x86_64 version of packages
First option from dvd
rpm -Uvh libaio-devel*.x86_64.rpm rpm -Uvh ksh*.x86_64.rpm
Second option using yum install command. It requires access to internet.
yum install libaio-devel*.x86_64 yum install ksh*.x86_64
Add kernel parameters to /etc/sysctl.conf
# kernel parameters for 12gR1 installation 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 65500kernel.panic_on_oops=1
Apply kernel parameters
/sbin/sysctl -p
Add following lines to set shell limits for user oracle in file /etc/security/limits.conf
# shell limits for users oracle 12gR1 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768
Add following line in the /etc/pam.d/login file, if it does not already exist
session required pam_limits.so
Modify /etc/selinux/config and change flag SELINUX. Restart server after this change.
SELINUX=permissive
Disable firewall
service iptables stop chkconfig iptables off
Additional steps
Add following lines in .bash_profile for user oracle
# Oracle Settings export TMP=/tmp export ORACLE_HOSTNAME=oel7.dbaora.com export ORACLE_UNQNAME=ORA12C export ORACLE_BASE=/ora01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1 export ORACLE_SID=ORA12C PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; alias cdob='cd $ORACLE_BASE' alias cdoh='cd $ORACLE_HOME' alias tns='cd $ORACLE_HOME/network/admin' alias envo='env | grep ORACLE' umask 022if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -u 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fienvo
Directory structure
Create directory structure as user root
ORACLE_BASE – /ora01/app/oracle
ORACLE_HOME – /ora01/app/oracle/product/12.1.0/db_1
mkdir -p /ora01/app/oracle/product/12.1.0/db_1 chown oracle:oinstall -R /ora01
In Oracle Enterprise Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.
systemctl mask tmp.mount
Install database software
Let’s start with database software installation as oracle user.
su - oracle --unizp software it will create directory "database" --where you can find installation software unzip linuxamd64_12102_database_1of2.zip unzip linuxamd64_12102_database_2of2.zip --I defined 4 aliases in .bash_profile of user oracle to make --administration easier :) [oracle@oel7 ~]$ alias envo cdob cdoh tns alias envo='env | grep ORACLE' alias cdob='cd $ORACLE_BASE' alias cdoh='cd $ORACLE_HOME' alias tns='cd $ORACLE_HOME/network/admin' --run alias command envo to display environment settings envo ORACLE_UNQNAME=ORA12C ORACLE_SID=ORA12C ORACLE_BASE=/ora01/app/oracle ORACLE_HOSTNAME=oel7.dbaora.com ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1 --run alias command cdob and cdoh --to check ORACLE_BASE, ORACLE_HOME [oracle@oel7 ~]$ cdob [oracle@oel7 oracle]$ pwd /ora01/app/oracle [oracle@oel7 db_1]$ cdoh [oracle@oel7 db_1]$ pwd /ora01/app/oracle/product/12.1.0/db_1 --run installation from "database" directory ./runInstall
1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.
2. Ignore following message and click “Yes” button.
3. Select “Create and configure a database” then click “Next” button.
4. Select “Server class” and click “Next” button.
5. Accept default “Single instance database installation” and click “Next” button.
6. Select “Advanced install” to later select more options during database installation and click “Next” button.
7. You can select language here. Once it’s done click “Next” button.
8. You can select here type of binaries to install. Once it’s done click “Next” button.
9. Here you should see directories for ORACLE_BASE and ORACLE_HOME for your binaries according to environmental settings. Click “Next” button.
10. Accept default and click “Next” button.
11. Accept default “General Purpose/ transaction Processing” and click “Next” button.
12. Here you define your database name. Check checkbox “Create as Container database” and enter “Pluggable database name” to add your first container ORA12C and pluggable PORA12C1 database and click “Next” button.
13. Specify more details about your database on 3 tabs where you can define memory settings, character set and if to install sample schema on your database. Once you are happy with your settings click “Next” button.
14. Specify directory where you want to install your database files then click “Next” button.
15. On this page you can register your database in Oracle Enterprise Manager”. Accept default settings and click “Next” button.
16. Check checkbox “Enable Recovery” to specify directory for your recovery area “Recovery area location” and click “Next” button.
17. Specify password for each user or enter the same for all. Once it’s done click “Next” button.
18. Here you can specify OS group for each oracle group. Accept default settings and click “Next” button.
19. Checks are started to verify if OS is ready to install database software.
20. If everything is right click “Install” button. It’s the last moment to come back to each of previous point and make changes.
21. Installation in progress … go play football
22. Once binaries are installed the last step is to run 2 scripts as user root.
--execute scripts /ora01/app/oraInventory/orainstRoot.sh /ora01/app/oracle/product/12.1.0/db_1/root.sh
23. Installation will continue …
24. Database Configuration Assistant will start automatically and create database for you.
25. When database is ready you should see summary window. You can click “Password Management” to change passwords for many accounts in database. Once it’s done click “OK” button to continue.
26. You are lucky 12C installation is completed. Click “Close” button.
27. Try to login as SYS to Enterprise manager Database express 12C . NOTE – It requires to install flash plug-in.
https://oel7.dbaora.com:5500/em
Remember it requires listener up and running.
Problem
In release 12.1.0.1 following bugs can be encountered
1. Linking errors ins_precomp.mk
Error in invoking target 'links proc gen_pcscfg procob' of makefile '/ora01/app/oracle/product/12.1.0/db_1/precomp/lib/ins_precomp.mk'
To solve this problem do following as user oracle
remove directory /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
rm -rf /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
backup file $ORACLE_HOME/rdbms/lib/env_rdbms.mk
cd $ORACLE_HOME/rdbms/lib/ cp env_rdbms.mk env_rdbms.mk.bck
make changes in $ORACLE_HOME/rdbms/lib/env_rdbms.mk
modify line 176
LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS)
to
LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS) -lons
modify line 279 and 280
LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS)
to
LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) -Wl,--no-as-neededLINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS) -Wl,--no-as-needed
modify line 3041 and 3042
TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \ $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS)
to
TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \ $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS) -lnnz12
Once it’s done click “Retry” button. Linking should finish properly and binaries installation should continue.
2. Linking error ins_ctx.mk
Error in invoking target 'install' of makefile '/ora01/app/oracle/product/12.1.0/db_1/ctx/lib/ins_ctx.mk'.
To solve this problem do following as user oracle
remove directory /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
rm -rf /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
backup file $ORACLE_HOME/rdbms/lib/env_rdbms.mk
cd $ORACLE_HOME/rdbms/lib/ cp env_rdbms.mk env_rdbms.mk.bck
make modifications in file “$ORACLE_HOME/ctx/lib/env_ctx.mk”
modify line 154
LINK=$(LDCCOM)
to
LINK=$(LDCCOM) --Wl,--no-as-needed
Click the “Retry” button.
目录 返回
首页