Create synonym for table : Synonym « User Previliege « Oracle PL / SQL






Create synonym for table

  
SQL>
SQL> CREATE TABLE source_log
  2  (backup_date    DATE,
  3   backup_time    VARCHAR2(6),
  4   last_ddl_time  DATE,
  5   owner          VARCHAR2(30),
  6   name           VARCHAR2(30),
  7   type           VARCHAR2(12),
  8   line           NUMBER,
  9   text           VARCHAR2(2000))
 10  /

Table created.

SQL> CREATE INDEX source_log_idx1 ON source_log
  2    (last_ddl_time, owner, name)
  3  /

Index created.

SQL> CREATE or replace PUBLIC SYNONYM source_log FOR source_log
  2  /

Synonym created.

SQL> GRANT SELECT, INSERT ON source_log to PUBLIC
  2  /

Grant succeeded.

SQL>
SQL> drop table source_log;

Table dropped.

SQL>
SQL>

   
  








Related examples in the same category

1.Creating a Public Synonym
2.Creating a Private Synonym
3.drop synonym addresses;
4.drop public synonym;
5.create synonym for a view
6.Create synonyms for dropped tables
7.Viewing synonyms and what they reference.