Reputation: 53
I am trying to import a large .sql file into Oracle database but I get a lot of errors like:
ORA-00922: missing or invalid option 00922. 00000 - "missing or invalid option"
and
SQL Error: ORA-00911: invalid character 00911. 00000 - "invalid character"
Is there some options I can change in preferences? Or any other solution to this?
What I am doing is:
set define off
@ D:\Downloads\backup.sql
The file is also 11.8 Gb big, so if you have suggestions how to import such large database please share.
Upvotes: 0
Views: 981
Reputation: 64959
The SQL script you are trying to run is broken. Either you fix it somehow or you use an alternative approach to get the data into your database.
Evidently, something is generating this script and making a bad job of it. So, whatever it is that is generating this script needs to be fixed and the script re-generated. I would not want to manually fix up an 11.8GB SQL script file.
However, I wouldn't use a huge SQL script for moving data about. If I'm going to move or copy a lot of data from one database to another I would use data-pump export and import instead.
Another possible cause of these errors may be character set encoding differences. For example, the SQL script may be written in UTF-8 but it looks like you are importing it using the Windows Command Prompt, which uses some other codepage by default. Again, this is a problem you would avoid if you used data-pump export and import.
Upvotes: 1