cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Can't create table 'alfresco_222.#sql-52f_97

nicolasraoul
Star Contributor
Star Contributor
Hello all!

I am trying to upgrade from Alfresco 2.2.1 to 2.2.2 but receive an SQLException. Here is what I did:
1) Backup database from Alfresco 2.2.1
2) Backup contentstore, contentstore.deleted, audit.contentstore from Alfresco 2.2.1
3) Install Alfresco 2.2.2 and start/stop it once
4) Replace tables and alf_data with backup
5) Start Alfresco, I get:

16:42:16,994 WARN  [org.springframework.remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
16:42:17,389 DEBUG [org.alfresco.repo.model.filefolder.FileFolderPerformanceTester] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@19b7dfa, name=log4j:logger=org.alfresco.repo.model.filefolder.FileFolderPerformanceTester
16:42:17,390 DEBUG [org.alfresco.repo.avm.TransactionalLookupCache.init] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@19b7dfa, name=log4j:logger=org.alfresco.repo.avm.TransactionalLookupCache.init
16:42:19,960 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
16:42:20,479 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /home/nico/programs/Alfresco/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-8039251262533655706.sql (Generated).
16:42:24,468 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: alter table JBPM_ACTION add index FK_ACTION_REFACT (REFERENCEDACTION_), add constraint FK_ACTION_REFACT foreign key (REFERENCEDACTION_) references JBPM_ACTION (ID_)
   Error: Can't create table 'alfresco_222.#sql-52f_97' (errno: 121)
   File: /home/nico/programs/Alfresco/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-8039251262533655706.sql
   Line: 29
16:42:24,469 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
java.sql.SQLException: Can't create table 'alfresco_222.#sql-52f_97' (errno: 121)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)

Any idea what I did wrong?
If that matters, all tables use InnoDB, and Alfresco is Enterprise version.
Thanks a lot!
Nicolas Raoul
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
I suggest you contact A;fresco support.

muralie39
Champ on-the-rise
Champ on-the-rise
Hi,

Create a schema name with capital letters.. & use db.schema.update=true

If you still facing the problem..write a mail to me ..

nicolasraoul
Star Contributor
Star Contributor
I solved the problem by renaming the JBPM-related MySQL table to capital letter just after restoring the backup, before starting Alfresco:

alter table jbpm_action rename to JBPM_ACTION;
alter table jbpm_bytearray rename to JBPM_BYTEARRAY;
alter table jbpm_byteblock rename to JBPM_BYTEBLOCK;
alter table jbpm_comment rename to JBPM_COMMENT;
alter table jbpm_decisionconditions rename to JBPM_DECISIONCONDITIONS;
alter table jbpm_delegation rename to JBPM_DELEGATION;
alter table jbpm_event rename to JBPM_EVENT;
alter table jbpm_exceptionhandler rename to JBPM_EXCEPTIONHANDLER;
alter table jbpm_job rename to JBPM_JOB;
alter table jbpm_log rename to JBPM_LOG;
alter table jbpm_moduledefinition rename to JBPM_MODULEDEFINITION;
alter table jbpm_moduleinstance rename to JBPM_MODULEINSTANCE;
alter table jbpm_node rename to JBPM_NODE;
alter table jbpm_pooledactor rename to JBPM_POOLEDACTOR;
alter table jbpm_processdefinition rename to JBPM_PROCESSDEFINITION;
alter table jbpm_processinstance rename to JBPM_PROCESSINSTANCE;
alter table jbpm_runtimeaction rename to JBPM_RUNTIMEACTION;
alter table jbpm_swimlane rename to JBPM_SWIMLANE;
alter table jbpm_swimlaneinstance rename to JBPM_SWIMLANEINSTANCE;
alter table jbpm_task rename to JBPM_TASK;
alter table jbpm_taskactorpool rename to JBPM_TASKACTORPOOL;
alter table jbpm_taskcontroller rename to JBPM_TASKCONTROLLER;
alter table jbpm_taskinstance rename to JBPM_TASKINSTANCE;
alter table jbpm_token rename to JBPM_TOKEN;
alter table jbpm_tokenvariablemap rename to JBPM_TOKENVARIABLEMAP;
alter table jbpm_transition rename to JBPM_TRANSITION;
alter table jbpm_variableaccess rename to JBPM_VARIABLEACCESS;
alter table jbpm_variableinstance rename to JBPM_VARIABLEINSTANCE;