A public synonym is accessible to every user in a database and owned by a specified group named PUBLIC while a private synonym is stored a specific schema owned by a specific user and available only to that user. Notice that the sales public synonym hides the name of the sales table and its schema lion. Skip to content Home » Oracle Synonym.
Up Next. For example, you rename a table but do not want to affect the current applications that currently use the table. To keep the applications working properly, you can create a synonym that has the name the same as the old name of the table.
Third, synonyms help moving objects between schemas, even databases, without breaking the existing code. Oracle recommends that you specify the schema containing the object in the remote database. If you omit dblink , then Oracle Database assumes the object is located on the local database. Restriction on Database Links You cannot specify dblink for a Java class synonym.
To create a PUBLIC synonym for the employees table in the schema hr on the remote database, you could issue the following statement:. A synonym may have the same name as the underlying object, provided the underlying object is contained in another schema. For example, the schemas oe and s h both contain tables named customers. If the user sh then issues the following statement, then the database returns the count of rows from sh.
To retrieve the count of rows from oe. The user sh must have select permission on oe. If the user hr 's schema does not contain an object named customers , and if hr has select permission on oe. See Also: Oracle Database Concepts for general information on synonyms. Note: Synonyms longer than 30 bytes can be created and dropped.
0コメント