0

I have an Oracle database connected to a SQL Server. The connection works correctly, but unfortunately, I don't know the password used for that connection. Now I need to change the password in Oracle.

Is it a good idea to run something like

SELECT * FROM OPENQUERY([oracle], '
     ALTER USER OracleUser IDENTIFIED BY pswd;
     SELECT 1 FROM DUAl')

Or maybe, is there another solution?

UPD My query ends with error

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

4
  • social.msdn.microsoft.com/Forums/sqlserver/en-US/… - maybe this will work, never tried it. Commented Sep 25, 2015 at 12:23
  • surely a better idea would be to log onto the Oracle database with a user who has the privilege to change passwords, DBA role as an example, and work from there? Commented Sep 25, 2015 at 12:54
  • 1
    Thank you Robert. EXEC('...') AT [oracle] works for me. This query caused error Server ‘oracle′ is not configured for RPC for a Linked Server, but I altered linked server according to this article. And now I'm stumped with an oracle error ORA-28221: REPLACE not specified. It seems I need to call the oracle administrator. Commented Sep 25, 2015 at 13:05
  • You need to specify the old password. (Unless this is the first time you set the password) Commented Sep 25, 2015 at 15:05

1 Answer 1

1

Correct syntax for changing password in Oracle from SQL Server via linked server is

EXEC ('ALTER USER OracleUser IDENTIFIED BY new_password REPLACE old_password') AT [oracle]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.