Seeing SYNONYM in the Oracle data dictionary : Synonyms « User Privilege « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE TABLE product (
  2       product_name     VARCHAR2(25) PRIMARY KEY,
  3       product_price    NUMBER(4,2),
  4       quantity_on_hand NUMBER(5,0),
  5       last_stock_date  DATE
  6       );

Table created.

SQL>
SQL> INSERT INTO product VALUES ('Product 1', 99,  1,    '15-JAN-03');

1 row created.

SQL> INSERT INTO product VALUES ('Product 2', 75,  1000, '15-JAN-02');

1 row created.

SQL> INSERT INTO product VALUES ('Product 3', 50,  100,  '15-JAN-03');

1 row created.

SQL> INSERT INTO product VALUES ('Product 4', 25,  10000, null);

1 row created.

SQL> INSERT INTO product VALUES ('Product 5', 9.95,1234, '15-JAN-04');

1 row created.

SQL> INSERT INTO product VALUES ('Product 6', 45,  1,    TO_DATE('December 31, 2008, 11:30 P.M.','Month dd, YYYY, HH:MI P.M.'));

1 row created.

SQL>
SQL>
SQL>
SQL> CREATE PUBLIC SYNONYM product FOR product;

Synonym created.

SQL>
SQL>
SQL> SELECT table_name, SUBSTR(comments, 1, 45) FROM dict WHERE SUBSTR(comments, 1, 7) <> 'Synonym' and rownum < 50;


SQL>
SQL> drop PUBLIC SYNONYM product;

Synonym dropped.

SQL>
SQL> drop table product;

Table dropped.

SQL>








36.8.Synonyms
36.8.1.Synonyms
36.8.2.Public Synonyms
36.8.3.Creating a synonym for a table
36.8.4.Creating a public synonym
36.8.5.create a synonym for a view
36.8.6.Dropping a synonym
36.8.7.Dropping a public synonym
36.8.8.Query a table by selecting its synonym
36.8.9.Seeing SYNONYM in the Oracle data dictionary
36.8.10.Describe a synonym