Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open /home/db2topgdir/TABLEDESC, No such file or directory at ./deltocopy.pl line 234 #5

Closed
sarathmv opened this issue Jun 20, 2017 · 7 comments

Comments

@sarathmv
Copy link

I tried to migrate the DB2 to Postgresql, at the time it shows error as Cannot open /home/db2topgdir/TABLEDESC, No such file or directory at ./deltocopy.pl line 234 while trying execute ./deltocopy.pl -d /home/db2topgdir/ | psql -U postgres -e --set=ON_ERROR_STOP=1 RBD

@marco44
Copy link
Contributor

marco44 commented Jun 20, 2017

well, the TABLEDESC should have been created by the db2topg step. If you don't have a TABLEDESC, it means that either you didn't do this step, or the file is in another directory.

@sarathmv
Copy link
Author

Thanks that was in another directory i just moved it into the same and now it is working.
Now if i run unsure.sql and error occurs

psql.bin:/home/db2topgdir/unsure.sql:32: ERROR: syntax error at or near "LANGUAGE"
LINE 1: CREATE OR REPLACE FUNCTION rmsvcchk_fn LANGUAGE plpgsql RETU...
^
psql.bin:/home/abc/db2topgdir/unsure.sql:32: STATEMENT: CREATE OR REPLACE FUNCTION rmsvcchk_fn LANGUAGE plpgsql RETURNS (trigger) AS
$func$

NEW AS N FOR EACH ROW MODE DB2SQL WHEN (LCASE(N.SVR_SERVERNAME) = (SELECT
LCASE(SVR_SERVERNAME) FROM RMSERVER WHERE LCASE(N.SVR_SERVERNAME) = LCASE(SVR_SERVERNAME)))
SIGNAL SQLSTATE '75000' ('Servername already exists')
$func$
;

@marco44
Copy link
Contributor

marco44 commented Jun 21, 2017

Yes, that's the principle of the "unsure" file: there are statements that probably won't run in PostgreSQL.

To be honest, I didn't even try to run it once with stored procedures in it, these are too different between postgresql and db2.

@sarathmv
Copy link
Author

IS there any issue happens if we not run that unsure.sql

@marco44
Copy link
Contributor

marco44 commented Jun 21, 2017

The only issue is that the objects in this unsure file wont be migrated. The unsure file is produced so that you can inpect it, see if there are things you may want to try to migrate, and rewrite them yourself. The content cannot be re-written by db2topg (because of large differences in SQL or PL language mostly)

@sarathmv
Copy link
Author

Yes i checked that in db2 and it was some different kind ok data all other data was restored.

OK thanks for the valuable information and also thanks for such a great script db2topg

@marco44
Copy link
Contributor

marco44 commented Jun 21, 2017

I'm delighted it helped you.

@marco44 marco44 closed this as completed Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants