OBIEE 11g OBIApps RPD Update row count, NQ_SESSION.USER_LANGUAGE_CODE "No value defination" - oracle

The repository in OBIEE 11g is a prebuilt RPD from oracle OBIApps. The connection pool is appropriate and is working.
But while updating the row count there are few variables which pop up and as they are default so i press them "OK".
But then there is an error message which is stated as
nQSError23006:The session variable, NQ_SESSION.USER_LANGUAGE_CODE, has no value
Then I tried to disable the session variable by disabling initialization block.
Then also the same error is popping up.
Please guide me with this error.

That means the variable is (re-)used as a reference in - for example - other initialization block SQLs, calculations or generally inside other repository objects and is still being queried. Or at least "attempted to be queried".
Best search across your RPD for references to that variable.

The Variable was being pointed from the Standard Views by oracle where in the the view was written with a where clause.
Where Clause was as follows:
select * from xyz where language_code = 'NQ_SESSION.USER_LANGUAGE_CODE'.

Related

OBIEE 12c RPD how to put sql code in session variable as default

I have a session variable in the RPD of OBIEE 12c and I wanted to put a small sql code in it as default initializer. It's something that selects only one row but this gives a syntax error (the sql is correct, I've tested it). Is this possible? Or are there any other ways to make the default dynamic?
There is also one other thing: I only have the category constants in my tab 'category' of the expression builder.
You can't use SQL to set your default initializer, that's why you only see Constants as an option. It's meant to be a constant value. The initialization block is used to set your session variable to a dynamic value.
https://docs.oracle.com/cd/E28280_01/bi.1111/e10540/variables.htm#BIEMG3104
You want the content of the variable to be a SQL statement as a string?
Like VALUEOF(NQ_SESSION.MYVAR) = 'select ''This is jist some text'' from dual;"?
Cause that's what you then get. Text. Uninterpreted. Like typing a sentence, not code.

is there any way to know the oracle database instance failure count

I am working on Oracle database, I have to know about instance failure, also I need to save instance failure count in a file, if there is any command to do this? where can I get the information of the instance failure ? any logs ?
I am new to Oracle, I don't know about what are the commands used to get instance failure.
Try this query to get the instance count in oracle,
SELECT COUNT(STATUS) INSTANCES_RUNNING,
sys_context('USERENV', 'INSTANCE_NAME') "I'm logged in"
FROM GV$INSTANCE
WHERE STATUS='OPEN'
GROUP BY STATUS
Oracle contains a set of underlying views that are maintained by the database server. These views are called dynamic performance views.
The dynamic performance views are V$ Views and GV$ Views.
In oracle RAC I think the following query helps,
select * from v$active_instances

ORA-01438 Issue while performing dup search

I am a developer with SQL Server experience. We have one legacy application which uses SQR and Oracle to perform a weekly duplicate record search. We got an error while performing this search after 14 years. It says 'ORA-01438: value larger than specified precision allows for this column'. When I googled that error, I found out that it is related to a numeric field and the value passed is larger than it can hold. I can increase the size but don't know for which one. Since no one supports Oracle here, I am trying to trouble shoot this error and found people using
alter system set events='1438 trace name Errorstack forever,level 10';
I would like to know if this is the right way to find out which sql is failing?
Also what does it alter and what is level 10? Anything that I should consider before running this query in production? Is there something I need to roll back after performing this query? I was told that if I do SQL> insert into test values (100000000000000000,'test','test'); where 10000000000000000 is invalid then it will throw generic Oracle message ORA-01438. But in the trace file, it would show ORA-01438: value larger than specified precision allowed for this column. So, where would the trace file be generated?
Current SQL statement for this session:
insert into test values (100000000000000000,'test','test').
Please let me know if I am not in the right path.
Use DBMS_MONITOR to enabling trace for the session affected. This will contain all SQL and errors and bind variables, if you enable it.

Skipping unusable indexes causes dblink error

Every once and a while when I'm executing the following statement:
alter session set skip_unusable_indexes=true;
I'm getting the following error:
ORA-03135: connection lost contact
ORA-02063: preceding line from my_dblink
What does skipping indexes has to do with my dblink?
How can I detect the problematic index?
How can I limit the scope of the above statement only to my local indexes?
1) What does skipping indexes has to do with my dblink?
It has no relation. Please elaborate how you are getting the issue. Is
that you are login to sqlplus and as soon as you alter session, your
DB link disconnects?
2) How can I detect the problematic index?
select STATUS,index_name,table_name from user_indexes where status='UNUSABLE';
select STATUS,index_name,table_name from user_indexes where status!='VALID' and status!='N/A';
3) How can I limit the scope of the above statement only to my local indexes?
I believe you meant to say the indexes on connected database and not
on the DB link database. You can not do this. This is session or
system setting.
I suspect that this is a bug, or at least an unimplemented feature.
When you set your session to skip unusable indexes, you're modifying the query optimiser/parser behaviour, and I suspect that this modification cannot be "pushed" to the remote instance that you have made a connection to.
I also suspect that the key to avoiding this problem, if it can be avoided, is to alter the session before referencing any database links, but even then I would not be surprised if the remote database does not implement the modification, as it is effectively a different session.

Cannot update Oracle view from JDBC

Overview: Need to read row from Oracle view and create a Notes document, save document, then write Document Unique ID back to Oracle.
I am able to read connect and read data no problem. I am using a type 4 connection connecting to an Oracle 11 database. The Oracle view is setup to allow Updating. The view has nothing in it that is outline here: In Oracle, is it possible to INSERT or UPDATE a record through a view?
*With the same username and password, you are able to successfully update view by typing in SQL statement.
*Tried using conn.setAutoCommit(false); This had no effect.
*Verified that the result set was updatable (1008)
*User has been given full DBA access (temporarily)
*I have tried every possible combination of the first parameter in the createStatement method
...
Statement statement = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = statement.executeQuery(fetch);
...
String UNID = doc.getUniversalID(); //gets unique id from saved Notes Document
System.out.println("This is what to write to Oracle:" + UNID);
System.out.println("is updatable=1008, not updatable=1007 value is:" + rs.getConcurrency());
System.out.println("is Result Set Closed:" + rs.isClosed());
rs.updateString("NOTES_DOC_ID", UNID);
System.out.println("got past updating NOTES_DOC_ID column");
rs.updateRow(); //fails here
Here is the error from console:
This is what to write to Oracle:BF8091259610C61B87257B16005C14FB
is updatable=1008, not updatable=1007 value is:1008
is Result Set Closed:false
got past updating NOTES_DOC_ID column
java.security.AccessControlException: Access denied (java.lang.RuntimePermission exitVM.0)
Prior to asking for the user to have DBA access I would get a
java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges
I think this a big clue. My DBA doesn't know what further access to give me.
The DBA is wanting me to start using ref cursors, which is fine, but I suspect there is some kind of security setting for JDBC access that is tripping me up, and I want to explore that first. If there is a security issue, then I don't think changing the way I read the rows is going to make a difference. Most of all the documentation on how to do this was obtained from Oracle's website, as well as this site.
I am going to answer my question and explain how I got past this roadblock. In the end, I basically did what 'a_horse_with_no_name' suggested.
Instead of using the resultSet cursor or a ref cursor to perform the update, I was able to use a plain UPDATE statement. This was possible, because I was able to convince the DBA to create a column for a unique identifier. We could never get around the exceptions caused by the updateRow() method of the resultSet. Prior to him adding the unique identifier, there was not a key in which to reliably use the UPDATE statement.
Here is the code where updateSQL is a string holding the update SQL statement:
updateResultInt = updateStatement.executeUpdate(updateSQL);
It returns a 1 if successful.
One word of caution, if you are using a tools like TOra or sql plus to check your update statements, you have to remember to manually commit them. If you don't your java agent will hang when trying to run it. Here is an good reference that helped me with that issue: SQL Update hangs Java program
Thanks to those who commented!

Resources