Friday, July 11, 2014

Change DB password through DB link

DECLARE

   cursor_handle          INTEGER;
   cursor_handle_tmp      INTEGER;

BEGIN

   -- Open a Cursor on the REMOTE database
   cursor_handle := DBMS_SQL.OPEN_CURSOR@DB.world;

   -- Parse the "change password"
   DBMS_SQL.PARSE@DB.world(cursor_handle,'ALTER USER sharmh04 IDENTIFIED BY tigerlion',DBMS_SQL.NATIVE);

   -- Execute the cursor
   cursor_handle_tmp := DBMS_SQL.EXECUTE@DB.world(cursor_handle);

   -- Close the cursor
   DBMS_SQL.CLOSE_CURSOR@DB.world(cursor_handle);

END; 

No comments:

Post a Comment