.ora-code.com

Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
How do I get a value from the windows registry to set a variable

How do I get a value from the windows registry to set a variable

2005-10-12       - By Radoulov, Dimitre
Reply:     <<     11     12     13     14  

:o) I choose this variable name (CURR_OH) to demonstrate that this is new
variable, not the ORALCLE_HOME that you already have in your environment. If
you want to use it with the ORACLE_HOME you have to change it(script test.bat)

@(protected) OFF
set ORACLE_HOME=
echo The current ORACLE_HOME is %ORACLE_HOME%
:: delims is a TAB followed by a space
FOR /F "tokens=3* delims=  " %%A IN ('reg query HKLM\SOFTWARE\ORACLE\ /v ORACLE
_HOME') DO SET ORACLE_HOME=%%A
ECHO The NEW Oracle Home is %ORACLE_HOME%


D:\Downloads>test
The current ORACLE_HOME is
The NEW Oracle Home is C:\oracle\ora92
D:\Downloads>sqlplus /nolog

SQL*Plus: Release 9.2.0.7.0 - Production on Wed Oct 12 11:03:16 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL>




Regards,
Dimitre


 -- -- Original Message -- --
 From: Niall Litchfield
 To: cichomitiko@(protected)
 Cc: Juan Carlos Reyes Pacheco ; oracle-l@(protected)
 Sent: Wednesday, October 12, 2005 10:55 AM
 Subject: Re: How do I get a value from the windows registry to set a variable


 I'm guessing you don't have 10g and 9i installed with 10g as the home. oh.bat
is your script.

 C:\Scripts>oh
 Oracle home is C:\oracle\ora92
 C:\Scripts>sqlplus /

 SQL*Plus: Release 10.1.0.4.0 - Production on Wed Oct 12 09:54:16 2005

 Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 ERROR:
 ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error


 Enter user-name:
 ERROR:
 ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error


 Enter user-name:
 ERROR:
 ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error


 SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus



 
 On 10/12/05, Dimitar Radoulov <cichomitiko@(protected)> wrote:
   Works on my PC, may be with copy/paste the delims are changing, try to
adjust the value to TAB followed by a space.


   Regards,
   Dimitre

   
   On 10/11/05, Juan Carlos Reyes Pacheco < juancarlosreyesp@(protected)> wrote:
     Thanks a lot Dimitre, copying and pasting directly from the email
     don't work precisely, but the solution is there :)
     On 10/11/05, Radoulov, Dimitre <cichomitiko@(protected)> wrote:
     > Excuse me, the correct syntax is with tokens=3*(by using the asterisk
we
     > make sure that not only the third word is used but everything following
it
     > as well) and you have to set %%A (not %%B).
     >
     >
     > @(protected) OFF
     > :: delims is a TAB followed by a space
     > FOR /F "tokens=3* delims=  " %%A IN ('reg query HKLM\SOFTWARE\ORACLE\
/v
     > ORACLE_HOME') DO SET
     > CURR_OH=%%A
     > ECHO Oracle home is %CURR_OH%
     >
     >
     >
     >
     > Dimitre Radoulov
     >
     >


     --
     Oracle Certified Profesional 9i 10g
     Orace Certified Professional Developer 6i

     8 years of experience in Oracle 7,8i,9i,10g and developer 6i






 --
 Niall Litchfield
 Oracle DBA
 http://www.niall.litchfield.dial.pipex.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>:o) I choose this variable name (CURR_OH) to
demonstrate that this is new variable, not the ORALCLE_HOME that you already
have in your environment.&nbsp;If you want to use it with the ORACLE_HOME you
have to change it(script test.bat)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>@(protected) OFF<BR>set ORACLE_HOME=<BR>echo The current
ORACLE_HOME is %ORACLE_HOME%<BR>:: delims is a TAB followed by a space<BR>FOR
/F
"tokens=3* delims=&nbsp; " %%A IN ('reg query HKLM\SOFTWARE\ORACLE\ /v
ORACLE_HOME') DO SET ORACLE_HOME=%%A<BR>ECHO The NEW Oracle Home is
%ORACLE_HOME%</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>D:\Downloads&gt;test<BR>The current ORACLE_HOME
is<BR>The NEW Oracle Home is C:\oracle\ora92<BR>D:\Downloads&gt;sqlplus
/nolog</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>SQL*Plus: Release 9.2.0.7.0 - Production on Wed
Oct
12 11:03:16 2005</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Copyright (c) 1982, 2002, Oracle Corporation.&nbsp
;
All rights reserved.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>SQL&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT><BR>Dimitre </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT:
#000000 2px solid; MARGIN-RIGHT: 0px">
 <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV>
 <DIV
 style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
 <A title=niall.litchfield@(protected)
 href="mailto:niall.litchfield@(protected)">Niall Litchfield</A> </DIV>
 <DIV style="FONT: 10pt arial"><B>To:</B> <A title=cichomitiko@(protected)
 href="mailto:cichomitiko@(protected)">cichomitiko@(protected)</A> </DIV>
 <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=juancarlosreyesp@(protected)
 href="mailto:juancarlosreyesp@(protected)">Juan Carlos Reyes Pacheco</A> ; <A
 title=oracle-l@(protected)
 href="mailto:oracle-l@(protected)">oracle-l@(protected)</A> </DIV>
 <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, October 12, 2005 10:55
 AM</DIV>
 <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: How do I get a value from
 the windows registry to set a variable</DIV>
 <DIV><BR></DIV>
 <DIV>I'm guessing you don't have 10g and 9i installed with 10g as the home.
 oh.bat is your script.</DIV>
 <DIV>&nbsp;</DIV>
 <DIV>
 <P>C:\Scripts&gt;oh<BR>Oracle home is C:\oracle\ora92<BR>C:\Scripts&gt
;sqlplus
 /</P>
 <P>SQL*Plus: Release 10.1.0.4.0 - Production on Wed Oct 12 09:54:16 2005</P>
 <P>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</P>
 <P>ERROR:<BR>ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error</P>
 <P><BR>Enter user-name:<BR>ERROR:<BR>ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error</P>
 <P><BR>Enter user-name:<BR>ERROR:<BR>ORA-12560 (See ORA-12560.ora-code.com): TNS:protocol adapter error</P>
 <P><BR>SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting
 SQL*Plus</P><BR><BR>&nbsp;</DIV>
 <DIV><SPAN class=gmail_quote>On 10/12/05, <B class=gmail_sendername>Dimitar
 Radoulov</B> &lt;<A
 href="mailto:cichomitiko@(protected)">cichomitiko@(protected)</A>&gt;
 wrote:</SPAN>
 <BLOCKQUOTE class=gmail_quote
 style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px
solid">
   <DIV>Works on my PC, may be with copy/paste the delims&nbsp;are changing,
   try to adjust the value to TAB followed by a space.</DIV>
   <DIV>&nbsp;</DIV>
   <DIV>&nbsp;</DIV>
   <DIV>Regards,</DIV><SPAN class=sg>
   <DIV>Dimitre<BR><BR>&nbsp;</DIV></SPAN>
   <DIV><SPAN class=q><SPAN class=gmail_quote>On 10/11/05, <B
   class=gmail_sendername>Juan Carlos Reyes Pacheco</B> &lt;<A
   onclick="return top.js.OpenExtLink(window,event,this)"
   href="mailto:juancarlosreyesp@(protected)" target=_blank>
   juancarlosreyesp@(protected)</A>&gt; wrote:</SPAN> </SPAN>
   <DIV><SPAN class=e id=q_106e37b3219cc4bc_4>
   <BLOCKQUOTE class=gmail_quote
   style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px
solid">Thanks
     a lot Dimitre, copying and pasting directly from the email<BR>don't work
     precisely, but the solution is there :) <BR>On 10/11/05, Radoulov,
Dimitre
     &lt;<A onclick="return top.js.OpenExtLink(window,event,this)"
     href="mailto:cichomitiko@(protected)"
     target=_blank>cichomitiko@(protected)</A>&gt; wrote:<BR>&gt; Excuse me, the
     correct syntax is with tokens=3*(by using the asterisk we <BR>&gt; make
     sure that not only the third word is used but everything following it
     <BR>&gt; as well) and you have to set %%A (not
     %%B).<BR>&gt;<BR>&gt;<BR>&gt; @(protected) OFF<BR>&gt; :: delims is a TAB
     followed by a space<BR>&gt; FOR /F "tokens=3* delims=&nbsp;&nbsp;" %%A IN
     ('reg query HKLM\SOFTWARE\ORACLE\ /v <BR>&gt; ORACLE_HOME') DO SET<BR>&gt
;
     CURR_OH=%%A<BR>&gt; ECHO Oracle home is
     %CURR_OH%<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Dimitre Radoulov
     <BR>&gt;<BR>&gt;<BR><BR><BR>--<BR>Oracle Certified Profesional 9i
     10g<BR>Orace Certified Professional Developer 6i <BR><BR>8 years of
     experience in Oracle 7,8i,9i,10g and developer
   6i<BR></BLOCKQUOTE></SPAN></DIV></DIV><BR></BLOCKQUOTE></DIV><BR><BR
 clear=all><BR>-- <BR>Niall Litchfield<BR>Oracle DBA<BR><A
 href="http://www.niall.litchfield.dial.pipex.com">http://www.niall.litchfield
.dial.pipex.com</A>
</BLOCKQUOTE></BODY></HTML>