Home » Infrastructure » Linux » Problem in using the SQL Command Line
Problem in using the SQL Command Line [message #299347] Mon, 11 February 2008 10:28 Go to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
Hello,

I installed oracle-xe in Ubuntu 7.10 (Gutsy). I can login from the Database homepage and operate the system. When I tried to login from the command line, I always get this error when the SQL*Plus window opens: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found

Also when I try to connect the database with Connect system/***** I receive this error:

ORA-27101: shared memory realm does not exist


Please can someone help me out in solving the problem.

Thanks,

Jide
Re: Problem in using the SQL Command Line [message #299515 is a reply to message #299347] Tue, 12 February 2008 05:17 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Do you have your environment set correctly (ie. ORACLE_HOME, PATH, ORACLE_SID)? What is the output of env ?
Re: Problem in using the SQL Command Line [message #299588 is a reply to message #299515] Tue, 12 February 2008 09:31 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
Hello,
I added the following at the last line of the .bashrc file:

#Oracle configuration
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE

export PATH


The output of ENV is:
ORACLE_SID=XE
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server


Thanks,

Jide
Re: Problem in using the SQL Command Line [message #299594 is a reply to message #299347] Tue, 12 February 2008 10:14 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Quote:
... I always get this error when the SQL*Plus window opens...


what do you mean?
I thought sql*plus window only opens in windows??
Re: Problem in using the SQL Command Line [message #299860 is a reply to message #299594] Wed, 13 February 2008 07:14 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
Hello,
Not just only in Windows, SQL*Plus also opens in Ubuntu. After installation in Ubuntu, go to Applications->Oracle Database 10g Express Edition->Run SQL Command Line. The window that opens is the SQL*Plus window where you can access the database through the command line.

Each time I open the window, the error message /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found is displayed twice. All my attempt to login through the command line failed.

Thanks,

Jide
Re: Problem in using the SQL Command Line [message #299861 is a reply to message #299347] Wed, 13 February 2008 07:19 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Quote:
After installation in Ubuntu, go to Applications->Oracle Database 10g Express Edition->Run SQL Command Line


Why do you want to hold your nose the other way round?

what do you see when you type:
sqlplus /nolog in the terminal?
Re: Problem in using the SQL Command Line [message #299878 is a reply to message #299861] Wed, 13 February 2008 08:29 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
If I type sqlplus /nolog in the terminal I get the following:
SQL*PLUS: Release 10.2.0.1.0 - Production on Wed Feb 13 15:24:37
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL>
Re: Problem in using the SQL Command Line [message #299888 is a reply to message #299878] Wed, 13 February 2008 09:08 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
jide wrote on Wed, 13 February 2008 15:29
If I type sqlplus /nolog in the terminal I get the following:
SQL*PLUS: Release 10.2.0.1.0 - Production on Wed Feb 13 15:24:37
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL>



Additional Information:

When I tried to login through the terminal after starting oracle form the command line, I got these errors:

ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segement
Linux Error: 13: Permission denied


Although I started Oracle and made sure that it is running.

Thanks,

Jide
Re: Problem in using the SQL Command Line [message #299916 is a reply to message #299347] Wed, 13 February 2008 12:05 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
ORA-27123: unable to attach to shared memory segment 
Cause: shmat() call failed 
Action: check permissions on segment, contact Oracle support 

Whats the output of:
$id
$ ps -ef | grep smon
$ ipcs -m | grep oracle
Re: Problem in using the SQL Command Line [message #299936 is a reply to message #299916] Wed, 13 February 2008 14:43 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Wed, 13 February 2008 19:05
ORA-27123: unable to attach to shared memory segment 
Cause: shmat() call failed 
Action: check permissions on segment, contact Oracle support 

Whats the output of:
$id
$ ps -ef | grep smon
$ ipcs -m | grep oracle


The outputs are:
$id
uid=1000(jide) gid=1000(jide) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),104(scanner),108(lpadmin),110(admin),115(netde v),117(powerdev),1000(jide),1001(dba)

$ ps -ef | grep smon
oracle 5571 1 0 21:17 ? 00:00:00 xe_smon_XE
jide 5623 5525 0 21:26 pts/1 00:00:00 grep smon


$ ipcs -m | grep oracle
0x880f3334 1179661 oracle 640 289411072 19
Re: Problem in using the SQL Command Line [message #300008 is a reply to message #299347] Thu, 14 February 2008 00:26 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
It should be user oracle to have access to instance.
Why it is jide?
Re: Problem in using the SQL Command Line [message #300127 is a reply to message #300008] Thu, 14 February 2008 05:25 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Thu, 14 February 2008 07:26
It should be user oracle to have access to instance.
Why it is jide?


Jide is the name of the linux account that I am using. If "user oracle" is correct what can I do to correct it? Reinstall oracle-xe?
Re: Problem in using the SQL Command Line [message #300139 is a reply to message #299347] Thu, 14 February 2008 06:17 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Post the output of
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax
Re: Problem in using the SQL Command Line [message #300144 is a reply to message #300139] Thu, 14 February 2008 07:15 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Thu, 14 February 2008 13:17
Post the output of
cat /proc/sys/kernel/sem
cat /proc/sys/kernel/shmmax



The outputs are:
cat /proc/sys/kernel/sem:
250 32000 100 128

cat /proc/sys/kernel/shmmax:
536870912


Thanks,

Jide

Re: Problem in using the SQL Command Line [message #300189 is a reply to message #299347] Thu, 14 February 2008 09:20 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
edit /etc/sysctl.conf file and
change
kernel.shmmax=2147483648.
save the file and restart the machine and then try
Re: Problem in using the SQL Command Line [message #300195 is a reply to message #300189] Thu, 14 February 2008 09:59 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Thu, 14 February 2008 16:20
edit /etc/sysctl.conf file and
change
kernel.shmmax=2147483648.
save the file and restart the machine and then try


I did change the sysctl.conf file as you mentioned above but still got the same error message.

Thanks,

Jide
Re: Problem in using the SQL Command Line [message #300207 is a reply to message #299347] Thu, 14 February 2008 10:44 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
post your alert log file also
$tail alert.log
shutdown your database if started
and post
$ipcs -m | grep oracle

Re: Problem in using the SQL Command Line [message #300211 is a reply to message #300195] Thu, 14 February 2008 10:52 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
I do not have Ubuntu around to test anything.
Could you post the output of mount command?
Make sure the mount (the one you are using for ORACLE_HOME) is not using "nosuid" option.
Re: Problem in using the SQL Command Line [message #300220 is a reply to message #300207] Thu, 14 February 2008 11:18 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Thu, 14 February 2008 17:44
post your alert log file also
$tail alert.log
shutdown your database if started
and post
$ipcs -m | grep oracle




When I tailed the alert.log file I got this message:
tail: cannot open `alert.log' for reading: No such file or directory

When I stop oracle and issue the second command (grep) I got nothing.
Re: Problem in using the SQL Command Line [message #300223 is a reply to message #299347] Thu, 14 February 2008 11:27 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
See this
Re: Problem in using the SQL Command Line [message #300225 is a reply to message #300211] Thu, 14 February 2008 11:35 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
Mahesh Rajendran wrote on Thu, 14 February 2008 17:52
I do not have Ubuntu around to test anything.
Could you post the output of mount command?
Make sure the mount (the one you are using for ORACLE_HOME) is not using "nosuid" option.


I suspect that the problem is here because the ORACLE_HOME is at hda3 but I have to check how to change the "nosuid" option. Below is the output of mount command:

/dev/hda3 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
/dev/hda1 on /media/hda1 type fuseblk (rw,nosuid,nodev,noatime,allow_other,default_permissions,blksize=4096)
/dev/hda5 on /media/hda5 type vfat (rw,utf8,umask=007,gid=46)
/dev/hda6 on /media/hda6 type vfat (rw,utf8,umask=007,gid=46)
/dev/hda7 on /tmp type ext3 (rw)
securityfs on /sys/kernel/security type securityfs (rw)


Thanks,

Jide
Re: Problem in using the SQL Command Line [message #300226 is a reply to message #300220] Thu, 14 February 2008 11:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>>tail: cannot open `alert.log' for reading: No such file or directory
Thats because alert.log should be somewhere in your $ORACLE_BASE (depends on how you installed it).
>>When I stop oracle and issue the second command (grep) I got nothing.
No wonder.
If you look into the man pages for ipcs
-m    Prints information about  active  shared  memory  seg-
           ments.

After shutting down Oracle, what do you expect to be in memory owned by oracle(unless you have other oracle products installed)?
Re: Problem in using the SQL Command Line [message #300228 is a reply to message #300225] Thu, 14 February 2008 11:41 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>> how to change the "nosuid" option.
Not sure about Ubuntu.
Check /etc/vfstab?
Take a backup before you try anything you are not sure.
Re: Problem in using the SQL Command Line [message #300230 is a reply to message #299347] Thu, 14 February 2008 11:45 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
See the link i posted.It has the solution to your problem
Re: Problem in using the SQL Command Line [message #300233 is a reply to message #300225] Thu, 14 February 2008 11:53 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
But it seems your hda3 is alright.
Login as root and do a

chown -R < username > /usr/lib/oracle/*
or just chmod 755.

[Updated on: Thu, 14 February 2008 11:53]

Report message to a moderator

Re: Problem in using the SQL Command Line [message #300240 is a reply to message #300230] Thu, 14 February 2008 12:17 Go to previous messageGo to next message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
varu123 wrote on Thu, 14 February 2008 18:45
See the link i posted.It has the solution to your problem


I will take time to go through the link.
Thanks very much for your efforts. I will keep you posted.

Jide
Re: Problem in using the SQL Command Line [message #300822 is a reply to message #300240] Mon, 18 February 2008 03:24 Go to previous message
jide
Messages: 20
Registered: February 2008
Location: Luxembourg
Junior Member
jide wrote on Thu, 14 February 2008 19:17
varu123 wrote on Thu, 14 February 2008 18:45
See the link i posted.It has the solution to your problem


I will take time to go through the link.
Thanks very much for your efforts. I will keep you posted.

Jide


Hello,
I tried the link you posted but it did not work. I also tried the suggestion from mahesh and it didn't work too. I decided to re-install oracle-xe and now everything is OK.

Thank you all for your time and the great help.

Jide
Previous Topic: Accessing windows share folder from Linux Machine
Next Topic: creating database in oracle 10g on linux
Goto Forum:
  


Current Time: Tue Apr 16 13:42:27 CDT 2024