The ORA-21254 is a very common error, always related to your local copy of the tnsnames.ora file, your listener configuration and your database name aliases.
- Make sure that your listener is listening for the same service name that you are using.
- Your service name might have an alias, so check for global (world) entries and local entries. Check $ORACLE_HOME/network/admin/tnsnames.ora.
- Check your global_name setting with this SQL:
SQL>SELECT * FROM GLOBAL_NAME;
SQL>alter database rename global_name to xxx;