Exforsys.com
 
Home Tutorials Oracle 10g
 

Oracle 10g Free Training - Synonyms

 

Oracle 10g Free Training - Synonyms - Page 2

Page 2 of 2

.


.



INSERT INTO Emp_tab (Empno, Ename, Job)
VALUES (Emp_sequence.NEXTVAL, 'SMITH', 'CLERK');



 


 


 


 


 


The image cannot be displayed, because it contains errors.


Figure 30. Inserting in a table using a synonym (Emp_tab).


If the synonym named fire_emp refers to a standalone procedure or package procedure, then you could execute it with the command


EXECUTE Fire_emp(7344);


Dropping Synonyms

You can drop any private synonym in your own schema. To drop a private synonym in another user's schema, you must have the DROP ANY SYNONYM system privilege. To drop a public synonym, you must have the DROP PUBLIC SYNONYM system privilege.


Drop a synonym that is no longer required using DROP SYNONYM statement. To drop a private synonym, omit the PUBLIC keyword. To drop a public synonym, include the PUBLIC keyword.


For example, the following statement drops the private synonym named emp:


DROP SYNONYM emp;


The image cannot be displayed, because it contains errors.


Figure 31. Dropping a synonym.


The following statement drops the public synonym named public_emp:


DROP PUBLIC SYNONYM public_emp;


The image cannot be displayed, because it contains errors.


Figure 32. Dropping a public synonym.


When you drop a synonym, its definition is removed from the data dictionary. All objects that reference a dropped synonym remain. However, they become invalid (not usable).


Viewing Information About Views, Synonyms, and Sequences

The following views display information about views, synonyms, and sequences:


View
Description
DBA_VIEWS
ALL_VIEWS
USER_VIEWS
DBA view describes all views in the database. ALL view is restricted to views accessible to the current user. USER view is restricted to views owned by the current user.
DBA_SYNONYMS
ALL_SYNONYMS
USER_SYNONYMS
These views describe synonyms.
DBA_SEQUENCES
ALL_SEQUENCES
USER_SEQUENCES
These views describe sequences.
DBA_UPDATABLE_COLUMNS
ALL_UPDATABLE_COLUMNS
USER_UPDATABLE_COLUMNS
These views describe all columns in join views that are updatable.




First Page: Oracle 10g Free Training - Synonyms


Read Next: Oracle 10g Free Training - Manipulating data through SQL



 

 

Comments


Medhatithi said:

  I have a userID/Password in oracle. This user has a number of privileges in other schema objects also. Now, if I have sufficient privileges, I will be able to view other schema objects also from my schema. In that case, I have to write schema_name.object_name in my query. But from my schema I am being able to view a table which is not in my schema, but in some other schema. I am not even giving the schema_name before the table name. How is this possible? An option is that this is a synonym. But I’ve checked out the all_synonyms view and its name is not there in the list. Please explain. I’m totally confused.



Also, I deleted one row from the table/synonym without giving its schema name. The deletion is reflected in the table present in the other schema also. Are these two tables same? Then why I am not to give the schema name? If this is a synonym, then why it is not present in all_synonyms view?
December 13, 2006, 4:16 am

vikram S. said:

  I think, you have given the 'sys' level privileges to user.please check your user privileges

Thanks and Regards
Vikram S.
September 15, 2009, 2:28 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape