Re: Basic question | run multiple queries without reconnecting



Mark C. Stock wrote:
"Anoop" <anoopkumarv@xxxxxxxxx> wrote in message
news:1151097737.964493.207840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
:

: 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

.



Relevant Pages

  • Re: Basic question | run multiple queries without reconnecting
    ... : system as role: sysdba - but then I cant even connect to the db.. ... Valid usernames must be specified ... as default - I get the same error when I run this command: ...
    (comp.databases.oracle.server)
  • SUMMARY: sudo version 1.6.7p5 : using -H -u options on Solaris 8
    ... Many thanks to those that responded, as expected all responses were helpful. ... This will allow you to do the thing that the user oracle requires while also ... designated in the sudoers file who requires to use the command, ... there is a CLASSPATH variable set which, as the oracle user I can see by ...
    (SunManagers)
  • Re: How many names and addresses can you have for ID card
    ... Think command line only (except when you're installing, ... which is unsettling to we Linux users. ... This is NOTHING to do with Oracle though. ...
    (uk.legal)
  • Re: AIX Performance issue
    ... however approx 30 users normally access AIX server ... > through oracle application, every thing was running fine during last 3 ... > sar and lpstat command and their output was as given below. ... > Mostly when error occurred our database daily backup was in process ...
    (comp.unix.aix)
  • Re: Storing paswords encrypted in DB tables.
    ... Also, quite often, the passwd program will ... Oracle program do that? ... and it will be asking for a root login to ... scanning of environment variables or command lines (all available ...
    (comp.security.unix)