Environment variable PATH and Sql*Plus
Hi all,
i have a problem with sqlplus.
It might seem not to be able to read the path environment variable.
I need to launch some sqls without typing their path (to put the path i should modify morre than 300 shell scripts), e.g.: @script.sql.
My shell scripts are invoked by the database using java.
Inside the shell scripts we have commands like "sqlplus -silent <login> @script.sql [parameters]"
So if sqlplus is not able to read the PATH environment variable, the command hangs waiting for something to do without the chance to close it.(it is silent).
I run RDBMS v8.1.7 on compaq tru64 Unix.
Can someone help me??
Thanks in advance.
Marco - Milan, Italy
Where do I set SQL*Plus SQLPATH variable??As every other unix environment variable - either in your profile or in your current shell whatever you like
Is this the PATH where SQL*Plus searches for .sql
files??SQL*Plus searches for your files in your current directory, and then the directories you specify with the SQLPATH environment variable.
SQL*Plus searches this colon-separated list of directories in the order they are listed.
Similar Messages
-
this is really frustrating ive been googling for hours trying to find the solution! any help would be greatly appreciated. I have windows 7 and the newest gen ipod nano
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
tt2 -
How to pass Unix environment variable to a SQL procedure or SQL * Plus
Can any body suggest me how to ,
How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
I am trying to invoke a SQL Procedure from Unix
by passing the value of a Unix environment variable.
Is it possible..?
Thanks in advance.
Regards,
Srinivas JaltaruWithin your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
<pre>
#!/bin/bash
export ORACLE_SID=DEV05
FILENO=1007351
while [ ${FILENO} -le 1008400 ]
do
FILENAME=farm_${FILENO}.txt
DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
set lines 73
set pages 0
set head off
set termout off
set echo off
set feedback off
select rpad(searchx, 8)
from blastx@PRODUCTION
where searchx = ${FILENO} ### here's a shell variable
spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
spool off
SQLSTOP`
FILENO=`expr ${FILENO} + 1`
done
exit 0
</pre> -
Can i use a environment variable inside a *.sql file?
Hello,
I want to create a external table.
So i am using the command
create or replace directory abc as 'C:\folder'.... inside a sql file.
Now i want the path "C:\folder" to be dynamic as i am using this path in many other places also inside the sql file.So i thought to create a environment variable and put this value there.I tried using as %PATH% but it gives error..... where %PATH%=C:\folder.
Can i use a environment variable inside a *.sql file?
But how to do that or is there any other way.
Thanks
Swapna
Edited by: user11018268 on Feb 19, 2010 1:03 AMuser11018268 wrote:
Actually what i want is the path "C:\folder" is not fixed it can be anything which i may not know the user may decide it later. Not supported. A directory object refers to a specific physical location (directory/folder) on a file system. Not a path.
You can work around it by (creating and) using a function (running under a super user schema with authid definer privs). The caller (e.g. schema scott ) calls it with a physical path. E.g. GetDirectoryObject( 'C:\folder\2010\feb\week4' ).
This function determines if there is an existing directory object for the path. If not, it uses a wildcard search to determine if there are any directory objects for parents in the path (e.g. for C:\folder\2010\feb or C:\folder\2010 or C:\folder ).
If it finds a directory object, it interrogates the data dictionary to determine if the caller, schema scott for example, has read/write access on that directory object. If it has, it creates a new directory object and grants the caller read/write access to it. The function then returns the name of the directory object to the caller.
The caller thus do not deal directly with directory objects. The function returns the object name given a physical path as input. Also, only a single base directory needs to be created (e.g. for C:\folder ) and access granted to the schema on it. Any sub-directory in that base directory can now be dynamically accessed by the schema. -
How to Specify the environment variable JCE_POLICY_ZIP and restart
Hello All,
I am installing the ABAP SAP NetWeaver 7.01 SR1 ABAP Trial Version.
sapinst.exe installed successfully.
I am installing the sapinstgui.exe but I got the following message:
Program is starting... Please wait!
Path: C:\Users\George\AppData\Local\Temp\sapinst_exe.6220.1246290325
jre\bin\java.exe
For the requested processing mode java policy
files within the used SAP JVM are needed.
Specify the environment variable JCE_POLICY_ZIP and restart.
See also SAP note 1238121.
Exit status of child: 10
JRE is installed in C:\Program Files\Java\j2re1.4.2_19
How do I specify the environment variable JCE_POLICY_ZIP?
Thanks
George
Edited by: George King on Jun 29, 2009 9:01 PMHi everyone,
I had the same problem and found the solution !
I was trying to setup the GUI thanks to sapinstgui.exe from the trial download folder and I got the exact same message,
The problem is not the policies but the installation file.
The installation file for the GUI is located at :
<extract_folder_SAP_trial_version>\GUI\SAP_GUI_FOR_WINDOWS(...)\SAP_GUI_for_windows_(...)_Components.exe
Hope it helps !
Nicolas -
when i am going to Install 11gR2 then thsi error shows how to solve it plz give me guidance
This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.
Expected Value: 1023
Actual Value: 0HELLO iSHAN SHAH
JUST EXPLAIN US YOUR PROBLEM IN DEPTH.
TELL US YOUR HARDWARE AND SOFTWARE CONFIGURATION.
ALSO TELL US IN WHICH STEP OF INSTALLATION , THIS ERROR RAISED.
THANKS
HARSH SHAH -
Environment variable path failed in oracle 11g installation
hi all,
i am reinstalling oracel 11g in my window 7 64 bit machine after i uninstalled it. however, i got an issue that is environment variable path failed in the installation process. this didn't happen when i firstly successfully installed oracle. how can i fix the issue? thanks in advance.
regards,
honguser571093 wrote:
hi,
the problem is i uninstalled oracle 11g in my windows 7 64 bit machine and then try to install it on my machine. during the prerequisite check stage, an error message popped up like this:
environment variable: "PATH" failed
This test checks whether the length of the environment variable "PATH" does not exceed the recommended length. (more details)
Expected Value
: 1023
Actual Value
: 1433
so, what is the reason caused this problem and how to fix it. thanks in advance.
hongI believe the error message is self-explanatory - assuming you you using a supported database and OS combination (which are unknown)
environment variable: "PATH" failed+
This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.+
Expected Value+
*: 1023*
Actual Value+
*: 1433*
Your PATH variable exceeds the limit of 1023 characters
HTH
Srini -
Shorten environment variable path
I am installing Oracle database 10G on Windows XP. I am getting an error message saying 'The value of the environment variable path is more than 1023 characters.' How do I shorten this path, where do I go? thanks
My Computer ( right click) -> property -> Advance -> Environment Variable
Select patch and edit it , remove all not required paths
Virag -
Hi all,
I am installing 11g database in order to play with it. My OS is windows 7 premium edition, personnal PC and I am having that message:
Environment variable: "PATH" - This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.
Valeur attendue
: 1023
Valeur réelle
: 1558
Liste des erreurs :
PRVF-3929 : Adding the Oracle binary location to the PATH environment variable will exceed the OS length limit of [ "1023" ] for the variable on the node "DATAEBULLITION" - Cause: The installer needs to update the PATH environment variable to include the value "%ORACLE_HOME%/bin;". However, doing so will cause PATH to exceed the maximum allowable length that this operating system allows. - Action: Ensure that the sum of the lengths of your current PATH environment variable and that of "%ORACLE_HOME%/bin;" does not exceed the operating system limit. Restart the installer after correcting the setting for environment variable
Is anyone could help me as I don't understand what is PATH and how to reinstall it ?
THank youI found the answer by reading other user question.
-
OC4J and SQL Plus: ORACLE_HOME problem
I installed (unzip) latest version of OC4J standalone. OS is Windows XP professional. After unziping I put enviroment varibles ORACLE_HOME and JAVA_HOME and started ocj4 -start. It works OK. But I cannot run SQL Plus anymore (because it has different ORACLE_HOME) . What should I do to run both: SQL Plus and OC4J (which are installed on the same computer)?
Message was edited by:
user529386Hi All
Correct. Oracle application server wants to point ORACLE_HOME variable to its home directory and to smooth functionality of Oracle DB it also need same environment variable (ex sqlplus, sqlldr).
Try this, this may work.
1) Do not set ORACLE_HOME environment variable in profiles. (In UNIX systems do not set ORACLE_HOME in .profiles files and windows system does not set it using -> System Properties (Right Click My Computer -> proprieties) -> Advanced -> Environment variables). If it is already set please unset that.
2) Open cmd and check ORACLE_HOME is set or not (in windows u can use echo %ORACLE_HOME% and Unix/Linux u can use echo $ORACLE_HOME). If it is set please unset ORALCE_HOME environment variable.
3) To start application server open cmd, follow step 2 and set ORALCE_HOME home to oracle application server home and then u can run the command to start oracle application server. If u want to use script to start app server what u have to do is u can set ORALCE_HOME environment variable inside script and point it to app server home.
4) If u want to run the Oracle DB utilities please open the another cmd , follow the step 2 and set ORACLE_HOME environment variable to Oracle DB home. And then execute DB utilities commands.
Note: - What we have to do is simply point to correct oracle home to before execute commands
Thanks
Asanka Priyanjith -
Where its not possible to use a variable (&&var) in SQL*PLUS ?
SQL*Plus Command Reference - DEFINE
Whenever you run a stored query or script, SQL*Plus substitutes the value of variable for each substitution variable referencing variable (in the form &variable or &&variable)
The question is which are the limits of this. Can eg even be between a 'STR&&varING' passed as parameter to some function? Or as parameter I can pass only a single variable and there isnt such auto-casting level ?
I have created DBCA Scripts to batch create a DB. So I want inside these scripts to replace the DBNAME with a variable. So I can create different DBS with these prescriptions from an API tool.
E.g here there are 6 different scenarios where I might need to pass the variable. I dont know
1. On which of the bellow scenarios I can inject the &&var
2. On which I cant and thus have to create a 2nd VAR to inject the 1st one
3. Which dont accept variables at all - but only static text
@D:\app\admin\DBNAMEY\scripts\CreateDB.sql
spool D:\app\admin\DBNAMEY\scripts\CreateDB.log append
startup nomount pfile="D:\app\admin\DBNAMEY\scripts\init.ora";
CREATE DATABASE "DBNAMEY"
DATAFILE 'D:\app\oradata\DBNAMEY\system01.dbf' SIZE ...
GROUP 2 ('D:\app\oradata\DBNAMEY\redo02.log') SIZE 51200K,
I may not start testing the scripts 6 times fearing corrupting my Workstation on half executed scripts.GoodfireGeorge wrote:
SQL*Plus Command Reference - DEFINE
Whenever you run a stored query or script, SQL*Plus substitutes the value of variable for each substitution variable referencing variable (in the form &variable or &&variable)
The question is which are the limits of this. Can eg even be between a 'STR&&varING' passed as parameter to some function? Or as parameter I can pass only a single variable and there isnt such auto-casting level ?
I have created DBCA Scripts to batch create a DB. So I want inside these scripts to replace the DBNAME with a variable. So I can create different DBS with these prescriptions from an API tool.
E.g here there are 6 different scenarios where I might need to pass the variable. I dont know
1. On which of the bellow scenarios I can inject the &&var
2. On which I cant and thus have to create a 2nd VAR to inject the 1st one
3. Which dont accept variables at all - but only static text
@D:\app\admin\DBNAMEY\scripts\CreateDB.sql
spool D:\app\admin\DBNAMEY\scripts\CreateDB.log append
startup nomount pfile="D:\app\admin\DBNAMEY\scripts\init.ora";
CREATE DATABASE "DBNAMEY"
DATAFILE 'D:\app\oradata\DBNAMEY\system01.dbf' SIZE ...
GROUP 2 ('D:\app\oradata\DBNAMEY\redo02.log') SIZE 51200K,
I may not start testing the scripts 6 times fearing corrupting my Workstation on half executed scripts.
If you can't test because you are afraid the test might fail, you need to address that issue first. No one on the web is going to give you iron-clad assurance that some code you write is going to work exactly as you expect.
Your script is trying to create a database? What's the worst thing that can happen if it doesn't work? Do you know how to manually dis-mantle whatever your script does? If not, you need to learn. The knowledge you will gain from that exercise will go a long way to improving your understanding of how these things interrelate. -
Accessing environment variables in PL/SQL??
I have two oracle schemas; myenv1 and myenv2. They are both exact copies from each other except for the fact that one is my "developement" environment and the other my "production" environment.
So in each of them I have some packages with PL/SQL code.
I'd like to have an environment variable called PLATFORM (maybe not the best name) that should have the value "devel" in one schema and the value "prod" in the other schema. And I'd like to be able to access this variable in my PL/SQL code so I can slightly change some code or conditionate some code to the production environment only... or stuff like that.
Does anyone know how to do that? (where and how to configure the env. variable)
Any help will be most appreciated.
Thanks!but I'm using the same 'current_user' in both schemas... is there other values I can get with sys_context ?? maybe there's one that would do it... but i think it's not 'current_user' It should be. Consider:
SQL> show user
USER is "SCOTT"
SQL> create or replace function show_user return varchar2
2 as
3 begin
4 return sys_context('userenv','current_user');
5 end show_user;
6 /
Function created.
SQL> select show_user from dual;
SHOW_USER
SCOTT
SQL> grant execute on show_user to test;
Grant succeeded.
SQL> connect test/test
Connected.
SQL> select scott.show_user from dual;
SHOW_USER
SCOTT -
Apache Environment Variables inside PL/SQL
How to access Apache Environment Variables inside HTMLDB (PL/SQL block)?
Hi,
You can use the owa_util.get_cgi_env packaged function -
FUNCTION GET_CGI_ENV RETURNS VARCHAR2
Argument Name Type In/Out Default?
PARAM_NAME VARCHAR2 INSo, pass in the name of the Env var you want and it will give you back the value. -
Use Registry path like SQL*Plus!
Is there a wish list for future SQL Developer releases? I want SQL Developer to find my scripts in my registry path the same way SQL*Plus does it. I have a lot of stuff in different directories and I do not want to put them all into 1 folder just so SQL Developer can find them. This doesn't seem like an outrageous request. I will stick with SQL*Plus and Textpad until this is fixed.
http://sqldeveloper.oracle.com has a feature request section where you can log anything and others can vote it up the priority.
-kris -
Please Help with Forms and SQL Plus Connection Issues in XE
I am not able to connect with the Forms Builder or SQL Plus with the following errors:
When attempting to connect with the supplied website.edu:port/orcl
ORA-06401: NETCMN: invalid driver designator
When leaving the connection information blank and using my local login and password
for my copy of Oracle XE
ORA-12560: TNS:protocol adapter error
Based on some reading, I set the TNS_ADMIN user environmental variable, trying each of the tnsnames.ora locations but I'm still receiving the same errors
Location 1: DevSuiteHome\...\tnsnames.ora
Location 2: oraclexe\...\tnsnames.oraThanks, Vikas!
But I did a search for 6iServer.conf and did NOT locate any such file
Please help
TIA
SHANKAR
Shankar,
It would have helped if you had indicated what is the full version of 9iAS that you have installed. By default the portnumber that is used is 7778.
As per the entries, they should have already been made in the config files. But check that the 6iServer.Conf file and it should contain the entries that you are being told to update. If not, then add the entries in the 6iServer.conf file and that is all you need.
HTH.
Vikash
Maybe you are looking for
-
ITunes and Windows Vista Ultimate 64-bit
Is there an iTunes version that is compatible with the 64-bit version of Windows Vista Ultimate? If so, can you please let me know?
-
Hyperion products not showing in Services
Hello Gurus, I have installed and configured the epm system planning, reports, hss but I do not see them in SERVICES, Is thre anything I need to do after the configuration? Thanks
-
Trouble with port forwarding, DHCP, VUZE, and downloading speed.
I am using Vuze to download things. I have a slow download speed and yellow smiley face, indicating a NAT problem. I think I need to implement a port forwarding, but that requires a static IP address. My router and security is set up such that I CANN
-
Odd behaviour appending to System.out PrintStream
I've run into some unexpected behaviour with the System.out PrintStream object. When I append characters to it I'm expecting the characters to be displayed on screen much like I'd expect the characters to be written to a file using a FileOutputStream
-
'recent items' isn't storing word and excel documents
I just purchased a new iMac running Yosemite. Under the apple, recent items, the items stored are only various types of images (.jpg, screenshot). No documents from Word or Excel are listed. How can I get 'recent items' to list the Word or Excel I ha