SQLLoader with a password that contains @-signs

2020-02-14 04:27发布

In windows xp, I start sqlloader.exe to load data onto Oracle. This works great, until my password contains an @-sign, that is also used by sqlloader parameters to determine the database to connect to: sqlldr.exe userid/password@database control=ctrlfile.ctl

How can I make sqlldr.exe accept a password like p@ssword?

I tried with single/double quotes: sqlldr.exe "user/p@ssword"@database without success. I tried to skip the whole user/password, to type it in on the console, without success.

Even google couldn't help me (though it brought me on thsi great website).

2条回答
贼婆χ
2楼-- · 2020-02-14 05:06

Have you tried it with a parameter file? I think that would allow you to have whatever kind of password you want. From Oracle's site:

PARFILE = path_ file_name

Tells SQLLoader to read command-line parameter values from a text file. This text file is referred to as a parameter file, and contains keyword/value pairs. Usually, the keyword/value pairs are separated by line breaks. Use of the PARFILE parameter can save a lot of typing if you need to perform the same load several times, because you won't need to retype all the command-line parameters each time. There is no default extension for parameter files.*

查看更多
在下西门庆
3楼-- · 2020-02-14 05:08

It will fail using parfile as well. You just need to escape the password with \" as follows: username/\"p@ssword\"@database

not sure why nobody posted this solution before.

Cheers, Bernardo

查看更多
登录 后发表回答