In the above entry, ORA11G is the connect identifier, everything behind the equal sign is the connect descriptor. More specifically, the connect identifier is just an alias which can be used in connection string to represent their own lengthy connect descriptor for convenience.

C:\Users\edchen>sqlplus /nolog .. SQL> conn hr/hr@ora11g Connected.

In other words, the connect identifier, the alias will be translated into its own connect descriptor at connect-time. That is to say, the real working thing is the connect descriptor. That's why we replace the connect identifier with the connect descriptor to connect a new or moved database.

For safety, we use double quotes to wrap the string. It connected successfully.

2. Use Your Own tnsnames.ora

I know you cannot touch the original tnsnames.ora, but you can use your own tnsnames.ora. The trick is to set a TNS_ADMIN environment variable temporarily for your session and put your own tnsnames.ora in that directory. Then connection tools including sqlplus will know where to find the new tnsnames.ora.