수동 DB생성시 catproc.sql 실행중에 OWA_UTIL에서 오류가 납니다. 0 0 2,314

by 김대청 [2007.01.08 13:52:20]


오류가 나는 부분은 다음부분입니다.

수동으로 DB를 생성하고, 

인스톨가이드를 참고해, catalog.sql 과 catproc.sql 는 실행하여야 한다고 해서,

실행을 했는데, catalog.sql은 성공적으로 수행하고, catproc.sql 실행시 오류가 나네요.

오라클 설치시에 설치 안한 것이 있는 것인가요?

어떻게 해결해야할까요?

====================================================================================

SQL>
SQL> Rem
SQL> Rem OWA_UTIL might already exist in DB.
SQL> Rem If so, recompile its spec and body.
SQL> Rem Ignore errors if any.
SQL> Rem
SQL> alter package owa_util compile;
alter package owa_util compile
*
1행에 오류:
ORA-04043: 객체 OWA_UTIL가 존재하지 않습니다


SQL> alter package owa_util compile body;
alter package owa_util compile body
*
1행에 오류:
ORA-04043: 객체 OWA_UTIL가 존재하지 않습니다


SQL>
SQL> DECLARE
  2    /*
  3   * This next line must be updated whenever
  4   * OWA_UTIL.version is updated.
  5   */
  6    shipped_owa_version    VARCHAR2(80) := '3.0.0.0.4';
  7    installed_owa_version  VARCHAR2(80);
  8    new_line        VARCHAR2(4)  := '
  9  ';
 10 
 11   --
 12   -- takes a string of the form 'num1.num2.num3.....'
 13   -- returns "num1" AND updates string to 'num2.num3...'
 14   --
 15   FUNCTION get_next_int_and_advance(str IN OUT NOCOPY varchar2)
 16      RETURN PLS_INTEGER is
 17    loc pls_integer;
 18    ans pls_integer;
 19   BEGIN
 20    loc := instr(str, '.', 1);
 21    if (loc > 0) then
 22   ans := to_number(substr(str, 1, loc - 1));
 23   str := substr(str, loc + 1, length(str) - loc);
 24    else
 25   ans := to_number(str);
 26   str := '';
 27    end if;
 28    return ans;
 29   END;
 30 
 31    --
 32    -- If shipped version of OWA packages is higher than the
 33    -- pre-installed version of the OWA packages, then
 34    -- we need to reinstall the OWA packages.
 35    --
 36    FUNCTION needs_reinstall(shipped_owa_version   IN VARCHAR2,
 37      installed_owa_version IN VARCHAR2)
 38        RETURN BOOLEAN is
 39 
 40     shp_str VARCHAR2(80) := shipped_owa_version;
 41     shp_vsn PLS_INTEGER;
 42     ins_str VARCHAR2(80) := installed_owa_version;
 43     ins_vsn PLS_INTEGER;
 44 
 45    BEGIN
 46    --
 47    -- either OWA pkgs are not already installed (as can happen
 48    -- with a new DB) or an older version of the pkg is installed
 49    -- where version numbering was not implemented.
 50    --
 51    IF (installed_owa_version is NULL) THEN
 52      return TRUE;
 53    END IF;
 54 
 55    --
 56    -- Even though versions are same, lets reload+compile perhaps
 57    -- to pick up some code-gen changes/optimizations. Also, during
 58    -- development labels we may NOT  bump up the version
 59    -- for every label, but might have made changes to the
 60    -- implementation.
 61    --
 62    IF (installed_owa_version = shipped_owa_version) THEN
 63      return TRUE;
 64    END IF;
 65 
 66    --
 67    -- Check if shipped version is higher.
 68    --
 69    -- The OWA_UTIL version number format is V1.V2.V3.V4.V5.
 70    -- Lets compare versions by comparing Vi's from left to right.
 71    --
 72    FOR i in 1..5 LOOP
 73 
 74     -- parse "shipped_version" one int at a time, from L to R
 75     shp_vsn := get_next_int_and_advance(shp_str);
 76 
 77     -- parse "installed_version" one int at a time, from L to R
 78     ins_vsn := get_next_int_and_advance(ins_str);
 79 
 80     IF (shp_vsn > ins_vsn) THEN
 81       return TRUE;
 82     ELSIF (shp_vsn < ins_vsn) THEN
 83       return FALSE;
 84     END IF;
 85 
 86    END LOOP;
 87 
 88    --
 89    -- Should never come here. Return TRUE in this case as well.
 90    --
 91    RETURN TRUE;
 92    END;
 93 
 94    FUNCTION get_installed_owa_version RETURN VARCHAR2 IS
 95    installed_owa_version VARCHAR2(80);
 96    BEGIN
 97    --
 98    -- Run this block via dynamic SQL and not static SQL
 99    -- because compilation of this block could fail as OWA_UTIL
100    -- might be non-existant. Doing it from dynamic SQL allows
101    -- us to catch the compile error as a run-time exception
102    -- and proceed.
103    --
104    EXECUTE IMMEDIATE 'begin :version := OWA_UTIL.get_version; end;'
105         USING OUT installed_owa_version;
106 
107    return installed_owa_version;
108 
109    EXCEPTION
110    --
111    -- Either OWA pkgs have not been preinstalled or
112    -- they are older set of OWA pkgs which did not
113    -- implement the OWA_UTIL.get_version method
114    --
115    WHEN OTHERS THEN
116      return NULL;
117    END;
118 
119  BEGIN
120 
121   installed_owa_version := get_installed_owa_version;
122   :owa_dbg_msg := 'installed OWA version is: ' || installed_owa_version || ';' ||
123           new_line ||
124           'Shipped OWA version is: ' || shipped_owa_version || ';';
125 
126   if (needs_reinstall(shipped_owa_version, installed_owa_version)) then
127   :owa_dbg_msg := :owa_dbg_msg || new_line ||
128     'OWA pkgs will be reinstalled;';
129   :owa_file_name := 'owacomm.sql';
130   else
131   :owa_dbg_msg := :owa_dbg_msg || new_line ||
132     'OWA pkgs will be not be reinstalled;';
133   :owa_file_name := 'owadummy.sql';
134   end if;
135 
136  end;
137  /

PL/SQL 처리가 정상적으로 완료되었습니다.

SQL>
SQL> print :owa_dbg_msg;

OWA_DBG_MSG                                                                    
--------------------------------------------------------------------------------
installed OWA version is: ;                                                    
Shipped OWA version is: 3.0.0.0.4;                                             
OWA pkgs will be reinstalled;                                                  
                                                                               

SQL> print :owa_file_name;

OWA_FILE_NAME                                                                  
--------------------------------------------------------------------------------
owacomm.sql                                                                    

SQL>
SQL> COLUMN :owa_file_name NEW_VALUE owa_file_var NOPRINT;
SQL> SELECT :owa_file_name FROM DUAL;

                                                                               
                                                                               

SQL>
SQL> @@&owa_file_var;

 

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입