Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Basic question | run multiple queries without reconnecting

Re: Basic question | run multiple queries without reconnecting

From: Anoop <anoopkumarv_at_gmail.com>
Date: 23 Jun 2006 16:02:21 -0700
Message-ID: <1151103741.358052.19610@y41g2000cwy.googlegroups.com>


Mark C. Stock wrote:
> "Anoop" <anoopkumarv_at_gmail.com> wrote in message
> news:1151097737.964493.207840_at_c74g2000cwc.googlegroups.com...
> :
>
> : But I am facing a problem still - a bit unrelated and rather basic..
> : But I will go ahead and ask.
> :
> : >From an oracle client like oracle sqldeveloper, I can run the DCL -
> : "audit all by anoop by access" just fine if I log in as sys as sysdba
> : role.
> :
> : But I need to run these as another user - system; and I am getting this
> : error message:
> :
> : java.sql.SQLException: ORA-00987: missing or invalid username(s)
> :
> : I think this means system does not have privileges and I tried using
> : the same: ie., tried connecting as
> : system as role: sysdba - but then I cant even connect to the db.. the
> : test connection fails.
> :
> : How can give additional privileges to the user "system" so that I can
> : run the above command?
> :
> : My java code I have written does not allow me to connect as sysdba
> : role....
> :
> : Thanks,
> : Anoop
> :
>
> you should not be logging in as SYSDBA unless you are planning on
> starting/stopping/restoring/backing up or otherwise managing the database
>
> if you look up the error in the oracle reference or try to google on it
> you'll get a complete description of the error -- it's not what you think.
>
> ++ mcs

<My Original response>

        Well - I did google it up and this was what I got.....

        ORA-00987: missing or invalid username(s)

        Cause: No username was specified in a GRANT statement or one of the specified usernames is invalid. Valid usernames must be specified following the keyword TO in a GRANT statement to define a user. A username must begin with a letter, consist only of alphanumeric characters and the special characters $, _, and #, and be less than or equal to 30 characters. If it contains other characters, it must be enclosed in double quotation marks. It may not be a reserved word.

        Action: Specify a valid username, or list of usernames, following the keyword TO in the GRANT statement.

        And I could recreate the same error when I log in as sys with connect as default - I get the same error when I run this command:

        audit all by anoop by access

        Now if I go back to my connection settings and change the role to connect as sysdba and re-run the same command - it works fine ( I think it does coz there is no error message)

        I am running all these using oracle raptor / now sqldeveloper.

        Initially I thought my command was missing the username - "anoop" somehow - that was proven false after seeing the query through my java logging....

        Anoop
</My Original response>

Well - actually - I just figured out what the problem is...

I was trying this as well...

audit all by 111 by access

So this is a user which starts with a numeral / digit... and in Oracle if you need to specify a user like that you need to enclose it in quotes (for whatever reason)....

Disregard my previous response.... Duh!! (But still wonder if the quotes will cause any problems for users who do not start with a number??? I thin kit should not!!!)

Now all of it works fine.. and my audit commands just ran.. thank you all such a lot for the help - I really appreciate it...

Best regards,
Anoop Received on Fri Jun 23 2006 - 18:02:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US