Run SQL Command Line

Sorry folks, but I'm new to all this - just started an Oracle db course and downloaded the Windows (Oracle.exe) version of 10g to practise at home. Whenever I try and writes some SQL, I get a message:
SP2-0640: Not connected
What am I doing wrong?!?

hi,
u can connect to the ORACLE database like this
SQLPLUS <user_name>/<pasword>
or
SQLPLUS
Enter Username: <user_name>
Enter Password:
Trinath Somanchi,
Hyderabad.

Similar Messages

  • Clear screen in "Run SQL Command Line" causes the utility to dump in Window

    Just for your notice... I have not checked if i can reproduce this on Linux platform or on second node running Windows XP Pro.
    But if I use "Run SQL Command Line" utility and do
    clear screen
    The utility dumps, (not the database though only the utlility)
    Maybe some other people could confirm if this findings is a bug or not and if it is a port specific issue with Windows XP only.
    Kindly Rgds
    /Ulf, Kentor IT Sweden

    Tracking info is in
    Re: SQL*Plus generated Program Error
    -- cj

  • Run Sql command line is not openning.

    Hi !
    sql command line is not openning.(windows 2008 enterpise and oracel 11g express)
    please tel me is there any other way to open it, i have tried it from the phyical directory also.
    but oracel is working properlly.
    i wanted it load data from captured data to oracle database. (i was migrating).
    yours sincerely
    Edited by: 944768 on Aug 14, 2012 12:12 AM

    Open a command prompt (cmd), from there run:
    c:\> sqlplus user/passwordHow do you plan to "load data", based on what format? Sqlplus might not be the right tool for the job.
    Sql*loader is one option. Another option to help with migration is Oracle SQL Developer (separate, free tool).

  • Password keystrokes won't register in Run SQL Command

    I'm sorry if this has been answered before. I searched but I couldn't find this particular problem. I'm new to Oracle and I'm trying to install it on my computer. I'm used to using the Enterprise Edition that is available at school, so the Express Edition seems so much different.
    In case it is important, I'm running Windows Vista Home Premium (64-bit). When I go to Start > All Programs > Oracle Database 10g Express Edition > Run SQL Command Line, I enter "connect", then it prompts me for a username. I enter "SYSDBA", then it asks me for a password and my keystrokes are not recognized. I tried to just go ahead and enter the password I created when I installed and press ENTER but that didn't work.
    I tried going to the Database Homepage, and I can log in with SYSTEM and my password, but my SQL commands and scripts (from school, that work with the Enterprise Edition) don't work. I get this pop-up window with the title "Enter Bind Variables" and the page itself has a SUBMIT button, but there is nothing else there.
    I'm totally lost. Any help is greatly appreciated.
    Edited by: user10823568 on Apr 1, 2009 11:56 PM

    sysdba is a privilege, not a user. SYS and SYSTEM users have the DBA role privileges, SYS owns the catalog (database, tables, datafile, user and object info, all the metadata).
    The sys and system users can manipulate just about anything in the instance, using a connect sys as sysdba grants the ability to do a few more management tasks (i.e. shut down the database). Its best to only use those database logins when they're really needed (backups, startups, etc) and create other database users for all the other stuff. A quick way to get started is
    connect sys as sysdba; -- or connect / as sysdba;
    create user joe identified by joepasswd;
    grant resource to joe;
    grant connect to joe;
    grant create session to joeThe resource privilege is a quick way to get all the rights needed to create tables, indexes, procedures. There are a couple of rights in resource that most admins don't like to hand out to just anyone but it'll get the joe database user rolling.
    Now on to that "bind variables" dialog, the script that is running needs some input, take a look at the .sql file and there's probably an ampersand in there somewhere- maybe it wants a user name name, just have to figure out what it wants.
    And sqlplus does not echo characters typed in at the password prompt, that's normal.

  • Oracle Express 10g - SQL Command Line - copy and paste?

    Is there a special key to copy and paste SQL statement in the SQL command line?
    I'm doing a spool and this can only be achieved through the SQL command line. Thanks for the help if any.

    It uses the functionality of the shell it is running in.
    If you're using Windows, right-click on the title bar, select Edit then Paste from the menu that pops up.
    If you select Properties from the menu, you can enable Quick Edit mode, which lets you paste using the right mouse button.
    You can use the up arrow key to recall previous commands.
    If you're using Linux, I think you can paste with the right mouse button. (Or is it the middle mouse button?)

  • SQL COMMAND LINE DISAPPEARD

    I AM ALREADY IN THE CHAP05 OF THE BOOK. I USED THE OBJECT BROUSER TO CREATE SOME TABLES. AFTER THAT I TRIED TO USE THE SQL COMMAND LINE BUT EVERYTIME I HIT "ENTER", THE COMMAND LINE JUST DISAPPEARED ON ME RIGHT AWAY. I CANNOT EVEN GET THE RESULT AFTER I EXECUTED SOME QUERRIES IN THE COMMAND LINE BECAUSE IT WILL JUST DISAPPEAR RIGHT AWAY AFTER I HIT THE "ENTER", IN THE KEY PAD.
    PLEASE HELP ME. I CANNOT GO AHEAD BECAUSE OF THIS PROBLEM. IM REALLY FRUSTRATED FOR 3 NIGHTS IN A ROW ALREADY. ANY HELP IS GREATLY APPRECIATED.
    THANK YOU.

    Seriously, what book? Are you using the browser interface for Oracle 10g Express Edtion (XE)? If so, is there a "Run" button at the top right of the screen? Or are you using the SQL*Plus client application which runs in a Windows command window?
    btw your caps lock key is stuck.

  • Ref : SQL Command Line -

    Hi Experts,
    I've started using SQL Command Line to write queries. But the problem is ,i'm not able to format the o/p properly.
    select * from v$sqlarea;When i executed this query, the output came in very unreadable format and covered the entire Editor window.
    Can anybody please prove me some tips to improve the readability?
    Thanks in Advance,
    Ranit B.

    >
    Thanks... I'll keep these in mind.
    >
    That isn't what you need to do to learn how to get formatted output. You need to actually try things. You learn by doing, not by reading.
    Start simple. Use the query in the doc example. See how messy the output is with no formatting. Then use the formatting in that example. See the difference it makes.
    Then do the same with your query. Just use two or three columns. See how messy the output is when you don't specify formatting. Then try different formats and see what effect it has.
    Once you have done that you will notice that you now get the nice output you want but in order to get it you have to spend time looking up what the column names and datatypes are and hand-coding a bunch of formatting.
    You can make that job easier in a couple of ways. One way is to create a script that contains the formatting and query and then just execute that script when you want to run that query.
    The second way is more complex but more flexible. You can add parameters to your script that control which columns get used, how many rows will get returned and how to sort the output. Then you can either pass the parameters manually every time you run the script, have the script prompt you for the parameters or just create several versions of the script that do things different ways.
    SB's advice may have seemed simplistic but unless you start building your own 'toolkit' you will never advance to the stage where you can do those things easily. There are just too many permutations to try to remember them all when you need to. You need to start creating the building blocks that you can use to build on and create more complex combinations.
    I have one question for you. Will you commit to trying that doc example and then trying similar formatting for your own query?

  • Error while running the SAP JCO java program running via command line

    Hi,
        We are facing an issue while using SAP JCO. When i try to run the sample program using RAD 8.0 ( IBM IDE tool For Java Development) its working fine.
    The same sample program if i try to run using command line, Then its giving below exception message.
    Exception in thread "main" java.lang.NoClassDefFoundError: Integration
    NOTE: I have configured proper sapjco jar & Dll files path in class path settings in my batch file.

    Hi,
    class loader can't find class definition during runtime but it could find it during compilation. So the problem is with your classpath. Does your classpath point to file with class Integration? Check this [blog|http://javarevisited.blogspot.com.au/2011/06/noclassdeffounderror-exception-in.html].
    Cheers
    Added reference to blog.

  • Running a command line in Java

    Dear all,
    I have a question, I need to run a command line in a Java program. The commands line is the next:
    cas.exe -i file1
    I have been seeing in internet and I have tried:
    Process ls_proc = Runtime.getRuntime().exec("cmd /c start D:\\cas>cas.exe -i file1");
    it start the window where the cas folder is... but it dont run the commands line : cass.exe -i file1 :(
    Somebody can help me, please??
    Andrea

    try running it like this.
    Process ls_proc = Runtime.getRuntime().exec("cmd /c start D:\\cas>cas.exe -i file1" +"\n");
    if that does not work put this underneath the original.
    ls_proc.newLine();
    or look into the ProcessBuilder class in java.lang.

  • How to run a command line argument

    i want to run a command line argument, say for eg......i want to execute the "dir" command on the dos prompt and capture the output.
    how can i do this.
    actually i want to capture the output of the ping command and write it to a file. can any body plsssssss help

    This command runs a ping to "address" and writes the output back to the command line. To capture it, just put strings into an array or do whatever you want with it. If you want to wait until the program completes before reading its input, use p.waitFor().
    Process p = Runtime.getRuntime().exec("ping " + address);
    BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String currLine = null;
    while((currLine = in.readLine()) != null)
      System.out.println("ping: " + currLine);
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Oracle Express 10g - a way to terminate in SQL Command Line interface

    I've downloaded Oracle Express 10g and use the SQL Command Line interface to execute SQL*Plus -- a really simple window / interface without hardly any smarts. In other Oracle installations' SQL*Plus, I'm used to be able to do a Ctrl C to terminate the current SQL that's being executed and the session is still active and I can keep using it. But with the Oracle Express 10g SQL Command Line interface, when I do a Ctrl C the currrent SQL is terminated -- but so is the whole dang session and the window goes away too. There must be a way in the Oracle Express 10g SQL Command Line interface to simply terminate th current SQL results without losing the whole dang session!!! This is so incredibly frustrating it's not even funny. HELP!!!!

    I think your answer is in this thread:
    Re: stopping a query
    Regards, Marc

  • Connection error when logining in from sql command line

    I'm getting the following errors when I attempt to connect using the sql command line. I have installed 10g Express on XP home addition. The errors are as follows:
    ORA-01034 Oracle not available
    ORA-27101 Shared memory realm does not exist.
    Thanks

    I am getting this error in the oradim log file:
    ORA-01078: failure in processing system parameters
    ORA-01565: error in identifying file 'D:\oraclexe\app\oracle\product\10.2.0\server\dbs/spfileXE.ora'
    checked this directory and it is empty
    should I uninstall and reinstall. Can I get this file somewhere?

  • Query runs from command line, but not from scheduler

    We use Control-M to schedule shell scripts to be run on a Solaris server. Some of the scripts have to access an Oracle database and in that case our security team will include the DB user and password in the script, then encrypt it and the sys admin team schedules the encrypted shell script with Control-M. That works fine, but we've been trying to have the DB user and password on a separate encrypted file so that we don't have to ask for file encryption every time it's necessary to modify a script (this is a test environment).
    We have the script at ~/system_name/scripts, the query at ~/system_name/sql and the encrypted file and key at ~/system_name/keys. The SQLPlus call in the script is:
    ${ORACLE_HOME}/bin/sqlplus "`decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system`"@instance_name <<EOF
    @${DIR_SQL}/TEST_QUERY.SQL
    quit
    EOF
    The security analyst has tested is successfully from command line, but when we schedule it with Control-M the job abends and we get the following in the sysout:
    + decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system
    decrypt: cannot open ./../keys/key.3des.system
    decrypt: invalid key.
    + /u00/app/oracle/product/11.1.0/db_1/bin/sqlplus @instance_name
    + 0<<
    @/sistemas/hmp/system_name/sql/TEST_QUERY.SQL
    quit
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 3 09:41:55 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SP2-0310: unable to open file "instance_name.sql"
    Enter user-name: SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    0000000080
    Any ideas?

    Looks like the command is being split in some way - the connection to sqlplus is being made before it completes the whole string
    It appears to be seeing the @instance_name as a script to execute rather than a db to connect to.
    Is the database on the same server as the script?
    If so, try setting your environment to the correct databsae, so that you can omit the @instance_name part of the syntax and see if it helps
    Also just noticed the failure to open the decrypt script. It would appear uyou are not using a full path name. Have you checked which directroy the scheduled job starts in? You may need to look at running some environment specific scripts first.
    Edited by: LindaA on 05-May-2010 07:43

  • How to run ADF command-line test-client on standalone weblogic host

    I have followed the steps to create a test client for the ADF application. In used the following link:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcquerying007.htm
    The above link does not talk about how to setup the environment where the standalone weblogic is installed to be able to run the test client.
    I can run it in the jdeveloper environment.
    I can also run from the command line on the development host, by cut-paste the command from the jdeveloper output log tab.
    I am trying to run this client on the machine where we have a weblogic installed (standalone) for testing. We can run our ADF application from the browser with no issues. We want to automate and run some testing related to the ADF model (non-viewcontroller part) from the command line on this test stage.
    Which/Where are the ADF libraries?
    How can I add our application jar deployed on the weblogic (ear file) to the CLASSPATH?
    What other libraries ADF/Weblogic do I need for the command line test client?
    What am I missing?
    Thanks for any help.
    Edited by: mmunawar on Jul 2, 2011 1:03 PM
    Edited by: mmunawar on Jul 2, 2011 1:04 PM

    create weblogic application server connection from jdeveloper and then Deploy that application through jdeveloper in the weblogic application server and then run it from jdeveloper and see if its working.

  • Running a Command Line via a Package

    Hi,
    I am trying to deploy the following command line via a package to my servers but for some reason the results are as expected. The command I am trying to run is:
    reg add "hklm\software\microsoft\windows nt\currentversion\softwareprotectionplatform" /f /v "KeyManagementServiceName" /t reg_sz /d "dc4hmancmddc1.mydomain.local"
    When I look in the log files on the server the command is being executed as:
    <![LOG[Command line = "C:\Windows\system32\reg.exe" add "hklm\software\microsoft\windows nt\currentversion\softwareprotectionplatform" /f /v "KeyManagementServiceName" /t reg_sz /d "dc4hmancmddc1.mydomain.local",
    Working Directory = C:\Windows\system32\]LOG]!><time="12:44:32.391+00" date="02-24-2014" component="execmgr" context="" type="1" thread="3976" file="scriptexecution.cpp:346">
    Why is this is not working? If I run the command manually on the server, it works and reg key is updated correctly.
    PS: I am probably being really stupid here but any help is appreciated.
    Thank You
    Mayur

    Hi,
    Just looking at the logs file, I see this:
    <![LOG[Running "C:\Windows\system32\cmd.exe" /c "C:\windows\system32\reg.exe add "hklm\software\microsoft\windows nt\currentversion\softwareprotectionplatform" /f /v "KeyManagementServiceName" /t reg_sz /d "dc4hmancmddc1.osmanage.local" with 32bitLauncher]LOG]!><time="13:06:32.677+00"
    date="02-24-2014" component="execmgr" context="" type="1" thread="4024" file="scriptexecution.cpp:364">
    It is launching it with 32bit launcher. So is this still a problem with 64bit redirection?
    The thing is before trying this reg fix I tried several times to run command: slmgr.vbs /skms servername.local via  a packag which executed successfully but again the KMS server wasn't updated. So something tells me this is a different problem?

Maybe you are looking for