1. 程式人生 > >OCP-1Z0-051-V9.02-51題

OCP-1Z0-051-V9.02-51題

51. Which statement is true regarding synonyms? A. Synonyms can be created only   for a table.  不只是表,schema object B. Synonyms are used to reference only those tables that are owned by another user. C. A public synonym and a private synonym can exist with the same name for the same table. 共有和私有可以共同存在 D. The DROP SYNONYM statement removes the synonym, and the table on which the synonym has been created becomes invalid. Answer: C 答案解析: A錯誤,不只是表,是資料庫所有的物件,如表、檢視、序列、過程等。 B錯誤,由資料庫管理員建立的公共的同義詞,可以所有的使用者都可以訪問,而由使用者自己建立的同義詞,只能自己訪問。 C正確,共有同義詞和私有同義詞的名字在一張表中可以相同。 實驗驗證: [email protected]> create public synonym semp for scott.emp; Synonym created. [email protected]> conn scott/tiger Connected. [email protected]> create synonym semp for emp;-------------必須有建立同義詞許可權,否則報錯
create synonym semp for emp * ERROR at line 1: ORA-01031: insufficient privileges [email protected]> conn /as sysdba Connected. [email protected]> grant CREATE synonym to scott;-------------賦予建立同義詞許可權 Grant succeeded. [email protected]> conn scott/tiger Connected. [email protected]
> create synonym semp for emp;------------建立一個和共有同義詞的一樣名稱的同義詞,執行成功。
Synonym created. D錯誤,刪除了同義詞,但是表不會被變為無效的。