InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Do Stored Procedures And Functions Within The Same Schema Share The Same Namespace? |
|
Answer» YES, stored PROCEDURES and FUNCTIONS WITHIN the same schema share the same namespace. Yes, stored procedures and functions within the same schema share the same namespace. |
|
| 2. |
Give A Sql Statement So That The Procedure Proc_1 In The Package Pack_sample Is Granted Access To All The Users In The Database ? |
|
Answer» The SQL STATEMENT is GIVEN as FOLLOWS: The SQL statement is given as follows: |
|
| 3. |
Give A Sql Statement To Grant Access On The Procedure Proc_sample In The Schema, Schema_a. |
|
Answer» The SQL STATEMENT is GIVEN as FOLLOWS: The SQL statement is given as follows: |
|
| 4. |
Is It Possible To Create A Package Body And Store It In A Database? |
|
Answer» Yes, it is POSSIBLE to create a PACKAGE body and store it in the DATABASE, ALTHOUGH it would be in an INVALID state and cannot be executed. Yes, it is possible to create a package body and store it in the database, although it would be in an invalid state and cannot be executed. |
|
| 5. |
Give The Sql Statement To Drop The Package Specification For Pack_a Without Dropping The Package Body ? |
|
Answer» It Is not possible to DROP a package specification and leave the package BODY. If the package is DROPPED, the whole package is removed from a DATABASE. It Is not possible to drop a package specification and leave the package body. If the package is dropped, the whole package is removed from a database. |
|
| 6. |
Suppose A Procedure Proc_1 Refers To A Procedure Proc_2 Within The Pack_1 Package. If The Definition Of The Proc_2 Procedure Is Changed And It Is Recompiled Again, Then Does The Proc_1 Procedure Is Invalidated ? |
|
Answer» If the declaration of the proc_2 procedure is not ALTERED in the PACKAGE SPECIFICATION, then the proc_1 procedure is not invalidated. However, if the specification of the procedure is altered, then the DEPENDENT procedure gets the invalid STATUS. If the declaration of the proc_2 procedure is not altered in the package specification, then the proc_1 procedure is not invalidated. However, if the specification of the procedure is altered, then the dependent procedure gets the invalid status. |
|
| 7. |
Explain The Grant And Revoke Dcl Statements ? |
|
Answer» DCL STATEMENTS CONTROL the security of the DATABASE. The two statements, GRANT and REVOKE, are used to give permissions to users to access the DIFFERENT schema objects; therefore, enabling security and access control on the database. DCL statements control the security of the database. The two statements, GRANT and REVOKE, are used to give permissions to users to access the different schema objects; therefore, enabling security and access control on the database. |
|
| 8. |
Which Data Dictionary View Will Give The Owner Name Along With The Privileges On A Schema Object? |
|
Answer» The USER_TABS_PRIVS data DICTIONARY view gives the LIST of SYSTEM and object privileges on the object ALONG with the owner name of the object. The USER_TABS_PRIVS data dictionary view gives the list of system and object privileges on the object along with the owner name of the object. |
|
| 9. |
Which Column In The User_sys_privs View Determines Whether The System Privilege Is With Admin Option ? |
|
Answer» The ADMIN OPTION column in the USER_SYS_PRIVS VIEW is a YES/NO column that INDICATES if the PRIVILEGE was granted WITH ADMIN OPTION. The ADMIN OPTION column in the USER_SYS_PRIVS view is a YES/NO column that indicates if the privilege was granted WITH ADMIN OPTION. |
|
| 10. |
Write A Pl/sql Statement To Show The Privileges On A Procedure Proc_1 Within The Schema A ? |
|
Answer» The STATEMENT is GIVEN as FOLLOWS: The statement is given as follows: |
|
| 11. |
Suppose The Trig_1 Trigger On The Tab_1 Table Exists In The Schema A, And The Schema B Has Privilege To Access The Tab_1 Table. What Additional Privilege Is Required By Schema B To Be Able To Execute The Trig_1 Trigger? |
|
Answer» No ADDITIONAL privilege is required to execute the TRIGGER as the schema B already has ACCESS privilege to the TRIGGERED table, TAB_1. No additional privilege is required to execute the trigger as the schema B already has access privilege to the triggered table, TAB_1. |
|
| 12. |
Which Privilege Is Required To Be Able To Drop A Trigger? |
|
Answer» The CREATE TRIGGER PRIVILEGE is REQUIRED to create, alter, and DROP TRIGGERS in a SCHEMA. The CREATE TRIGGER privilege is required to create, alter, and drop triggers in a schema. |
|
| 13. |
Suppose A Package Pack.a With A Procedure Proc_1 Exists In The Schema Sample_one_schema. If The Schema Sample_two_schema Needs To Be Given Privilege To Execute The Procedure Proc_1, Which Privilege Has To Be Granted ? |
|
Answer» The statement is as FOLLOWS: GRANT EXECUTE ON PACK_A TO SAMPLE_TWO_SCHEMAThe privilege is always granted on the whole PACKAGE and not on the individual procedures or functions. The statement is as follows: The privilege is always granted on the whole package and not on the individual procedures or functions. |
|
| 14. |
Which Data Dictionary View Shows All Directly And Indirectly Granted System Privileges In Effect To A Schema? |
|
Answer» The SESSION_PRIVS data dictionary view shows all the directly and indirectly GRANTED SYSTEM privileges to a SCHEMA. The SESSION_PRIVS data dictionary view shows all the directly and indirectly granted system privileges to a schema. |
|
| 15. |
Which Data Dictionary View Is Used To View Information About All The Privileges That Have Been Made By And To The Current Schema? |
|
Answer» The USER_TAB_PRIVS DATA dictionary VIEW is used to view information about all the privileges that have been MADE by and to the CURRENT SCHEMA. The USER_TAB_PRIVS data dictionary view is used to view information about all the privileges that have been made by and to the current schema. |
|
| 16. |
What Are Indirectly Granted Privileges? |
|
Answer» INDIRECTLY GRANTED privileges are those privileges that have been granted to a role, which in TURN granted to a SCHEMA through a role. Indirectly granted privileges are those privileges that have been granted to a role, which in turn granted to a schema through a role. |
|
| 17. |
Write A Statement To Remove Create Any View Privilege On A Schema Sample_schema ? |
|
Answer» The STATEMENT to REMOVE the CREATE ANY VIEW privilege on the SCHEMA SAMPLE_SCHEMA is as FOLLOWS: The statement to remove the CREATE ANY VIEW privilege on the schema SAMPLE_SCHEMA is as follows: |
|
| 18. |
Which Keyword Is Used To Define The Program Unit As An Invoker Rights Program Unit? |
|
Answer» The KEYWORD AUTHID CURRENT_USER is used to DEFINE a PROGRAM UNIT as an invoker rights program unit. The keyword AUTHID CURRENT_USER is used to define a program unit as an invoker rights program unit. |
|
| 19. |
What Is The Difference Between The Owner Rights Program Unit And The Invoker Rights Program Unit? |
|
Answer» A PROGRAM unit created as an owner rights program unit EXECUTES ACCORDING to the PRIVILEGES that the owner of the program unit have at the time of execution; whereas, a program unit created as an invoker rights program unit executes according to the privileges that the invoker of the program unit have at the time of execution. A program unit created as an owner rights program unit executes according to the privileges that the owner of the program unit have at the time of execution; whereas, a program unit created as an invoker rights program unit executes according to the privileges that the invoker of the program unit have at the time of execution. |
|
| 20. |
Can A Schema A With The Create Any Procedure Privilege Alter Or Modify A Package X In A Schema B? |
|
Answer» No, a schema A with the CREATE ANY PROCEDURE privilege cannot alter or MODIFY a PACKAGE X in the schema B. The schema must have the ALTER ANY PROCEDURE system privilege for ALTERING or MODIFYING any program unit. No, a schema A with the CREATE ANY PROCEDURE privilege cannot alter or modify a package X in the schema B. The schema must have the ALTER ANY PROCEDURE system privilege for altering or modifying any program unit. |
|
| 21. |
What Does Create Any Procedure System Privilege Grant To A Schema? |
|
Answer» The CREATE ANY PROCEDURE SYSTEM privilege ALLOWS the schema to create any package, procedure, or function WITHIN its schema or owned by any other schema. The CREATE ANY PROCEDURE system privilege allows the schema to create any package, procedure, or function within its schema or owned by any other schema. |
|
| 22. |
What Is The Advantage Of Using Roles For System Privilege? |
|
Answer» ROLES are easy to manage and helpful in granting multiple system PRIVILEGES to SCHEMAS. Any privilege can be added to a role or removed from a role. This WOULD AUTOMATICALLY affect all the schemas with that role. Roles are easy to manage and helpful in granting multiple system privileges to schemas. Any privilege can be added to a role or removed from a role. This would automatically affect all the schemas with that role. |
|
| 23. |
Suppose A Schema A Grants The Create Any Trigger With Admin Option Privilege To A Schema B And The Schema B Grants The Create Any Trigger Privilege To A Schema C. If The Schema A Revokes This Privilege On The Schema B, Then Does The Privilege On Schema C Be Revoked As Well? |
|
Answer» No, the PRIVILEGE on the SCHEMA C will not be revoked AUTOMATICALLY; only the privilege on the schema B is revoked. No, the privilege on the schema C will not be revoked automatically; only the privilege on the schema B is revoked. |
|
| 24. |
What Is The Meaning Of Granting System Privilege With Admin Option? |
|
Answer» Granting system privilege WITH ADMIN OPTION MEANS that the schema can in turn GRANT the same privilege to any other schema. Granting system privilege WITH ADMIN OPTION means that the schema can in turn grant the same privilege to any other schema. |
|
| 25. |
What Is The Difference Between The Create Table And Create Any Table Privileges? |
|
Answer» The CREATE TABLE privilege GRANTS the schema to create TABLES in its own schema; however, CREATE ANY TABLE grants the privilege to create any table owned by any other schema as WELL. The CREATE TABLE privilege grants the schema to create tables in its own schema; however, CREATE ANY TABLE grants the privilege to create any table owned by any other schema as well. |
|
| 26. |
What System Privileges Are Required By An End User? |
|
Answer» The END user MAY not require any SYSTEM PRIVILEGE except the CREATE ANY SESSION, which grants them the privilege to log in as an ORACLE user. The end user may not require any system privilege except the CREATE ANY SESSION, which grants them the privilege to log in as an Oracle user. |
|
| 27. |
What Is The Meaning Of Granting A Privilege To Public? |
|
Answer» Granting a privilege to PUBLIC MEANS it is granted to all the SCHEMAS in the DATABASE that ALREADY exist or CREATED in the future. Granting a privilege to PUBLIC means it is granted to all the schemas in the database that already exist or created in the future. |
|
| 28. |
What Is A System Privilege? |
|
Answer» A SYSTEM privilege is the right to PERFORM a PARTICULAR action in the database. Privileges are granted to a schema. They may be granted to a role, which in turn is granted to schemas. A system privilege is the right to perform a particular action in the database. Privileges are granted to a schema. They may be granted to a role, which in turn is granted to schemas. |
|
| 29. |
If The Return Type Of A Remote Function Is Changed And The System Is In The Signature Mode Of The Dependency Checking, Then Does It Cause The Local Procedure To Be Invalidated? |
|
Answer» Yes, the status of the local PROCEDURE will be set to invalid if the RETURN type of the remote FUNCTION is CHANGED because the SIGNATURE of the function is changing. Yes, the status of the local procedure will be set to invalid if the RETURN type of the remote function is changed because the signature of the function is changing. |
|
| 30. |
In The Time-stamped Checking Mode, Which Value Of The Two Program Units Is Compared To Determine The Dependency Checking? |
|
Answer» The LAST_DDL_TIME column of the USER_OBJECTS DATA DICTIONARY VIEW records the last time a SQL statement was issued to change the structure of the objects. This column is compared to determine if the referenced program unit has been changed since the dependent unit was last COMPILED. The LAST_DDL_TIME column of the USER_OBJECTS data dictionary view records the last time a SQL statement was issued to change the structure of the objects. This column is compared to determine if the referenced program unit has been changed since the dependent unit was last compiled. |
|
| 31. |
Why Should Column Names Be Used In The Insert Statements? |
|
Answer» The INSERT statements should have column NAMES so that if any UNRELATED change to the table is made after the program unit is compiled, AUTOMATIC recompilation should SUCCEED. The INSERT statements should have column names so that if any unrelated change to the table is made after the program unit is compiled, automatic recompilation should succeed. |
|
| 32. |
Suppose A Schema A Has The Create Any Trigger Privilege And The Select Privilege On The Table X In The Schema B. Can The Schema A Create A Trigger On The Table X? |
|
Answer» Yes, SCHEMA A can CREATE a TRIGGER on the table X of schema B. Yes, schema A can create a trigger on the table X of schema B. |
|
| 33. |
Suppose A Schema 2 Has Granted Necessary Privileges To The Schema 1 Through Roles. Is It Possible For A Program Unit In The Schema 1 To Refer The Database Objects In The Schema 2 ? |
|
Answer» No, a program unit in the schema 1 cannot reference the database objects in the schema 2, EVEN if the schema 2 has GRANTED necessary privileges to the schema 1 through roles. This is because granting privileges through roles does not work for program units. They can reference other schemp objects only if the necessary PRIVILEGE has been granted directly to the schema. No, a program unit in the schema 1 cannot reference the database objects in the schema 2, even if the schema 2 has granted necessary privileges to the schema 1 through roles. This is because granting privileges through roles does not work for program units. They can reference other schemp objects only if the necessary privilege has been granted directly to the schema. |
|
| 34. |
Can A Table Or Synonym Be Invalidated? |
|
Answer» A table or SYNONYM can NEVER be INVALIDATED; only DEPENDENT OBJECTS are invalidated. A table or synonym can never be invalidated; only dependent objects are invalidated. |
|
| 35. |
Give A Few Guidelines To Minimize The Dependency Failures ? |
|
Answer» A few guidelines that would minimize the dependency failures are as follows:
A few guidelines that would minimize the dependency failures are as follows: |
|
| 36. |
What Happens If A Private Referenced Table Is Dropped, But A Public Table With The Same Name Exists? |
|
Answer» When a private table, which is referenced by a dependent procedure, is DROPPED, the dependent procedure is invalidated. When the procedure is recompiled and a PUBLIC table of the same name EXISTS with all the columns REQUIRED by the procedure, then the procedure will recompile successfully but refer to the public table. When a private table, which is referenced by a dependent procedure, is dropped, the dependent procedure is invalidated. When the procedure is recompiled and a public table of the same name exists with all the columns required by the procedure, then the procedure will recompile successfully but refer to the public table. |
|
| 37. |
What Happens If The Time-stamped Checking Is Used For Dependency Checking Across Remote Databases In Different Time Zones? |
|
Answer» The TIME stamp of the remote procedure and the local procedure will not match and the dependency checking will not be successful. Therefore, while WORKING on remote databases ACROSS time ZONES, signature checking should be used. The time stamp of the remote procedure and the local procedure will not match and the dependency checking will not be successful. Therefore, while working on remote databases across time zones, signature checking should be used. |
|
| 38. |
How Is Signature Checking Better Than The Time-stamped Checking? |
|
Answer» Signature checking eliminates the problem of unnecessary recompilation of the program units ACROSS networks. The signature of the REMOTE procedure is stored in the p-code of the local procedure. In signature checking, the signature of the remote procedure is compared and not the time stamp. If the remote program is MODIFIED and recompiled but its signature does not change, then the local procedure can be executed without any runtime error. Therefore, signature checking does not degrade the SYSTEM performance by repetitive compilation of the local procedure. Signature checking eliminates the problem of unnecessary recompilation of the program units across networks. The signature of the remote procedure is stored in the p-code of the local procedure. In signature checking, the signature of the remote procedure is compared and not the time stamp. If the remote program is modified and recompiled but its signature does not change, then the local procedure can be executed without any runtime error. Therefore, signature checking does not degrade the system performance by repetitive compilation of the local procedure. |
|
| 39. |
What Is The Disadvantage Of Time-stamped Checking? |
|
Answer» The disadvantage of time-stamped checking is that it CAUSES UNNECESSARY recompilation of the dependent objects ACROSS networks when it MAY not be required, leading to the degradation of SYSTEM performance. The disadvantage of time-stamped checking is that it causes unnecessary recompilation of the dependent objects across networks when it may not be required, leading to the degradation of system performance. |
|
| 40. |
What Is The Meaning Of Signature Of A Procedure? |
|
Answer» The signature of a procedure refers to:
The signature of a procedure refers to: |
|
| 41. |
What Parameter Is Used To Determine Whether The Mode Of Checking For The Management Of Remote Dependencies Is Time-stamped Or Signature Checking? |
|
Answer» The parameter used to DETERMINE if the mode of CHECKING for the management of remote dependencies is time-stamped or SIGNATURE checking is set in the init.ora parameter file as REMOTE_DEPENDENCIES_MODE = value, where value can be TIMESTAMP or SIGNATURE. The parameter used to determine if the mode of checking for the management of remote dependencies is time-stamped or signature checking is set in the init.ora parameter file as REMOTE_DEPENDENCIES_MODE = value, where value can be TIMESTAMP or SIGNATURE. |
|
| 42. |
How Is Time-stamped Checking Used For The Management Of Remote Dependencies? |
|
Answer» Time-stamped checking is based on the fact that every program unit CARRIES a time STAMP, which is set when it is CREATED or recompiled. Whenever a program unit or a schema object is altered, all its dependent units are invalidated and must be recompiled before they can be executed. The time stamp is recorded in the p-code of the procedure. Time-stamped checking is based on the fact that every program unit carries a time stamp, which is set when it is created or recompiled. Whenever a program unit or a schema object is altered, all its dependent units are invalidated and must be recompiled before they can be executed. The time stamp is recorded in the p-code of the procedure. |
|
| 43. |
Does A Change To A Remote Procedure Automatically Change The Status Of Dependent Objects In Local Database To Invalid? |
|
Answer» No, a change to a remote procedure does not automatically change the STATUS of DEPENDENT objects in local DATABASE to INVALID. No, a change to a remote procedure does not automatically change the status of dependent objects in local database to invalid. |
|
| 44. |
How Does Oracle Manage Dependencies Across Remote Databases On Distributed Networks? |
|
Answer» Oracle does not manage dependencies across remote schema objects on DISTRIBUTED NETWORKS other than local-procedure-to- remote procedure dependencies. It only manages dependencies among stored procedures (procedures, functions, and PACKAGES) using time-stamped checking or signature checking. If there is a local VIEW BASED on a remote table, and the remote table definition is altered, the local view is not invalidated. Oracle does not manage dependencies across remote schema objects on distributed networks other than local-procedure-to- remote procedure dependencies. It only manages dependencies among stored procedures (procedures, functions, and packages) using time-stamped checking or signature checking. If there is a local view based on a remote table, and the remote table definition is altered, the local view is not invalidated. |
|
| 45. |
What Is The Advantage Of Referring Tables Indirectly Using Views? |
|
Answer» REFERENCING tables indirectly using views ALLOWS:
Referencing tables indirectly using views allows: |
|
| 46. |
Is A View Invalidated When A New Column Is Added To The Table It References? |
|
Answer» No, a VIEW is not INVALIDATED if a NEW column is added to the table it REFERENCES. No, a view is not invalidated if a new column is added to the table it references. |
|
| 47. |
What Is The Effect On The Dependent Object When A Package Body Is Modified? |
|
Answer» When a PACKAGE body is MODIFIED, there is no CHANGE in the DEPENDENT objects. When a package body is modified, there is no change in the dependent objects. |
|
| 48. |
Which View Is Used To Track The Security Dependencies? |
|
Answer» The SECURITY DEPENDENCIES can be TRACKED USING the USER_TAB_PRIVS data dictionary view. The security dependencies can be tracked using the USER_TAB_PRIVS data dictionary view. |
|
| 49. |
What Information Is Stored In The Ideptree View? |
|
Answer» The IDEPTREE view has the HIERARCHICAL information of the DEPENDENCY tree in a single column called DEPENDENCIES. This column stores a single string of information SHOWING the DEPENDENT objects indented as per the hierarchy. The IDEPTREE view has the hierarchical information of the dependency tree in a single column called DEPENDENCIES. This column stores a single string of information showing the dependent objects indented as per the hierarchy. |
|
| 50. |
Which Procedure Has To Be Executed Before Using The Ideptree View? |
|
Answer» The DEPTREE_FILL PROCEDURE needs to be executed before the IDEPTREE VIEW can be USED. The DEPTREE_FILL procedure needs to be executed before the IDEPTREE view can be used. |
|