{"id":191870,"date":"2013-09-02T19:05:02","date_gmt":"2013-09-02T15:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=191870"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=191870","title":{"rendered":"<span class=\"post_title\">\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u0411\u0414 Oracle \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0434\u043b\u044f \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043d\u0443\u0436\u0434 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 OS \u0438\u0437 pl\/sql \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 sql \u0432\u043d\u0443\u0442\u0440\u0438 Oracle Database. <br \/>  \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. <br \/>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432 11.2 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u00ab\u041f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u00bb. <br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b:   <\/p>\n<ul>\n<li>Directory \u2014 \u0432 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u0430 \u0438 \u043d\u0430 \u043d\u0435\u0451 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/li>\n<li>external organization table \u2014 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/li>\n<li>script \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 OS <\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"sql\">-- directory create or replace directory UTIL_DIR as '\/u01' \/ -- table CREATE TABLE T_OS_COMMAND  (  v_line varchar2(4000)  )  ORGANIZATION external  ( TYPE oracle_loader  DEFAULT DIRECTORY UTIL_DIR  ACCESS PARAMETERS  ( RECORDS DELIMITED BY NEWLINE  preprocessor UTIL_DIR:'os_command.sh'  FIELDS TERMINATED BY &quot;\\n&quot; LDRTRIM  )  location ( 'os_command.sh')  ) \/ <\/code><\/pre>\n<p>  \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e directory \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u0435\u0439 \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u043b\u0443\u0447\u0448\u0435 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c.<br \/>  \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 (\u0445\u043e\u0442\u044c \u0438 \u0432 \u0441\u0445\u0435\u043c\u0435 SYS) \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a OS, \u0430 \u0441\u0430\u043c\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u043d\u0438\u043a\u043e\u0433\u043e \u043a \u043d\u0435\u0439 \u043d\u0435 \u043f\u043e\u0434\u043f\u0443\u0441\u043a\u0430\u0442\u044c.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a UTIL_DIR \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u044e\u0442\u0441\u044f, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 select \u0438\u0437 T_OS_COMMAND.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 OS (\u0434\u0430 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 OS \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0432 \u043a \u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ssh):  <\/p>\n<pre><code class=\"bash\">$touch \/u01\/os_command.sh $chmod ug+x \/u01\/os_command.sh <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043b\u0438\u0431\u043e \u0447\u043b\u0435\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b) \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0411\u0414.<\/p>\n<p>  \u0412\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b OS \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0451 \u0432 \u0444\u0430\u0439\u043b os_command.sh \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 T_OS_COMMAND.  <\/p>\n<pre><code class=\"sql\">declare   F1 UTL_FILE.FILE_TYPE; begin   F1 := UTL_FILE.FOPEN('UTIL_DIR','os_command.sh','W', 4048);    UTL_FILE.PUT_LINE (file =&gt; F1, buffer =&gt; '#!\/bin\/sh');   UTL_FILE.PUT_LINE (file =&gt; F1, buffer =&gt; 'export LANG=en_US.UTF-8');   UTL_FILE.PUT_LINE (file =&gt; F1, buffer =&gt; 'export PATH=$PATH:\/bin');   UTL_FILE.PUT_LINE (file =&gt; F1, buffer =&gt; 'df -k | grep \/');   UTL_FILE.fclose (file =&gt; F1); end; \/ <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 T_OS_COMMAND  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432 OS \u043a\u043e\u043c\u0430\u043d\u0434\u044b df -k | grep \/ \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">\/dev\/sda2             32414672  14870956  15870548  49% \/ \/dev\/sda1               124427     18001    100002  16% \/boot tmpfs                  8219820    184808   8035012   3% \/dev\/shm \/dev\/sdb2            961432104 606013444 306580660  67% \/u02 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 SELECT * FROM T_OS_COMMAND<\/b><\/p>\n<div class=\"spoiler_text\">\n<table>\n<tr>\n<th>V_LINE<\/th>\n<\/tr>\n<tr>\n<td>\n<pre>\/dev\/sda2             32414672  14871076  15870428  49% \/<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<pre>\/dev\/sda1               124427     18001    100002  16% \/boot<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<pre>tmpfs                  8219820    184808   8035012   3% \/dev\/shm<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<pre>\/dev\/sdb2            961432104 606013444 306580660  67% \/u02<\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 OS.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/giam777\/Utility\/blob\/master\/P_SYS_UTILITY.pck\">P_SYS_UTILITY<\/a>. \u041f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043f\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e \u0438 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043e\u043d\u043e\u043c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">create or replace package P_SYS_UTILITY is    -- Author  : ALEXEY   -- Created : 23.08.2013   -- Purpose : Get system info (*nix versions)  \/* Get on file or folder name its device or ASM group and used\/free space on it   * raw devices not supported *\/ procedure Get_Disk_Usage ( p_file_name  in varchar2, -- file name (also accept only path)                            o_mount_dev  out nocopy varchar2, -- device or ASM group                            o_used_space out number, -- used space                            o_free_space out number); -- free space   -- Collect space USAGE in BD -- Recomended evry day schedule run procedure Collect_Usage;  -- Get Forecast on space usage -- Recomended base from 10 collects function Get_Forecast ( pDT         in date, -- date for forecast                         pBASE       in integer default 188, -- base days in calculate forecast                         pTYPE_F     in varchar2 default 'SLOPE', -- type forecast: SLOPE | AVG                         pTABLESPACE in varchar2 default null, -- tablespace ( null = all )                         pOWNER      in varchar2 default null, -- user ( null = all )                         pTYPE       in varchar2 default null )  -- segment type ( null = all ), allow like          return number; -- size in bytes on date pDT  -- Get score of space usage and availability -- Can be used in external monitoring tool : Nagios, etc function Get_Space_Status ( pFOREDAYS   in number default 60,  -- days after that                             pFREE_PRCNT in number default 25 ) -- free cpace greater than          return number; -- 0 - Space free enough .. 100 - not enough free space  end P_SYS_UTILITY; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 Get_Disk_Usage<\/h3>\n<p>  <b>p_file_name<\/b> \u2014 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u043c\u0435\u0441\u0442\u043e\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e(-\u043e\u0439) \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d \u0440\u0430\u0441\u0447\u0435\u0442. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a ASM disk groups.<br \/>  <b>o_mount_dev<\/b> \u2014 \u0438\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b df. \u0414\u043b\u044f ASM \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u0438\u043c\u044f disk group.<br \/>  <b>o_used_space<\/b> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\/diskgroup<br \/>  <b>o_free_space<\/b> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\/diskgroup<br \/>  \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 df \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430, \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a v$asm_diskgroup \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043d\u0430 &quot;<b>+<\/b>&quot;.<\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 Collect_Usage<\/h3>\n<p>  \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0441\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414. \u0413\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c, \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430\u043c \u0438 \u0442\u0438\u043f\u0430\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0435 \u0431\u0435\u0440\u0435\u0442 \u0432 \u0443\u0447\u0435\u0442 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 undo \u0438 temp. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 T_SPACE_USAGE. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 T_SPACE_USAGE<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">create table T_SPACE_USAGE (   dt$ date,   owner$ varchar2(30),   tablespace$ varchar2(30),   type$ varchar2(18),   bytes$ number,   blocks$ number); create index INDX_T_SPACE_USAGE_DT on T_SPACE_USAGE (dt$); comment on table T_SPACE_USAGE is 'Store archive data of usage space in RDBMS'; comment on column T_SPACE_USAGE.DT$ is 'Date collect space usage'; comment on column T_SPACE_USAGE.OWNER$ is 'Segment owner - user in BD'; comment on column T_SPACE_USAGE.TABLESPACE$ is 'Name of tablespace in BD'; comment on column T_SPACE_USAGE.TYPE$ is 'Segment type'; comment on column T_SPACE_USAGE.BYTES$ is 'Size in bytes'; comment on column T_SPACE_USAGE.BLOCKS$ is 'Size in blocks'; <\/code><\/pre>\n<\/div>\n<\/div>\n<h3>\u041c\u0435\u0442\u043e\u0434 Get_Forecast<\/h3>\n<p>  <b>pDT<\/b> \u2014 \u0434\u0430\u0442\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u0441\u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440<br \/>  <b>pBASE<\/b> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439, \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0439\u0434\u0443\u0442 \u0432 \u0431\u0430\u0437\u0443 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437<br \/>  <b>pTYPE_F<\/b> \u2014 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043b\u0438\u0431\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f (\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439) \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438, \u043b\u0438\u0431\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<br \/>  <b>pTABLESPACE<\/b> \u2014 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e \u043f\u043e \u0432\u0441\u0435\u043c<br \/>  <b>pOWNER<\/b> \u2014 \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0441\u0445\u0435\u043c\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e \u043f\u043e \u0432\u0441\u0435\u043c<br \/>  <b>pTYPE<\/b> \u2014 \u0442\u0438\u043f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e \u043f\u043e \u0432\u0441\u0435\u043c<br \/>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u0430\u0441\u0447\u0435\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 Get_Space_Status<\/h3>\n<p>  <b>pFOREDAYS<\/b> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043d\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430<br \/>  <b>pFREE_PRCNT<\/b> \u2014 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 (\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u0430\u043d\u044f\u0442\u043e\u0433\u043e)<br \/>  \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0446\u0435\u043d\u043a\u0443 \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u043e\u0442 0 \u0434\u043e 100 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u043e\u0441\u0442\u0430 \u0411\u0414 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u043e\u0441\u0442 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043f\u043e\u0440\u043e\u0433\u043e\u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <b>ps.<\/b>\u0438 \u0434\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043c\u044b \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u0435\u0448\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/191870\/\"> http:\/\/habrahabr.ru\/post\/191870\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0434\u043b\u044f \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u043d\u0443\u0436\u0434 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 OS \u0438\u0437 pl\/sql \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 sql \u0432\u043d\u0443\u0442\u0440\u0438 Oracle Database. <br \/>  \u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. <br \/>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432 11.2 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u00ab\u041f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u00bb.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-191870","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/191870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=191870"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/191870\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}