Parsing failed with message SyntaxError. Unexpected token 'PARTITION' (Line 35, Col 1) symbol Id
asollber
Posts: 5 New member
I'm trying to create audit tables with a storage clause as well as a partitioning clause. This is what such a table looks like:
The options we're setting (wrapped in another script) are:
Do I have to change the format to get this to work or is there an option I have to set differently?
Thanks for any help with this
Alain
create table MY_SCHEMA.MY_TEST_AUDT ( TEST_ID NUMBER(19), -- all sorts of business fields, omitted for clarity AUDT_CRT_DTM TIMESTAMP DEFAULT SYSTIMESTAMP, AUDT_ACTN_CODE VARCHAR2(1), AUDT_CRT_USR_NM VARCHAR2(128) DEFAULT USER, AUDT_CLIENT_IDENTIFIER VARCHAR2(256), AUDT_CLIENT_INFO VARCHAR2(256) ) TABLESPACE MY_TABLESPACE PCTFREE 0 INITRANS 10 STORAGE ( INITIAL 64K NEXT 1M MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT ) COMPRESS FOR OLTP NOCACHE PARTITION BY RANGE (AUDT_CRT_DTM) INTERVAL(interval '1' month) ( PARTITION P0 VALUES LESS THAN (date '2018-11-01') PCTFREE 0 INITRANS 10 ) /<br>The first time I ran it I got this error:
Parsing failed with message SyntaxError. Unexpected token 'K'Pointing to the storage clause. When I got rid of the storage clause (since I can use the defaults) it started complaining about the partitioning clause and that's where I am not very happy with the software.
Parsing failed with message SyntaxError. Unexpected token 'PARTITION' (Line 35, Col 1) symbol Id<br>We're running Schema Compare for Oracle version:4.0.8.420
The options we're setting (wrapped in another script) are:
-behavior=scriptheader -behavior=defineoff -ignore=slowdependencies -ignore=dependentobjects -ignore=whitespace -ignore=casedifferences -ignore=storage -ignore=doublequotes -ignore=sequencevalue -ignore=permissions -ignore=constraintnames -ignore=indexnames -ignore=loggroups /exclude:Additional
Do I have to change the format to get this to work or is there an option I have to set differently?
Thanks for any help with this
Alain
Tagged:
Best Answer
-
Eddie D Posts: 1,807 Rose Gold 5Hi Alain
I have a reproduction of the problem, the fact that you are comparing scripts folders helped me identify the cause of the parsing problem. There are in fact 3 parsing problems, the first two are easily rectified and the third one is little puzzling as it is a valid PL-SQL keyword.
For some reason the scripts parser encounters a problem.System.AggregateException: One or more errors occurred. ---> RedGate.Oracle.Common.ScriptPopulationException: Failed to parse file D:\EDDIE_ScriptsFolder_Target\EDDIE\Tables\MY_TEST_AUDT.sql - Parsing failed with message SyntaxError. Unexpected token 'K' (Line 12, Col 24) symbol Id.
I was able to resolve the above by changing:<pre class="CodeBlock"><code>INITIAL 64K
to become<pre class="CodeBlock"><code>INITIAL 65536
System.AggregateException: One or more errors occurred. ---> RedGate.Oracle.Common.ScriptPopulationException: Failed to parse file D:\EDDIE_ScriptsFolder_Target\EDDIE\Tables\MY_TEST_AUDT.sql - Parsing failed with message SyntaxError. Unexpected token 'M' (Line 14, Col 23) symbol Id.
I was able to resolve the above by changing:NEXT 1M
to becomeNEXT 1048576<br>
System.AggregateException: One or more errors occurred. ---> RedGate.Oracle.Common.ScriptPopulationException: Failed to parse file D:\EDDIE_ScriptsFolder_Target\EDDIE\Tables\MY_TEST_AUDT.sql - Parsing failed with message SyntaxError. Unexpected token 'PARTITION' (Line 22, Col 1) symbol Id.
I removed the NOCACHE keyword from the script, which resolved this problem.
Although looking at the Oracle help, NOCACHE is a valid keyword and the default value if NOCACHE or CACHE is not specified. When first creating the table, I noticed that Oracle SQL Developer placed a red squiggle line underneath the keyword and when viewing the DDL for the table using Oracle SQL Developer the keyword is omitted.
Despite the work around, I have submitted a new bug report whose reference is OC-1026.
Many Thanks
Eddie
Answers
Thank you for your forum post.
Using V5.2.1.1127 of Schema Compare for Oracle, I am unable to replicate the reported problem on an Oracle 12c2 database, using the DDL you posted.
The only changes to your script I made were to the schema name and tablespace name.
Are you comparing two live schemas, or a scripts folder to a live schema?
Are you using the GUI or the Command Line to perform your comparison?
A support ticket has been created for you, I will sent to you a private message on how to view the support ticket created for you.
Would it be possible for you to increase the minimum logging level to verbose and repeat the comparison attempt. When the reported error occurs, please update the support ticket.
If using the GUI, please us the information in this help article to set the verbose logging.
If using the command line, please add the /loglevel:verbose switch to your syntax.
You will be able to locate the log files in the following folder:
C:\Users\<user name>\AppData\Local\Red Gate\Logs\Schema Compare for Oracle
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Thanks for getting back to me.
The comparison I'm using is the scripts folders (both sides) and I'm using the GUI.
I attached you the log file.
Your help is much appreciated.
Best regards
Alain
Thank you for your forum post.
Using V5.2.1.1127 of Schema Compare for Oracle, I am unable to replicate the reported problem on an Oracle 12c2 database, using the DDL you posted.
The only changes to your script I made were to the schema name and tablespace name.
Are you comparing two live schemas, or a scripts folder to a live schema?
Are you using the GUI or the Command Line to perform your comparison?
A support ticket has been created for you, I will sent to you a private message on how to view the support ticket created for you.
Would it be possible for you to increase the minimum logging level to verbose and repeat the comparison attempt. When the reported error occurs, please update the support ticket.
If using the GUI, please us the information in this help article to set the verbose logging.
If using the command line, please add the /loglevel:verbose switch to your syntax.
You will be able to locate the log files in the following folder:
C:\Users\<user name>\AppData\Local\Red Gate\Logs\Schema
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com