Analysis of OCP question _ 007: Synonym

Source: Internet
Author: User

Analysis of OCP question _ 007: synonym synonyms are the alias of the base table. They are defined only in the data dictionary. They do not store synonyms. They provide location transparency for distributed databases. Accessing resources in different regions is just like accessing local resources. www.2cto.com (I) Syntax:

Private synonyms without public are the synonyms created by common users. They are private, this is because only the user who creates this synonym can use this synonym, while the Public synonym is created by the database administrator. Of course, public synonyms allow all users to use www.2cto.com. To create a synonym for a table on a remote Database, you must first create a Database Link, then, use @ DB_Link_name. When the same name appears, the priority is as follows: Private synonym> Public synonym base table> Public synonym has the same name object and public synonym, when the database preferentially selects an object as the target to have private and public objects with the same name, the database preferentially selects private synonyms as the destination base table and private synonyms cannot have the same name; otherwise, a ORA-00955 error is reported. (2) operation on the synonym ① view synonym [SQL] sys @ ORCL> select table_name from dict where table_name like' % SYNONY M % '; TABLE_NAME ------------------------------ DBA_SYNONYMS USER_SYNONYMS ALL_SYNONYMS ② Delete synonym drop [PUBLIC] SYNONYM [schema.] SYNONYM name [FORCE]; drop synonym SYSN_TEST; drop public synonym PUBLIC_TEST; -- when the original object of the SYNONYM is deleted, the SYNONYM is not deleted. ③ the compiled synonym alter synonym t compile; -- when the original object of the synonym is re-created, after the synonym needs to be re-compiled to perform DDL operations on the original object, the synonym state will change to INVALID. When this synonym is referenced again, synonyms are automatically compiled, and the status changes to VALID without manual intervention. Of course, the premise is that the name of the original object is not changed. (3) The permission management for synonyms has the CREATE SYNONYM, create any synonym, and create public synonym permissions ① you must have the create synonym permission to CREATE a private SYNONYM in your own mode, otherwise, you cannot create a private synonym. ② If you need to create a synonym in other modes, you must have the create any synonym permission. ③ CREATE a public synonym. You must have the create public synonym system permission. (4) OCP question [SQL] Q: 16 Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, deployments, and LOCATIONS tables. she granted SELECT privilege to Scott on this view. which option enables S Cott to eliminate the need to qualify the view with the name MARY. EMP_DEPT_LOC_VU each time the view is referenced? A. scott can create a synonym for the EMP_DEPT_LOC_VU by using the command create private synonym EDL_VU FOR mary. EMP_DEPT_LOC_VU; then he can prefix the columns with this synonym. b. scott can create a synonym for the EMP_DEPT_LOC_VU by using the command create synonym EDL_VU FOR mary. EMP_DEPT_LOC_VU; then he can prefix the columns with this synonym. c. scott can create a synonym for the EMP_DEPT_LOC_VU by using the command create local synonym EDL_VU FOR mary. EMP_DEPT_LOC_VU; then he can prefix the columns with this synonym. d. scott can create a synonym for the EMP_DEPT_LOC_VU by using the command create synonym EDL_VU ON mary (EMP_DEPT_LOC_VU); then he can prefix the columns with this synonym. e. scott cannot create a synonym because synonyms can be created only for tables. f. scott cannot create any synonym for Mary's view. mary shoshould create a private synonym for the view and grant SELECT privilege on that synonym to Scott. answer: B

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.