I am not getting User Environment Variable Value
Hi Team,
I have been Trying to recover variables values using an anonym procedure from Windows XP SP3
I have already executed following procedure.
BEGIN
DECLARE
gf_filelog UTL_FILE.file_type;
v_file_log VARCHAR2 (1024) := ' ';
gv_path_log VARCHAR2 (1024) := ' ';
gv_path_log2 VARCHAR2 (1024) := ' ';
gv_file_log VARCHAR2 (1024) := ' ';
BEGIN
DBMS_OUTPUT.put_line ( 'obteniendo valores of vars: '
|| gv_path_log
|| ' '
|| gv_file_log
DBMS_SYSTEM.get_env ('ORACLE_HOME', gv_path_log);
DBMS_SYSTEM.get_env ('PATH_MODULO', gv_path_log2);
DBMS_SYSTEM.get_env ('FILELOG', v_file_log);
DBMS_OUTPUT.put_line ( 'valores vars ORACLE_HOME: '
|| gv_path_log
|| 'PATH_MODULO:'
|| gv_path_log2
|| ' FILELOG:'
|| v_file_log
gv_file_log :=
v_file_log || TO_CHAR (SYSDATE, 'yyyymmddHH24MISS')
|| '.log';
DBMS_OUTPUT.put_line ( 'Nombre de Archivo creado'
|| gv_path_log
|| ' '
|| gv_file_log
gf_filelog := UTL_FILE.fopen (gv_path_log, gv_file_log, 'w');
DBMS_OUTPUT.put_line ('Archivo creado' || gv_path_log || ' '
|| gv_file_log
UTL_FILE.put_line (gf_filelog,
|| TO_CHAR (SYSDATE, 'HH24:MI:SSSSS')
|| ']--> '
|| 'Prueba de escritura'
|| gv_path_log
|| ' '
|| v_file_log
UTL_FILE.fflush (gf_filelog);
UTL_FILE.fclose (gf_filelog);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( '[reporta_log]Error en :'
|| SQLCODE
|| ' - '
|| SQLERRM
raise_application_error (-20000,
'[reporta_log]Error en :'
|| SQLCODE
|| ' - '
|| SQLERRM
END;
END;
I show you data result after procedure was excecuted.
obteniendo valores of vars:
valores vars ORACLE_HOME: E:\oracle\product\10.2.0\db_1PATH_MODULO: FILELOG:
Nombre de Archivo creadoE:\oracle\product\10.2.0\db_1 20111122171625.log
[reporta_log]Error en :-29280 - ORA-29280: invalid directory path
BEGIN
ERROR at line 1:
ORA-20000: [reporta_log]Error en :-29280 - ORA-29280: invalid directory path
ORA-06512: at line 55
I see that only ORACLE_HOME variable value was got, question is why, of course, variable values are already defined as user variables.
Variables PATH_MODULO and FILELOG was defined using windows maintenance variable method, that is :
1.- settings
2.- system
3.- advanced options
4.- environment variables
Here my oracle version
SQL> select version from v$instance;
VERSION
10.2.0.1.0
SQL>
Is this an Oracle Issue or variables would be defined in another way?
ORACLE_HOME VARIABLE was created when oracle engine was installed.
I have got same result after computer was restart.
I appreciate wathever clue.
Ok, that is , I only can read environment variables values, but not variables values at user profile. It happends in unix environment too. So I tried to use another instruction sequence in order to read user variables values.
Regards
Similar Messages
-
How to get system Environment variable?
How to get system Environment variable without using jni?
just like "JAVA_HOME" or "PATH"...
Any reply is help to me!! :-)Thx for your reply...
I get it!!!
Read environment variables from an application
Start the JVM with the "-D" switch to pass properties to the application and read them with the System.getProperty() method. SET myvar=Hello world
SET myothervar=nothing
java -Dmyvar="%myvar%" -Dmyothervar="%myothervar%" myClass
then in myClass String myvar = System.getProperty("myvar");
String myothervar = System.getProperty("myothervar");
This is useful when using a JAVA program as a CGI.
(DOS bat file acting as a CGI) java -DREQUEST_METHOD="%REQUEST_METHOD%"
-DQUERY_STRING="%QUERY_STRING%"
javaCGI
If you don't know in advance, the name of the variable to be passed to the JVM, then there is no 100% Java way to retrieve them.
NOTE: JDK1.5 provides a way to achieve this, see this HowTo.
One approach (not the easiest one), is to use a JNI call to fetch the variables, see this HowTo.
A more low-tech way, is to launch the appropriate call to the operating system and capture the output. The following snippet puts all environment variables in a Properties class and display the value the TEMP variable. import java.io.*;
import java.util.*;
public class ReadEnv {
public static Properties getEnvVars() throws Throwable {
Process p = null;
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
String OS = System.getProperty("os.name").toLowerCase();
// System.out.println(OS);
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set" );
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set" );
else {
// our last hope, we assume Unix (thanks to H. Ware for the fix)
p = r.exec( "env" );
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
return envVars;
public static void main(String args[]) {
try {
Properties p = ReadEnv.getEnvVars();
System.out.println("the current value of TEMP is : " +
p.getProperty("TEMP"));
catch (Throwable e) {
e.printStackTrace();
Thanks to W.Rijnders for the W2K fix.
An update from Van Ly :
I found that, on Windows 2003 server, the property value for "os.name" is actually "windows 2003." So either that has to be added to the bunch of tests or just relax the comparison strings a bit: else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1 )
|| (OS.indexOf("windows 2003") > -1 ) // works but is quite specific to 2003
|| (OS.indexOf("windows xp") > -1) ) {
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 20") > -1 ) // probably is better since no other OS would return "windows" anyway
|| (OS.indexOf("windows xp") > -1) ) {
I started with "windows 200" but thought "what the hell" and made it "windows 20" to lengthen its longivity. You could push it further and use "windows 2," I suppose. The only thing to watch out for is to not overlap with "windows 9."
On Windows, pre-JDK 1.2 JVM has trouble reading the Output stream directly from the SET command, it never returns. Here 2 ways to bypass this behaviour.
First, instead of calling directly the SET command, we use a BAT file, after the SET command we print a known string. Then, in Java, when we read this known string, we exit from loop. [env.bat]
@set
@echo **end
[java]
if (OS.indexOf("windows") > -1) {
p = r.exec( "env.bat" );
while( (line = br.readLine()) != null ) {
if (line.indexOf("**end")>-1) break;
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
hash.put( key, value );
System.out.println( key + " = " + value );
The other solution is to send the result of the SET command to file and then read the file from Java. ...
if (OS.indexOf("windows 9") > -1) {
p = r.exec( "command.com /c set > envvar.txt" );
else if ( (OS.indexOf("nt") > -1)
|| (OS.indexOf("windows 2000") > -1
|| (OS.indexOf("windows xp") > -1) ) {
// thanks to JuanFran for the xp fix!
p = r.exec( "cmd.exe /c set > envvar.txt" );
// then read back the file
Properties p = new Properties();
p.load(new FileInputStream("envvar.txt"));
Thanks to JP Daviau
// UNIX
public Properties getEnvironment() throws java.io.IOException {
Properties env = new Properties();
env.load(Runtime.getRuntime().exec("env").getInputStream());
return env;
Properties env = getEnvironment();
String myEnvVar = env.get("MYENV_VAR");
To read only one variable : // NT version , adaptation for other OS is left as an exercise...
Process p = Runtime.getRuntime().exec("cmd.exe /c echo %MYVAR%");
BufferedReader br = new BufferedReader
( new InputStreamReader( p.getInputStream() ) );
String myvar = br.readLine();
System.out.println(myvar);
Java's System properties contains some useful informations about the environment, for example, the TEMP and PATH environment variables (on Windows). public class ShowSome {
public static void main(String args[]){
System.out.println("TEMP : " + System.getProperty("java.io.tmpdir"));
System.out.println("PATH : " + System.getProperty("java.library.path"));
System.out.println("CLASSPATH : " + System.getProperty("java.class.path"));
System.out.println("SYSTEM DIR : " +
System.getProperty("user.home")); // ex. c:\windows on Win9x system
System.out.println("CURRENT DIR: " + System.getProperty("user.dir"));
Here some tips from H. Ware about the PATH on different OS.
PATH is not quite the same as library path. In unixes, they are completely different---the libraries typically have their own directories. System.out.println("the current value of PATH is: {" +
p.getProperty("PATH")+"}");
System.out.println("LIBPATH: {" +
System.getProperty("java.library.path")+"}");
gives the current value of PATH is:
{/home/hware/bin:/usr/local/bin:/usr/xpg4/bin:/opt/SUNWspro/bin:/usr/ccs/bin:
/usr/ucb:/bin:/usr/bin:/home/hware/linux-bin:/usr/openwin/bin/:/usr/games/:
/usr/local/games:/usr/ccs/lib/:/usr/new:/usr/sbin/:/sbin/:/usr/hosts/:
/usr/openwin/lib:/usr/X11/bin:/usr/bin/X11/:/usr/local/bin/X11:
/usr/bin/pbmplus:/usr/etc/:/usr/dt/bin/:/usr/lib:/usr/lib/lp/postscript:
/usr/lib/nis:/usr/share/bin:/usr/share/bin/X11:
/home/hware/work/cdk/main/cdk/../bin:/home/hware/work/cdk/main/cdk/bin:.}
LIBPATH:
{/usr/lib/j2re1.3/lib/i386:/usr/lib/j2re1.3/lib/i386/native_threads:
/usr/lib/j2re1.3/lib/i386/client:/usr/lib/j2sdk1.3/lib/i386:/usr/lib:/lib}
on my linux workstation. (java added all those execpt /lib and /usr/lib). But these two lines aren't the same on window either:
This system is windows nt the current value of PATH is:
{d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;c:\depot\cdk\main\cdk\bin;c:\depot\
cdk\main\cdk\..\bin;d:\OrbixWeb3.2\bin;D:\Program
Files\IBM\GSK\lib;H:\pvcs65\VM\win32\bin;c:\cygnus
\cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;D:\orant\bin;C:\WINNT\system32;C:\WINNT;
C:\Program Files\Dell\OpenManage\Resolution Assistant\Common\bin;
d:\Program Files\Symantec\pcAnywhere;
C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce}
LIBPATH:
{D:\jdk1.3\bin;.;C:\WINNT\System32;C:\WINNT;d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;
c:\depot\cdk\main\cdk\bin;c:\depot\cdk\main\cdk\..\bin;
d:\OrbixWeb3.2\bin;D:\Program Files\IBM\GSK\lib;
H:\pvcs65\VM\win32\bin;c:\cygnus\cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;
D:\orant\bin;C:\WINNT\system32;
C:\WINNT;C:\Program Files\Dell\OpenManage\ResolutionAssistant\Common\bin;
d:\Program Files\Symantec\pcAnywhere;
C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce} -
Hi all,
how do i get the environment variables in PL/SQL on Windows NT/2000 or SUN environment..?
Thanks.hi Andrew P Clarke ,
Thanks for ur immediate reply. That's fine, using sys_context. But i'm not asking thatt...sorrry i didn't specified clearly.
My question is how do i get the Operating system - User defined system variables. (Ex: in Win 2000 Server Box i've creadted the sysvariable like TEST='C:\TEST\FILE\', like our V$parameter in ORACLE...in 'C'/JAVA we will use the function "GETENV".
Similllar one in oracle. how do i get the value?
Thank You very much for ur help and OTN. -
Using CIS to get UCM environment variables
Hi,
I am working on extending an existing CIS application.
I would need to read the UCM's environment variable value.
I see there are CIS APIs for the most common actions needed, but couldn't find anything useful in the docs - is there something similar for the env variables?
Any help is highly appreciated.
Thanks,
ZoranDo you want to get the port and server name from the web server or from the database?
If it's the web server have a look at the package OWA_Util.print_cgi_env to get a list (you can also run this procedure in the SQL Workshop) of all available environment variables in the HTTP session context. Use OWA_Util.get_env to read the value of a particular environment variable.
Hope that helps
Patrick -
How to get BW-BPS variable value into Visual Basic?
Hello,
Scenario:
Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variables value i want to get the value of variable into Visual Basic and to format header for table in the layout.
How to get BW-BPS variable value into Visual Basic?
Could you help me?
Thanks in advance.
Best Regards,
Arunas StonysHi,
If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how i would solve this,
Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM T-code. Now using the SAP delivered SAPAfterDataPut macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
Hope this helps.
regards
Sai Vishnubhatla -
is there any way to get windows environment variables like %USERNAME% with javascript using Adobe 10 pro?
There is a fair amount of Acrobat JavaScript and Acrobat knowledge need to sort all of this out.
The identity object holds a lot of sedative information. First, upon installation of Acrobat, only the login name is available in the identity object and the end user of the application needs to complete the "Name", "email" and "Organization Name" in the application's preferences. These are the only fields that are available to Acrobat JavaScript identity object as corporation, email, loginName, and name.
Using the instructions in The Acrobat JavaScript Console (Your best friend for developing Acrobat JavaScript) you can run the following script in the JS console to see the items of the identity object:
for(i in identity) {
console.println(i +": " + identity[i]);
and the following will appear in the console:
loginName: georgeK
name: George Kaiser
corporation: Example
email: [email protected]
true
The documentation states you need to use a trusted function to access this data, but you can access it at startup of Acrobat/Reader and add the properties of the identity object to an array:
// application variable to hold the properties of the identity object
var MyIdentity = new Array();
// loop through the properties of the identity object
for (i in identity) {
// place each property of the identity object into an element of the same name in the Identity array
MyIdentity[i] = identity[i];
console.println(i +": " + MyIdentity[i])
You access the items with:
var loginUser = MyIdentity[loginName]; // get the loginName property
In the user application level JavaScript file. See Acrobat Help / User JavaScript Changes for 10.1.1 (Acrobat | Reader) for the location of the application level folder you need to use.
I would change the name of the array used in this post so an untrusted user cannot get to your data. Some of this data can be used in hacking into a user's system. -
Jsf page not getting refreshed with updated values?
Hi All,
- managed-bean - session scope.
- On a request, Even though, I am updating the bean's properties(values), my Jsf page is not getting refreshed with updated values as it is displaying the older values.
Can anybody throw some light?
Thanks in advance.
- SriPlease try to give us more information, follow BalusC suggestion.
For this moment I only can say you that the more common cause to this problem (in my expirence) is that you have problems with your conversion/validate phase. -
How to get an environment variable from OS in class ?
Hello,
How to get an environment variable from OS in class ?
Thanks !An example of a Java application that does this is Ant, when you add a line like this in your build.xml:
<!-- Import environment variables -->
<property environment="env"/>
I have looked at the source code of Ant 1.3, especially the file src/main/org/apache/tools/ant/taskdefs/Execute.java. Look at the methods getProcEnvironment() and getProcEnvCommand(). Ant uses an OS-dependent trick to get the environment variables.
You can download the Ant source code from http://jakarta.apache.org/ant
Jesper -
Not getting BI query variable selection screen for few test users
Hi,
i am having problem when i am executing the reports. i am not getting variable screen for the test users ID's. but i am getting the screen when when 0BI_ALL authorization selected.
i want role based authorization, and not complete authorization.
the parameters in su01 are scl(X) and wlc(X X XX X)
Thanks,Can you please check into Infoobject Maintenance screen in Bex Tab i.e. Query Execution Filter Value Selection. assign "Values from Masterdata Table".
Try again and let me know.
Nagesh Ganisetti. -
How to get the path of the INST_TOP environment variable value
Hi,
I have some file processing code in the OAF. I would like to use INST_TOP/temp folder as a temporary location. When I tried to get the env variable from System.getenv(), System.getProperties(), they don't seem to have INST_TOP in the list.
Could anyone please tell me if it could be fetched from some other place ?
Thanks
PonrajConcurrent processes store the value in fnd_env_context ... if that helps, you might do something like the following (example only for this thread, not tested!):
select value from FND_ENV_CONTEXT where variable_name = 'INST_TOP' and concurrent_process_id = (select max(concurrent_process_id) from FND_ENV_CONTEXT);
Regards,
Gareth -
Getting a substitution variable value with VB API
Hi,I'm trying to get the value of a specific substitution variable on an application with EsbGetVariable().I get a nice message that says "you do not have sufficient access to get this subsitution variable." and then i get the return code of EsbGetVariable() that is 1051085 (i couldn't find it in any documentation).The funniest thing is that i can get the value of the substitution variable, using Application Manager, with the same Essbase user that tries to get the value in the API.Any help would be welcome...PS : here is the code of the macro i execute (hope it will be readable)...Public Sub ESB_GetVariable()Dim i As IntegerDim nCount As IntegerDim sts As LongDim oVariable As ESB_VARIABLE_TDim hCtx As LongDim AppName As String * ESB_APPNAMELENDim DbName As String * ESB_DBNAMELENDim szApp As IntegerDim szDb As IntegerDim pAccess As IntegerDim X As VariantX = EssVConnect("Feuil1", "xxx", "xxx", "xxx", "Gmo_RvIt", "It_Repr")If X = 0 Then hCtx = EssVGetHctxFromSheet("Feuil1") If hCtx <> 0 Then sts = EsbGetActive(hCtx, AppName, szApp, DbName, szDb, pAccess) oVariable.AppName = AppName oVariable.VarName = "Divers_VR" sts = EsbGetVariable(hCtx, oVariable) MsgBox "status is " & sts MsgBox "Divers_VR value is " & oVariable.VarValue Else MsgBox "EssVGetHctxFromSheet failed with status " & hCtxEnd IfElse MsgBox "EssVConnect failed with status " & XEnd IfEnd Sub
testing formatting ...
0.03965 0.00026 ds ... <save> auth user=nobodyEdited by: gpoz on Apr 18, 2013 12:14 PM -
Getting oracle environment variables using plsql code
Hi Geeks,
Can anyone tell me how to get an Oracle environment variable (eg db_cache_size) from inside a plsql block of code or through a sql query?
Thanks,
PrabhuIs it possible to update the values via SQL?That's indicated by:
ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER SESSION (TRUE) or not (FALSE)
ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER SYSTEM and when the change takes effect:
See the docs:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176 -
How do you get your environment variables seen in SS?
I am trying out SS, we currently use gcc/Kdevelop. When I try to launch my program or debug inside Sun Studio I get an error about a missing .so. Since everything works fine from the command line I assume SS does see my shell environment variables. I don't see any option for this, what am I missing?
First of all, you can check whether environment is inherited or not from dbx command line:
- start debug session
- go to "Dbx console" tab at the bottom
- issue 'set' command and/or 'set | grep your_variable' to see if it is there
If it's really missing or has value other that expected, use project properties to specify environment for the application. It can be done like this:
- right-click project in Projects window, choose Properties
- select "Running" node
- and edit the "Environment" field -
Retrieve OS Environment variable values
Dear All,
In all Operating System we can set the system environment variables in either Batch file(Windows) or script files (Unix Based operating system). Is there any way to retrive the variable values declared in the batch file or script file in throu java application without specifying -D param in java command
Thanks
ARvindPersonally, I use a little dirty trick to get the environment settings on Windows.
I have a batch file doing "set > output.txt". Then I call this batch file with Runtime.exec() and I parse the resulting output.txt file.
Not clean at all, but it works ;-)
David -
Not getting all the attributes value from Trusted Recon in eventhandler
Hi,
I am not getting the values of all the attributes in hashmap from Trusted recon in eventhandler.
Following is the hashmap value I am getting :
Parameter Hashmap value is {re_key=1869, Email=[email protected], Role=Full-Time, act_key=22, User Login=TUser43, Xellerate Type=End-User, Last Name=User43, First Name=Test}
Please let me know how to get all the attributes value in eventhandler. I need to take some decisions based on these attributes.
ThanksYou should be getting all the values in the recon event.
To get the current user states for all the records in the bulk event use this:
Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");
Now when you are looping through your bulkParametersp[], you can use the same get from the currentUserStates:
Identity currentUser = null;
currentUser = currentUserStates[counter];
Now if the attribute is not in your hashmap, you can use:
currentUserState.getAttributes().get(attribute)
-Kevini
Maybe you are looking for
-
Server allows overwriting files that are open by other users.
We're having a problem with Snow Leopard Server not warning a user when they attempt to overwrite a file that is open by another user. Running Snow Leopard Server 10.6.8 on an Xserve with an Xserve RAID. Have about 25-30 Mac clients, running 10.6.8 o
-
Problem with Reporte Generation Toolkit for Microsoft Office 2010
When I use the Report Generation Toolkit (LabVIEW 2010), and Office 2010, the tables generated are bad. In office 2007 in the tables are correct. Someone can help me solve this problem?
-
How to open my adf application in a new windw
I want to open my adf application when run it in a new window as I don't want to see back button or any something else. is there solution for this thanks.
-
Set DOCTYPE for a self rendered HTML page using cl_gui_html_viewer
G'Day! I'm dealing with HTML in ABAP and i' stuck with a nasty little problem. Perhaps somebody know's the answer and can help me out. Thanks in advance. (I'm sorry for my poor english) My problem is: I am rendering a html page in abap and display is
-
AS91 - takeover values coming with grey mode
Hi, While doing As91 system is giving grey mode for cumm acquisation value and accumalated depreciation value under takeover values tab. Can any body tell me what could be the reason. govind.