java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object

atlassian.com | 4 months ago
  1. 0

    ORA-00955: Name is Already Used by an Existing Object - Atlassian Documentation

    atlassian.com | 4 months ago
    java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
  2. 0

    insconsistence between UI OIM and User.xml  oim 11g r1

    Oracle Community | 4 years ago | DianaOrd
    java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
  3. 0

    Unable to use changelogSchemaName/changelogCatalogName configuration parameters on Oracle DB. h3. Steps to reproduce: Testplan 1. # Configure Liquibase against Oracle DB instance, user A; # Set changelogSchemaName to B; # Launch update procedure; # Note that DATABASECHAGELOG* tables are created in A schema. Testplan 2. # Configure Liquibase against Oracle DB instance, user A; # Set changelogCatalogName to B; # Launch update procedure; # Note that DATABASECHAGELOG* tables are created in A schema. Testplan 3. # Perform steps outlined in Testplan 2. # Launch Liquibase again with the same configuration. # Notice an exception similar to this: {code} Error setting up or running Liquibase: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE <changelogCatalogName>.DATABASECHANGELOGLOCK (ID NUMBER(10) NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)): ORA-00955: name is already used by an existing object at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE <changelogCatalogName>.DATABASECHANGELOGLOCK (ID NUMBER(10) NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)): ORA-00955: name is already used by an existing object at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:371) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19 more Caused by: liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE <changelogCatalogName>.DATABASECHANGELOGLOCK (ID NUMBER(10) NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)): ORA-00955: name is already used by an existing object at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:214) at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153) at liquibase.Liquibase.update(Liquibase.java:182) at liquibase.Liquibase.update(Liquibase.java:174) at org.liquibase.maven.plugins.LiquibaseUpdate.doUpdate(LiquibaseUpdate.java:31) at org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo.performLiquibaseTask(AbstractLiquibaseUpdateMojo.java:24) at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:367) ... 21 more Caused by: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE <changelogCatalogName>.DATABASECHANGELOGLOCK (ID NUMBER(10) NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)): ORA-00955: name is already used by an existing object at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112) at liquibase.lockservice.StandardLockService.init(StandardLockService.java:88) at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187) ... 27 more Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:931) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1792) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1745) at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:334) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:310) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ... 31 more {code} h2. Code analysis showed that: h3. Oracle does not support schemas "in Liquibase's opinion". I.e. {{liquibase.database.core.OracleDatabase.supportsSchemas()}} always return {{false}}, hence {{liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName()}} always return default catalog (usually <jdbc_connection_username>). h3. Code, which creates DATABASECHANGELOG/DATABASECHANGELOGLOCK tables also affected. {{liquibase.sqlgenerator.core.CreateDatabaseChangeLogLockTableGenerator.generateSql(CreateDatabaseChangeLogLockTableStatement, Database, SqlGeneratorChain)}} will create an SQL statement containing catalog only, whereas schema (set to <changelogSchemaName>) ignored by {{liquibase.database.AbstractJdbcDatabase.escapeObjectName(String, String, String, Class<? extends DatabaseObject>)}}. The same issue with {{liquibase.sqlgenerator.core.CreateDatabaseChangeLogTableGenerator.generateSql(CreateDatabaseChangeLogTableStatement, Database, SqlGeneratorChain)}}. h3. Note on DB metadata check when <changelogCatalogName> is set. In {{liquibase.snapshot.SnapshotGeneratorFactory.hasDatabaseChangeLogLockTable(Database)}} DATABASECHANGELOGLOCK table object recieves catalog = <changelogCatalogName>, schemaName = <jdbc_connection_username> (see note about {{AbstractJdbcDatabase.getDefaultSchemaName()}} above) upon creation. DB metadata loading code - {{liquibase.snapshot.JdbcDatabaseSnapshot.CachingDatabaseMetaData.getTables(String, String, String, String[])}} - called prior to the existance check, recieves catalogName = null, schemaName = <changelogCatalogName>, but eventually calls {{CatalogAndSchema catalogAndSchema = new CatalogAndSchema(catalogName, schemaName).customize(database);}}(JdbcDatabaseSnapshot.java:356, fastFetchQuery() method). customize(Database) method, in turn, calls {{liquibase.CatalogAndSchema.standardize(Database)}}, which nullifyes schema name: {code:title=CatalogAndSchema.java|borderStyle=solid} if (accordingTo.supportsSchemas()) { if (schemaName != null && schemaName.equalsIgnoreCase(accordingTo.getDefaultSchemaName())) { schemaName = null; } } else { schemaName = null; } {code} This effectively eliminates configured <changelogCatalogName> value and resets it to default schema (usually <jdbc_connection_username>). {{queryOracle(CatalogAndSchema, String)}} that called furhter creates a query of the form: {code:SQL} SELECT null as TABLE_CAT, a.OWNER as TABLE_SCHEM, a.TABLE_NAME as TABLE_NAME, 'TABLE' as TABLE_TYPE, c.COMMENTS as REMARKS from ALL_TABLES a join ALL_TAB_COMMENTS c on a.TABLE_NAME=c.table_name and a.owner=c.owner WHERE a.OWNER='<jdbc_connection_username>' AND a.TABLE_NAME not in (select mv.name from all_registered_mviews mv where mv.owner='<jdbc_connection_username>') {code} which will return information about tables from <jdbc_connection_username> schema only; table snapshot will retain this info and, hence, the DATABASECHANGELOGLOCK table object passed to {{liquibase.snapshot.SnapshotGeneratorFactory.has(DatabaseObject, Database)}} by {{liquibase.snapshot.SnapshotGeneratorFactory.hasDatabaseChangeLogLockTable(Database)}} will not be matched because schema names differ. Liquibase will decide that this table does not exist (even if it is not the case, and it existis within the default schema) and attempt to recreate a lock table.

    JIRA | 2 years ago | Alexander Kiselyov
    liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE <changelogCatalogName>.DATABASECHANGELOGLOCK (ID NUMBER(10) NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)): ORA-00955: name is already used by an existing object
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SymmetricDS Issues

    symmetricds.org | 4 months ago
    java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
  6. 0

    Setup an XWiki server that uses PostgreSQL as the DB, then start the server and connect to it. You'll see a message similar to this one: {code} 2014-05-26 15:23:01,630 [XWiki initialization] INFO .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki] 2014-05-26 15:23:02,696 [XWiki initialization] ERROR .HibernateDataMigrationManager - The empty database xwiki seems to be not writable, please check your configuration! com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of wiki [xwiki] at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:181) ~[xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.initializeEmptyDB(HibernateDataMigrationManager.java:141) ~[xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initNewDB(AbstractDataMigrationManager.java:434) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:534) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:517) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:722) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:898) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:830) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:829) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:291) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1357) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1405) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.getXWikiPreference(XWiki.java:2081) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.getXWikiPreference(XWiki.java:2113) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.render.XWikiMacrosMappingRenderer.loadPreferences(XWikiMacrosMappingRenderer.java:107) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.render.XWikiMacrosMappingRenderer.<init>(XWikiMacrosMappingRenderer.java:83) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.<init>(DefaultXWikiRenderingEngine.java:72) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.resetRenderingEngine(XWiki.java:1004) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:760) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.XWiki.<init>(XWiki.java:661) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:129) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at org.xwiki.job.internal.AbstractJob.run(AbstractJob.java:155) [xwiki-commons-job-6.1-milestone-1.jar:na] at org.xwiki.context.concurrent.ExecutionContextRunnable.run(ExecutionContextRunnable.java:70) [xwiki-commons-context-6.1-milestone-1.jar:na] at java.lang.Thread.run(Unknown Source) [na:1.8.0_05] Caused by: org.hibernate.HibernateException: Failed updating schema while executing query [create sequence public.hibernate_sequence] at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:613) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:371) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:196) ~[xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:178) ~[xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] ... 23 common frames omitted Caused by: org.postgresql.util.PSQLException: ERROR: relation "hibernate_sequence" already exists at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331) ~[postgresql-9.3-1101.jdbc41.jar:na] at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) ~[commons-dbcp-1.3.jar:1.3] at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228) ~[commons-dbcp-1.3.jar:1.3] at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:609) [xwiki-platform-legacy-oldcore-6.1-milestone-1.jar:na] ... 26 common frames omitted 2014-05-26 15:23:02,703 [XWiki initialization] INFO .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki] 2014-05-26 15:23:03,602 [XWiki initialization] INFO .HibernateDataMigrationManager - Storage schema updates and data migrations are enabled 2014-05-26 15:23:03,603 [XWiki initialization] INFO .HibernateDataMigrationManager - No data migration to apply for wiki [xwiki] currently in version [54300] 2014-05-26 15:23:03,603 [XWiki initialization] INFO .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki] 2014-05-26 15:23:07,809 [XWiki Solr index job thread] INFO o.x.s.s.i.j.IndexerJob - Starting job of type [solr.indexer] with identifier [[solr, indexer]] 2014-05-26 15:23:07,954 [XWiki Solr index job thread] INFO o.x.s.s.i.j.IndexerJob - 0 documents added, 28 deleted and 0 updated during the synchronization of the Solr index. 2014-05-26 15:23:07,955 [XWiki Solr index job thread] INFO o.x.s.s.i.j.IndexerJob - Finished job of type [solr.indexer] with identifier [[solr, indexer]] {code} The message says "The empty database xwiki seems to be not writable, please check your configuration!", but I am able to install the UI using DW. Doesn't reproduce on 3.5.1 & 4.5.4.

    XWiki.org JIRA | 3 years ago | Manuel Smeria
    com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of wiki [xwiki]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLSyntaxErrorException

      ORA-00955: name is already used by an existing object

      at oracle.jdbc.driver.SQLStateMapping.newSQLException()
    2. Oracle jdbc
      OracleStatement.executeUpdateInternal
      1. oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
      2. oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
      3. oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
      4. oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
      5. oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
      6. oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
      7. oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
      8. oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:942)
      9. oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
      10. oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1706)
      10 frames