DOS command "sqlplus /nolog @file" and "sqlplus  user / password @file

It's very strange what j've observed:
J've two files *.sql :
-- 1:
file_with_connect.sql which contains 3 lines :
connect <user>/<password>@tnsname
select count(*) from <table_name>;
exit
-- 2:
file_without_connect.sql which contains only:
select count(*) from <table_name>;
exit
table <table_name> isn't empty (it contains 1 row)
-- 1:
When J execute from DOS (on the client):
sqlplus /nolog @file_with_connect.sql le result is 0 rows in table <table_name>
-- 2:
When J execute from DOS :
sqlplus <user>/<password>@tnsname @file_without_connect.sql le result is: 1 row in table <table_name>
I use the same connection, tnsname, table.
Why the result isn't the same ?
There is no error in my alertXXXX.log

Hi Mustafa
The table <table_name> that j've used exists only in one database.
It's tnsname is ok on the server, on the client it was defined 2 times ! (but the same) in the file tnsname.ora. J've modify the client tnsname.ora.
But, j'm not sure it was the reason of our problem: the error isn't regular (sometimes) so j can't verify that it will never appear.
Any other idea?

Similar Messages

  • DOS command for batch file

    Hi All,
    anybody knows how to call a batch file from java
    is there any DOS command aor dll file like url.dll by wich i can call my batch file from a java file
    or may be some body can tell me how to use FileUploadProtocal to call a batch file from java
    Please help me
    ASAP
    Thanks in advance

    Actuly I got these lines from a frnd
    String loadPath = "rundll10 url.dll,FileProtocolHandler D:\\a.bat";
    Process process = Runtime.getRuntime().exec(loadPath);
    but my original code was
    try{
         boolean imported = true;
         String _cmd = "cmd /c ";
         cmd =cmd+"sqlldr ";
         cmd = cmd + " userid=" + userId + "/" + passwd + "@"+ tnsEntry;
         cmd = cmd + " control=" + controlFilePath;
         cmd = cmd + " log=sql.log skip=1";
         System.out.println(_cmd);
         String envArr[] = new String[2];
         envArr[0] = "ORACLE_HOME=" + System.getProperty("ORACLE_HOME");
         envArr[1] = "PATH=" + System.getProperty("PATH");
              try{
                   Runtime r = Runtime.getRuntime();
         Process process = r.exec(_cmd);
              catch(RuntimeException re )
                   System.out.println("Failed to runtime run the process.123.."+re);
    it was not working even i m not getting any error or excep. so I tried that two lines above.
    but still frustating results

  • SYS and SYSTEM user password expired

    My 11g2 database on Redhat 5 has sys and system user password expiredSQL> select username,account_status,EXPIRY_DATE
    from dba_users where username like 'SYS%';
      2
    USERNAME                       ACCOUNT_STATUS                   EXPIRY_DA
    SYSMAN                         OPEN
    SYSTEM                         OPEN                             15-FEB-11
    SYS                            OPEN                             15-FEB-11But I can still connect the databsae with t expired password.
    Do I need worry about the expiration of these user's password? For a normal user, I connot login with expired password

    Dear user13148231,
    Here is an illustration;
    SQL> alter user sys account lock;
    User altered.
    SQL> select username, account_status, lock_date, expiry_date from dba_users where USERNAME='SYS';
    USERNAME                      ACCOUNT_STATUS                   LOCK_DATE EXPIRY_DA
    SYS                                      LOCKED                           20-AUG-10      23-FEB-09
    SQL> host sqlplus sys/password@opttest as sysdba
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Aug 20 12:25:43 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    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> exit
    Disconnected from 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> alter user sys identified by password password expire;
    User altered.
    SQL> select username, account_status, lock_date, expiry_date from dba_users where username='SYS';
    USERNAME                      ACCOUNT_STATUS                   LOCK_DATE EXPIRY_DA
    SYS                                EXPIRED & LOCKED                 20-AUG-10   20-AUG-10
    SQL> host sqlplus sys/password@opttest as sysdba
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Aug 20 12:27:02 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    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> exit
    Disconnected from 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> alter user sys identified by password account unlock;
    SQL> select username, account_status, lock_date, expiry_date from dba_users where username='SYS';
    USERNAME                       ACCOUNT_STATUS                   LOCK_DATE EXPIRY_DA
    SYS                            OPENEven if it shows expired and locked it is OK to connect to the database for the SYS user.
    SQL> alter user ogan identified by password account lock password expire;
    User altered.
    SQL> select username, account_status, lock_date, expiry_date from dba_users where username='OGAN';
    USERNAME                       ACCOUNT_STATUS                   LOCK_DATE EXPIRY_DA
    OGAN                           EXPIRED & LOCKED                 20-AUG-10 20-AUG-10
    SQL> conn ogan/password
    ERROR:
    ORA-28000: the account is locked
    Warning: You are no longer connected to ORACLE.
    SQL> conn / as sysdba
    Connected.
    SQL> alter user ogan account unlock;
    User altered.
    SQL> conn ogan/password@opttest
    ERROR:
    ORA-28001: the password has expired
    Changing password for ogan
    New password:
    Retype new password:
    Password changed
    Connected.
    SQL>Ogan

  • How can i add a new user and change user'password with javamail?

    how can i add a new user and change user'password from a mailserver with javamail?
    email:[email protected]

    Well user creation and updation is a system property..U need to go through that part...as it depends on the system you are hosting pout your application...
    if it is linux...u have to use some shell programming\
    bye for now let me know if this guides you or if you need some more stuff.
    bye

  • Restrict SU01 to only lock and unlock user passwords

    how  to  restrict SU01 to only lock and unlock user passwords,(should not have acces to create users) What is the auth.obj I need to change ? please suggest.
    Thanks
    sr
    Message was edited by:
            sunny raj

    Restrict authorization object S_USER_GRP to activity '05'
    Cheers,
    Ben

  • Dos command to compare files using adobe acrobat pro 9.

    Hi,
    I am using Adobe Acrobat Pro 9, through its utility i am comparing two pdfs using its GUI. Now i want to compare two pdfs through Dos prompt using Adobe Acrobat Pro 9. Is there any Dos command to compare two pdfs using Adobe Acrobat Pro 9.
    Regards 

    I don't think so.

  • Forgotten Sys and System user passwords

    In the case of forgetting the Sys and the System user passwords, is there anyway of logging on with privilages to be able to change these passwords, if not, are there any other solutions?
    Thanks,
    Nick

    In order for "/ as sysdba" to work, you need to run
    the password file creation utility (orapwd).
    No, it has nothing to do with the password file. In order for "connect / as sysdba" to succeed, it is necessary to have an operating system account which is a member of the "osdba group". In Windows, this OS group is : "ORA_DBA". Any member of this group can and has privileges to connect "/ as sysdba". Again, it has nothing to do with password file.
    In Windows there is another condition for it to work :
    The file %ORACLE_HOME%\network\admin\sqlnet.ora must have the following line :
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    In Unix systems, the osdba group is configured at installation and is conventionally named "dba".

  • Acrobat 9 pro and Admin user/password

    Every time Acrobat 9 pro on my Mac (OSX 10.6.1) is launched it sakes for my admin user/password. If I enter the info in every time I launch Acrobat 9 pro admin it works, but the next time I login with my network user account Acrobat 9 pro want the admin user/password again.  What might be causing Acrobat 9 pro to want admin user/password.

    If, as it it says on top of the page, the question is "possibly answered", the "1 correct answer" is not shown.  The mystery and annoyance remains.
    Acrobat 9 Pro (installed as part of CS4 Design Standard by the same admin user that now wants to use it, OSX 6.7) asks for my password every time I start it:  "Type your password to allow Adobe Acrobat Pro to make changes."  The only necessary change that I see is upgrading back to version 8, which didn't suffer from this bug.
    When I click cancel (twice – the window returns once.), I'm told that "Adobe Acrobat could not install correctly.  An invalid password or user name was entered.  Adobe Acrobat will now quit."
    To repeat it, Acrobat is already installed, and I've entered the username-password combination several times correctly to use the software, but it's not acceptable to do that every time in all eternity.  Please, Adobe, fix this quickly or give solution if one exists.

  • Run dos command that starts program and program stay open

    I'm running the following code,
    string m_file= "c:\program\program.exe" ;// runs a program
    Process myProcess = new Process();
    myProcess.StartInfo.FileName = @programtextBox.Text.Trim();
    myProcess.StartInfo.Arguments = m_file;
    String m_arguments = myProcess.StartInfo.Arguments.ToString().Trim();
    myProcess.Start();
    It works fine except I need the program to stay open that this command starts. But it closes while it's in the process of starting.

    I had a mistake in what I posted in my code. Here it is again with corrections, and more detail.
    string m_run= "c:\my programs\adobe\photoshope.exe" //This is saved in the program and can be set to any program the user wants to use. it's saved in the programtextBox.Text noted eailer, which is saved to the hard drive.
    string m_file= "c:\file\anypicture.jpg" ;// picture that is selected in the interface.
    Process myProcess = new Process();
    myProcess.StartInfo.FileName = m_run;
    myProcess.StartInfo.Arguments = m_file;
    String m_arguments = myProcess.StartInfo.Arguments.ToString().Trim();
    myProcess.Start();
    This is a windows form program.
    It looks to me like you're either redacting or modifying your actual code before posting.  I could be wrong about that, but I'm pretty sure because:
    If you were calling Process.Start() against program files/adobe/photoshope.exe I believe that you'd get a Win32 Exception since I don't think that file exists in any photoshop installation.
    I sincerely doubt that you're actually working with "file/anypicture.jpg."
    I'm confused by the declaration of m_arguments which is never used.  I assume it is in fact used somewhere in your code.
    Finally, you have stated that the program to open files with is pre-defined, so I suspect that data is actually being pulled from a variable instead of from a hard string as in your "example."
    If that's the case then you might as well go shoot yourself in the foot, since that would do exactly as much good as asking for help with broken code and then posting pseudo-code instead of what doesn't work.  It's like telling an auto mechanic your
    car dies every time you hit 22 miles per hour, while delivering your bicycle for service.
    Content Removed

  • Used MA and now User password isn't recognized?

    So, unboxed a new iMac and used Migration Assistant to suck up my Time Machine back-up (from older MacBook).  Seemed to go fine but now I can't make it past the initial login screen on the iMac.
    I had one and only one user / Admin on the MacBook which is represented now on the iMac as a coin-sized circle (w/ picture) and asks for a password.  I've tried the known password and it just shakes the box at me like I'm a dummy.  I verified that the password is correct on the MacBook (by re-setting it and then setting it back again).
    So, brand new iMac, totally worthless to me as I can't make it past the login screen.
    I've no Install DVD (Apple didn't include one in the box) and my MacBook's Snow Leopard DVD seems to put the iMac into a fit and it immediately wants to restart.  I was trying to get to the password reset utility in single user mode by using the install disk, BTW.
    Any ideas?  Or do I have to lug this thing to the Apple Store / Geniuses (sp)?

    Hmm, probably not the most elegant solution but this fixed it...
    http://gigaom.com/apple/reset-os-x-password-without-an-os-x-cd/
    New Admin and re-doing Migration Assistant (files and applications only) but, at least, I'm logged in and don't have an expensive silver paper-weight any longer.

  • Considerations to change LINUX and Oracle users passwords

    Dear friends
    i want to change password to the following accounts in my oracle servers:
    - oracle, OS linux user.
    - system, db oracle user
    - sys, db oracle user.
    but, i want to know what considerations must i have in order to do it that.
    VERSIONS:
    - Oracle Database 10g Release 10.2.0.1.0 - Production
    - Red Hat Enterprise Linux AS release 4 (Nahant Update 4) 2.6.9 5.ELsmp (32-bit)
    thanks a lot.

    Madrid, and everybody.
    does anyone knows ...
    - What is the number ID (note) in metalink where are the default account passwords when installed Oracle default database ??? (some days ago i saw but i don't remember the note)
    - Are there any link when describe any consideration about OS LINUX users like "root" and "oracle" ?
    i must to view that document in order to present my boss.
    Thanks a lot !!!!

  • Command Line to change all the users passwords

    Hello there,
    I run Tiger Server. I want to change the password for 300 students from the command line to 1234 as a password for all the students. Is there any easy way to change all the password at once.
    Thanks,

    I changed it from WM. No terminal.

  • SRW2016 and ssh user password

    Hi,
    some hours ago I had asked for help on that given switch. Everything is working so far as expected. There is only one last thing, I want to ask for.
    Because I am an Unix-user, I have configured the srw2016 for ssh on port 216. When connect, I am asked for the user name. I have set a password, but it is enough for the console menu, if I only enter admin in the name field. It does not ask for a password. So is that right? So everybody on the switch could change the configuration. How can I change that, please? :-)
    Thanks in advance
    Christian 

    Thx,
    formerly I had set a password, but for a reason I dont understand yet, it was cleared. Now everything is fine
    Thanks again.

  • Fresh install of 11.1 and "sqlplus user@instance/password" does not work

    new server, windows server 2008, fresh install of 11.1.0.7 with local instance.
    can connect to the instance using "sqlplus user/password" since ORACLE_SID is set,
    can connect to a 9.2 remote instance using "sqlplus user@remoteinstance/password".
    can't connect using "sqlplus user@localinstance/password".
    <command>
    l:path>set oracle_sid=localinstance
    l:path>sqlplus username/password
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Nov 8 13:11:02 2010
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Release 11.1.0.7.0 - Production
    SQL> exit
    Disconnected from Oracle Database 11g Release 11.1.0.7.0 - Production
    l:\path>sqlplus username@localinstance/password
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Nov 8 13:11:21 2010
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    l:\path>
    l:\path>sqlplus username@remoteinstance/password
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Nov 8 13:11:45 2010
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> exit
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    l:\path>
    </command>
    what am i doing wrong?
    many thanks in advance,
    stephen.

    =================================
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.
    Additional notes on the listener: One listener is capable of listening on multiple ports. But please notice that it is the listener using these ports, not the database instance. You can't bind a specific listener port to a specific db instance. Similarly, one listener is capable of listnening on multiple IP addresses (in the case of a server with multiple NICs) But just like the port, you can't bind a specific ip address to a specific db instance.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Next, tns sends a request to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the request arrives at port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, you'll be connected.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"
    Third: If the client is on the same machine as the db instance, it is possible to connect without referencing tnsnames and without going through the listener.
    Now, when you issue a connect, say like this:
    $> sqlplus scott/tigertns will attempt to establish an IPC connection to the db instance. How does it know the name of the instance? It uses the current value of the enviornment variable ORACLE_SID. So...
    $> export ORACLE_SID=fred
    $> sqlplus scott/tigerIt will attempt to connect to the instance known as "fred". If there is no such instance, it will, of course, fail. Also, if there is no value set for ORACLE_SID, the connect will fail.
    check executing instances to get the SID
    [oracle@vmlnx01 ~]$ ps -ef|grep pmon|grep -v grep
    oracle    4236     1  0 10:30 ?        00:00:00 ora_pmon_vlnxora1set ORACLE_SID appropriately, and connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID='vlnxora1
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:37 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsNow set ORACLE_SID to a bogus value, and try to connect
    SQL> exit
    [oracle@vmlnx01 ~]$ export ORACLE_SID=FUBAR
    [oracle@vmlnx01 ~]$ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:42:57 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    Enter user-name: Now set ORACLE_SID to null, and try to connect
    [oracle@vmlnx01 ~]$ export ORACLE_SID=
    [oracle@vmlnx01 ~]$ sqlplus /scott/tiger
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 22 10:43:24 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    ERROR:
    ORA-12162: TNS:net service name is incorrectly specifiedOk, that is how we get from the client connection request to the listener. What about the listener's part of all this?
    The listener is very simple. It's job is to listen for connection requests and make the connection (server process) between the client and the database instance. Once that connection is made, the listener is out of the picture. If you were to kill the listener, all existing connections would continue. The listener is configured with the listener.ora file, but if that file doesn't exist, the listener is quite capable of starting up with all default values. One common mistake with the listner configuration is to specify "HOST=localhost" or "HOST=127.0.01". This is a NONROUTABLE ip address. LOCALHOST and ip address 127.0.0.1 always mean "this machine on which I am sitting". So, all computers are known as "localhost" or "127.0.0.1". If you specify this address, the listener will only be capable of receiving requests from the machine on which it is running. If you specified that address in your tnsnames file - on a remote client machine - the request would be routed to the machine on which the requesting client resides. Probably not what you want.
    =====================================

  • Host string and new users

    Hi, I've just installed DevSuiteHome1, OraDb10g_home1, and Oracle Developer Suite - DevSuiteHome1 and will be creating forms for an assignment. I've managed to log in to SQL*Plus with: "/ as sysdba" and successfully created a new user with a password and created a table "student", what privileges should I give this user (currently DBA) to allow them to access simple forms?.
    When I log in to SQL*Plus I get in without entering a "Host String", do I need this? What is a Host String?
    Also, though I don't need the database name just yet, I'd like to know how to find it!
    Thanks for reading, I'm grateful for any help.
    Will.

    The more formal way of reading that is
    sqlplus user/password@service-information
    where service-information is somehow translated into a combination of 3 pieces of information
    1) how to find the host or computer where the database resides
    2) which port the listener is monitoring
    3) which service (commonly mistaken as database) to which the listener should provide a connection
    (A database, when 'running', has a default service that matches the database name.)
    If you are logged on the the same machine as the database, you can bypass the network and the listener by setting the ORACLE_SID and implying the 3 pieces of information.
    If you are remote, there are several ways of getting the 3 pieces. The most common is to use the TNSNAMES.ORA to translate the service-information alias into the needed information. The translation could also be stored in an LDAP database Using InstantClient you have added variations, such as 'supply the host name and assume the listener is monitoring port 1521 for one and only one database', or supplying the whole translation manually.

Maybe you are looking for