Is it possible to use a fully qualified TNS record using sqlldr bundled with Oracle 10/11?
For example, in SQLPlus:
sqlplus user/ password@ (description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(sid=orcl))) @script.sql
But using sqlldr (SQL Loader) there are problems with the direct use of the TNS record. In particular:
sqlldr user/ password@ (description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(sid=orcl))) bad='bad_file.txt' control='control.ctl' data='data.txt' log='log.txt' direct='true'
Here is the error message:
LRM-00116: syntax error at 'address' following '(' SQL*Loader: Release 11.2.0.1.0 - Production on Tue Sep 13 15:41:54 2011 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. SQL*Loader-100: Syntax error on command-line
Attempting to encapsulate the TNS record in quotation marks causes the same error.
I looked at the sqlldr documentation and tried to use the 'userid' command line argument to no avail. In particular:
sqlldr userid='user/ password@ (description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(sid=orcl)))' bad='bad.txt' control='control.ctl' data='data.txt' log='log.txt' direct='true' LRM-00116: syntax error at ' password@ (' following '=' SQL*Loader: Release 11.2.0.1.0 - Production on Tue Sep 13 15:44:17 2011 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. SQL*Loader-100: Syntax error on command-line
It makes sense that Oracle hopes to force the user to a local instance to mitigate I / O when transferring data to a remote host. But the deviation in the supported syntax is not so intuitive. Does anyone else face similar issues?
thetwan
source share