Writing About Our Experiences With Oracle Databases
Friday September 3rd 2010

Latest Topics

Effect Of Multiple SHMMAX Settings

Last week I saw a warning message at database startup time saying: WARNING: EINVAL creating segment of size [Read More]

Finding blogging tough? Just copy and do find and replace

Finding blogging tough? Just copy and do find and replace

Well this is motto followed by Guenadi Jilevski for his blog http://gjilevski.wordpress.com and he seems to get result [Read More]

Physical Corruption: ORA-1578 part 3

Recently we encountered a block corruption issue in 10g database on Linux x86 64 bit and using ASM for storing database [Read More]

Cloning RAC Database with RMAN fails with error

Steps for cloning a RAC database  with RMAN is similar to cloning a single instance database. But while using rman [Read More]

DBMS_SCHEDULER jobs not running?

I came across this posting on OTN which lists down things to check in case your scheduler job is not . This is quite [Read More]

Effect of OS Terminal Setting “STTY” on Oracle Database

Few days back, while trying to create a synonym over dblink I experienced following error:

SQL> create synonym synonymn_name for dual@DBLINK9i;
SP2-0042: unknown command "DBLINK9i" - rest of line ignored

Strange error !!!

Also while trying to perform a simple select statement over another dblink:

SQL > select * from dual@dblink10g;
SP2-0042: unknown command "DBLINK10g" - rest of line ignored.

It also failed with a similar error, though the select over this dblink was working fine earlier.The tnsnames.ora entry was correct and double checked.So what happened to this dblink now?

From other database I was able to perform a simple select over same dblink.

While I was researching this, I came to know that sql queries also started failing :

SQL> UPDATE HRRECORD_TEST SET EMAIL_ADDRESS = 'abc@123.com' WHERE NAME = 'XYZ';
SP2-0734: unknown command beginning "123.com'..." - rest of line ignored.
SQL>

One Notable thing was that all the queries which failed contained “@” symbol and I also got this error  while create a synonym over dblink (having “@” symbol).

These two issues were related, Then I tried to create a synonym locally and it went fine. This led to conclusion  that sql prompt was not recognising “@” symbol.

So it was clear that the problem was with terminal settings at OS level for oracle user.

Searcing google for terminal setting at OS, I found a command which is used to Sets options for your terminal i.e “stty”. By using stty we can change the terminal settings.

Now checking the current terminal settings using:

# stty -a

speed 9600 baud; line = 0;
rows = 36; columns = 80
min = 4; time = 0;
intr = DEL; quit = ^\; erase = DEL; kill = @
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
stop = ^S; start = ^Q; susp <undef>; dsusp <undef>
werase <undef>; lnext <undef>
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts

From this output I found that there were two settings causing problem:

1) kill = @

2) eol = ^@

Then, to overcome this I added the following two lines in the oracle user .profile

stty kill ^U

stty eol ^E

Above change will force oracle user to use ^U to kill any session and ^E to end a line instead of using @ for these purpose.

After making these changes in oracle user’s .profile everything went fine. In the end it turned out OS issue whose settings was modified by sysadmin. ;-)

  • Share/Bookmark
Related Tags: , ,

Leave a Comment

Recent Comments

Ron Gordon had this to say

I had a simillar ORA-15020: discovered duplicate ASM disk issue, our sysadmin determined that there was a BAD Read the post

Can a security group be a member of another group? had this to say

install Oracle and have so many problems with it. My goal is to install it according to this link Read the post

M Tanvir had this to say

Hi Amit, really its great response, bcoz i just new with oracle. Thanks... Read the post

Aman.... had this to say

Hahaha aur sab se badi baat, he is not even ready to accept! jigar chahiye bhai yeh karne aur fir na maanne ke liye :D . Read the post

Dev had this to say

Hi Amit, Thanks for quick reply. It looks fine on my HTC Desire ( Android ) ,so no need to worry about Read the post