Note: This tutorial is just for installing/testing Oracle for personal purposes. If you are installing for some production environments, consult expert advice.
This is a second part of two part blog on how to install Oracle 12c on CentOS 7. First part can be found here
Now create a user ‘oracle’ and groups ‘dba’ and ‘oracle’.
Then login into GUI using user ‘oracle’.
[oracle@centos7 12c]$ ll
total 2.6G
-rw-r--r-- 1 vivek users 968M Aug 5 08:06 linuxamd64_12102_database_2of2.zip
-rw-r--r-- 1 vivek users 1.6G Aug 5 08:16 linuxamd64_12102_database_1of2.zip
Get the Oracle pre-requisites repo for their website. After setting up the repo, issue the command:
Open the ‘terminal’ and go to the path where you have downloaded the Oracle 12 downloads
When you get the below GUI, un-tick the check box and proceed further. Follow the snapshots.
Your choice for Desktop or Server class. My choice is server class as I wanted to understand the different options.
As we are installing for development/testing purposes, ignoring few pre-requisites won’t matter.
Database creation in progress.
Your database details:
On hitting the “Password Management” in the above screen you will get this screen. Change passwords of users you want to.
We are done here installing Oracle!
Now small tips.
You can setup your centOS7 to start at run level 3. Refer THIS.
Now with VirtualBox, you can use VBoxManage and VBoxHeadless to manage and run Virtual Machines from terminal and in background.
And, install or enable SSH on your CentOS server. Refer THIS
So if you have your own LAN set up. Go to network settings for this machine in VirtualBox and choose “Bridged Adapter”
Network Settings
vivek@WorkHorse:~/Documents $ VBoxManage list vms
"CentOS7_X64" {9ad0fbb0-fb12-4246-aa9c-e4250607a5a9}
"Win7" {49884b71-04dc-4b63-b56b-d025e012ea9b}
To see all options of VBoxManage, hit enter after tying in VBoxManage on terminal.
Now we can see that, it has listed two VM’s for me. We need CentOS7_X64. Now we will start it using VBoxHeadless.
vivek@WorkHorse:~/Documents $ VBoxHeadless -s CentOS7_X64 &
[1] 28043
vivek@WorkHorse:~/Documents $ Oracle VM VirtualBox Headless Interface 5.0.12_SUSE
(C) 2008-2016 Oracle Corporation
All rights reserved.
vivek@WorkHorse:~/Documents $
Now, get IP of your VM. And do this
vivek@WorkHorse:~/Documents $ ssh oracle@192.168.0.135
Last login: Tue Jan 26 23:33:09 2016 from 192.168.0.100
[oracle@centos7 ~]$
Set up your shell login script like below.
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
. /u01/app/oracle/product/12.1.0/db_1/bin/oracle_env.sh
Now logout and login again. And start your database and listeners:
[oracle@centos7 ~]$ dbstart $ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0/db_1/startup.log
[oracle@centos7 ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-JAN-2016 23:29:02
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=CentOS7)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 28-JAN-2016 23:27:55
Uptime 0 days 0 hr. 1 min. 6 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/centos7/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CentOS7)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=CentOS7)(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
If port 1521 is open in firewall, then you can connect to this database from anywhere in your LAN.
To shutdown database and CentOS server:
oracle@centos7 ~]$ dbshut $ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0/db_1/shutdown.log
[oracle@centos7 ~]$ sudo /sbin/shutdown -h now
[sudo] password for oracle:
Connection to 192.168.0.135 closed by remote host.
Connection to 192.168.0.135 closed.
vivek@WorkHorse:~/Documents $
[1] + 28043 done VBoxHeadless -s CentOS7_X64
vivek@WorkHorse:~/Documents $
0 Comments