From the course: Oracle Database 12c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating synonyms

Creating synonyms - Oracle Database Tutorial

From the course: Oracle Database 12c: Advanced SQL

Start my 1-month free trial

Creating synonyms

- [Instructor] An Oracle synonym allows you to create a pointer to an object that exists somewhere else in your database. Essentially, a synonym is an alternative name for your database schema object, such as tables, views, sequences, store procedures, and other schema objects. Creating synonyms in Oracle is extremely easy, and accomplished using the create synonym command. For example, I can type create synonym, followed by the synonym name, say emp, shorthand for employees, for, and then the schema.table name, so hr.employees. What I'm essentially doing here is creating an alias called emp which points to the hr.employees table. Let's execute the command and see that our synonym was created. By the way, if a synonym already exists and you want to redefine it or change it, you can simply use the or replace phrase as part of the command. So create or replace synonym. The same create or replace trick holds true for many different Oracle schema object, such as store procedures, views…

Contents