Tag Archives: oracle

Install Oracle 12c on CentOS 7 – Part II

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’. 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.
Figure 1

Figure 2

Your choice for Desktop or Server class. My choice is server class as I wanted to understand the different options.
Figure 3

Figure 4

Figure 5

Figure 6

Figure 8

As we are installing for development/testing purposes, ignoring few pre-requisites won’t matter.
Figure 9

Figure 10

Figure 11

Database creation in progress.
Figure 13

Your database details:
Figure 14

On hitting the “Password Management” in the above screen you will get this screen. Change passwords of users you want to.
Figure 15

Figure 16

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

Network Settings

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. Now, get IP of your VM. And do this Set up your shell login script like below. Now logout and login again. And start your database and listeners: 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:

Install Oracle 12c on CentOS 7 – Part I

This is a first part of two series blog on installing Oracle 12c on CentOS 7. First part is about installing CentOS 7 on Virtualbox. In second part we will be installing Oracle 12c on that CentOS machine.

You can download CentOS 7 from https://www.centos.org/download. Download DVD ISO or “Everything ISO”. If you downloading DVD ISO, downloading only Part 1 will be sufficient. We would not need Part 2.

For Oracle 12c http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html. You will need to have a userid on Oracle and also need to accept the OTN License before allowed to download the files. For Oracle 12c, the downloads are in two parts. Download both of them.

Assumption:Virtual Box is already installed, up and running with guest editions and extensions installed

First on the VirtualBox main window, create a new Virtual Machine. Here is the screen shot of the first window when creating a new virtual machine.

Image 1

Step 2: Put in RAM you want your virtual machine to have. As it will be running an Oracle server, I have set it as 1024 MB/1 GB VBox2 Step 3: The virtual machine will need a virtual hard disk, so create one. VBox3 Step 4: Choose your HD type. I only use Virtualbox, so leaving the default option as it is. VBox4 Step 5: Choosing “Dynamically allocated” here, as I do not want to unnecessary wastage of my HD. You can choose “Fixed size” if you want faster speed. VBox5 Step 6: Choose your HD size, 30GB has proven sufficient for me till now. Hit Create and your VM will be ready for use. VBox6 Step 7: Now, in Machine -> Settings -> Storage, mount your downloaded ISO image on Controller IDE -> Storage by clicking on the drop down as shown in the image below. With CentOS 7, there are two ISOs. Mount the first ISO, second ISO is not used for installation. VBox_iso Step 8: On the main Virtualbox window, click on Start. After a few seconds you will be booted on the to the below welcome screen. Choose your Language/Locale and then “Continue”. CentOS1 Step 9: Check your settings on next screen and then “Begin Installation”       CentOS2 Step 10: On the configuration screen, set up your “root” password. Linux guys will know how important “root” password is. For Windows audience: “Set up your root password and remember it. It’s like an Administrator account on windows, but with much greater powers, and is NEVER used to log-in to GUI or being used as any other user on the system”. CentOS3 Step 11:  Setting up my user. CentOS4 Step 12: Now my configuration screen shows Root password is set and User details are also set. And system is being installed. CentOS5 Step 13: System installation in progress….   CentOS6 Step 14: License is not accepted.. so click on the icon or text… CentOS7 Step 15: Accept the license and “Done” CentOS8 Step 16: After the system instllation is done, you will be taken to the login screen, where you can see the user you had created in Step 11. Click on it and… CentOS9 Step 17: Enter password. CentOS10 Step 11: Voila you are logged in! CentOS12 Here our installing CentOS 7 on VirtualBox is complete. In next tutorial we will be installing Oracle 12c on this Virtual CentOS 7. Part II is live now: http://www.vivekbhat.in/blogs/technical/oracle/install-oracle-12c-on-centos-7-part-ii

PHP with Oracle

I am personally working on a Project, that has web UI having Apache server, PHP on server side and Oracle as database. For this I need to configure PHP so that it can talk to my Oracle database. The first error I got while querying the database using PHP was. For this, we need to first install php5-pear and then using pecl, we need to install OCI8. As I am using openSUSE 13.2 Then install OCI8 extension for PHP This will install and compile oci8 module. This command will ask for ORACLE HOME location. If everything goes fine, this will end like Add the line to your /etc/php/apache2/php.ini and /etc/php/cli/php.ini Then restart Apache server After this when I tried to access Oracle, I got the error “Call to undefined function oci_connect()” again! When I checked in /var/log/apache2/err_log, I found this: So even though the file libnnz11.so is present at $ORACLE_HOME/lib, I still get this error. To get over this error, we need two more steps. Create a file /etc/ld.so.conf.d/oracle.conf and add this line it: and run “ldconfig”. Restart your Apache server again, and this time things should work!

RMAN archivelog deletion policy

Today I faced issues while starting my Oracle database. While startup/opening the database I was getting the error: I checked my “Alert log” which was at In there was this line So the issue was my recovery size was full! Oracle gives you the below options for this problem First I need to delete the files to recover the space: After that change RMAN retention policy to avoid this problem in future:

SQLDeveloper Fonts

I like Oracle’s sqldeveloper. It does a nice job and is free. So if someone has to learn Oralce or is working on Oracle DB as a hobbh, investing in Quest’s PlSQL Developer or Toad does not make sense, even if they provide a lot more functionality than Oracle’s SQL Developer.

What I do not like in SQL developer is its look and feel and fonts in it, which look so ugly. You can change the theme of developer to windows in windows which makes a bit better. But, in Linux there’s no choice. You have to work with Oracle theme.

Here is how I made it look a bit better for me.

Modify sqldeveloper/sqldeveloper/bin/sqldeveloper.conf to add below line: Instead of “Droid Sans” you can use and test whatever font you like.

Here is a before and after snapshot of my SQLDeveloper.

SQLDeveloper Before changes
Oracle SQLDeveloper before changes
SQLDeveloper After Changes
Oracle SQLDeveloper After changes

And, here is my sqldeveloper.conf after changes: