ORA-12705: Cannot access NLS data files or invalid environment specified

While running autoconfig in oracle apps on database side, you might encounter this error. Also you can see this when you do sqlplus from command prompt.


Either your NLS_LANG parameter is not set correctly or NLS_ORA10 parameter is not set correctly.

Solution :

check $ORA_NLS10 path. This should point to ORACLE_HOME/nls/data/9idata

if this is not set correct, then you need to set the same manually using export command. Also if this is an oracle application database ( either 11i or R12), then make sure to change the variable s_db_oranls in CONTEXT_FILE and then run autoconfig.

If  ORACLE_HOME/nls/data/9idata path is not present then you can create the same using $ORACLE_HOME/nls/data/old/cr9idata.pl script. Run this script and it will create the desired directories and after that set ORA_NLS10 parameter.

If this doesn’t resolve the issue then you need to check NLS_LANG parameter setting. This should be (Language)_(Territory).(character set). Example American_America.UTF8.

Hope this helps !!

ORA-00600: internal error code, arguments: [kcratr1_lastbwr]

Some time we encounter this error while starting the database. Below is the solution for recovering through this error.


SQL> startup
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size 1264916 bytes
Variable Size 264241900 bytes
Database Buffers 801112064 bytes
Redo Buffers 7122944 bytes
Database mounted.
ORA-00600: internal error code, arguments: [kcratr1_lastbwr], [], [], [], [],
[], [], []

Encountered in : Database


Oracle is unable to perform instance recover but it works when is invoked manually.


SQL> startup mount
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size 1264916 bytes
Variable Size 264241900 bytes
Database Buffers 801112064 bytes
Redo Buffers 7122944 bytes
Database mounted.
SQL> recover database
Media recovery complete.
SQL> alter database open;

Database altered.



Metalink note ID: 393984.1

Using Net::LDAP perl Module

Hi All, this post is related to using Net::LDAP perl module to register, search and delete the users in OID (oracle internet directory). I have been struggling to get this perl code for me. Finally I was able to create a perl script for doing the same.

Initially I tried the same thing using ldapadd command (for adding users in OID). But this has some dependencies. Like for using ldapadd command you need AS10g Oracle home installed where you can reference to these commands. Even if AS10g home is not present you can still use the perl binaries for LDAP. But this again depends on our perl installation. Not all perl installation is having these binaries installed.

So best approach is to use Net::LDAP module for the same. Remember there is a URI::LDAP module also. But this cannot be used, we need Net::LDAP module. You can check if this module is present in your perl installation or not Possibly this should be present as a file LDAP.pm in one of the location present in @INC). If the module is not present then you can install the same by following the below simple steps.

You can download the Net::LDAP perl module from CPAN

Instruction for install 

Unzip the module and run the following steps

  • perl Makefile.PL
  • make
  • make test
  • su root
  • make install

Once you install the module you can connect to LDAP server and add the user. Below is the perl script I have used for the same.

Perl script for using Net::LDAP 

#!/local/bin/perl -I /oracle/iAS/perl_modules/lib/perl5/site_perl/5.8.0
#use strict;
#use warnings;
use Net::LDAP;

$ldap = Net::LDAP->new("ap6059rt.us.oracle.com") or die "$@";
$mesg = $ldap->bind("cn=orcladmin", password=>"welcome1");

%mon = ("Jan","01","Feb","02","Mar","03","Apr","04","May","05","Jun","06","Jul","07","Aug","08","Sep","09","Oct","10","Nov","11","Dec","12");

my $gen_time= localtime();
my @TimeStamp = split(/ /, $gen_time);
my $TimeStamp=$TimeStamp[4].$mon{$TimeStamp[1]}.$TimeStamp[2]."000000z";

$arg = "$ARGV[$0]";


$mesg = $ldap->search(filter=>"(uid=$uid)", base=>"dc=ap6059rt,dc=us,dc=oracle,dc=com");
$mesg->count && $ldap->delete($dn);

$result = $ldap->add($dn, 
                attr => [ 'uid' => $uid,
                          'cn' => $cn,
                          'sn' => $sn,
                          'mail' => $mail,
                          'givenName' => $givenName,
                          'userpassword' => $userpassword,  
                          'orcltimezone' =>  $orcltimezone,      
                          'orclactivestartdate' => $TimeStamp,     
                          'orclisenabled' => $orclisenabled,            
                          'objectclass' => [ 'person', 'inetOrgPerson', 'organizationalperson', 'orcluser', 'orcluserv2', 'ctCalUser', 'orclUserProvStatus']
$result->code && warn "error: ", $result->error;


You need to just pass the username which you want to register in OID and this script will register the same.

/oracle/iAS/perl_modules/lib/perl5/site_perl/5.8.0 is the location where my Net::LDAP module is installed and I am including the same in my script as first line using -I option.

Hope this helps !!




Creating Oracle Home Inventory – Oracle Database 10g

Some times you clone an oracle home manually using OS level commands and this might cause problem in your existing inventory. Your new ORACLE_HOME will not be registered in your existing registry.

As far as running of database is concerned, we wont face any problem, trouble comes when in future you want to apply a patch to an oracle home which is not registered in inventory. The patch can be applied to an ORACLE_HOME with -no_inventory option, but then you wont have the record of patches applied to that ORACLE_HOME.

For such situation, you can register your new ORACLE_HOME manually to the existing inventory (or create a new inventory). Below is the command for the same.

cd $ORACLE_HOME/oui/bin 

./runInstaller -attachHome ORACLE_HOME=”/slot/ems1696/oracle/db/tech_st/11.1.0″ ORACLE_HOME_NAME=”Oracle11g_home1″ 

Here ORACLE_HOME will contain the complete path for ORACLE_HOME and  ORACLE_HOME_NAME will be the name you want to give for your ORACLE_HOME

Hope this helps !!


Some times the situation arises where we want to output the result from the table as a comma separated string. This situation can be answered using many methods. The most efficient method, however, is using TABLE_TO_COMMA procedure of DBMS_UTILITY package. Below is the example that I encountered.

set echo on serveroutput on
cursor c1 is select dept_no, dept_name, location
from dept12;

output_table dbms_utility.uncl_array;
cnt binary_integer;
output_string varchar2(80);
counter integer:= 0;
for i in c1 loop
output_table(counter+1) := I.dept_no;
output_table(counter+2) := I.dept_name;
output_table(counter+3) := I.location;
counter := counter + 3;
end loop;
DBMS_UTILITY.TABLE_TO_COMMA(output_table, cnt, output_string);

Hope this helps !!

Creating users in OID (Oracle Internet Directory) – Oracle Collabsuite 10g


his port is regarding creation of users in central OID (Oracle Internet Directory) instance. We call it a central because of its architecture. Usually for any business setup, there will be many instances of application and a single installation of OCS or Oracle AS. Either of these techstack is having OID as one of the component. So the users of all the instances are basically registered in this central OID instance.

So here we will see, how to create users in OID. We can create users either through UI or through command line API. We will see both the methods here.

Creating users using UI:

Navigate to the OID self service console, the URL will be in the form as given below.


1) Click on the right hand top corner to login


2) use the super user ID having all privileges to create a user. In my case its orcladmin


3) Once you login, click on directory tab and then click on create button


4) First screen will ask for general information. Here you need to enter password for user.


5) You can provision the various component for this user. Example in case of mail, if its provisioned, then by default a mail account will be created for user.


6) On third screen, you can check the information and also keep the default information as it is. You can also decide the quota for mail server.


7) Review screen. You can review and finish

If you search for the user you created you should be able to see the record.


Creating users using command line

You can use the following command for creating users from command line.

These commands needs to be run on the host where the OID is installed. Also make sure to source the environment before creating the user.



Creating a user:

1. Create an ldif file called orcl.ldif that includes the following content:

      dn: cn=orcladmin, User_Search_Base
changetype: add
uid: orcladmin
mail: orcladmin
givenName: orcladmin
cn: orcladmin
sn: orclAdmin
description: Seed administrative user for subscriber.
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: orcluser
objectClass: orcluserV2



2. Execute the following command (the following command is one continuous line):

ldapadd -h OID_host -p non-SSL_port -D OID_superuser -w OID_superuser_password -v -f orcl.ldif


ldapadd -p 389 -h ap6059rt -D “cn=orcladmin” -w “welcome1” -v -f test.ldif

sh-2.05b$ ldapadd -p 389 -h ap6059rt -D “cn=orcladmin” -w “welcome1” -v -f test.ldif
do modify ****
add objectclass:
add givenname:
add sn:
add orcltimezone:
add mail:
add uid:
add orclactivestartdate:
add cn:
add orclisenabled:
adding new entry cn=avdeo,cn=users,dc=us,dc=oracle,dc=com
modify complete

Searching for the user:

ldapsearch uid=avdeo

sh-2.05b$ ldapsearch uid=avdeo

Deleting users from LDAP:

ldapdelete -p non-SSL_port -h OID_host -D OID_superuser -w OID_superuser_password username


ldapdelete -p 389 -h ap6059rt -D cn=orcladmin -w welcome1 “cn=avdeo,cn=users,dc=us,dc=oracle,dc=com”


Metalink Note ID: 125301.1

Oracle OID Admin Guide

Open LDAP Manual page

Installing OCS (Oracle Collabsuite) 10g – Linux

Introduction:This document gives a step by step approach for installing OCS (Oracle Collabsuite) 10g. This is created from the Oracle documentation available on OTN. This serves as a simple guide for installation of OCS 10g.

Setup Details:

OS Detail :

bash-2.05b$ uname -a
Linux ap6059rt 2.4.21- #1 SMP Fri Feb 24 18:01:54 PST 2006 i686 i686 i386 GNU/Linux
bash-2.05b$ cat /etc/issue
Red Hat Enterprise Linux AS release 3 (Taroon Update 6)
Kernel \r on an \m
OCS 10g Version : Oracle Collabsuite 10g Release I (

Pre – Installation Steps

Download the required OCS software zip files to one of the directory on slot and unzip the same in a separate directory.

bash-2.05b$ ls -rlttotal 12
drwxrwxrwx 2 oracle oracle 4096 Mar 5 16:08 OCS-Supp-DVD
drwxr-xr-x 2 oracle oracle 4096 Mar 5 16:08 OCS-Main-DVDs

Perform the following pre-reqs steps before starting the installation. These are the pre-installation steps.

1) Check the free space on slot and also under /tmp directory

[oracle@ap6059rt /slot03]$ df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
140509184 4416256 136092928 4% /SLOTS/slot03
[oracle@ap6059rt /slot03]$ df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 46354176 183516 43815936 1% /tmp
[oracle@ap6059rt /slot03]$

2) Check the swap memory available. It should be atleast twice that of RAM memory.

[oracle@ap6059rt /slot03]$ grep SwapTotal /proc/meminfoSwapTotal: 24587472 kB
visual id: 0x32
class: TrueColor
depth: 16 planes
available colormap entries: 64 per subfield
red, green, blue masks: 0xf800, 0x7e0, 0x1f
significant bits in color specification: 6 bits

3) Check the Linux Red Hat release and important packages

Note:- Login as root and then perform these tasks.

[jmyang@ap6059rt /slot03]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 3 (Taroon Update 6)

[jmyang@ap6059rt /slot03]# rpm -q glibc-2.3.2

[jmyang@ap6059rt /slot03]# rpm -q glibc-common-2.3.2

[jmyang@ap6059rt /slot03]# rpm -q binutils-

[jmyang@ap6059rt /slot03]# rpm -q compat-db-4.0.14

[jmyang@ap6059rt /slot03]# rpm -q compat-glibc-7.x

[jmyang@ap6059rt /slot03]# rpm -q compat-libstdc++-7.3

[jmyang@ap6059rt /slot03]# rpm -q compat-libstdc++-devel

[jmyang@ap6059rt /slot03]# rpm -q gcc-3.2.3

[jmyang@ap6059rt /slot03]# rpm -q gcc-c++-3.2.3

[jmyang@ap6059rt /slot03]# rpm -q libstdc++-3.2.3

[jmyang@ap6059rt /slot03]# rpm -q libstdc++-devel-3.2.3

[jmyang@ap6059rt /slot03]# rpm -q openmotif21-2.1.30

[jmyang@ap6059rt /slot03]# rpm -q pdksh-5.2.14

[jmyang@ap6059rt /slot03]# rpm -q setarch-1.3

[jmyang@ap6059rt /slot03]# rpm -q make-3.79.1

[jmyang@ap6059rt /slot03]# rpm -q gnome-libs-

[jmyang@ap6059rt /slot03]# rpm -q sysstat-5.0.5
sysstat-5.0.5-5.rhel3 4) Checking Kernel parameters.

4) Checking Kernel parameters

Note:- All these values should be updated as a root user. So login as root and then perform these tasks.


shmall is -sh-2.05b# cat /proc/sys/kernel/shmall
it is smaller than 3279547
so we need to modify the /etc/sysctl.conf

Once this file is modified we can run /sbin/sysctl -p for this to take effect.
You can check all the kernel parameters using

sh-2.05b# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
kernel.sysrq = 1
kernel.core_uses_pid = 1
fs.file-max = 1677721
vm.pagecache = 1 15 15
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 3279547
net.ipv4.tcp_tw_recycle = 1
kernel.sem = 1100 32000 100 1100
kernel.msgmnb = 65535
kernel.msgmni = 2878
kernel.msgmax = 8192
net.ipv4.ip_local_port_range = 10000 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
kernel.sysrq-key = 64

5) To improve the performance of the software on Linux system, you must increase the following shell limits for oracle user

– login as root

– Add the following lines to /etc/security/limits.conf file:

  • soft nproc 4096
  • hard nproc 16384
  • soft nofile 16384
  • hard nofile 65536

– Add the following lines to the /etc/pam.d/login file, if it does not already exist:

session required /lib/security/pam_limits.so

– Add the following lines to the /etc/pam.d/su file, if you use su to switch to oracle account

6) Check your shell and add the below content accordingly

sh-2.05b# echo $SHELL

  • For the C or tch shell, add the following lines to the /etc/csh.login file:

if ( $USER == “oracle” ) then
limit maxproc 16384
limit descriptors 65536

  • For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file:

if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
ulimit -u 16384 -n 65536

7) Location of the Default Identity Management Realm has been set in /etc/hosts
The hosts file should use the following format:

ip_address fully_qualified_hostname short_hostname

Example: primaryHost.mydomain.com primaryHost

sh-2.05b$ cat /etc/hosts localhost.localdomain localhost ap6059rt.us.oracle.com ap6059rt

This completes all pre-reqs steps. Now starting with installation.

Installation Steps

Unzip the downloaded DVD in one of the directories before starting the installation.

For Example in my case the location for ZIP was

sh-2.05b$ pwd/slot03/ocs10g/downloads/OCS-Main-DVDs
sh-2.05b$ ls -lrt
total 3725448
-rw-r–r– 1 oracle oracle 1840273814 Mar 5 14:10 B24986-01_1of2.zip
-rw-r–r– 1 oracle oracle 1967099379 Mar 5 14:42 B24986-01_2of2.zip

Created a directory call setup at /slot03/ocs10g/downloads location and unziped both the zip files in setup directory.

sh-2.05b$ cd /slot03/ocs10g/downloads/setup/
sh-2.05b$ unzip /slot03/ocs10g/downloads/OCS-Main-DVDs/B24986-01_1of2.zip

sh-2.05b$ unzip /slot03/ocs10g/downloads/OCS-Main-DVDs/B24986-01_2of2.zip

Your setup directory will now look like this

sh-2.05b$ cd /slot03/ocs10g/downloads/setup/
sh-2.05b$ ls -lrt
total 36
-rwxrwxrwx 1 oracle oracle 4715 Oct 26 2005 runInstaller
-rw-r–r– 1 oracle oracle 4410 Oct 27 2005 welcome.html
drwxrwxrwx 2 oracle oracle 4096 Nov 2 2005 response
drwxrwxrwx 5 oracle oracle 4096 Nov 2 2005 install
drwxrwxrwx 8 oracle oracle 4096 Nov 2 2005 doc
drwxrwxrwx 4 oracle oracle 4096 Nov 2 2005 calendar_standalone
drwxrwxrwx 8 oracle oracle 4096 Mar 5 22:06 stage

Another important thing before starting the installation is to rename a file /etc/tnsname.ora. If this file is present then installation will give error and will be terminated. So make sure to login as root user and rename this file to some other name

sh-2.05b$ mv /etc/tnsname.ora /etc/tnsname.ora.backup

Start the installation by running runInstaller present in unzipped directory (/slot03/ocs10g/downloads/setup/ in my case).

Make sure that the installation is started as oracle user and not as root.

sh-2.05b$ cd /slot03/ocs10g/downloads/setup

sh-2.05b$ ./runInstaller -invPtrLoc /slot03/oracle/product/ocs10g/oraInst.loc

Screen 0) A welcome screen will come. Click on next and go to next screen


Screen 1) Specify Inventory directory and Credential Specify the inventory directory and the group which will be th owner of inventory. In our case we want the user oracle to be the owner of inventory and its primary group is DBA. So we are providing the group for inventory as DBA


Screen 2) Specify File Location
Specify the ORACLE_HOME location where the software will be installed. Under this location 1 or 2 directories will be created (depending on your installation). Once will be for infra and other for application.


Screen 3) Select a product to install
select the product you want to install. We are here doing the complete installation. So we will be installing infra as well as application. Depending on your requirement you can choose either or both of them.


Screen 4) Installer will carryout the pre-reqs checking and will flag an error if any of the pre-reqs are not satisfied.


Screen 5) Language Selection
Select the language you want to install


Screen 6) This screen will summarize the selection done till now. Validate and click on next to go to next screen.


Screen 7) Select component to configure
You can select one or more component you want the installer to configure for you. In our case we are going for all the components.


Screen 8) Specify Namespace in Internet Directory
The distinguished name (DN) that you specify in the Specify Namespace in Internet Directory screen will be designated as the namespace in Oracle Internet Directory, where users and groups are administered.

A suggested namespace appears on the screen. The installer determines the suggested namespace from the /etc/hosts file. If it meets your deployment requirements, then select it. If not, enter another DN in the Custom Namespace field.


Screen 9) Specify database configuration option
Enter a name for the Oracle Collaboration Suite Database. You can give any name (less than 8 chars) for database or even accept the default one.


Screen 10) Specify database schema password
Its good to have common password for all account. This is to avoid confusion.


Screen 11) Specify Application Passwords
Its good to have same passwords as database user passwords. This is to avoid confusion.


Screen 12) Specify Oracle Mail Domain Information


Screen 13 – a) Specify port Configuration Options
In this screen specify the port you want your application to use. You can go with default port numbers of you can specify your own port numbers. When specifying custom ports, make sure that the port is not in use. You can check if the port is in use or not using netstat -an | grep <port no> command. Also if specifying the custom ports, then make sure that port numbers are above 1024. In our case, we changed the HTTP port number from 80 to 7779. Also SSl port has been changed from 443 to 4443. The ranges for the port is given in 3rd column.
Also note that these ports are for infra installation. When installing application, it will again ask for the ports.


Screen 13 – b) Also the port number of SMTP server was already in use. So you can change the port number from 25 to some unused port (example 30).


Screen 14) Warning
This screen will show a warning, since some of the ports are below 1024. Only root user is having access to ports below 1024. You can select the check box “I authorize SUID root actions” and click on next.


Screen 15) Installation summary.
Click on “Install” button to begin installation of infra.


Screen 16) Shows the installation progress for infra tier. Remember that in our installation, we have selected to install infra as well as application. So first it will install infra and then application. Installing infra also involves installing database also. This is shown in screen 17 below.
After this installation progress screen, when the installation comes to end, installer will ask to run root.sh as root user.
When such message appears, start another session and login as root. Run the required script and then come to this screen, click on OK. Do not click on OK before running root.sh.

During our installation, we faced some issue while running root.sh. We logged a bug 6870418 for the same and as per server team, the underlying filer was not having root privileges. After this bug is resolved, we were able to run root.sh 181.jpg

Screen 17) Shows all the components of infra getting installed in the back screen. Database installation is in progress and is shown in front screen.


Screen 18) Shows the component progress during installation. After this screen infra installation completes and installer automatically starts application (mid tier) installation.


Screen 19) Specify port configuration options
Installer will ask for ports for the second time. These ports are for applicaiton (mid tier). Example there will be 2 HTTP server process that will run, one for infra and one for mid tier. So we have to specify HTTP port for both. Similar is the case with other ports as well. If you remember we have given 7779 initially for HTTP port of infra. We can change that here to 7778 or some thing else. Even if we keep the ports same as that of infra (example 7779), it will automatically select different ports. In our case we have kept the same port number as that of infra. (that is 7779 for HTTP, 4443 for SSL and 30 for SMTP. All other ports are having default values).After clicking next, it will show the installation progress for each component similar to screen Screen 18) and after the installation of all components of mid tier, installer will ask to run root.sh again. After running root.sh the installation will end.

================================================================= Use the following URL to access the Oracle Collaboration Suite Console :


Use the following URL to access the Oracle Collaboration Suite
Release Notes:

Global Database Name: ocs10g.us.oracle.com

Post Installation steps

For accessing database from UNIX prompt, you need to source the environment using the following export commands.

This will source the required ORACLE_HOME (infra) and other parameters mentioned below.

export ORACLE_HOME=/slot03/oracle/product/ocs10g/infra
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=ocs10g
  • OID account can be unlocked as given below
sh-2.05b$ oidpasswd connect=ocs10g unlock_su_acct=true
OID DB user password:
OID super user account unlocked successfully.
  • Performing Component-Specific Tasks

sh-2.05b# export ORACLE_HOME=/slot03/oracle/product/ocs10g/infra
sh-2.05b# export PATH=$ORACLE_HOME/bin:$PATH
sh-2.05b# tnslsnr listener_es -user 8000 -group 8000 &

  • Configuring the Time-out Value in the sqlnet.ora File

Set following parameter in sqlnet.ora
SQLNET.EXPIRE_TIME = 10 References: