SQLPlus and Windows command-line
Hi,
From a Windows 2000/2003 box, I have to run a SQLPlus command (looks like "sqlplus /nolog @my_command_file.sql"). In the sql file, I run a "CREATE USER" which fails because, let's say, the default tablespace does not exist. Unfortunately, the .bat file which launches SQLPlus is not aware of this error : ERRORLEVEL is still 0.
Is there a way I can check wether the SQL command did work ?
Thanks for your help ...
WHENEVER SQLERROR EXIT SQL.SQLCODE
create user ...
Read:
Page 446 of:
SQL*Plus®
Userâs Guide and Reference
Release 10.1
Part No. B12170-01
December 2003
Similar Messages
-
Run Scripts from windows command line
Hi, We're creating a test enviroment and we need to "rebuild" our Database (Tablespace) from scratch everytime we run a test.
What we need is to run all scripts files from windows command line, there is any command or application we can use here?
thanks.
Fernando.Create a scripts.bat file with something like this in it:
@sqlplus -S username/password@connect @scriptname.sql -
Execute windows command line to a file
Hi,
I would like to run a windows command line from Java and output the result to a file.
eg.
cmd> mycommand hello > output.txt
in windows ">" is to output the result to a file.
I've tried
String command = "mycommand hello > output.txt";
Process process = Runtime.getRuntime().exec(command);But that exec() didn't output to a file.
Can someone give me an example on how to do this?
ThanksYou are falling for one of the traps described here. The redirection operator '>' has to be interpreted by a shell or command processor. On windows this would be
String command = "cmd.exe /C mycommand hello > output.txt";and on Linux this would beString command = "sh -c mycommand hello > output.txt";You should read all 4 sections of the traps article and implement ALL the recommendations or you will be back here again. -
How to Invoke tasks created in FrameMaker Publishing Server from the Windows command line
Hi All ,
i would like to know how can we Invoke tasks and schedules created in FrameMaker Publishing Server from the Windows command line.
we used publishing server mainly to convert Frame maker files into PDF and that should be do progarmatically without manual intervention on Demand.
so could you please let us know how can i invoke rthe task creted to convert FM file to PDF in FrameMaker Publishing Server from the Windows command line.
please let me know the command to execute .
thank you and waiting for valuable response.
best regards
Ramesh babuPlease see http://blogs.adobe.com/techcomm/2011/03/adobe-framemaker-server-10-and-its-command-line-ca pability.html for the same.
Harish Dhawan -
Can't run java .class programs from Windows command line!
I have tried to get a program that I wrote with the JDK to run from the Windows command line, but it is not working. I typed:
java HelloWorld
Where my .class was HelloWorld.class, a compiled java program. I spelled the name correctly (and I am in the correct directory), yet I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
I think something is screwy with windows, but that's just me. Any ideas??Likely a CLASSPATH issue - try
java -classpath . HelloWorldGood Luck
Lee -
Launched from a windows command line
If my labview app is run remotely from a windows command line, is there any way to tell programmatically from a variable somewhere that it was launched by another app and not by the operator manually launching the app itself ?
Hello id,
If you have control over the application that's invoking your exe through the command line, I'd suggest using a simple custom argument that is passed to the application per this KnowledgeBase:
KnowledgeBase 1CNFGHFI: Passing Command Line Arguments to a LabVIEW Executable
http://digital.ni.com/public.nsf/allkb/17C3AD70493CE0208625666A00763364
You would then use the App.Args property (Application:Command Line Arguments Property) to check for your "this launched from the command line via this other application" argument, whatever it might be. I would suggest that you should only need to check for *any* arguments, if they're present then you know it's been launched via the command line. The argument could just be the name of the calling application. If you're unable to insert arguments via the invoking application, you could also use a one-line batch file that's installed with the target EXE to do the same thing (you'd run the batch file instead of the executable from the invoking application).
Determining where an application was invoked from without sending it that information explicitly is another, trickier problem- there are plenty of discussions on stackexchange and elsewhere detailing possible solutions, but if the invoked application (your EXE) isn't owned by the command prompt process I'm not sure it's possible. There are a few mentions of checking environment variables that the command prompt usually sets to see if they've been configured, but I have no experience with this.
Best Regards,
Tom L. -
How to check system status from Windows command line?
Does anyone has an idea how to check system status from Windows command line? In UNIX we use startsap check, unfortunately I didn't find an appropriate command provided by SAP.
The only idea we have is to use
tasklist /FI "Username eq SAPService<SID>" | find "disp+work"
which isn't as nice as startsap check.Hi,
In windows you can use the command
go to profile directory in command prompt and the give the following command to check the status of the instance.
sapstart check pf=START_DVEBMGS<nr>_<hostname>
that means you need to mention start profile or instance profile. So that it will say whether the instance is running or not.
If you want any other information please reply back to me.
Thanks,
Chaitanya. -
Is thee any way to use java to process Windows command line commands, such as running ftp?
Runtime.exec() is used to run system commands, but it's not a command-line shell. Before you try to use it, you should read the following: Navigate yourself around pitfalls related to the Runtime.exec() method
If you're looking for an FTP API in Java, you should try the Jakarta Commons Net packages... -
Running class files from the windows command line...
Hello Everyone,
My instructor showed us a way to run class files from the windows command line. However every time I try to run the class file from the command line using a command like: java CruiseHelper.class
I get an error that states "Exception in thread "main" java.lang.NoClassDefFoundError: CruiseHelper/class"Hello Everyone,
My instructor showed us a way to run class files from
the windows command line. However every time I try
to run the class file from the command line using a
command like: java CruiseHelper.class
I get an error that states "Exception in thread
"main" java.lang.NoClassDefFoundError:
CruiseHelper/class"Classes are not file names. You don't have a class named "CruiseHelper.class", that's a file name. The class name is just CruiseHelper (if you have no package statement in it).
So,
java -classpath . CruiseHelper -
How to use sqlplus with utf8 on windows command line
I expected sqlplus to work interactively with the following settings:
- Lucida Console font for command window
- chcp 65001 (UTF8-Windows-Codepage)
- set NLS_LANG=.AL32UTF8
But it turned out that
1) sqlplus apparently does not use WIN32-API function ReadConsoleW and WriteConsoleW (these wide char functions must be used instead of ReadFile and WriteFile for Console I/O)
2) cmd silently ignores all .cmd and .bat files with codepage set to 65001.
I fear that such a problem regarding a minority of command line freaks has low priority for Oracle and for Microsoft, so I wrote two small filters in C.
rconsu8 passes keyboard input to stdout, using ReadConsoleW
wconsu8 passes stdin to console, using WriteConsoleW
both set the UTF8-codepage 65001 and restore the previous codepage at exit.
Anybody interested?
(Yes, I know that I could use sqldeveloper.)
Sample session:
C:\>set NLS_LANG=.AL32UTF8
C:\>rconsu8 | sqlplus scott/tiger@DBUTF8 | wconsu8
SQL> select '€' from dual;
'€'
€
SQL> select * from test_cyrillic;
NAME
Йозеф
Euro €Console Output
works for characters covered by Lucida Console font if the first character in a line is ASCII (code < 128, e.g. blank)
CHCP 65001
sqlplus
SQL> select ' ', unistr('Josef \0419\043E\0437\0435\0444') from dual;
Josef Йозеф
SQL> select ' ',unistr('Euro \20AC') from dual;
Euro €
Sven, windows is able to render the output (as covered by Lucida Console), but there is a quirk in MSVCRTxx (C Runtime-Lib), function fwrite(). The first byte in a line is passed separately to an isolated single write() call, which causes conversion of an utf8 sequence to fail.
Console Input
For non-ascii characters (code >= 128), ReadConsoleW must be called, e.g. through a simple filter converting UTF-16 stdin to UTF-8 stdout. -
Windows command line to invoke jabber client
Hi there,
We have an application running when jabber starts. Currently users have to start Jabber manually first and then start working with the app. Is there a way to invoke jabber from command-line with parameters such as credential?
Thanks!
LinYou are falling for one of the traps described here. The redirection operator '>' has to be interpreted by a shell or command processor. On windows this would be
String command = "cmd.exe /C mycommand hello > output.txt";and on Linux this would beString command = "sh -c mycommand hello > output.txt";You should read all 4 sections of the traps article and implement ALL the recommendations or you will be back here again. -
Please help: Running a java script form the windows command line.
Hello forum,
I'm trying to run a java script from the command line on
windows but I always get the "Failed to open document" alert.
I typed the following in the run command line:
"flash.exe" C:\Documents and Settings\Hasan.Atieh\My
Documents\science\java scripts\testing jsfl\get_files_mx2004.jsfl
now I copied and pasted the path of my java script file from
the windows explorer address bar so I'm sure that the java script
file exists in the specified path.
Any thoughts why am I getting the message!!:oops: never mind... issue resolved. I didn't quote the java
script file path but thats because the help documents on flash
didn't say that.
this is what flash help say:
To run a script from the command line on Windows:
Use the following syntax (add path information as required):
"flash.exe" myTestFile.jsfl -
To acces vmware servers using windows command line
Hello,
I installed vmware server 1.0.3 on windows 7, for linux and oracle 10g. which i implemented successfully, My question, Is it possible to access the oracle database or vmware server through windows 7 command line?
If its possiable can any one help me out. what i am thinking is if i could install putty on windows 7 and access the vmware servers so i can have a kind of live environment on single system.
thanks and regards
firdous ahmad
[email protected]Hi,
It is possible. However, please post your question in the appropriate forum.
Database - General
General Database Discussions
Thanks,
Hussein -
How to run EJB through a ide and not command line
I have been trying out a simple Cart EJB. I have no problem running the whole thing through command line using the runclient script. But when i compile and run the same code in my ide it chucks the following error
Caught an unexpected exception!
javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/SimpleCart
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at CartClient.main(CartClient.java:26)
Is there any reasons you cant run an EJB client code through an ide. This is the code i am using
// Decompiled by DJ v3.0.0.63 Copyright 2002 Atanas Neshkov Date: 8/20/2002 2:33:45 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: CartClient.java
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Vector;
import javax.ejb.EJBObject;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class CartClient
public CartClient()
public static void main(String args[])
try
InitialContext initialcontext = new InitialContext();
Object obj = initialcontext.lookup("java:comp/env/ejb/SimpleCart");
CartHome carthome = (CartHome)PortableRemoteObject.narrow(obj, CartHome.class);
Cart cart = carthome.create("Duke DeEarl", "123");
cart.addBook("The Martian Chronicles");
cart.addBook("2001 A Space Odyssey");
cart.addBook("The Left Hand of Darkness");
Vector vector = new Vector();
vector = cart.getContents();
String s;
for(Enumeration enumeration = vector.elements(); enumeration.hasMoreElements(); System.out.println(s))
s = (String)enumeration.nextElement();
cart.removeBook("Alice in Wonderland");
cart.remove();
catch(BookException bookexception)
System.err.println("Caught a BookException: " + bookexception.getMessage());
catch(Exception exception)
System.err.println("Caught an unexpected exception!");
exception.printStackTrace();
}Are you setting the system properties for your Java runtime in the IDE?
You might need some command-line options along the lines of
Djava.naming.provider.url=BAR -Djava.naming.factory.initial=FOO
Failing that you might have to do a global JNDI lookup instead of a local one but that'd be far from ideal. -
Hana db filesystem directory structure and process command line
Hi experts,
Could someone provide please actual directory structure of Hana db filesystem?
Generally speaking, I need to model some Hana db(of 1.0, 1.5 versions) entities. Among them:
Schemas
Data files
Log files
Important configuration files
Database parameters(guess found in config files and command line)
Database version
The question is where i can find such information having access to filesystem?
One another question is how common Hana db commandline looks like?
Does it have one process or several?
It would be perfect if someone give some ps -aef command result grepped with relevant Hana Db processes
Thanks,
Eugene
Edited by: Eugene Kondrashev on Dec 28, 2011 12:51 PMEugene Kondrashev wrote:
> * What are the processes relevant to Hana Db?
This is still changing pretty much ...
Anyhow, just check the running services in HANA studio (landscape tab) and you have all the process at hand.
> * What is the signature of starting command?
What is that supposed to mean?
> * How can I identify running Hana Db instance on a host having shell access?
How about the HDB command?
SUSE Linux Enterprise Server 11 (x86_64)
/usr/sap/HAN/HDB00> HDB help
Usage: /usr/sap/HAN/HDB00/HDB { start|stop|reconf|restart|version|info|proc|admin|kill|kill-<sig>|term }
kill or kill-9 should never be used in productive environment!
/usr/sap/HAN/HDB00> HDB info
USER PID PPID %CPU VSZ RSS COMMAND
hanadm 14682 14677 0.0 85580 2180 sshd: hanadm@pts/0
hanadm 14683 14682 3.3 16768 2980 \_ -bash
hanadm 14756 14683 18.1 13652 1680 \_ /bin/sh /usr/sap/HAN/HDB00/HDB info
hanadm 14782 14756 0.0 6620 892 \_ ps fx -U hanadm -o user,pid,ppid,pcpu,vsz,rss,args
hanadm 31638 1 0.0 42624 1820 sapstart pf=/usr/sap/HAN/SYS/profile/HAN_HDB00_vml3012
hanadm 31645 31638 0.0 528216 151400 \_ /usr/sap/HAN/HDB00/vml3012/trace/HDB.sapHAN_HDB00 -d -nw -f /usr/sap/HAN/HDB00/vml3012/daemon.ini pf=/usr/sap/HAN/SYS/profi
hanadm 31665 31645 0.5 5001972 1002844 \_ hdbnameserver
hanadm 31723 31645 0.0 4367024 244336 \_ hdbpreprocessor
hanadm 31744 31645 1.9 5664496 1779448 \_ hdbindexserver
hanadm 31752 31645 3.6 7197924 3359440 \_ hdbstatisticsserver
hanadm 31759 31645 0.6 5289164 1507684 \_ hdbxsengine
hanadm 32017 31645 0.0 429188 124344 \_ sapwebdisp_hdb pf=/usr/sap/HAN/HDB00/vml3012/wdisp/sapwebdisp.pfl -f /usr/sap/HAN/HDB00/vml3012/trace/dev_webdisp
hanadm 31527 1 0.0 292676 110380 /usr/sap/HAN/HDB00/exe/sapstartsrv pf=/usr/sap/HAN/SYS/profile/HAN_HDB00_vml3012 -D
> * Does Hana DB started with SAP start profile? If so, could someone point me to the example of such a profile?
?? seriously... take a guess
regards,
Lars
Maybe you are looking for
-
How is the best way to have Itunes notice your app or drive traffic to the app store?
How is the best way to have Itunes notice your app or drive traffic to the app store? What are the best ways based on experiance that works to drive traffic to your app as a paid game for .99?
-
Creating arrow navigation with a photo gallery
I am in the process of creating my own phtoography website. I created all the pages in Photoshop, sliced them and am now using dreamweaver to add interactivity. The class I took showed us how to make remote rollover images with small thumbnails that
-
I accidentally deleted ALL the messages from my wife from my iPhone, nearly all of them iMessages. Yet, I can see all of them on my iMac and on my MacPro. Indeed, there is a discussion item (https://discussions.apple.com/message/21313040#21313040)
-
My program closed on me when i was downloading videos
it just closed on me when i had 9 videos downloading and that thing popped up "send error report" or whatever and i did and then it closed on me. i lost all my files that were downloading and i spent money on them and i dont even get redeemed? I WANT
-
cm:search is not returning any result when logical operator '!' is used.
<cm:search is not returning any result when logical operator '!' is used. I am using BEA 9.1 content management services API. When I run the following query I am not receiving any results. Also no error or exceptions are seen in the weblogic or cmspi