{"id":12781,"date":"2024-01-05T08:27:53","date_gmt":"2024-01-05T07:27:53","guid":{"rendered":"https:\/\/roglacup.com\/klaus62\/?p=12781"},"modified":"2024-01-05T14:31:24","modified_gmt":"2024-01-05T13:31:24","slug":"data-dictionary-storage","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2024\/01\/05\/data-dictionary-storage\/","title":{"rendered":"Data Dictionary Storage"},"content":{"rendered":"\n<p>Views: <strong>User_Objects, User_source, User_Errors, User_Object_size, User_Dependicies<\/strong><\/p>\n\n\n\n<p><strong>&#8211;Query the User_Objects view for all procedures and functions<\/strong><br>SELECT object_name, status<br>FROM user_objects<br>WHERE object_type IN(&#8216;PROCEDURE&#8217;, &#8216;FUNCTION&#8217;);<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"251\" height=\"111\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image.png\" alt=\"\" class=\"wp-image-12787\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>&#8212;<strong>Determine which objects have source code<\/strong><br>SELECT DISTINCT name, type<br>FROM user_source;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"254\" height=\"107\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-1.png\" alt=\"\" class=\"wp-image-12793\"\/><\/figure>\n\n\n\n<p><strong>&#8211;Retrieve the code for the raise_salary procedure<\/strong><br>SELECT text<br>FROM user_source<br>WHERE name = &#8216;RAISE_SALARY&#8217;<br>ORDER BY line;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"223\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-2.png\" alt=\"\" class=\"wp-image-12794\" srcset=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-2.png 574w, https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-2-300x117.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/figure>\n\n\n\n<p><strong>&#8211;Execute a query retrieving all errors for the Error_Salary procedure<\/strong><br>SELECT line, text, attribute, message_number<br>FROM user_errors<br>WHERE name = &#8216;ERROR_SALARY&#8217;<br>ORDER BY line;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"166\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-3.png\" alt=\"\" class=\"wp-image-12795\" srcset=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-3.png 726w, https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-3-300x69.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure>\n\n\n\n<p><strong>&#8211;Query the user_object_size to ascertain storage information for our objects.<\/strong><br>SELECT *<br>FROM user_object_size<br>WHERE type IN(&#8216;PROCEDURE&#8217;, &#8216;FUNCTION&#8217;);<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"597\" height=\"103\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-4.png\" alt=\"\" class=\"wp-image-12797\" srcset=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-4.png 597w, https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-4-300x52.png 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/figure>\n\n\n\n<p><strong>&#8211;Query the USER_DEPENDENCIES to find the dependency information on the<br>&#8211;SALARY_VALID procedure<\/strong><br><\/p>\n\n\n\n<p>SELECT referenced_name, referenced_type<br>FROM user_dependencies<br>WHERE name = &#8216;SALARY_VALID&#8217;;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"125\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-5.png\" alt=\"\" class=\"wp-image-12799\" srcset=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-5.png 370w, https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-5-300x101.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Dependency Tracking Utility SETUP &#8211; utldtree.sql<\/strong><\/p>\n\n\n\n<p><strong>DEPTREE_FILL()<\/strong> &#8211; fills IDEPTREE table<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Package<\/strong><\/p>\n\n\n\n<p>Oracle Packages are database objects that are unique to the Oracle DBMS. They are containers that group logically-related objects into a single definition. Packages have two parts &#8211; a specification and a body. The:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Specification section declares the various components<\/li>\n\n\n\n<li>Body section provides the full definitions of the components<\/li>\n<\/ul>\n\n\n\n<p>The Package components can consist of Types, Variables, Constants, Exceptions, Cursors and subprograms.<\/p>\n\n\n\n<p><strong>Specifications<\/strong><\/p>\n\n\n\n<p>CREATE OR REPLACE PACKAGE personnel AS<\/p>\n\n\n\n<p>&#8211;Define hire_employee procedure<br>PROCEDURE hire_employee<br>( input_ssn IN employee.ssn%TYPE,<br>first_name IN employee.fname%TYPE,<br>last_name IN employee.lname%TYPE,<br>department_name IN department.dname%TYPE,<br>input_salary IN employee.salary%TYPE);<\/p>\n\n\n\n<p>&#8211;Define procedure to fire employees<br>PROCEDURE fire_employee (input_ssn IN employee.ssn%TYPE);<\/p>\n\n\n\n<p>&#8211;Define procedure to transfer employees to different department<br>PROCEDURE transfer_employee<br>( input_ssn IN employee.ssn%TYPE,<br>new_department_number IN department.dnumber%TYPE);<\/p>\n\n\n\n<p>&#8211;Define procedure to test salary increases<br>PROCEDURE raise_salary_valid<br>(employee_ssn IN CHAR,<br>employee_pct IN NUMBER DEFAULT 5,<br>result_message OUT CHAR);<\/p>\n\n\n\n<p>END personnel;<\/p>\n\n\n\n<p><strong>Body<\/strong><\/p>\n\n\n\n<p>CREATE OR REPLACE PACKAGE BODY Personnel AS<\/p>\n\n\n\n<p>&#8230;.<\/p>\n\n\n\n<p>&#8230;..<\/p>\n\n\n\n<p>END Personnel;<\/p>\n\n\n\n<p>SELECT object_name, object_type, status<br>FROM user_objects<br>WHERE object_type IN (&#8216;PACKAGE&#8217;, &#8216;PACKAGE BODY&#8217;);<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"298\" height=\"69\" src=\"https:\/\/roglacup.com\/klaus62\/wp-content\/uploads\/2024\/01\/image-7.png\" alt=\"\" class=\"wp-image-12803\"\/><\/figure>\n\n\n<p>[the_ad id=&#8217;12166&#8242;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Views: User_Objects, User_source, User_Errors, User_Object_size, User_Dependicies &#8211;Query the User_Objects view for all procedures and functionsSELECT object_name, statusFROM user_objectsWHERE object_type IN(&#8216;PROCEDURE&#8217;, &#8216;FUNCTION&#8217;); &#8212;Determine which objects have source codeSELECT DISTINCT name, typeFROM user_source; &#8211;Retrieve the code for the raise_salary procedureSELECT textFROM user_sourceWHERE name = &#8216;RAISE_SALARY&#8217;ORDER BY line; &#8211;Execute a query retrieving all errors for the Error_Salary procedureSELECT&hellip;&nbsp;<a href=\"https:\/\/roglacup.com\/klaus62\/2024\/01\/05\/data-dictionary-storage\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Data Dictionary Storage<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":12788,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[884,35],"tags":[],"class_list":["post-12781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-oracle"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/12781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=12781"}],"version-history":[{"count":5,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/12781\/revisions"}],"predecessor-version":[{"id":12804,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/12781\/revisions\/12804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media\/12788"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=12781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=12781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=12781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}