oracle - Schemas issues when migration from discoverer to OBIEE - oracle

I'm working on migrating some reports from Oracle Discoverer to OBIEE. I've already exported the layouts from discoverer to OBIEE. I have all I need in the OBIEE Admin tool now, but when I try to perform this operation:
I got this message:
I've read in many forums that this is because of the query (enter link description here) but I've executed the query in SQL Developer and all is fine.
Any idea?
Thanks,

I can see from the icon on your object that it is an Opaque View that your trying to run View Data on.
This is probably because of a syntax issue in your opaque view. Make sure the code in the opaque view doesn't end with a semi-colon or slash, that will cause problems. Try eliminating any blank lines, if there are any. However, without knowing exactly the syntax of the code it's impossible to say exactly what the cause is.
It's also possible that there is a connection script attached to the connection pool you are using to View Data, running on connection or before execution with bad syntax.
Otherwise have a look in the Admin Tool log to see if there's more information about what is causing the error. It will usually contain more detailed information than is passed back through the GUI.

Related

Datagrip - table names do not appear when clicking on schema names in left-hand panel

I recently installed Datagrip to view my Company's Postgres database, however I am currently unable to view the tables in the different schemas by clicking on the schema name:
In the image, I've clicked to open and show the ab-testing schema, however nothing appears below it. This behavior is consistent across all of the schemas in the database. I am able to use the query editor to query tables in the schemas (assuming i know the table names), yet I cannot see the names in the left-side panel. I am using datagrip 2020.2
Thanks!
I had the same problem with a MySQL database. As a test, I used the MariaDB driver instead of the MySQL driver as usual. This was intentional and not an oversight, but it was not a good idea!
The tables, views and server objects were not displayed. Although I was able to display the tables and views after activating Schema Properties -> Advanced -> "Introspect using JDBC metadata", the server objects were not displayed. Working with the displayed tables and views was not possible in the usual way.
Only when I used the MySQL driver again, everything worked correctly again. The tables, views and server objects were displayed correctly and the work with it was possible in the usual way.
As a small quintessence I would like to recommend to all who "struggle" with similar problems to check your chosen drivers. Maybe the problem is caused by choosing the wrong driver, as it was in my case.
Whick kind of message do you get when instrospecting the schema?
I had a java.io.CharConversionException caused by a not valid UTF-8 string.
If this is the case, you can add the following VM option -Ddb2.jcc.charsetDecoderEncoder=3.

Mastering Oracle Trace Data - Page 60: APEX Tracing URL Extension

I have a question regarding the APEX tracing section on page 60 of The Method R Guide to Mastering Oracle Trace Data.
"Many great window-on-data applications these days are developed with Oracle Application Express (APEX). Tracing is easy in APEX. The simplest tracing operation, tracing a single page execution, is trivially easy to do: simply append &p_trace=YES to the page’s URL."
I do not work with APEX a lot, but needed to trace APEX applications (APEX 4.x) from time to time. Unfortunately it never worked out with the URL extension even if I did the exact same procedure you described in the book. Later on I discovered that maybe the debug mode must be activated as well to get this running (slide 13: http://www.aioug.org/sangam12/Presentations/20157.pdf). However I always needed to edit the APEX header and footer page to enable/disable tracing.
Any idea what I am missing here? Is debug mode needed even if not mentioned in the book?
Thank you.
Regards
Stefan
P.S.: In addition maybe you guys also know an extension or clever way to implement DBMS_PROFILER on APEX pages to get the complete hierarchy (https://www.freelists.org/post/oracle-l/Oracle-APEX-4x-Looking-for-clever-ways-to-implement-DBMS-PROFILER)?
The additional debug mode information is present in The Method R Guide to Mastering Oracle Trace Data, 2nd Edition printings with a revised date of August 4, 2016 or later.
The following answer comes from our colleague Doug Gault.
To enable the &P_TRACE appended to the URL, the following things need to be true:
Trace must be enabled at the APEX instance level.
Debug must be enabled at the application level.
In early versions of APEX, debugging being enabled was not a prerequisite for tracing. This was added somewhere in the lifecycle of APEX 4 to protect against someone writing scripts to append that to every call and filling up your file system.
I do know that in certain versions of 4.X, there were issues where this did not work as expected. The issues were addressed (I believe) in 4.2.5 and should be available and working from that point forward.
A little known fact of the P_TRACE parameter is that there are actually three settings available: YES, TRACE, and HPROF.
The first two basically do the same thing—turn on event 10046 tracing. However, if you use HPROF as the value of the parameter, APEX will use the Hierarchical Profiler.
There is also an instance level parameter HPROF_DIRECTORY that can be set by a DBA by calling apex_instance_admin.set_parameter.
At least this was the missing piece for me:
I suspected that internally Apex creates the .trc file by using
ALTER SESSION SET EVENTS '10046 trace name context forever, level xx';
Depending on how the Schema (that Apex is working with) has been created this priv is missing. I was able to let Oracle write a trc file by granting the schema the "alter session" priv...
grant alter session to apex_demo;
Hope that helps.
Best,
Jonas

Debug SQL queries in SQuirrel-sql

How do I go about debugging a SQL statement in SQuirrel-sql?
I keep getting "unhelpful" errors like:
Error: [SQL0104] Token , was not valid. Valid tokens: ) OR.
SQLState: 42601
ErrorCode: -104
I would love to be able to see the line number where I made the error, or some other way of guiding me to where the problem is.
I am working with the JDBC driver on a IBMi DB2 database.
You can add the "errors=full" property for more detailed error messages although it will still require some interpretation to locate the precise syntax issue.
See the IBM Toolbox for Java JDBC properties for more information.
As Tracy mentioned if you want interactive syntax checking you will have to use one of the native SQL interfaces such as the green screen Start SQL Interactive Session (STRSQL) command or the IBM i Access Run SQL scripts tool.
For such errors where the problem isn't obvious, I like to copy and paste the SQL into the AS/400's green screen interactive SQL tool. (I'm assuming your database server is an AS/400 based on your tag and the mention of IBMi DB2.) The command is STRSQL. When there's an error, it will put your cursor right where the problem is. Or, more specifically, where it thinks the problem is. It does require green screen access to the AS/400.

Invalid privilege error?

Two related applications use a function in a package in several queries to return some data as CSV. The column being selected and concatenated is a CLOB field and can contain HTML, special characters, etc. The applications have few users and so are not heavily used. One is a Flex application that consumes Oracle HTTP services, and the other is an ASP.NET application that uses ODP.NET. The applications are really one integrated application with hyperlinks to each other.
Yesterday, I received several notifications of a strange error:
ORA-01031: insufficient privileges ORA-06512
The line number in the package in the error details indicates that the error was caused by the function being used in the select clause. It would occur when called by either application about 75% of the time.
Am I correct that an ORA-06512 occurred in the function that then caused an ORA-01031 insufficient privilege error? Unfortunately, ORA-06512 is a very generic error and doesn't tell me anything. And why would it cause an invalid privilege error? The Oracle user accounts being used by both applications have the execute privilege on the package that contains the function.
Regarding the function... it has been used for about 2 years in production without any issue. Also, when I imported the data to QA yesterday and tested it, no error would occur, no matter how many times I hammered the server with requests. But in production, the error would occur about 75% of the time with exactly the same parameters.
The DBA tried to help me with a trace, but we could not find the error message in the trace files.
Today, everything is back to normal in production. Even if I hammer the server with requests the error will stubbornly refuse to occur.
What caused this very strange behaviour yesterday? Do any of the gurus here have any ideas?
EDIT: I just realized one important detail. The column in the table that is being selected and concatenated into CSV by the function is a CLOB.
If the client applications were running "SELECT clob_to_csv(clob_col) FROM ..." and it returned an invalid privilege SOMETIMES, then it is probably something the function is trying to do, rather than the select statement not having sufficient privilege to execute the function.
Not quite clear on what it might do that may require a privilege. Does it use a file (UTL_FILE) or network connection / web service ?
Could be some sort of odd data (a very large clob perhaps).

Trace MS Access DB activity

I have an Access application with a SQL server back-end, mixed with quite a few DB objects local to the Access app. I've tried running SQL Profiler, but I got very little except a cryptic sp_execute 2,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297.
I would like a trace tool that is local to the Access DB, so I also pick up any activity that doesn't go back to the SQL server.
As far as I know there is no such facility within Access but, depending on your case, you could try these few things:
Write a wrapper against SQL executables: that would mean replacing all calls to Execute, OpenRecordset etc within your VBA to an alternative version that would log the query.
This isn't going to catch everything obviously but it could help.
Move your local tables to another database and use ODBC to relink them to your original Access application. You can then use ODBC's logging facilities.
This could be the best altenative as it's fairly easy to setup for debugging.
It's not the best solution for a production environment though as all your calls to local tables will in fact go through ODBC, but again, it's a temporary solution for debugging.
Use ShowPlan and ISAMStats to view how Jet/ACE interprets your queries and get other database activity stats.
It's easy to setup by writing a key to the registry and you'll end-up with a log describing how your queries are analysed.
It's more useful for optimisation than logging but again, it could help.
Use Flextracer, a shareware, free for 30 days or so. My colleague here has just found this for us as we were going through a similar situation. Problem solved.
http://www.geardownload.com/development/flextracer-download.html
[]s,
Pedro Carneiro Jr.
pedrokarneiro#hotmail.com

Resources