Invoking Sqlplus without "as sysoper"

On the database server how do I connect without using "as sysdba" or "as sysoper" when I invoke sqlplus.
the below does not work
[oracle@dev1 ~]$ sqlplus hr/blah
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 4 17:30:04 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
this works:
[oracle@dev1 ~]$ sqlplus hr/blah as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 4 22:06:39 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
Thanks!
Edited by: orafun on Jul 4, 2009 10:08 PM

You have SQLNET.AUTHENTICATION_SERVICES=(NTS) in your sqlnet.ora.
If your current user is the part of ORA_DBA group and SQLNET.AUTHENTICATION_SERVICES=(NTS) then anyuser/anypw as sysdba will be connected.
As in mine case:
C:\Documents and Settings\Girish Sharma>sqlplus anyuser/anypw
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 5 09:13:00 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: anyuser/anypw as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>Now if i wish to stop this functionality i SQLNET.AUTHENTICATION_SERVICES=(NONE) in sqlnet.ora.
C:\Documents and Settings\Girish Sharma>sqlplus anyuser/anypw
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jul 5 09:14:32 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: anyuser/anypw as sysdba
ERROR:
ORA-01031: insufficient privileges
Enter user-name:Now how do i connect with sys with only valid password ?
For authentication of SYS with password file we must have to set remote_login_passwordfile=SHARED and SQLNET.AUTHENTICATION_SERVICES=(NONE).
Only SYS user will be connected with valid password as per password file.
So, i will change the remote_login_passwordfile=SHARED and then connect with only valid sys password.
Hth
Girish Sharma

Similar Messages

  • Error while invoking sqlplus

    I am facing a problem while invoking sqlplus.
    The error message is as follows.
    Enter user-name: scott
    Assertion failed: !(fgets(hardwareAddr, (STRLEN-1), fstream) == NULL), file snlu
    i.c, line 1249
    IOT trap (core dumped) ----------------------------------------
    Can anyone help me on this?
    Thanks & Regards
    null

    Try
    set LOCAL=<tns_name>
    Regards
    Kurt

  • How to configure IIS webserver with weblogic so that I can invoke servlets without the .wlforward extension

    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter and .wlforward
    has also been
    included as a special file type. However this requires me to key-in ".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

    I am able to invoke the servlet without the wlforward extension now.
    However, now I am required to add /weblogic before the servlet
    name otherwise it does not execute the pathtrim property.
    I have tried with the pathprepend thing also.
    Can we get rid of the /weblogic part also. I just want to execute
    my servlet as http://iis/myServlet.
    Your help in this regard is greatly appreciated...
    Thanks..
    "Rishi" <[email protected]> wrote:
    >
    Thanks for the reply Kumar.
    I did follow the instructions as given in the Weblogic documentation
    The documentation said to add iisforward.dll as a filter service
    and register .wlforward as a special
    file type to be handled by iisproxy.dll. For this,
    while configuring the IIS server in the Home Directory tab
    I added an extension ".wlforward" and the executable as
    iisproxy.dll. Is this the way it should have been done...
    I also modified the iisproxy.ini file as per the documentation.
    I have added the WLForwardPath property and set it to /weblogic.
    My server works fine when I give the url as
    http://iis/myServlet.wlforward
    but it does not work for
    http://iis/myServlet and this is the way i'd want it to work.
    Please tell me if I am missing something on the configuration part
    and if there is something special that needs to be done. I shall
    be grateful to you.
    Kumar Allamraju <[email protected]> wrote:
    http://e-docs.bea.com/wls/docs61/adminguide/isapi.html#101184
    Rishi wrote:
    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter
    and
    .wlforward
    has also been
    included as a special file type. However this requires me to key-in".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

  • Command Line sqlplus without using @filename

    How can I pass sql statement directly to sqlplus on command line without using an external file ?

    If the insert happens infrequently, then the cost of writing
    to a temporary file may not matter overall. And if the
    insert happens frequently, the cost of invoking SQL*Plus and
    connecting to the DB could outweigh the time for writing to
    a file.
    Do you have any problem doing something like:
    tail -f mylog.txt | myawkprog | sqlplus -s scott/tiger
    Here I'm thinking that 'myawkprog' prints appropriate INSERT
    and COMMIT statements.
    For what it is worth, I have an old, old Perl 4 script for a
    similar log parsing task. It keeps the SQL*Plus connection
    alive forever and makes sure there is no I/O buffering. The
    outline of it is below. Use at own risk.
    -- CJ
    #! /usr/local/bin/perl -w
    # Open I/O pipes
    open(LG, "tail -f /tmp/mylog.txt|") || die "Can't open input";
    open(SP, "| sqlplus -s scott/tiger") || die "Can't open sqlplus";
    # unbuffered I/O
    select(LG); $| = 1;
    select(SP); $| = 1;
    while(<LG>)
    chop;
    print SP "insert into mytab values ('$_');\n";
    print SP "commit;\n";
    # Never actually get here
    close(LG);
    close(SP);

  • ADF Task Flow Binding - Refresh ifNeeded being invoked even WITHOUT any Parameter change

    Using JDeveloper 11.1.1.6.0
    Issue: Task Flow Binding property "refresh = ifNeeded" seems to be triggered even without the mutation of the input parameter.
    As per definition, "ifNeeded: refresh the ADF Region if the value of a task flow binding parameter changes." (Reference: 17.5 Refreshing an ADF Region)
    Now for the setup which reproduces the issue.
    I'll focus at the fragment bounded task flow level and will skip the jspx side.
    taskflow: main-flow.xml
    contains a single fragment mainFgmt.jsff
    has a managed bean defined SampleBean.java as pageFlow scope.
    taskflow: sub-flow.xml
    contains a single fragment subFgmt.jsff
    has an inputParameter SampleBean.java (because it is an input parameter, by default it will be at pageFlow scope)
    !important - has a nested taskflow (task flow call as defined in the component pallete) called inner-flow (see below)
    the nested taskflow is the default activity
    the nested taskflow has an outcome pointing to subFgmt where outcome = "return"
    taskflow: inner-flow.xml
    contains a single fragment called stop.jsff
    has a return activity without outcome = "return"
    stop.jsff has a navigation pointing to the outcome.
    Finally mainFgmt.jsff has a task flow binding (pageDef)
    with id = "sub-flow.xml"
    refresh = "ifNeeded"
    parameter SampleBean being submitted as sub-flow's input parameter. (id=sampleBean, value=#{pageFlowScope.mainSampleBean})
    Assume that code compiles.
    In this scenario where the only tricky condition is the inner nesting (defined by !important), when the inner nesting decides to invoke its outcome to visit sub-flow's fragment, mainFgmt is restarting its taskflow which makes sub-flow start over again.
    Another way of saying it is, if sub-flow starts a nested activity and that nested activity exits out to utilize sub-flow's view. The high level definition which is mainFgmt's refresh ifNeeded is restarting sub-flow.
    In the above example if you notice, the bean (SampleBean) is not really being utilized except that it is completing the purpose of refresh=ifNeeded. This scenario is only to simplify the setup - in practical use this bean will be mutated to be utilized as a refresh mechanism.
    Now interestingly, if I change the pattern a bit then the issue will not happen:
    Don't use the nested taskflow (inner-flow) as the default activity, let a fragment of sub-flow hold the initial view.
    Navigate to the nested flow.
    Exit nested flow.
    Everything works.
    Now in this scenario, it seems like the sub-flow needs to have a view established first for it to be properly be used.
    So my questions are as follows:
    Can I consider the behavior of the refresh=ifNeeded as a bug in this usecase?
    Would it be better to utilize a different way of refreshing (maybe combination of refresh condition) to get around the issue?
    Is the use of the task flow as defined logical or does it cross any boundary or best practice that might be causing this behavior?

    Hi,
    actually you lost me in your description due to complexity. I lived under assumption that sub-flow already is a region on a view in main flow, but then you sad that
    "!important - has a nested taskflow (task flow call as defined in the component pallete) called inner-flow (see below)"
    which then confused me as to I have no idea if inner flow now is the second level nesting or first level nesting (should be second level nesting). If sub-flow is a region then having "has an inputParameter SampleBean.java (because it is an input parameter, by default it will be at pageFlow scope)"  is an unnecessary broad scope because the region wont live longer than view scope.
    Anyway, it seems that a region refresh is triggered by the lifecycle involved, which can be by design or a bug. I suggest you file a Service Request with support and provide a test case as purely from the description, its hard to parse and understand what is going on.
    Frank

  • What is the difference of using Invoke and without invoke for invoking delegate references .

    Lets consider the below example,
    1. Invoke the delegate reference with Invoke keyword,
    public delegate double returndel(int r);
     private void button1_Click(object sender, EventArgs e)
                returndel ret = CalculateArea;
                double yt = ret.Invoke(4);   
                MessageBox.Show(yt.ToString());
            public double CalculateArea(int r)
                return 3.14 * r * r;
    2.  Invoke the delegate reference without Invoke keyword,
    public delegate double returndel(int r);
     private void button1_Click(object sender, EventArgs e)
                returndel ret = new returndel(CalculateArea);
                double yt = ret(4);
                MessageBox.Show(yt.ToString());
     public double CalculateArea(int r)
                return 3.14 * r * r;
    What is the difference between these two ?
    Thanks and Regards
    Bijukrishnan.BS

    No difference if you just want to call single function.
    Try the following:
    public delegate void DoMyWork(int i);
    static void DoMyWork1(int i)
    Console.WriteLine(i);
    static void DoMyWork2(int i)
    Console.WriteLine(i * i);
    static void delegateTest()
    DoMyWork work = new DoMyWork(DoMyWork1);
    work += new DoMyWork(DoMyWork2);
    work.Invoke(4);
    The output would be:
    4
    16

  • Error 57 in invoking sqlplus command from DOS command prompt in Oracle Serv

    I have a Oracle 11G server which has suddenly shutdown due to power cut-off. Now when I restart the system and trying to connect to database invoking the sqlplus as sysdba from DOS command prompt - I am getting following errors
    C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
    Error 57 initializing SQL*Plus
    Error loading message shared library
    Can anyone help me please ?

    Yes sure!! .. The details of alert logs for today is herewith -
    Thu Feb 28 12:30:02 2013
    kewastUnPackStats(): bad magic 1 (0x0DFE82DA, 0)
    kewastUnPackStats(): bad magic 1 (0x0DFE82DA, 0)
    Thu Feb 28 12:36:02 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:36:19 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_5180.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_5180.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:36:40 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:08 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:28 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:50 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:07 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_6256.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_6256.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:12 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:34 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:56 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:31 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:47 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m001_7628.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:49 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m001_7628.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:10 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:31 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:48 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m002_2748.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m002_2748.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.

  • Using sqlplus without tnsnames

    I was using vpn at home last night tried to remote into one of my databases: sys/pwd@sidname as sysba
    My questions is I do not have a tnsnames file pointing to this service. How is it possible to connect to an oracle db without using a tnsnames.ora file?
    thanks.

    No. I have oracle 10g installed on my laptop at home. I started SQLPLUS from the command prompt (Windows). I did a search for tnsnames.ora on the entire computer and none of the files have the services I connected to. Is it possible to connect?

  • Error while Invoking SQLPLUS from Command Prompt

    Hi All,
    I am trying to Connect to Oracle through sqlplus from command prompt of windows and getting this Error:
    C:\Documents and Settings>sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 28 10:08:43 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter user-name: scott
    Enter password:
    ERROR:
    ORA-12560: TNS:protocol adapter error
    set ORACLE_SID=database_name was set
    Anyone ever got this error or has any idea could you please help.
    Thanks.

    Try
    set LOCAL=<tns_name>
    Regards
    Kurt

  • Error in invoking sqlplus

    Hi All,
    Yesterday we didnt one database upgrade after upgrade from 8.1.7.4 to 10.2.0.4 every thing went fine but after upgrade application users is not able to connect to the database by using their credentials.
    FROM ORACLE USER
    $ sqlplus
    SQL*Plus: Release 10.2.0.4.0 - Production on Mon Apr 26 10:50:22 2010
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    Enter user-name: / as sysdba
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    BUT BY USING APPLICATION USER CREDENTIALS ON THE SAME BOX
    cyrus: sqlplus
    Error 6 initializing SQL*Plus
    Message file sp1<lang>.msb not found
    SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
    even all the env var is setted.
    even i have ran the changePerm.sh also for relaxing the permissions.
    can you tell me where i have made the mistake
    OS is AIX 5.3
    KK

    Hi,
    1. Check if $ORACLE_HOME of both users is exactly the same
    2. Check if sqlplus that you are executing is the same too (which sqlplus)
    3. If that doesn't work, try executing directly ORACLE_HOME=/u01/oracle/.... sqlplus "/as sysdba"
    Regards,
    Mario Alcaide

  • Want to connect local SQLPlus without passing SID/connecting string.

    Hi
    On my network there are many databases and many several machine. On some database host machines when I pass user/password they connect locally but other wont unless I provide connecting string i.e. user/password@connection_string.
    How can I make my machines to connect locally if I pass just pass user/password as I want to install StatsPack, it change user within installation and log out as it only pass username/password not the connection string.
    Wishes
    Jawad

    try with TWO_TASK
    $ export TWO_TASK=lsc62.ex.zkb.ch            
    $ sqlplus scott/tiger
    SQL> select global_name from global_name;
    LSC62.EX.ZKB.CHMessage was edited by:
    Laurent Schneider
    well, this works only in Unix, so first, upgrade your plateform to Unix before setting this variable

  • Bypass user name and password prompt for sqlplus on Windows

    Hi folks,
    I had oracle 10g installed on my Windows XP SP2 system and everytime I use sqlplus, it prompts for user name and password. Some folks wrote some Unix shell scripts which invokes "sqlplus" without giving it user name and password, and these scripts are running fine on Solaris. So I would like to make these script to work on my Windows box as well. But obviously, it asks me user name and password every time. Since it is a shell script, sqlplus << EOT .... EOT will fail right away with : Fatal NI connect error 12560, blah blah blah...
    So my question is how to make sqlplus bypass the user name and password questions.
    Thanks,

    No sqlplus /nolog does not connect you to the database, you still need to connect to the database.
    c:\sql>sqlplus /nolog
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 21 15:19:16 2007
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    idle> select * from dual;
    SP2-0640: Not connected
    idle> connect test/test
    Connected.
    test@ORCL> select * from dual;
    D
    X
    Elapsed: 00:00:00.01
    test@ORCL>

  • How to invoke the mdb  without jms client

    Hi,
    I have a requirment in that I want to invoke the message driven bean without jms client.
    ejb 2.1 support this but I don't know how.
    if any one have an idea pl reply this.
    thanks

    Ino I did not mean invoke MDB without sending a message, but I want to say invoking the mdb by some other like jaxm client or soap client.
    if u have any idea pl tell me.
    thanks
    manish

  • Sqlplus set statement:format the output without specifying every col length

    Hi ppl,
    i am writing below query inside a shell script. Is there any way to format the output of sqlplus without providing the name of all the columns that we are going to output. for example, in below code i have specified the column width of the columns i want to output. but if the number of columns is large (or when we want to do a select * from...) then it becomes tedious to write all of them. Is there any way i can define display length all the columns to be of same size.. or at least all the number columns of one size, char columns of one size etc...
    sqlplus -sa/passwd@db_name << EOF
    SET ECHO ON;
    SET HEADING ON;
    COLUMN USERNAME FORMAT A20;
    COLUMN USER_ID FORMAT A20;
    COLUMN PASSWORD FORMAT A20;
    spool filename.txt
    some qry... ;
    exit
    EOFThanks
    Edited by: KnockTurnAll on 25 Oct, 2010 10:41 PM
    Edited by: KnockTurnAll on 26-Oct-2010 04:25

    My SQL*Plus is a bit rusty, but I don't think you can for characters. You can set NUMWIDTH for a default size for numeric columns.
    You could write a small bit of SQL to generate the required column definitions. You could even hit ALL_TAB_COLUMNS to generate a generic 'set every column width' file and run it as a separate sql script in your main script. Not sure if there is an upper limit on the number of Columns you can define.
    Back in the day when we did everything with SQL*Plus scripts, we had a standard columns file that we called in all our scripts, just for this purpose.
    Carl

  • Sqlplus invoking ksh shell code

    I have the following code:
    sqlplus -s / <<EOT
    SET PAGESIZE 0
    SET FEEDBACK OFF
    SET VERIFY OFF
    spool grant.sql
    SELECT 'GRANT SELECT ON ' || u.owner || '.' || u.object_name ||' TO xxx_role;'
    FROM dba_objects u WHERE u.object_type IN ('TABLE','VIEW','SEQUENCE')
    and owner = 'YYY';
    spool off
    EOT
    Is there a way in the SQL block above I can test to see if my spool file contains data instead of invoking sqlplus again to run the spool file?
    I would like to do something like this in the first block if possible or something very similiar.
    As this will be run in a loop and will be passed values I want to make it go as quick as possible
    and therefore limit the number of times I need to startup SQLPLUS
    if [ -s spool.sql ]
    then
    @@spool.sql
    fi

    Assuming you are calling the first script fromm a shell script, then something like:
    /export/home/oracle> cat t.sh
    sqlplus -s / <<EOT
    SET PAGESIZE 0
    SET FEEDBACK OFF
    SET VERIFY OFF
    spool grant.sql
    SELECT 'GRANT SELECT ON ' || u.owner || '.' || u.object_name ||' TO xxx_role;'
    FROM dba_objects u WHERE u.object_type IN ('TABLE','VIEW','SEQUENCE')
    and owner = 'YYY';
    spool off
    EOT
    if [ -s grant.sql ]; then
      echo 'Run grants.sql'
    else
      echo 'no grants'
    fiWhen you run it it gives:
    /export/home/oracle> ./t.sh
    no grantsJust substitute another here document for the echo run grants.sql line. If you are passing parameters to the shell script, then substitute thos for the hard coded bits.
    John

Maybe you are looking for