среда, 26 сентября 2012 г.

Oracle BI 11g. nQSError: 59021


На днях разрабатывал один отчет.
На тестовой инфраструктуре (MS Win x86) все работало отлично.
А вот после переноса на Production (Oracle Linux x64) при выполнении одного отчета стали появляться ошибки

[nQSError: 59021] CASE conditional expressions have mismatching data types. [[
[nQSError: 43119] Query Failed:

Долго не мог понять проблему... Тем более, что нигде CASE не использовал. И в конце концов выявил источник...))
Оказалось, что проблема кроется в использовании LOOKUP в логической модели.
Краткая инструкция и польза от использования  lookup tables описана в блоге RittmanMead  http://www.rittmanmead.com/2010/08/oracle-bi-ee-11g-lookup-tables-sparse-and-dense-lookups/

Так вот... Оказалось, что ошибка возникает в случае, если я возвращаю поле с типом DATETIME, а в качестве DefaultValue в Sparse lookups возвращаю null.

Выглядела функция примерно так:

LOOKUP
(
SPARSE
"Модель".."Реестр"."Дата отправки",
null,
"Модель".."Запрос"."ProcessUnid"
)

Я совсем забыл, что по умолчанию значение NULL имеет тип varchar и его надо преобразовывать.
После того, как я изменил функцию и добавил явное преобразование, все заработало

LOOKUP
(
SPARSE
"Модель".."Реестр"."Дата отправки",
to_datetime(null, 'dd.mm.yyyy'),
"Модель".."Запрос"."ProcessUnid"
)

Почему функция выполнялась на тестовой инфраструктуре и перестала выполняться на production для меня остается загадкой. Либо какие-то параметры окружения отличаются, либо это отличия, которые дает различие платформ.





понедельник, 24 сентября 2012 г.

Перенос репозитария BI

Каждый раз, перенося репозитарий со среды разработки на production, я мучительно ищу главу, в которой описывается процедура upgrade guid пользователей.
Сегодня чаша моего терпения иссякла.
И я решил записать для себя ссылку - http://docs.oracle.com/cd/E21764_01/core.1111/e10105/testprod.htm#BABFIHFJ 

To refresh the user GUIDs:
  1. Open the NQSConfig.INI file for editing. For information, see "Where are Configuration Files Located?" in Oracle Fusion Middleware System Administrator's Guide for Oracle Business Intelligence Enterprise Edition.
  2. Locate the setting FMW_UPDATE_ROLE_AND_USER_REF_GUIDS = NO and change its value to YES.
  3. Modify the instanceconfig.xml file to instruct Presentation Services to refresh GUIDs on restart. Edit the file to add the last line in the following instruction.
    <ps:Catalog xmlns:ps="oracle.bi.presentation.services/config/v1.1">
    <ps:UpgradeAndExit>false</ps:UpgradeAndExit>
    <ps:UpdateAccountGUIDs>UpdateAndExit</ps:UpdateAccountGUIDs>
    
  4. From a terminal window, stop and restart the managed processes using the opmnctl parameters stopall and startall. You can use the parameter status to verify process status throughout.
    The following components are involved: Presentation Services, Oracle BI Server, Oracle BI Scheduler, Oracle BI Cluster Controller, and Oracle BI JavaHost.
    For information about using opmnctl commands, see "Using the OPMN command line to Start and Stop Oracle Business Intelligence System Components" in Oracle Fusion Middleware System Administrator's Guide for Oracle Business Intelligence Enterprise Edition.
  5. Edit the NQSConfig.INI file to reset the FMW_UPDATE_ROLE_AND_USER_REF_GUIDS = YES to NO and restart the Oracle BI Servers.
  6. Remove, set to none, or comment out the last line added to the instanceconfig.xml file (that instructs Presentation Services to refresh GUIDs on restart, as specified in Step 3).
    <ps:Catalog xmlns:ps="oracle.bi.presentation.services/config/v1.1">
    <ps:UpgradeAndExit>false</ps:UpgradeAndExit>
    <ps:UpdateAccountGUIDs>none</ps:UpdateAccountGUIDs>
    
  7. Restart Presentation Services for the instanceconfig.xml file that was updated.
  8. Ensure that Oracle WebLogic Server and the system components are also running. If they are not running, then restart them.
    For information, see "Starting and Stopping the Oracle Business Intelligence Components" in Oracle Fusion Middleware System Administrator's Guide for Oracle Business Intelligence Enterprise Edition.