I have been asked to support oracle, I have started self learning and had some corporate training as well.
In this post, I am sharing how to build VM and install oracle database in your desktop or laptop.
- Install and build VMware workstation in your laptop
- Build new VM by installing CentOS or Linux
- Copy the DB software and install DB binaries
- Create a oracle database
- Create a listener
- Connect the database by putty and SQL developer
How to Install Linux on VMware workstation 1&2
Install VMware work station
On the OS part — install OS later option– 40 GB disk size VM
–Store virtual machine in single file– Click customize HDD–edit the VM and mount the ISO
Power ON–Skip installation No –Choose custom layout
Create four mandatory file system for Linux oracle
(/ -10 GB, /boot – 500MB, /tmp – 5GB, swap -5 GB & /opt) – Desktop or server class, connect IP automatically etc.
Reboot–Disable firewall, selinux – etc/selinux/config.
To disable firewall permanently, enter: # chkconfig iptables off # service iptables stop
Oracle installation 3:
Oracle is a platform dependent one, Download the software related to your operating system from Oracle website. (First two zip files will be fine for the DBs)
For Windows — Just unzip the folders and run the “setup.exe”–C:\>sqlplus –v
Oracle installation on Linux
We have two parts in this installation. The second part will be good since, it will install the required prerequisites from part 2.
–Copy the binaries to the Linux server file system: /opt – use winscp or putty
Better do go with two part installation, first software only and then create a database.
PART 1
Prerequisites for the Linux
1. Semaphores settings
ipcs –ls to see all Semaphores configurations.
vi /etc/sysctl.conf – come at last line and add the following.
Kernel.shmmax = 2147483648 – SGA max size (Half of the RAM size in bytes)
kernel.shmall = 2097152 – SGA minimum size
kernel.shmmi = 4096 – OS level block size
kernel.sem = 250 64000 100 128 – Semaphores total setting
fs.file-max = 65536 – Maximum of file creation on the filesystem
net.ipv4.ip_local_port_range = 1024 32000 – Network port range allowable
sysctl –p – It will display the configurations of the Semaphores files, In case of any error it will show.
- User limit settings
vi /etc/security/limits.conf – come at last line and add the following.
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
{Nofile / Noproc – number of hard & soft file and process an oracle user can create}
3. RPM Redhat Package Manager
RPM = dll
Linux has lots of RPM for OS,the followings are must for oracle database
RPM = dll
Linux has lots of RPM for OS,the followings are must for oracle database
RPM | ||
binutils* | libgcc* | elfutils* |
openmotif* | libstdctt* | unixODBC* |
cpp* | libaio* | ksh* |
compat* | libxp* | kernel* |
gcc* | setarch* | xorg* |
glibc* | make* | |
gnome* | systat* |
How to find the rpm is already installed
# rpm –q {Pak name} – It will display RPM # rpm –qa – It will display all RPM #rpm –qa|grep binufils* - If it’s not installed it will display ‘#’
One of the main problem is installing RPM for databases which is mandatory and pre-requesting as well.
We can do this in many methods, by using CD/iSO file mount or download from internet. In this we can install manually or using YUM.
Better to go with CD and ISO files and configure YUM to install in single shot.
=======Install RPM by manual or using YUM
— find the version of OS
cat /etc/redhat-release
mount /dev/sr0 /mnt
cd /etc/yum.repos.d
Create a file
vi CentOS7_7.repo
[InstallMedia]
name=CentOS 7.7
gpgcheck=0
baseurl=file:///mnt/
enabled=1
yum clean all
yum list
yum repolist
=================
cleanup yum repo, if needed
cd /etc/yum.repos.d/
ls -l
rm -f /etc/yum.repos.d/yum_oracle.repo
yum clean all
yum list all
— next install rpm by YUM
yum install gcc-* binutils* openmotif*
yum install cpp* compat* glibc* gnome* libaio-* libgcc* libstdctt* libxp*
yum install setarch* make* elfutils* ksh* kernel* xorg*
yum install sysstat-* unixODBC-* elfutils-* vnc*
To install manual
rpm –ivh –force –nodeps binutils*
part 2
groupadd oinstall
useradd -g oinstall -G oinstall oracle
passwd oracle
mkdir -p /opt/oracle/product/11.2.0/dbhome
chown -R oracle:oinstall /opt
chmod -R 777 /opt
–login as oracle
su – oracle
$
$ vi .bash_profile
Bash profile is used for oracle user environment settings. If it does not have, each time we need to enter the following. We can have same or different bash profile for multiple DBs.
Save: $HOME directory of the oracle user
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=test01
Save the profile file and reboot.
$exit
init 6
———–Configure VNC
rpm -qa | grep -i vnc
==================== VNC
yum install tigervnc-server
vi /etc/sysconfig/vncservers
VNCSERVERS=”2:root” VNCSERVERARGS[2]=”-geometry 1280×1024 -nolisten tcp -localhost”
VNCSERVERS=”1:oracle” VNCSERVERARGS[1]=”-geometry 1280×1024″
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
vi /etc/systemd/system/vncserver@:1.service
Change the user name two places <USER>
firewall-cmd --permanent --zone=public --add-service vnc-server firewall-cmd --reload su - oracle vncserver exit # to clear the unused entry of vnc #rm -rf /tmp/.X1-lock #rm -rf /tmp/.X11-unix/X2 systemctl daemon-reload systemctl enable vncserver@:1.service reboot #systemctl stop vncserver@:1.service systemctl start vncserver@:1.service systemctl status vncserver@:1.service #Go to VNC GUI IP:1 -- now try from vnc client 192.168.110.131:1 #find os bit 32 or 64 bit lscpu ## Download and copy transfer the zip oracle binaries by using winscp ## install s/w binaries
============== in VNC
Login as an oacle user
$ cd /opt
ls
$ unzip linux_11gR2_database_1of2.zip
$ unzip linux_11gR2_database_2of2.zip
$ ls
$ cd database
$ ./runinstaller
create DB DBCA 4.
$ netca – create listner
$ dbca
Configure listener and tnsname.ora 5
$ netca
lsnrctl status
change the hostname
$ hostname
vi $ORACLE_HOME/network/admin/listener.ora
vi $ORACLE_HOME/network/admin/tnsnames.ora
TEST01=
(description=
(address_list=
(address = (protocol = TCP)(host = muthu.localdomain)(port = 1521))
)
(connect_data =
(service_name=test01)
)
)
lsnrctl start
Try connect database by putty 6
sqlplus ‘/ as sysdba’
SQL> startup;
ORACLE instance started.
Total System Global Area 1962931152 bytes
Fixed Size 8897488 bytes
Variable Size 1224736768 bytes
Database Buffers 721420288 bytes
Redo Buffers 7876608 bytes
Database mounted.
Database opened.
SQL>
How to connect in organization
Example: Server name is SVR_ORA_DB01
- Connect by putty SVR_ORA_DB01 (Enter domain credential)
- Sudo su – oracle
- ps -ef|grep pmon
- sqlplus “/as sysdba”
You can find sid and DBname in cat /etc/oratab. You can change or switch to connect different databases by . oraenv
Ex: . oraenv (Type the Db name and enter)