简体   繁体   中英

Database migration from Sybase to MySQL: “ error calling Python module function DbSQLAnywhereRE.reverseEngineer”

I'm trying to migrate a database from Sybase to MySQL with the MySQL Workbench migration tool.

I have no problem connecting the datasource and the target database, but when it starts migrating I get the following issue from the log message.

Starting...
Connect to source DBMS...
- Connecting...
Connect to source DBMS done
Reverse engineer selected schemas....
Reverse engineering DBA, SYS, dbo, rs_systabgroup from corsi
- Reverse engineering catalog information
- Preparing...
Traceback (most recent call last):
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3
CE\\modules\\db_sqlanywhere_re_grt.py", line 489, in reverseEngineer
return SQLAnywhereReverseEngineering.reverseEngineer(connection, catalog_name, schemata_list, context)
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\db_sqlanywhere_re_grt.py", line 169, in reverseEngineer catalog = super(SQLAnywhereReverseEngineering, cls).reverseEngineer(connection, '', schemata_list, context)
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\db_generic_re_grt.py", line 258, in reverseEngineer table_count_per_schema[schema_name] = len(cls.getTableNames(connection, catalog_name, schema_name)) if get_tables else 0
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\db_sqlanywhere_re_grt.py", line 41, in wrapped_method res = method(cls, connection, *args)
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\db_sqlanywhere_re_grt.py", line 145, in getTableNames return [row[0] for row in cls.execute_query(connection, query)]
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\db_generic_re_grt.py", line 76, in execute_query return cls.get_connection(connection_object).cursor().execute(query, *args, **kwargs) pyodbc.ProgrammingError: ('42S02', "[42S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Table or view not found: Table 'SYSTAB' not found (-141) (SQLExecDirectW)")

Traceback (most recent call last):
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\workbench\\wizard_progress_page_widget.py", line 192, in thread_work self.func()
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\migration_schema_selection.py", line 175, in task_reveng self.main.plan.migrationSource.reverseEngineer()
File "C:\\Program Files (x86)\\MySQL\\MySQL Workbench 6.3 CE\\modules\\migration.py", line 369, in reverseEngineer self.state.sourceCatalog = self._rev_eng_module.reverseEngineer(self.connection, self.selectedCatalogName, self.selectedSchemataNames, self.state.applicationData) SystemError: ProgrammingError("('42S02', "[42S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Table or view not found: Table 'SYSTAB' not found (-141) (SQLExecDirectW)")"): error calling Python module function DbSQLAnywhereRE.reverseEngineer
ERROR: Reverse engineer selected schemas: ProgrammingError("('42S02', "[42S02] [Sybase][ODBC Driver][Adaptive Server Anywhere]Table or view not found: Table 'SYSTAB' not found (-141) (SQLExecDirectW)")"): error calling Python module function DbSQLAnywhereRE.reverseEngineer
Failed

How do I solve this issue?

That's because of SQL to get table names. Look at db_sqlanywhere_re_grt.py:142, there is:

SELECT st.table_name
FROM SYSTAB st LEFT JOIN SYSUSER su ON st.creator=su.user_id
WHERE su.user_name = '%s' AND st.table_type = 1

This is valid sql for sql anywhere version < 10, and I guess you have newest version. So you can edit and update that file with compatible SQL. Keep in mind there is much more SQL's that also need to be updated in that file. In meantime, please fill the bug report at bugs.mysql.com .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM