1

I have wasted a lot of time on this. Any ideas of what I am doing wrong here?

Script in bash

#!/usr/bin/bash
.
.
.  

/export/home/app/oracle/product/10.2.0/bin/exp $uname/$passw \
    FILE="$WORKSPACE"/"$EXP_FILE" \
    LOG="$EXP_LOG" \
    TABLES=SYSTEM_PARAMETERS\
    CONSISTENT=Y \
    ROWS=Y \
    INDEXES=Y \
    CONSTRAINTS=Y \
    GRANTS=Y ;

Error Message

/export/home/app/oracle/admin/ukediuat/exp >./exp_syspar.sh
Username: USER
Enter DPDADMIN Password:

LRM-00116: syntax error at 'TABLES' following '='

EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully

Problem

The issue is with the dollar signs in the export command. By replacing the variables which use the dollar sign with the full path the script runs.

Is there anyway to parse the shell variables into the export command?

0

Try changing the tables parameter to this. You only need parentheses when you have more than one table.

TABLES='SYSTEM_PARAMETERS' \

$ exp tables=system.plan_table file=plan_table.dmp statistics=none

Export: Release 11.2.0.2.0 - Production on Tue Feb 17 08:59:05 2015

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


Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8MSWIN1252 character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table                     PLAN_TABLE          4 rows exported
Export terminated successfully without warnings.
  • already tried that. Still does not work. – Stelios Feb 16 '15 at 22:36
  • You don't need the single quotes. Which seems counter intuitive to me. I should mention that when I do exports, I usually use data pump. exp seems like a leftover from 8i. – Gandolf989 Feb 17 '15 at 14:00
0

The error messages says

LRM-00116: syntax error at 'TABLES' following '='

EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully

so TABLES is following =. The relevant part of the script is

LOG="$EXP_LOG" \
TABLES=SYSTEM_PARAMETERS\

The OP says

By replacing the variables which use the dollar sign with the full path the script runs.

So if he replaces "$EXP_LOG" by the path of the logfile, the script works

This means that the variable EXP_LOG is empty. If this is the case then when the script is executed and variable replacement happend we have

LOG= \
TABLES=SYSTEM_PARAMETERS\

which is equivalent to

LOG= TABLES=SYSTEM_PARAMETERS

which raises the error the user gets.

you can insert a

set -x

statement before the export command then the shell will display the command that it will actually execute.

-1
#!/usr/bin/bash

TABLES=$DBUser."TBLTACCOUNTHISTORY"
directory=DATA_PUMP_DIR
dumpfile="ABC.dmp"
logfile="ABC.log"

Then run with:

expdp $SysDBUser/$SysDBPassword directory=$directory dumpfile=$dumpfile logfile=$logfile tables=$TABLES 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.