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’.
[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:
[oracle@centos7 12c]$ sudo yum install oracle-rdbms-server-11gR2-preinstall
  (more…)

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
(more…)

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.
Call to undefined function oci_connect()
For this, we need to first install php5-pear and then using pecl, we need to install OCI8. (more…)

RMAN archivelog deletion policy

Today I faced issues while starting my Oracle database. While startup/opening the database I was getting the error:
ORA-03113: end-of-file on communication channel
Process ID: 10263
Session ID: 91 Serial number: 3
I checked my “Alert log” which was at
 $ORACLE_BASE/diag/rdbms/xe/XE/trace/alert_XE.log
In there was this line
ORA-19815: WARNING: db_recovery_file_dest_size of 10737418240 bytes is 100.00% used, and has 0 remaining bytes available
So the issue was my recovery size was full! Oracle gives you the below options for this problem
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
First I need to delete the files to recover the space:
oracle@linux-xbvi:~> rman target / 

Recovery Manager: Release 11.2.0.2.0 - Production on Sat Oct 25 21:19:05 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: XE (DBID=2702090012)

RMAN> delete archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5 device type=DISK
List of Archived Log Copies for database with db_unique_name XE
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
36      1    48      A 25-AUG-13
        Name: /u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_48_9fonmn1c_.arc

37      1    49      A 19-JAN-14
        Name: /u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_49_9fonn0p1_.arc

38      1    50      A 19-JAN-14
...
Do you really want to delete the above objects (enter YES or NO)? YES
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_48_9fonmn1c_.arc RECID=36 STAMP=837218637
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_49_9fonn0p1_.arc RECID=37 STAMP=837218649
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_50_9fonn8xb_.arc RECID=38 STAMP=837218657
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_01_19/o1_mf_1_51_9fonnh9l_.arc RECID=39 STAMP=837218663
...
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_10_25/o1_mf_1_266_b4qkjlxx_.arc RECID=254 STAMP=861916652
deleted archived log
archived log file name=/u01/app/oracle/fast_recovery_area/XE/archivelog/2014_10_25/o1_mf_1_267_b4qkjnjl_.arc RECID=255 STAMP=861916654
Deleted 220 objects
After that change RMAN retention policy to avoid this problem in future:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 5 DAYS;
new RMAN configuration parameters are successfully stored

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:
AddVMOption -Dawt.useSystemAAFontSettings=on
AddVMOption -Dswing.aatext=true
AddVMOption -Dswing.plaf.metal.controlFont="Droid Sans-13" 
AddVMOption -Dswing.plaf.metal.userFont="Droid Sans-13"
AddVMOption -Dswing.plaf.metal.systemFont="Droid Sans-13"
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:
IncludeConfFile ../../ide/bin/ide.conf

SetJavaHome ../../jdk

AddVMOption  -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG=true

AddVMOption -Dsun.java2d.ddoffscreen=false

AddVMOption -Dwindows.shell.font.languages=

AddVMOption  -XX:MaxPermSize=256M

AddVMOption -Doracle.jdbc.mapDateToTimestamp=false  

AddVMOption -Doracle.ide.startup.features=sqldeveloper

AddVMOption -Doracle.jdbc.autoCommitSpecCompliant=false

#Our location for the NLS jars
AddJavaLibFile  ../../jlib/orai18n-collation.jar
AddJavaLibFile  ../../jlib/orai18n-mapping.jar
AddJavaLibFile  ../../jlib/orai18n-servlet.jar
AddJavaLibFile  ../../jlib/orai18n-utility.jar
AddJavaLibFile  ../../jlib/orai18n.jar

IncludeConfFile  sqldeveloper-nondebug.conf

AddVMOption -Dawt.useSystemAAFontSettings=on
AddVMOption -Dswing.aatext=true
AddVMOption -Dswing.plaf.metal.controlFont="Droid Sans-13" 
AddVMOption -Dswing.plaf.metal.userFont="Droid Sans-13"
AddVMOption -Dswing.plaf.metal.systemFont="Droid Sans-13"
1 2