Question: Assignment 1 0 - 2 : Using theDBMS _ DDLPackageBecause Brewbean s is in the middle of constructing its application and making severaldatabase modifications, the

Assignment 10-2: Using theDBMS_DDLPackageBecause Brewbeans is in the middle of constructing its application and making severaldatabase modifications, the developers are going to build a procedure to recompile all invalidobjects automatically.1. Start SQL Developer, if necessary.2. Type and run the following code:SELECT object_name, statusFROM user_objectsWHERE object_type ='PROCEDURE';3. If you see theBB_JOBTESTprocedure listed with aVALIDstatus onscreen, skip to Step 7.If this procedure doesnt exist, proceed with Step 4.4. Open theassignment02.txtfile in the Chapter10 folder, and use its code to create theBB_JOBTESTprocedure.
5. Type and run the following code:SELECT object_name, statusFROM user_objectsWHERE object_type ='PROCEDURE';6. Verify that the query results listBB_JOBTESTwith aVALIDstatus, which tells you theprocedure exists.7. Type and run the following statement to modify the BB_JOBQ table. Because theBB_JOBTESTprocedure uses this table, the procedure changes to the statusINVALID,indicating the need for recompiling.ALTER TABLE bb_jobqMODIFY (msg VARCHAR2(30));8. Type and run the following query to confirm the statusINVALID:SELECT object_name, statusFROM user_objectsWHERE object_type ='PROCEDURE';9. Create an anonymous block, using DBMS_DDL.ALTER_COMPILE to compile all INVALID objects using an IF THEN ELSE LOOP. To simplify this process, retrieve all the INVALID objects in a cursor. Run the anonymous block.10. Type and run the following query to confirm that these objects status is nowVALID:SELECT object_name, statusFROM user_objectsWHERE object_type ='PROCEDURE';

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!