-1

sh_main.sql を実行すると、すべて正常に動作します。スキーマも作成しますが、実行中にエラーが発生します

ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04027: file name check failed: ext_1v3.log

sh_main.sql がテーブルにデータを入力すると、このエラーが発生します。テーブルにデータを入力する際、lsh_v3.sql を使用します。このスクリプトでは、外部テーブルを作成します。

外部テーブルの作成まではすべて問題ありませんが、外部テーブルsale1vs.datを使用してデータを入力しているときに問題が発生した場合.

ログファイルの内容はこちら

Session altered.

DROP USER sh CASCADE
          *
ERROR at line 1:
ORA-01918: user 'SH' does not exist



User created.


User altered.


User altered.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.

Connected.

Grant succeeded.


Directory created.


Directory created.


Grant succeeded.


Grant succeeded.


Grant succeeded.


Grant succeeded.

Connected.

Session altered.


Session altered.


Table created.


Table created.


Table created.


Table created.


Table created.


Table created.


Table created.


Table created.


Table created.


Creating constraints ...

Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


specify password for SH as parameter 1:

specify path for data files as parameter 2:

specify path for log files as parameter 3:

specify version as parameter 4:

specify connect string as parameter 5:

Looking for indexes that could slow down load ...

no rows selected


loading TIMES using:
C:/App/db_home/demo/schema/sales_history/time_v3.ctl
C:/App/db_home/demo/schema/sales_history/time_v3.dat
%ORACLE_HOME%/demo/schema/logtime_v3.log


loading COUNTRIES using:
C:/App/db_home/demo/schema/sales_history/coun_v3.ctl
C:/App/db_home/demo/schema/sales_history/coun_v3.dat
%ORACLE_HOME%/demo/schema/logcoun_v3.log


loading CUSTOMERS using:
C:/App/db_home/demo/schema/sales_history/cust_v3.ctl
C:/App/db_home/demo/schema/sales_history/cust1v3.dat
%ORACLE_HOME%/demo/schema/logcust1v3.log


loading PRODUCTS  using:
C:/App/db_home/demo/schema/sales_history/prod_v3.ctl
C:/App/db_home/demo/schema/sales_history/prod1v3.dat
%ORACLE_HOME%/demo/schema/logprod1v3.log


loading PROMOTIONS  using:
C:/App/db_home/demo/schema/sales_history/prom_v3.ctl
C:/App/db_home/demo/schema/sales_history/prom1v3.dat
%ORACLE_HOME%/demo/schema/logprom1v3.log


loading CHANNELS using:
C:/App/db_home/demo/schema/sales_history/chan_v3.ctl
C:/App/db_home/demo/schema/sales_history/chan_v3.dat
%ORACLE_HOME%/demo/schema/logchan_v3.log


loading SALES  using:
C:/App/db_home/demo/schema/sales_history/sale_v3.ctl
C:/App/db_home/demo/schema/sales_history/sale1v3.dat
%ORACLE_HOME%/demo/schema/logsale1v3.log


loading COSTS using external table


Table created.

INSERT /*+ append */ INTO costs
*
***ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04027: file name check failed: ext_1v3.log***



loading additonal SALES using:
C:/App/db_home/demo/schema/sales_history/dmsal_v3.ctl
C:/App/db_home/demo/schema/sales_history/dmsal_v3.dat
%ORACLE_HOME%/demo/schema/logdmsal_v3.log


loading SUPPLEMENTARY DEMOGRAPHICS using:
C:/App/db_home/demo/schema/sales_history/dem_v3.ctl
C:/App/db_home/demo/schema/sales_history/dem1v3.dat
%ORACLE_HOME%/demo/schema/logdem1v3.log


Commit complete.


Enabling constraints ...

Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Table altered.


Creating additional indexes ...

Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Create dimensions ...

Dimension created.


Commit complete.


Dimension created.


Dimension created.


Dimension created.


Dimension created.

Creating MVs as tables ...


View created.


Table created.


Table created.


Index created.


Index created.


Index created.


Index created.

Creating materialized views ...


Materialized view created.


Materialized view created.


Creating comments ...

Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


gathering statistics ...
BEGIN dbms_stats.gather_table_stats(          ownname          => 'SH'                     ,          tabname          => 'SALES_TRANSACTIONS_EXT' ,          partname         => NULL                     ,          estimate_percent => NULL                     ,          block_sample     => TRUE                     ,          method_opt       => 'FOR ALL COLUMNS SIZE 1' ,          degree           => NULL                     ,          granularity      => 'ALL'                    ,          cascade          => TRUE                     ,          stattab          => NULL                     ,          statid           => NULL                     ,          statown          => NULL                     ); END;

*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-06512: at "SYS.DBMS_STATS", line 40751
ORA-06512: at "SYS.DBMS_STATS", line 40035
ORA-06512: at "SYS.DBMS_STATS", line 38912
ORA-06512: at "SYS.DBMS_STATS", line 37089
ORA-06512: at "SYS.DBMS_STATS", line 30296
ORA-29400: data cartridge error
KUP-04027: file name check failed: ext_1v3.log
ORA-06512: at "SYS.DBMS_SQL", line 1735
ORA-06512: at "SYS.DBMS_STATS", line 30213
ORA-06512: at "SYS.DBMS_STATS", line 36821
ORA-06512: at "SYS.DBMS_STATS", line 38738
ORA-06512: at "SYS.DBMS_STATS", line 39738
ORA-06512: at "SYS.DBMS_STATS", line 40183
ORA-06512: at "SYS.DBMS_STATS", line 40732
ORA-06512: at line 1



PL/SQL procedure successfully completed.

Oracle 19c を使用しています。HRスキーマはすでにロック解除されています


これは、適切なプラグ可能なコンテナを使用してSYSユーザーを使用して実行しているスクリプトです

SH_MAIN.SQL

SET ECHO OFF

PROMPT
PROMPT specify password for SH as parameter 1:
DEFINE pass     = &1
PROMPT
PROMPT specify default tablespace for SH as parameter 2:
DEFINE tbs      = &2
PROMPT
PROMPT specify temporary tablespace for SH as parameter 3:
DEFINE ttbs     = &3
PROMPT
PROMPT specify password for SYS as parameter 4:
DEFINE pass_sys = &4
PROMPT
PROMPT specify directory path for the data files as parameter 5:
DEFINE data_dir = &5
PROMPT
PROMPT writeable directory path for the log files as parameter 6:
DEFINE log_dir = &6
PROMPT
PROMPT specify version as parameter 7:
DEFINE vrs = &7
PROMPT
PROMPT specify connect string as parameter 8:
DEFINE connect_string     = &8
PROMPT

DEFINE spool_file = &log_dir.sh_&vrs..log
SPOOL &spool_file

ALTER SESSION SET NLS_LANGUAGE='American';

--
-- Dropping the user with all its objects
--

DROP USER sh CASCADE;

REM =======================================================
REM create user
REM THIS WILL ONLY WORK IF APPROPRIATE TS ARE PRESENT
REM =======================================================

CREATE USER sh IDENTIFIED BY &pass;

ALTER USER sh DEFAULT TABLESPACE &tbs
 QUOTA UNLIMITED ON &tbs;
ALTER USER sh TEMPORARY TABLESPACE &ttbs;

GRANT CREATE DIMENSION         TO sh;
GRANT QUERY REWRITE            TO sh;
GRANT CREATE MATERIALIZED VIEW TO sh;


GRANT CREATE SESSION           TO sh;
GRANT CREATE SYNONYM           TO sh;
GRANT CREATE TABLE             TO sh;
GRANT CREATE VIEW              TO sh;
GRANT CREATE SEQUENCE          TO sh;
GRANT CREATE CLUSTER           TO sh;
GRANT CREATE DATABASE LINK     TO sh;
GRANT ALTER SESSION            TO sh;


GRANT RESOURCE , UNLIMITED TABLESPACE              TO sh;
GRANT select_catalog_role   TO sh;

rem   ALTER USER sh GRANT CONNECT THROUGH olapsvr;

REM =======================================================
REM grants for sys schema
REM =======================================================

CONNECT sys/&pass_sys@&connect_string AS SYSDBA;
GRANT execute ON sys.dbms_stats TO sh;

REM =======================================================
REM DIRECTORY objects are always owned by SYS
REM    for security reasons, SH does not have
REM    CREATE ANY DIRECTORY system privilege
REM =======================================================

CREATE OR REPLACE DIRECTORY data_file_dir AS '&data_dir';
CREATE OR REPLACE DIRECTORY log_file_dir AS '&log_dir';

GRANT READ ON DIRECTORY data_file_dir TO sh;
GRANT READ ON DIRECTORY log_file_dir  TO sh;
GRANT WRITE ON DIRECTORY log_file_dir TO sh;
GRANT WRITE ON DIRECTORY data_file_dir TO sh;
REM =======================================================
REM create sh schema objects (sales history - star schema)
REM =======================================================

CONNECT sh/&pass@&connect_string

ALTER SESSION SET NLS_LANGUAGE=American;
ALTER SESSION SET NLS_TERRITORY=America;

REM =======================================================
REM Create tables
REM =======================================================

REM CONNECT sh/&pass  reconnecting undoes the prior NLS settings

DEFINE vscript = C:/App/db_home/demo/schema/sales_history/csh_&vrs
@&vscript

REM =======================================================
REM Populate tables
REM =======================================================

DEFINE vscript = C:/App/db_home/demo/schema/sales_history/lsh_&vrs
@&vscript &pass &data_dir &log_dir &vrs &connect_string

REM =======================================================
REM Post load operations
REM =======================================================

DEFINE vscript = C:/App/db_home/demo/schema/sales_history/psh_&vrs
@&vscript


spool off

lsh_v3.sql このメイン スクリプトは、テーブルを作成するために別のスクリプト「lsh_v3.sql」を呼び出しています。これがそのスクリプトです

SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100
SET VERIFY OFF
SET CONCAT '.'

PROMPT
PROMPT specify password for SH as parameter 1:
DEFINE sh_pass     = &1
PROMPT
PROMPT specify path for data files as parameter 2:
DEFINE data_path = &2
PROMPT
PROMPT specify path for log files as parameter 3:
DEFINE log_path = &3
PROMPT
PROMPT specify version as parameter 4:
DEFINE vrs = &4
PROMPT
PROMPT specify connect string as parameter 5:
DEFINE connect_string     = &5
PROMPT

SET PAGESIZE 0

COLUMN index_name FORMAT A20

PROMPT Looking for indexes that could slow down load ...

SELECT index_name FROM user_indexes;

--
-- TIMES
--

DEFINE ctl_file = &data_path.time_&vrs..ctl
DEFINE dat_file = &data_path.time_&vrs..dat
DEFINE log_file = &log_path.time_&vrs..log

PROMPT
PROMPT loading TIMES using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=1000

--
-- COUNTRIES
--

DEFINE ctl_file = &data_path.coun_&vrs..ctl
DEFINE dat_file = &data_path.coun_&vrs..dat
DEFINE log_file = &log_path.coun_&vrs..log

PROMPT
PROMPT loading COUNTRIES using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=1000

--
-- CUSTOMERS
--

DEFINE ctl_file = &data_path.cust_&vrs..ctl
DEFINE dat_file = &data_path.cust1&vrs..dat
DEFINE log_file = &log_path.cust1&vrs..log

PROMPT
PROMPT loading CUSTOMERS using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=10000



--
-- PRODUCTS
--

DEFINE ctl_file = &data_path.prod_&vrs..ctl
DEFINE dat_file = &data_path.prod1&vrs..dat
DEFINE log_file = &log_path.prod1&vrs..log

PROMPT
PROMPT loading PRODUCTS  using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=10000


--
-- PROMOTIONS
--

DEFINE ctl_file = &data_path.prom_&vrs..ctl
DEFINE dat_file = &data_path.prom1&vrs..dat
DEFINE log_file = &log_path.prom1&vrs..log

PROMPT
PROMPT loading PROMOTIONS  using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=10


--
-- CHANNELS
--

DEFINE ctl_file = &data_path.chan_&vrs..ctl
DEFINE dat_file = &data_path.chan_&vrs..dat
DEFINE log_file = &log_path.chan_&vrs..log

PROMPT
PROMPT loading CHANNELS using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=10



--
-- SALES
--

DEFINE ctl_file = &data_path.sale_&vrs..ctl
DEFINE dat_file = &data_path.sale1&vrs..dat
DEFINE log_file = &log_path.sale1&vrs..log

PROMPT
PROMPT loading SALES  using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=100000


--
-- COSTS
--

PROMPT
PROMPT loading COSTS using external table
PROMPT

CREATE TABLE sales_transactions_ext
( PROD_ID           NUMBER,
  CUST_ID       NUMBER,
  TIME_ID       DATE,
  CHANNEL_ID    NUMBER,
  PROMO_ID      NUMBER,
  QUANTITY_SOLD   NUMBER,
  AMOUNT_SOLD   NUMBER(10,2),
  UNIT_COST     NUMBER(10,2),
  UNIT_PRICE    NUMBER(10,2)
)
ORGANIZATION external
(
  TYPE oracle_loader
  DEFAULT DIRECTORY data_file_dir
  ACCESS PARAMETERS
  (
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    TERRITORY AMERICA
    BADFILE log_file_dir:'ext_1v3.bad'
    LOGFILE log_file_dir:'ext_1v3.log'
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '^' LDRTRIM
    MISSING FIELD VALUES ARE NULL
    ( PROD_ID         ,
      CUST_ID         ,
      TIME_ID         DATE(10) "YYYY-MM-DD",
      CHANNEL_ID      ,
      PROMO_ID        ,
      QUANTITY_SOLD   ,
      AMOUNT_SOLD     ,
      UNIT_COST       ,
      UNIT_PRICE
    )
 )
 LOCATION
 ('sale1v3.dat')
)
REJECT LIMIT UNLIMITED;
--REJECT LIMIT 100;

INSERT /*+ append */ INTO costs
( prod_id,
  time_id,
  channel_id,
  promo_id,
  unit_cost,
  unit_price )
SELECT
  prod_id,
  time_id,
  channel_id,
  promo_id,
  AVG(unit_cost),
  AVG(amount_sold/quantity_sold)
FROM
  sales_transactions_ext
GROUP BY
  prod_id,
  time_id,
  channel_id,
  promo_id;


--
-- ODM additional SALES rows
--

DEFINE ctl_file = &data_path.dmsal_&vrs..ctl
DEFINE dat_file = &data_path.dmsal_&vrs..dat
DEFINE log_file = &log_path.dmsal_&vrs..log

PROMPT
PROMPT loading additonal SALES using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file


HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=100


--
-- SUPPLEMENTARY DEMOGRAPHICS
--

DEFINE ctl_file = &data_path.dem_&vrs..ctl
DEFINE dat_file = &data_path.dem1&vrs..dat
DEFINE log_file = &log_path.dem1&vrs..log

PROMPT
PROMPT loading SUPPLEMENTARY DEMOGRAPHICS using:
PROMPT   &ctl_file
PROMPT   &dat_file
PROMPT   &log_file

HOST sqlldr sh/&sh_pass@&connect_string  -
 control=&ctl_file data=&dat_file log=&log_file -
 direct=yes -
 rows=10

COMMIT;

エラーを引き起こしていると思われるlsh_v3.sqlスクリプトの部分はこれです-

PROMPT
PROMPT loading COSTS using external table
PROMPT

CREATE TABLE sales_transactions_ext
( PROD_ID           NUMBER,
  CUST_ID       NUMBER,
  TIME_ID       DATE,
  CHANNEL_ID    NUMBER,
  PROMO_ID      NUMBER,
  QUANTITY_SOLD   NUMBER,
  AMOUNT_SOLD   NUMBER(10,2),
  UNIT_COST     NUMBER(10,2),
  UNIT_PRICE    NUMBER(10,2)
)
ORGANIZATION external
(
  TYPE oracle_loader
  DEFAULT DIRECTORY data_file_dir
  ACCESS PARAMETERS
  (
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    TERRITORY AMERICA
    BADFILE log_file_dir:'ext_1v3.bad'
    LOGFILE log_file_dir:'ext_1v3.log'
    FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '^' LDRTRIM
    MISSING FIELD VALUES ARE NULL
    ( PROD_ID         ,
      CUST_ID         ,
      TIME_ID         DATE(10) "YYYY-MM-DD",
      CHANNEL_ID      ,
      PROMO_ID        ,
      QUANTITY_SOLD   ,
      AMOUNT_SOLD     ,
      UNIT_COST       ,
      UNIT_PRICE
    )
 )
 LOCATION
 ('sale1v3.dat')
)
REJECT LIMIT UNLIMITED;
--REJECT LIMIT 100;

INSERT /*+ append */ INTO costs
( prod_id,
  time_id,
  channel_id,
  promo_id,
  unit_cost,
  unit_price )
SELECT
  prod_id,
  time_id,
  channel_id,
  promo_id,
  AVG(unit_cost),
  AVG(amount_sold/quantity_sold)
FROM
  sales_transactions_ext
GROUP BY
  prod_id,
  time_id,
  channel_id,
  promo_id;

テーブルの作成までは正常に機能していますが、insert intoステートメントがエラーを引き起こしています。

4

2 に答える 2

0

基本的に、同じように見える 2 つのエラーがあります。

***ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04027: file name check failed: ext_1v3.log***

ORA-29400: data cartridge error
KUP-04027: file name check failed: ext_1v3.log

このエラーは、(論理、Oracle オブジェクト) directoryext_1v3.logが指す (物理、オペレーティング システム) ディレクトリにフィールドが存在しないことを示しています。

の結果を確認します (SYS などの特権ユーザーとして接続)。

select * from dba_directories

次に、そのインストール スクリプトを編集し、それらのエラーが発生した行を見つけて、そこで使用されているディレクトリを確認しdba_directoriesます。

ただし、それを処理する必要があるインストールスクリプトを使用しているため、これは少し奇妙です...おそらく編集しましたか?

于 2020-01-09T10:30:40.050 に答える