2

I am attempting to tune our oracle database that has been running a little slowly lately.

I have generated a SQL trace file, and can run the basic TKPROF from the command prompt, and generate the appropriate output file.

tkprof.exe source.trc output.txt

I would very much like to see the execution plan as well since there are a good number of indexes that should be used with this database. To do this, I am trying to run this:

tkprof.exe source.trc output.txt EXPLAIN=mbw/password

The problem is, the username which every application uses to connect with is lowercase (mbw for this example, and I have to leave it this way). So whenever I wish to look at data, I have to put quotes around the user like this:

SELECT * FROM "mbw".TABLE1

Unfortunately, I can never seem to get TKPROF to connect as "mbw"/password, it is always as mbw/password, which will never work. (I can see what TKPROF is attempting to connect with in the output.txt file)

I have tried a bunch of permutations on the command line, and just can't seem to make it happen. I've tried things like:

... EXPLAIN="mbw"/password
... EXPLAIN=""mbw""/password
... EXPLAIN="""mbw"""/password
... EXPLAIN=^"mbw^"/password

Does anyone have any ideas on how to properly structure the TKPROF command so I can connect as a user with lowercase letters?

I fully apologize for my lack of good oracle and sql skills, I have been rather unexpectedly thrown into this particular job and am trying to learn as fast as I can.

5
  • whats the username through which the application is connecting to the database?
    – cableload
    Apr 8, 2016 at 20:16
  • What operating system and command line are you using (the .exe makes me suspect Windows but I'm not sure). My first guess is that the operating system shell is intercepting the double-quotes and doing something and would have some way of escaping the double-quotes. Can you connect via command-line SQL*Plus with this username? Apr 8, 2016 at 20:52
  • Have you considered running the suspected queries in SQL*Plus using SET AUTOTRACE ON EXPLAIN? It will output the explain plan of the query for you.
    – Yaron Idan
    Apr 9, 2016 at 16:24
  • The username the application is connection with is the same, so "mbw".
    – mbw
    Apr 11, 2016 at 16:20
  • The OS is Windows Server 2012. When I connect with sqlplus over the command line, I can login with quotes, so "mbw" and password work.
    – mbw
    Apr 11, 2016 at 16:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.