ORA-24778: cannot open connections
Cause : The migratable transaction tried to access a remote database when the session itself had opened connections to remote database(s).
Action - How to fix it : DBA Scripts :: www.high-oracle.com/scripts
Close the connection(s) in the session and then try to access the remote database from the migratable transaction. If the error still occurs, contact Oracle customer support.
Well, the reason for above error is that i have taken the above script from a 11g database and running it on 10g database. 11g has bring some changes in password management. Below code is executed on 11g and user created successfully, which is expected result.