In oracle, if another database is on the same server, I did the following to create a synonym
CREATE SYNONYM synonymName FOR databaseName.schema.table;
What should I do to create a synonym for tables in a database hosted on another server so that I can provide credentials to connect to the server.
I need this for both oracle and netezza.
Edit: while trying (for Oracle), referring to the answer below, I received a syntax error when the remote link contains an ip address or '-' in the link name. eg.
CREATE PUBLIC DATABASE LINK abc-def.xyz.com CONNECT TO user IDENTIFIED BY pw USING 'databaseName';
source
share