如何编写 Oracle Wallet 更改脚本?
我使用 Oracle 钱包来存储我连接的数据库的密码。我们的密码政策要求我们经常更改密码,因此我想编写更改脚本。我有一个批处理文件,可以自行更改数据库密码,但我也想编写对钱包的更改脚本。问题是调用 mkstore 后必须输入钱包密码,并且密码不能作为参数传递。有没有办法在钱包中编写凭据更改脚本?
I use the Oracle wallet to store passwords for the databases I connect to. Our password policy requires us to change our passwords frequently enough that I would like to script the changes. I have a batch file that can change the database passwords themselves, but I would like to script the changes to the wallet as well. The problem is that a wallet password must be entered after calling mkstore and the password can't be passed as a parameter. Is there a way to script credential changes in the wallet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通过 echo 获取商店的密码,以便您可以编写脚本。
回声“$passwd”|
回声“钱包密码”| mkstore -wrl 。 -listCredential
这将列出输出,同样所有 mkstore、orapki 的命令都将起作用
Get the passwd for the store thru echo, so you can script it.
echo "$passwd" |
echo "WalletPasswd" | mkstore -wrl . -listCredential
This will list the output,likewise commands for all mkstore, orapki will work
这是我想出的一个 Powershell 脚本。要求:
Set-ExecutionPolicy RemoteSigned
以管理员身份运行)。钱包将在 c:\oracle\Wallets 中创建。这是脚本。
Here is a Powershell script I came up with. Requirements:
Set-ExecutionPolicy RemoteSigned
run as administrator).The wallet will be created in c:\oracle\Wallets. Here is the script.
至少对于 11g:
我还没有测试密码是否在 ps -fe|grep 可见的进程行中被混淆。
With 11g at least:
I have not tested whether the passwords get obfuscated in the process line visible from a ps -fe|grep.
自动热键解决方案:
AutoHotKey Solution:
来自文件的 Windows 管道工作正常。
我将钱包密码放在两行单独的行上,这样它就可以用于创建钱包以及 -createCredential:
当然,该脚本可以最初提示并创建文件,并在完成后删除该文件。将其放在仅限管理员的文件夹中,以防脚本异常终止。
Windows piping from a file works.
I put the wallet password on 2 separate lines so it works for creating the wallet as well as -createCredential:
The script could, of course, prompt and create the file initially, and delete the file when done. Put it in an admin-only folder, in case the script terminates abnormally.