Home » Infrastructure » Linux » SQL ERROR
SQL ERROR [message #359332] Fri, 14 November 2008 22:05 Go to next message
OracleDBA1
Messages: 7
Registered: November 2008
Junior Member
hi,

my sample script:

....
val=$(sqlplus -s user1/passwd@db <<END
select destination from v\$archive_dest where dest_name = 'LOG_ARCHIVE_DEST_1';
...

i had put this script in an .sh file to execute.

However there is an error thrown :

ORA-00904: "LOG_ARCHIVE_DEST_1 invalid identifier.

when i run the command in the database..it works fine.But only when i put it in script i get this error.

Also i tried :

select destination from v\$archive_dest where dest_name = \'LOG_ARCHIVE_DEST_1\';

still the same result. Sad


Kindly suggest.. Smile

Thank you in advance Cool
Re: SQL ERROR [message #359375 is a reply to message #359332] Sat, 15 November 2008 08:28 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
What does the rest of the script look like ?

The following works fine on Linux:

val=$(sqlplus -s test/test <<END
select destination from v\$archive_dest where dest_name = 'LOG_ARCHIVE_DEST_1';
END
)
Re: SQL ERROR [message #359379 is a reply to message #359375] Sat, 15 November 2008 09:42 Go to previous messageGo to next message
OracleDBA1
Messages: 7
Registered: November 2008
Junior Member
HI,
the script has to be executed in Linux.


#/bin/sh
export DIRE=/oracle/prod/
for j in `cat $DIRE/data.txt` -- the data.txt has 3 database names in it--
do
val=$(sqlplus -s user1/passwd@j <<END
select destination from v\$archive_dest where dest_name = 'LOG_ARCHIVE_DEST_1';
exit
END)


The script works fine when executed in the db however doesnot work when executed within a script.

I cannot understand this.


Thanks & kind regards.. Smile

[Updated on: Sat, 15 November 2008 09:46]

Report message to a moderator

Re: SQL ERROR [message #359383 is a reply to message #359379] Sat, 15 November 2008 10:50 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does "it does not work" refer to your original error or a new one?

Regards
Michel
Re: SQL ERROR [message #359384 is a reply to message #359379] Sat, 15 November 2008 10:52 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
END has to be on a line by itself.

Look at the example I provided above.

END
)
Previous Topic: Oracle installation on Linux Remotely
Next Topic: TNSLSNR program is not starting automatically
Goto Forum:
  


Current Time: Thu Mar 28 07:08:30 CDT 2024