Re: oracle "Error in database synchronization"

403 views
Skip to first unread message

Alessio Stalla

unread,
Oct 5, 2012, 5:56:31 AM10/5/12
to manydesign...@googlegroups.com
On Fri, Oct 5, 2012 at 11:30 AM, Zeljko Krstic <eze...@gmail.com> wrote:
> Hay,
> I am trying to connect to Oracle 8i with Portofino 4.0.7 (same with 4.0.6)
> using ojdbc14*.jar . On Step 3 I got :
> Error in database synchronization: liquibase.exception.DatabaseException:
> java.sql.SQLException: ORA-00904: invalid column name
>
> Any ideas what went wrong?

Hi, and welcome to the list!

I'm not sure about what is going wrong; could you attach your logs?

I suspect either a driver issue (are you using the right version of
the Oracle driver?) or an incompatibility between Liquibase and Oracle
8i. Unfortunately it's not clear from the Liquibase site which
versions of Oracle are supported, and in the past we've had to patch a
few database adapters ourselves.

Regards,
Alessio

Alessio Stalla

unread,
Oct 5, 2012, 8:45:33 AM10/5/12
to manydesign...@googlegroups.com
On Fri, Oct 5, 2012 at 1:19 PM, Zeljko Krstic <eze...@gmail.com> wrote:
> Thnx for replay. I have tried ojdbc14.jar with oracle 11R1 and it works, and
> also I know ojdbc14 driver can work with Oracle 8i (ojdbc14 can work with
> Oracle 8i - to Oracle 11R2 at least in some applications). I have tried to
> change oracle schema - same error. I have not tried ojdbc12.jar -- does
> Portofino support that driver?

Thanks for the detailed information. FYI, the Oracle driver names are
misleading; the numbers 12 and 14 refer to JVM compatibility (with
version 1.2 and 1.4 respectively), but there are actually multiple
versions of the drivers all named ojdbc14.jar. Digging in the logs,
you can see that the version of your driver is "10.2.0.1.0". If you
can get hold of the 8i JDBC driver, you might want to try it.

However, now I don't think the issue is caused by the driver. I looked
at the code that is causing the exception: it is inside Liquibase, and
it's the execution of a query for reading the primary keys of your
schema. Chances are that Liquibase is accessing system views that did
not exist with that name in Oracle 8i. You should try to run the
following query directly (with SqlPlus, TOAD, or similar) on your
database and see what happens:

select uc.table_name TABLE_NAME,ucc.column_name
COLUMN_NAME,ucc.position KEY_SEQ,uc.constraint_name
PK_NAME,ui.tablespace_name TABLESPACE from all_constraints
uc,all_indexes ui,all_cons_columns ucc where uc.constraint_type = 'P'
and uc.index_name = ui.index_name and uc.constraint_name =
ucc.constraint_name and uc.owner = 'your_schema' and ui.table_owner =
'your_schema' and ucc.owner = 'your_schema' and uc.table_name =
ui.table_name and ui.table_name = ucc.table_name

substitute your_schema with the name of your schema.

Alessio

> This is info for ORA-00904: invalid column name:
> "
>
> When ORA-00904 occurs, you must enter a valid column name as it is either
> missing or the one entered is invalid. The "invalid identifier" most common
> happens when you are referencing an invalid alias in a select statement.
> The Oracle docs note this on the ORA-00904 error:
>
> ORA-00904 string: invalid identifier
>
> Cause: The column name entered is either missing or invalid. Action: Enter a
> valid column name. A valid column name must begin with a letter, be less
> than or equal to 30 characters, and consist of only alphanumeric characters
> and the special characters $, _, and #. If it contains other characters,
> then it must be enclosed in double quotation marks. It may not be a reserved
> word.
>
> To avoid ORA-00904, column names cannot be a reserved word, and must contain
> these four criteria to be valid:
>
> begin with a letter
> be less than or equal to thirty characters
> consist only of alphanumeric and the special characters ($_#); other
> characters need double quotation marks around them
>
> Another important factor in correcting ORA-00904 is remembering to run
> catproc.sql
>
> You can also check your trace file to find the particular error which is
> causing the ORA-00904 to occur.
>
> "
>
>
>
> Here is exctract from portofino.log :
>
> INFO: Anonymous user not allowed. Redirecting to login.
>
> 12:57:38.207 [userId=] c.m.portofino.actions.user.LoginAction
> [LoginAction.java:143]
> INFO: User admin login
> 12:59:19.453 [userId=admin] c.m.p.m.database.JdbcConnectionProvider
> [ConnectionProvider.java:201]
>
> INFO: Processing schema: HR
> 13:00:14.536 [userId=admin] c.m.p.a.a.appwizard.ApplicationWizard
> [ApplicationWizard.java:355]
> ERROR: java.sql.SQLException: ORA-00904: invalid column name
>
> liquibase.exception.DatabaseException: java.sql.SQLException: ORA-00904:
> invalid column name
>
> at
> liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:251)
> ~[liquibase-core-2.0.5.jar:na]
> at
> liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69)
> ~[liquibase-core-2.0.5.jar:na]
> at
> com.manydesigns.portofino.sync.DatabaseSyncer.syncDatabase(DatabaseSyncer.java:122)
> ~[portofino-core-4.0.7.jar:4.0.7]
> at
> com.manydesigns.portofino.actions.admin.appwizard.ApplicationWizard.addSchemasToModel(ApplicationWizard.java:353)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> com.manydesigns.portofino.actions.admin.appwizard.ApplicationWizard.selectSchemas(ApplicationWizard.java:328)
> [portofino-web-4.0.7.jar:4.0.7]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.6.0_35]
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> ~[na:1.6.0_35]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> ~[na:1.6.0_35]
> at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.6.0_35]
> at
> net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:456)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
> [stripes-1.5.7.jar:1.5.7]
> at
> com.manydesigns.portofino.interceptors.GuardsInterceptor.intercept(GuardsInterceptor.java:70)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:454)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:278)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:160)
> [stripes-1.5.7.jar:1.5.7]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> [servlet-api.jar:na]
> at
> net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:260)
> [stripes-1.5.7.jar:1.5.7]
> at
> net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)
> [stripes-1.5.7.jar:1.5.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> com.manydesigns.portofino.dispatcher.DispatcherFilter.doFilter(DispatcherFilter.java:98)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> com.manydesigns.portofino.servlets.ApplicationFilter.doFilter(ApplicationFilter.java:120)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:260)
> [stripes-1.5.7.jar:1.5.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
> [urlrewritefilter-4.0.4.jar:4.0.4]
> at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
> [urlrewritefilter-4.0.4.jar:4.0.4]
> at
> org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
> [urlrewritefilter-4.0.4.jar:4.0.4]
> at
> org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
> [urlrewritefilter-4.0.4.jar:4.0.4]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> com.manydesigns.portofino.servlets.CleanupFilter.doFilter(CleanupFilter.java:55)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
> [shiro-web-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
> [shiro-web-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
> [shiro-core-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
> [shiro-core-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
> [shiro-core-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
> [shiro-web-1.2.0.jar:1.2.0]
> at
> org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
> [shiro-web-1.2.0.jar:1.2.0]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> com.manydesigns.elements.servlet.ElementsFilter.doHttpFilter(ElementsFilter.java:145)
> [elements-4.0.7.jar:4.0.7]
> at
> com.manydesigns.elements.servlet.ElementsFilter.doFilter(ElementsFilter.java:92)
> [elements-4.0.7.jar:4.0.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> com.manydesigns.portofino.servlets.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:49)
> [portofino-web-4.0.7.jar:4.0.7]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> [catalina.jar:6.0.35]
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> [catalina.jar:6.0.35]
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
> [tomcat-coyote.jar:6.0.35]
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
> [tomcat-coyote.jar:6.0.35]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
> [tomcat-coyote.jar:6.0.35]
> at java.lang.Thread.run(Unknown Source) [na:1.6.0_35]
> Caused by: java.sql.SQLException: ORA-00904: invalid column name
>
> at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at
> oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at
> oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at
> oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1272)
> ~[ojdbc14-10.2.0.2.jar:Oracle JDBC Driver version - "10.2.0.1.0"]
> at
> liquibase.snapshot.jvm.OracleDatabaseSnapshotGenerator.readPrimaryKeys(OracleDatabaseSnapshotGenerator.java:409)
> ~[liquibase-core-2.0.5.jar:na]
> at
> liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:243)
> ~[liquibase-core-2.0.5.jar:na]
> ... 68 common frames omitted
> 13:01:03.885 [userId=] c.m.elements.servlet.ElementsFilter
> [ElementsFilter.java:101]
> INFO: ElementsFilter destroyed
> 13:01:03.901 [userId=] c.m.portofino.servlets.PortofinoListener
> [PortofinoListener.java:229]
> INFO: ManyDesigns Portofino stopping...
> 13:01:03.901 [userId=] c.m.portofino.starter.ApplicationStarter
> [ApplicationStarter.java:201]
> INFO: Removing base classloader for application default
> 13:01:03.917 [userId=] c.m.p.d.p.AbstractDatabasePlatform
> [AbstractDatabasePlatform.java:122]
> INFO: Shutting down connection provider: wis_kron
> 13:01:03.917 [userId=] c.m.portofino.servlets.PortofinoListener
> [PortofinoListener.java:231]
> INFO: Destroying Shiro environment...
> 13:01:03.917 [userId=] c.m.portofino.servlets.PortofinoListener
> [PortofinoListener.java:233]
> INFO: Shutting down cache...
> 13:01:03.932 [userId=] c.m.portofino.servlets.PortofinoListener
> [PortofinoListener.java:235]
> INFO: ManyDesigns Portofino stopped.
> 13:01:03.932 [userId=] org.quartz.core.QuartzScheduler
> [QuartzScheduler.java:653]
> INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
> 13:01:03.932 [userId=] org.quartz.core.QuartzScheduler
> [QuartzScheduler.java:572]
> INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
> 13:01:04.370 [userId=] org.quartz.core.QuartzScheduler
> [QuartzScheduler.java:725]
> INFO: Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.
> 13:01:04.370 [userId=] o.q.ee.servlet.QuartzInitializerListener
> [QuartzInitializerListener.java:264]
> INFO: Quartz Scheduler successful shutdown.
>
>
>
> Regards Zeljko
>
> --
> You received this message because you are subscribed to the Google Groups
> "manydesigns-portofino" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/manydesigns-portofino/-/RZaa-SyolcEJ.
>
> To post to this group, send email to manydesign...@googlegroups.com.
> To unsubscribe from this group, send email to
> manydesigns-port...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/manydesigns-portofino?hl=en.

Zeljko Krstic

unread,
Oct 5, 2012, 10:37:31 AM10/5/12
to manydesign...@googlegroups.com
Thanks for the detailed information. FYI, the Oracle driver names are 
misleading; the numbers 12 and 14 refer to JVM compatibility (with 
version 1.2 and 1.4 respectively), but there are actually multiple 
versions of the drivers all named ojdbc14.jar. Digging in the logs, 
you can see that the version of your driver is "10.2.0.1.0". If you 
can get hold of the 8i JDBC driver, you might want to try it. 

However, now I don't think the issue is caused by the driver. I looked 
at the code that is causing the exception: it is inside Liquibase, and 
it's the execution of a query for reading the primary keys of your 
schema. Chances are that Liquibase is accessing system views that did 
not exist with that name in Oracle 8i. You should try to run the 
following query directly (with SqlPlus, TOAD, or similar) on your 
database and see what happens: 

select uc.table_name TABLE_NAME,ucc.column_name 
COLUMN_NAME,ucc.position KEY_SEQ,uc.constraint_name 
PK_NAME,ui.tablespace_name TABLESPACE from all_constraints 
uc,all_indexes ui,all_cons_columns ucc where uc.constraint_type = 'P' 
and uc.index_name = ui.index_name and uc.constraint_name = 
ucc.constraint_name and uc.owner = 'your_schema' and ui.table_owner = 
'your_schema' and ucc.owner = 'your_schema' and uc.table_name = 
ui.table_name and ui.table_name = ucc.table_name 

substitute your_schema with the name of your schema. 

Alessio 


Thank you Alessio for your answer. 
I am not java programmer (but learning), just pl/sql. It is system_views problem. Indeed, Oracle has changed system views, adding those INDEX_NAME, INDEX_OWNER columns to ALL_CONSTRAINTS and that is why it doesnt work on Oracle 8i. In oracle, with every 'P' (primary) and unique constraint "automaticly" get index with the same name unless user create index for primary key explicitly with differnet name. On my databases, I have found most (but not all) CONSTRAINT_NAMES=INDEX_NAMES.
So, can this be corrected in Portofino wizard? Obviously for Oracle 8i query can be changed or  you (we) can find out other way to get PK_NAME. I want to thank you for this great open source project and I hope we shall find solution for this little problem.
Regards Zeljko

Here are definitions for system views:

Oracle 11gR1:

CREATE OR REPLACE FORCE VIEW ALL_CONSTRAINTS
(
   OWNER,
   CONSTRAINT_NAME,
   CONSTRAINT_TYPE,
   TABLE_NAME,
   SEARCH_CONDITION,
   R_OWNER,
   R_CONSTRAINT_NAME,
   DELETE_RULE,
   STATUS,
   DEFERRABLE,
   DEFERRED,
   VALIDATED,
   GENERATED,
   BAD,
   RELY,
   LAST_CHANGE,
   INDEX_OWNER,
   INDEX_NAME,
   INVALID,
   VIEW_RELATED
)
AS
   SELECT   ou.name,
            oc.name,
            DECODE (c.type#,
                    1, 'C',
                    2, 'P',
                    3, 'U',
                    4, 'R',
                    5, 'V',
                    6, 'O',
                    7, 'C',
                    '?'),
            o.name,
            c.condition,
            ru.name,
            rc.name,
            DECODE (
               c.type#,
               4,
               DECODE (c.refact, 1, 'CASCADE', 2, 'SET NULL', 'NO ACTION'),
               NULL
            ),
            DECODE (c.type#,
                    5, 'ENABLED',
                    DECODE (c.enabled, NULL, 'DISABLED', 'ENABLED')),
            DECODE (BITAND (c.defer, 1), 1, 'DEFERRABLE', 'NOT DEFERRABLE'),
            DECODE (BITAND (c.defer, 2), 2, 'DEFERRED', 'IMMEDIATE'),
            DECODE (BITAND (c.defer, 4), 4, 'VALIDATED', 'NOT VALIDATED'),
            DECODE (BITAND (c.defer, 8), 8, 'GENERATED NAME', 'USER NAME'),
            DECODE (BITAND (c.defer, 16), 16, 'BAD', NULL),
            DECODE (BITAND (c.defer, 32), 32, 'RELY', NULL),
            c.mtime,
            DECODE (c.type#, 2, ui.name, 3, ui.name, NULL),
            DECODE (c.type#, 2, oi.name, 3, oi.name, NULL),
            DECODE (
               BITAND (c.defer, 256),
               256,
               DECODE (
                  c.type#,
                  4,
                  CASE
                     WHEN (   BITAND (c.defer, 128) = 128
                           OR o.status IN (3, 5)
                           OR ro.status IN (3, 5))
                     THEN
                        'INVALID'
                     ELSE
                        NULL
                  END,
                  CASE
                     WHEN (BITAND (c.defer, 128) = 128 OR o.status IN (3, 5))
                     THEN
                        'INVALID'
                     ELSE
                        NULL
                  END
               ),
               NULL
            ),
            DECODE (BITAND (c.defer, 256), 256, 'DEPEND ON VIEW', NULL)
     FROM   sys.con$ oc,
            sys.con$ rc,
            sys.user$ ou,
            sys.user$ ru,
            sys."_CURRENT_EDITION_OBJ" ro,
            sys."_CURRENT_EDITION_OBJ" o,
            sys.cdef$ c,
            sys.obj$ oi,
            sys.user$ ui
    WHERE       oc.owner# = ou.user#
            AND oc.con# = c.con#
            AND c.obj# = o.obj#
            AND c.type# != 8
            AND c.type# != 12                   /* don't include log groups */
            AND c.rcon# = rc.con#(+)
            AND c.enabled = oi.obj#(+)
            AND oi.obj# = ui.user#(+)
            AND rc.owner# = ru.user#(+)
            AND c.robj# = ro.obj#(+)
            AND (o.owner# = USERENV ('SCHEMAID')
                 OR o.obj# IN
                         (SELECT   obj#
                            FROM   sys.objauth$
                           WHERE   grantee# IN
                                         (SELECT   kzsrorol FROM x$kzsro))
                 OR                           /* user has system privileges */
                   EXISTS (SELECT   NULL
                             FROM   v$enabledprivs
                            WHERE   priv_number IN (-45   /* LOCK ANY TABLE */
                                                       , -47 /* SELECT ANY TABLE */
                                                            , -48 /* INSERT ANY TABLE */
                                                                 , -49 /* UPDATE ANY TABLE */
                                                                      , -50 /* DELETE ANY TABLE */
                                                                           )));
COMMENT ON TABLE ALL_CONSTRAINTS IS 'Constraint definitions on accessible tables';
COMMENT ON COLUMN ALL_CONSTRAINTS.OWNER IS 'Owner of the table';
COMMENT ON COLUMN ALL_CONSTRAINTS.CONSTRAINT_NAME IS 'Name associated with constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.CONSTRAINT_TYPE IS 'Type of constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.TABLE_NAME IS 'Name associated with table with constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.SEARCH_CONDITION IS 'Text of search condition for table check';
COMMENT ON COLUMN ALL_CONSTRAINTS.R_OWNER IS 'Owner of table used in referential constraint';
COMMENT ON COLUMN ALL_CONSTRAINTS.R_CONSTRAINT_NAME IS 'Name of unique constraint definition for referenced table';
COMMENT ON COLUMN ALL_CONSTRAINTS.DELETE_RULE IS 'The delete rule for a referential constraint';
COMMENT ON COLUMN ALL_CONSTRAINTS.STATUS IS 'Enforcement status of constraint - ENABLED or DISABLED';
COMMENT ON COLUMN ALL_CONSTRAINTS.DEFERRABLE IS 'Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE';
COMMENT ON COLUMN ALL_CONSTRAINTS.DEFERRED IS 'Is the constraint deferred by default -  DEFERRED or IMMEDIATE';
COMMENT ON COLUMN ALL_CONSTRAINTS.VALIDATED IS 'Was this constraint system validated? -  VALIDATED or NOT VALIDATED';
COMMENT ON COLUMN ALL_CONSTRAINTS.GENERATED IS 'Was the constraint name system generated? -  GENERATED NAME or USER NAME';
COMMENT ON COLUMN ALL_CONSTRAINTS.BAD IS 'Creating this constraint should give ORA-02436.  Rewrite it before 2000 AD.';
COMMENT ON COLUMN ALL_CONSTRAINTS.RELY IS 'If set, this flag will be used in optimizer';
COMMENT ON COLUMN ALL_CONSTRAINTS.LAST_CHANGE IS 'The date when this column was last enabled or disabled';
COMMENT ON COLUMN ALL_CONSTRAINTS.INDEX_OWNER IS 'The owner of the index used by this constraint';
COMMENT ON COLUMN ALL_CONSTRAINTS.INDEX_NAME IS 'The index used by this constraint';
CREATE PUBLIC SYNONYM ALL_CONSTRAINTS FOR ALL_CONSTRAINTS;

Oracle 8i:

CREATE OR REPLACE FORCE VIEW ALL_CONSTRAINTS
(
   OWNER,
   CONSTRAINT_NAME,
   CONSTRAINT_TYPE,
   TABLE_NAME,
   SEARCH_CONDITION,
   R_OWNER,
   R_CONSTRAINT_NAME,
   DELETE_RULE,
   STATUS,
   DEFERRABLE,
   DEFERRED,
   VALIDATED,
   GENERATED,
   BAD,
   RELY,
   LAST_CHANGE
)
AS
   SELECT   ou.name,
            oc.name,
            DECODE (c.type#,
                    1, 'C',
                    2, 'P',
                    3, 'U',
                    4, 'R',
                    5, 'V',
                    6, 'O',
                    7, 'C',
                    '?'),
            o.name,
            c.condition,
            ru.name,
            rc.name,
            DECODE (c.type#,
                    4, DECODE (c.refact, 1, 'CASCADE', 'NO ACTION'),
                    NULL),
            DECODE (c.type#,
                    5, 'ENABLED',
                    DECODE (c.enabled, NULL, 'DISABLED', 'ENABLED')),
            DECODE (BITAND (c.defer, 1), 1, 'DEFERRABLE', 'NOT DEFERRABLE'),
            DECODE (BITAND (c.defer, 2), 2, 'DEFERRED', 'IMMEDIATE'),
            DECODE (BITAND (c.defer, 4), 4, 'VALIDATED', 'NOT VALIDATED'),
            DECODE (BITAND (c.defer, 8), 8, 'GENERATED NAME', 'USER NAME'),
            DECODE (BITAND (c.defer, 16), 16, 'BAD', NULL),
            DECODE (BITAND (c.defer, 32), 32, 'RELY', NULL),
            c.mtime
     FROM   sys.con$ oc,
            sys.con$ rc,
            sys.user$ ou,
            sys.user$ ru,
            sys.obj$ o,
            sys.cdef$ c
    WHERE       oc.owner# = ou.user#
            AND oc.con# = c.con#
            AND c.obj# = o.obj#
            AND c.type# != 8
            AND c.rcon# = rc.con#(+)
            AND rc.owner# = ru.user#(+)
            AND (o.owner# = USERENV ('SCHEMAID')
                 OR o.obj# IN
                         (SELECT   obj#
                            FROM   sys.objauth$
                           WHERE   grantee# IN
                                         (SELECT   kzsrorol FROM x$kzsro))
                 OR                           /* user has system privileges */
                   EXISTS (SELECT   NULL
                             FROM   v$enabledprivs
                            WHERE   priv_number IN (-45   /* LOCK ANY TABLE */
                                                       , -47 /* SELECT ANY TABLE */
                                                            , -48 /* INSERT ANY TABLE */
                                                                 , -49 /* UPDATE ANY TABLE */
                                                                      , -50 /* DELETE ANY TABLE */
                                                                           )));
COMMENT ON TABLE ALL_CONSTRAINTS IS 'Constraint definitions on accessible tables';
COMMENT ON COLUMN ALL_CONSTRAINTS.OWNER IS 'Owner of the table';
COMMENT ON COLUMN ALL_CONSTRAINTS.CONSTRAINT_NAME IS 'Name associated with constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.CONSTRAINT_TYPE IS 'Type of constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.TABLE_NAME IS 'Name associated with table with constraint definition';
COMMENT ON COLUMN ALL_CONSTRAINTS.SEARCH_CONDITION IS 'Text of search condition for table check';
COMMENT ON COLUMN ALL_CONSTRAINTS.R_OWNER IS 'Owner of table used in referential constraint';
COMMENT ON COLUMN ALL_CONSTRAINTS.R_CONSTRAINT_NAME IS 'Name of unique constraint definition for referenced table';
COMMENT ON COLUMN ALL_CONSTRAINTS.DELETE_RULE IS 'The delete rule for a referential constraint';
COMMENT ON COLUMN ALL_CONSTRAINTS.STATUS IS 'Enforcement status of constraint - ENABLED or DISABLED';
COMMENT ON COLUMN ALL_CONSTRAINTS.DEFERRABLE IS 'Is the constraint deferrable - DEFERRABLE or NOT DEFERRABLE';
COMMENT ON COLUMN ALL_CONSTRAINTS.DEFERRED IS 'Is the constraint deferred by default -  DEFERRED or IMMEDIATE';
COMMENT ON COLUMN ALL_CONSTRAINTS.VALIDATED IS 'Was this constraint system validated? -  VALIDATED or NOT VALIDATED';
COMMENT ON COLUMN ALL_CONSTRAINTS.GENERATED IS 'Was the constraint name system generated? -  GENERATED NAME or USER NAME';
COMMENT ON COLUMN ALL_CONSTRAINTS.BAD IS 'Creating this constraint should give ORA-02436.  Rewrite it before 2000 AD.';
COMMENT ON COLUMN ALL_CONSTRAINTS.RELY IS 'If set, this flag will be used in optimizer';
COMMENT ON COLUMN ALL_CONSTRAINTS.LAST_CHANGE IS 'The date when this column was last enabled or disabled';
CREATE PUBLIC SYNONYM ALL_CONSTRAINTS FOR ALL_CONSTRAINTS;

Alessio Stalla

unread,
Oct 5, 2012, 11:47:24 AM10/5/12
to manydesign...@googlegroups.com
Ok, it's good at least to have identified the problem.
There are various ways to solve it:

1. The "right" way is to file an issue to the Liquibase library
developers, and wait for a fix to include in the next version of
Portofino. However, we don't control the release cycle of Liquibase,
and we cannot make any prediction about it.
2. Alternatively, we could fix Liquibase ourselves, e.g. by
special-casing Oracle 8i to use a dedicated query. Oracle is one of
our officially supported platforms, but we don't currently have an 8i
installation available. The fix would be included in some future
version of Portofino, but we cannot guarantee when it will be
released.
3. If you have time to spare, you could try to fix it yourself, since
both Portofino and Liquibase are open source. But, since you're not a
Java developer, maybe this path is too steep.
4. If you want the problem to be fixed quickly and are willing to
spend some money on it, there's of course the option of commercial
support. To be clear, such a commercially funded development would
still eventually end up in some later open source release of
Portofino, but you would get a custom-built release as soon as
possible.

Regards,
Alessio
Reply all
Reply to author
Forward
0 new messages