LRM-00116: syntax error at ‘)’ following ‘HH24:MI:SS’

Cause:

Different OS has different way of interpreting the special characters. EXPDP donot recognize the backslash and quotes character properly.

[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=to_char("15-11-2021 09:53:51", "DD-MM-YYYY HH24:MI:SS") nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('
[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time="to_char("15-11-2021 09:53:51", "DD-MM-YYYY HH24:MI:SS")" nologfile=Y reuse_dumpfiles=Y
LRM-00116: syntax error at ')' following 'HH24:MI:SS'

[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\"to_char("15-11-2021 09:53:51", "DD-MM-YYYY HH24:MI:SS")\" nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('
[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\to_char("15-11-2021 09:53:51", "DD-MM-YYYY HH24:MI:SS")\ nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('
[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\"to_char('15-11-2021 09:53:51', 'DD-MM-YYYY HH24:MI:SS')"\ nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('
[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\"to_char('15-11-2021 09:53:51', 'DD-MM-YYYY HH24:MI:SS')\" nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('
[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\"to_timestamp('15-11-2021 09:53:51', 'DD-MM-YYYY HH24:MI:SS')\" nologfile=Y reuse_dumpfiles=Y
-bash: syntax error near unexpected token `('

Workaround:

Correct the syntax

[oracle@dpprod ~]$ expdp \'/ as sysdba\' directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time=\"2021/11/15 09:53:51\" nologfile=Y reuse_dumpfiles=Y

Export: Release 12.1.0.2.0 - Production on Mon Nov 15 22:28:26 2021

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TABLE_01":  "/******** AS SYSDBA" directory=dpexp tables=TEST.T dumpfile=fb.dmp flashback_time="2021/11/15 09:53:51" nologfile=Y reuse_dumpfiles=Y
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
ORA-31693: Table data object "TEST"."T" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01466: unable to read data - table definition has changed
Master table "SYS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TABLE_01 is:
  /home/oracle/fb.dmp
Job "SYS"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at Mon Nov 15 22:28:31 2021 elapsed 0 00:00:05

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s