ORA-16516: the current state is invalid for the attempted operation
Cause : The broker may return this error for switchover operations and for database state change operations. If this error is returned for a switchover operation, the broker has determined that either: - The databases changing roles are offline. - The primary database is not shipping log files. - The standby database that will become the primary database is not applying log files. The broker returns this error for database state change operations if the database state specified is invalid.
Action - How to fix it : DBA Scripts :: www.high-oracle.com/scripts
If this error is returned when attempting a switchover operation, make sure that: - The databases changing roles are online. - The primary database is shipping log files. - The standby database is applying log files. If this error is returned when attempting a database state change operation, make sure you specify a valid state.
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.