The installation of the Oracle database on bare-bone Linux.
For a quick an dirty installation, see Azure - Quick Oracle Database Installation from MarketPlace
This installation after reboot of the machine will prevent the login service to restart. You can't then login with ssh :(
The boot diagnostic gives the below message:
�[K[�[1;31mFAILED�[0m] Failed to start Login Service.
See 'systemctl status systemd-logind.service' for details.
I had not time to investigate. For a quick installation, use the marketplace. See Azure - Quick Oracle Database Installation from MarketPlace
Creation of a VM with Oracle Linux 7 Update 4 and a Standard_DS1_v2 size.
az.cmd vm create ^
--resource-group GROUP_NAME ^
--name VM_NAME ^
--image Oracle:Oracle-Linux:7.4:7.4.20170908 ^
--size Standard_DS1_v2 ^
--authentication-type password ^
--admin-username admuser ^
--admin-password thepwd ^
--location westeurope
{\ Finished ..
"fqdns": "",
"id": "/subscriptions/a3c34890-da7a-51ac-88fa-090f6b96d44d/resourceGroups/GROUP_NAME/providers/Microsoft.Compute/virtualMachines/VM_NAME",
"location": "westeurope",
"macAddress": "01-5D-4A-29-79-H6",
"powerState": "VM running",
"privateIpAddress": "10.0.0.0",
"publicIpAddress": "55.666.444.88",
"resourceGroup": "GROUP_NAME",
"zones": ""
}
Usually only EnableSwap and SwapSizeMB will not come configured by default. Windows Azure Linux Agent (waagent) - (on Linux VM)
Edit the “/etc/waagent.conf” Add or uncomment these lines:
# Format if unformatted. If 'n', resource disk will not be mounted.
ResourceDisk.Format=y
# File system on the resource disk
# Typically ext3 or ext4. FreeBSD images should use 'ufs2' here.
ResourceDisk.Filesystem=ext4
# Mount point for the resource disk
ResourceDisk.MountPoint=/mnt/resource
# Create and use swapfile on resource disk.
ResourceDisk.EnableSwap=y
# Size of the swapfile.
ResourceDisk.SwapSizeMB=3175
Save and restart the agent to apply if any changes are made
systemctl stop waagent
systemctl start waagent
Private IP Address must be static.
In Azure, Network Interface > Configuration > Ip Configuration > Click > Static
Restrict the inbound rules to your public IP if you don't want to see others trying to get in.
As root
sudo su -
yum update -y
yum install wget zip unzip tmux -y
yum install xauth -y
cat /etc/ssh/sshd_config | grep -i X11
# Must be yes
X11Forwarding yes
yum install xclock -y
# Start your local X11 Server
# Not as root, start the clock
xclock
uname -m
x86_64
grep MemTotal /proc/meminfo
MemTotal: 3248960 kB
free # free ram
total used free shared buff/cache available
Mem: 3248960 137932 2947872 8532 163156 2926636
Swap: 2097148 0 2097148
Linux - Shared Memory (SHM) (/dev/shm)
Ensure that the /dev/shm mount area is of type tmpfs and is mounted with the following options:
df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 0 1.6G 0% /dev/shm
ls -l /dev | grep shm
drwxrwxrwt. 2 root root 40 Dec 21 09:02 shm
df -h /tmp
df -H /
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 32G 5.8G 24G 20% /
If the ORACLE_HOSTNAME environment variable is not set and you are installing on a computer that has multiple network cards, then Oracle Universal Installer determines the host name from the hosts file.
Example of /etc/hosts file with di-rep-db.hotitem.local as hostname
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
10.0.0.4 vm_name vm_name.localdomain
ping hostname
Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:
SELINUX=disabled
Resources Limitations: Linux - Resource Manager - Processes limitations (/etc/security/limits.conf)
Add the following lines to the /etc/security/limits.conf file that limits the resource for the oracle user.
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper
useradd -u 501 -g oinstall -G dba,oper oracle
passwd oracle # Set the password
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
See Automatically Configuring Oracle Linux with Oracle Preinstallation RPM
# As root
yum install oracle-rdbms-server-12cR1-preinstall
sysctl -p
yum update
Equivalent to the following ?
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
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 smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install zlib-devel.i686 -y
vi /etc/sysctl.conf
# Add the following kernel parameters
kernel.sem = 250 32000 100 142
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1663467520
kernel.shmmni = 4096
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
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
/sbin/sysctl -p
mkdir -p /u01/tmp
cd /u01/tmp
# Transfer the file linuxx64_12201_database.zip to /tmp
# Copy it below u01
mv /tmp/linuxx64_12201_database.zip /u01/tmp
unzip linuxx64_12201_database.zip
# Changes the owner to oracle
chown -R oracle.oinstall /u01
locale settings must enable Unicode support
locale # To check your current locale settings, use the locale command on your system.
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
If not good
setenv LANG en_US.UTF-8 # Sets the installation default locale.
setenv LC_ALL en_US.UTF-8 # overrides the value of the LANG environment variable and the values of any other LC_* environment variables.
Only if any other Oracle software is present. os: Bash - (Environment) Variable
unset ORACLE_HOME
unset ORACLE_BASE
unset ORACLE_SID
unset TNS_ADMIN
On the command line and in the bash profile
umask 022
cd /u01/tmp/database/
./runInstaller
# -ignoreSysPrereqs
The installation may seems to be not finished but this is not the case.
The following response file create:
Steps:
cd /u01/tmp/database/
# Start a tmux session
tmux
# Run the installer
./runInstaller -silent -responseFile /tmp/db.rsp
#./runInstaller -silent -ignoreSysPrereqs -responseFile /tmp/db.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 18828 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3174 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-01-08_05-23-00PM. Please wait ...
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2018-01-08_05-23-00PM.log
The installation of Oracle Database 12c was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2018-01-08_05-23-00PM.log' for more details.
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Successfully Setup Software.
As install user, execute the following command to complete the configuration.
/u01/tmp/database/runInstaller -executeConfigTools -responseFile /tmp/db.rsp [-silent]
When asked during the GUI installation or after a silent install.
set -o xtrace
. /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
# to know where is this script, ask the trace
set -o xtrace
. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
/u01/app/oracle/product/12.2.0/dbhome_1/install/root_HI-ORACLE-DB-01_2018-01-08_19-34-03-404231473.log
After a silent installation:
long operation
execute dbca silently (database configuration tool)
/u01/tmp/database/runInstaller -executeConfigTools -responseFile /tmp/db.rsp -silent
Follow it:
tail -f /u01/app/oraInventory/logs/installActions2018-01-08_07-47-43PM.log
Output:
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 11707 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3166 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-01-08_07-47-43PM. Please wait ...
You can find the logs of this session at:
/u01/app/oraInventory/logs
Successfully Configured Software.
[ 2018-01-08 19:49:07.747 UTC ] Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
DBCA_PROGRESS : 18%
DBCA_PROGRESS : 33%
[ 2018-01-08 19:53:43.530 UTC ] Creating and starting Oracle instance
DBCA_PROGRESS : 35%
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 44%
DBCA_PROGRESS : 49%
DBCA_PROGRESS : 53%
DBCA_PROGRESS : 54%
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 58%
[ 2018-01-08 19:57:51.162 UTC ] Completing Database Creation
DBCA_PROGRESS : 59%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 61%
DBCA_PROGRESS : 64%
DBCA_PROGRESS : 65%
DBCA_PROGRESS : 69%
[ 2018-01-08 20:08:57.580 UTC ] Executing Post Configuration Actions
DBCA_PROGRESS : 100%
[ 2018-01-08 20:08:57.581 UTC ] Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=orcl
export ORACLE_SID=orcl
sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Jan 8 21:24:38 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> exit
lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-JAN-2018 21:24:12
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=HI-ORACLE-DB-01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 08-JAN-2018 19:48:51
Uptime 0 days 1 hr. 35 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/HI-ORACLE-DB-01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HI-ORACLE-DB-01)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=HI-ORACLE-DB-01)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
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
Parameter | Minimum Required Value |
---|---|
SHARED_POOL_SIZE | 147,456 KB |
SGA_MAX_SIZE | 147,456 KB |
DB_BLOCK_SIZE | 8 KB |
session_cached_cursors | 100 |
processes | 500 |
open_cursors | 800 |
db_files | 600 |