Recently there was a requirement to import two prod schema’s on one of the test servers. So we created an empty database manually and imported the schema’s on the target server. The schema failed while importing some of the packages, functions and stored procedure. When we check the logs there are certain dependent database system objects was missing in the database and it is responsible for failing the import.
When i check the registry of the database only below components are listed :
SQL> select COMP_ID, COMP_NAME, STATUS from dba_registry; COMP_ID COMP_NAME STATUS ------------------------------ ------------------------------ -------------------------------------------- CATALOG Oracle Database Catalog Views VALID CATPROC Oracle Database Packages and Types VALID
The above components will be installed with database creation scripts :
@?/rdbms/admin/catalog.sql @?/rdbms/admin/catproc.sql
The schemas which i was trying to import was looking for the objects in database components Oracle Workspace manager and Oracle text. So these components should be installed manually.
Installation of Oracle Workspace manager(OWM):
Execute script:
SQL> @$ORACLE_HOME/rdbms/admin/owminst.plb Function created. Grant succeeded. PL/SQL procedure successfully completed. Grant succeeded. Procedure created. Type created. Type created. PL/SQL procedure successfully completed. Table created. Index created. Index created. Table created. ...... .....
Installation of Oracle Text:
Execute script:
SQL> spool text_install.txt SQL> @?/ctx/admin/catctx.sql change_on_install SYSAUX TEMP NOLOCK ...creating user CTXSYS User created. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. Grant succeeded. ..... .......
SQL> connect "CTXSYS"/"change_on_install" Connected. SQL> @?/ctx/admin/defaults/dr0defin.sql "AMERICAN"; old 1: SELECT DECODE('&nls_language', new 1: SELECT DECODE('AMERICAN', LA -- us Creating lexer preference... PL/SQL procedure successfully completed. Creating wordlist preference... PL/SQL procedure successfully completed. Creating stoplist... PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. Creating default policy... PL/SQL procedure successfully completed. SQL>
Lock user account:
SQL> alter user ctxsys account lock password expire; User altered. SQL>Verify Installation of Oracle TEXT: SQL> set pages 1000 col object_name format a40 col object_type format a20 col comp_name format a30 column library_name format a8 column file_spec format a60 wrap spool text_install_verification.logSQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> select comp_name, status, substr(version,1,10) as version from dba_registry where comp_id = 'CONTEXT'; COMP_NAME STATUS ------------------------------ -------------------------------------------- VERSION ---------------------------------------- Oracle Text VALID 11.2.0.4.0 SQL> select * from ctxsys.ctx_version; VER_DICT ---------------------------------------- VER_CODE ---------------------------------------- 11.2.0.4.0 11.2.0.4.0 SQL> select substr(ctxsys.dri_version,1,10) VER_CODE from dual; VER_CODE ---------------------------------------- 11.2.0.4.0 SQL> select object_type, count(*) from dba_objects where owner='CTXSYS' group by object_type; OBJECT_TYPE COUNT(*) -------------------- ---------- INDEX 63 TYPE BODY 6 INDEXTYPE 4 PROCEDURE 2 TABLE 50 TYPE 36 VIEW 77 FUNCTION 2 LIBRARY 1 PACKAGE BODY 63 OPERATOR 6 LOB 2 SEQUENCE 3 PACKAGE 74 14 rows selected.
Check components after installation:
SQL> select COMP_ID, COMP_NAME, STATUS from dba_registry; COMP_ID COMP_NAME STATUS ------------------------------ ------------------------------ -------------------------------------------- CATALOG Oracle Database Catalog Views VALID CATPROC Oracle Database Packages and Types VALID OWM Oracle Workspace Manager VALID CONTEXT Oracle Text VALID
Conclusion:
If you are creating a database manually for importing database objects from any other database then we need to verify the installed database components in source database and we should install all similar components in new database which was created manually.