Wednesday, May 9, 2012

Oracle Import Errors With ORA-03113, ORA-03114

When trying to import to a newly created database, Oracle import outputs with the following error:
IMP-00003: ORACLE error 3113 encountered
ORA-03113: end-of-file on communication channel
IMP-00003: ORACLE error 3114 encountered
ORA-03114: not connected to ORACLE
To correct this error, run the following scripts using the sys account:
$ORACLE_HOME/rdbms/admin/dbmsread.sql
$ORACLE_HOME/rdbms/admin/prvtread.plb

Tuesday, April 24, 2012

How To Make A Local Yum Repository Using The RHEL6 DVD


1. Insert RHEL 6 DVD and mount it.
2. Copy the Packages directory from the DVD on a local directory on your hard drive.

mkdir /RHEL6DVD
cp -R /media/RHEL_6.1\ x86_64\ Disc\ 1/Packages /RHEL6DVD/

3. Install createrepo

cd /RHEL6DVD/Packages
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm createrepo-0.9.8-4.el6.noarch.rpm

4. Create new yum repository

vi /etc/yum.repos.d/RHEL6DVD.repo

[dvd]
name=RHEL6DVD
baseurl=file:///RHEL6DVD/Packages
enabled=1
gpgcheck=0


5. Update yum repository

yum update

6. To install new packages

cd /RHEL6DVD/Packages
yum install binutils-2.20.51.0.2-5.20.el6.x86_64

REP-0118 Unable to create temporary file

Earlier today, we were getting the following error when generating reports in Oracle Developer 6i:

REP-0118 Unable to create temporary file

It seems that the reports runtime wasn't able to create a temporary file in the reports temporary directory.  So, we simply changed the permission of this directory to correct the problem.  We gave write permission to the user who was running the report.  This directory is located here:

$ORACLE_HOME/reports60/TMP

Installations can be customized, so to get the exact location of the above folder, look for the regedit entry: REPORTS60_TMP

In summary, the cause of this error is the changing of the permission of the REPORTS60_TMP folder to read only.  The user running the report has no permission to write any file on this directory.

Thursday, March 22, 2012

How to Drop an Oracle Account

Here's the command to drop an Oracle account or schema:

DROP USER username ;

or

DROP USER username CASCADE;

Use CASCADE option to drop all dependent objects on the schema (e.g. constraints).



Tuesday, February 28, 2012

find Not Working in cron

I'm getting the following error issuing a find in cron:

find: 0652-018 An expression term lacks a required parameter.

Here's my crontab entry:

0 23 * * * find /orafra/flash_recovery_area/exportArea -type f -mtime +6 -exec rm -f {} \;

After research and a lot of googling, I found out that cron is eating up some symbols, specifically the backslash "\" and the semicolon ";"

With that, here's my now working crontab entry:

0 23 * * * find /orafra/flash_recovery_area/exportArea -type f -mtime +6 -exec rm -f {} \\\;

Wednesday, February 8, 2012

Dropping Old Temporary Tablespace Hangs

I have recently switched my database to a new temporary tablespace and wanted to drop the old one to retrieve the space it was occupying. But the drop statement seem to hang or is taking too long.

Here's my drop statement:

DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

To solve this, I issued the following query:

SELECT b.username, b.sid, b.serial#, b.terminal
FROM v$sort_usage a, v$session
WHERE a.session_num = b.serial#
AND a.tablespace = 'TEMP';

Then I killed the sessions that were using the old temporary segment (of course I asked permission from the user before killing them).

After this, the hanged drop tablespace command continued and dropped the temp tablespace successfully.


Monday, February 6, 2012

Cron Not Running Commands With $(date +%Y%m%d-%H%M)

I have a script that runs in the shell with no problems. But when I put it in cron, it fails to execute. Here's my crontab entry.

00 00 * * 0 /oracle/flash_recovery_area/scripts/rman-level0.sh PROD fb4srv > /oracle/flash_recovery_area/PROD/logs/PROD-LVL0-$(date +%Y%m%d-%H%M).log


Upon investigating the cron log, (I usually just check the mail) I saw this:

& 1
Message 1:
From oracle@somedomain.com Tue Feb 7 00:00:02 2012
Date: Tue, 7 Feb 2012 00:00:02 +0800
From: root@somedomain.com (Cron Daemon)
To: oracle@somedomain.com
Subject: Cron /oracle/flash_recovery_area/scripts/rman-level1.sh PROD fb4srv > /oracle/flash_recovery_area/PROD/logs/PROD-LVL1-$(date +
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:

/bin/bash: -c: line 0: unexpected EOF while looking for matching `)'
/bin/bash: -c: line 1: syntax error: unexpected end of file

&

So it seems, cron doesn't recognize the values after the + sign. And so, clearly, the error was because of the following characters: %Y%m%d-%H%M).log

Looking at the characters above, my guess is that the % sign was causing the problem. So, I escaped them or replaced them with \%.

My crontab entry now looked like this:

00 00 * * 0 /oracle/flash_recovery_area/scripts/rman-level0.sh PROD fb4srv > /oracle/flash_recovery_area/PROD/logs/PROD-LVL0-$(date +\%Y\%m\%d-\%H\%M).log

And this solved my problem. The script now runs in cron.