通过链接服务器从 SQL 服务器更改 ORACLE 中的密码

Change password in ORACLE from SQL Server via linked server

我有一个连接到 SQL 服务器的 Oracle 数据库。连接工作正常,但不幸的是,我不知道用于该连接的密码。现在我需要在 Oracle 中更改密码。

运行 像

这样的东西是个好主意吗
SELECT * FROM OPENQUERY([oracle], '
     ALTER USER OracleUser IDENTIFIED BY pswd;
     SELECT 1 FROM DUAl')

或者,还有其他解决方案吗?

UPD 我的查询以错误结束

The OLE DB provider "OraOLEDB.Oracle" for linked server "oracle" indicates that either the object has no columns or the current user does not have permissions on that object

通过链接服务器从 SQL 服务器更改 Oracle 密码的正确语法是

EXEC ('ALTER USER OracleUser IDENTIFIED BY new_password REPLACE old_password') AT [oracle]