Mostrando postagens com marcador oracle database. Mostrar todas as postagens
Mostrando postagens com marcador oracle database. Mostrar todas as postagens

sexta-feira, 27 de maio de 2016

Create Database link / Criar link de Banco de Dados - Oracle

Via formulário/ By connect string

CREATE DATABASE LINK nome_do_dblink
CONNECT TO nome_do_usuario_que_ira_se_conectar IDENTIFIED BY senha_do_usuario
USING '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Host_do_usuario_que_irá_se_conectar)(PORT = Porta_do_host))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = Instância_do_banco_de_dados)
    )
  )';

quarta-feira, 27 de agosto de 2014

Erro ORA-29913, ORA-29400, KUP-04020, ORA-06512 - found record longer than buffer size supported, 524288

Boa tarde a todos,
 
Seguem abaixo os erros que tive enquanto criava uma external table: 
 
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04020: found record longer than buffer size supported, 524288,
 in C:\PathToFile\FileToLoad.txt_
ORA-06512: at "SYS.ORACLE_LOADER", line 52
 
Código que utilizei:
 
ALTER SESSION SET nls_length_semantics = CHAR
/
CREATE TABLE teste
(
    teste VARCHAR2(2000)     NULL
)
ORGANIZATION EXTERNAL
 ( TYPE ORACLE_LOADER
   DEFAULT DIRECTORY DIRETORIO
   ACCESS PARAMETERS
    ( RECORDS DELIMITED BY NEWLINE
      CHARACTERSET UTF8
      STRING SIZES ARE IN CHARACTERS 
        logfile DIRETORIO:'sdp_tst_ext_%p.log'
        badfile DIRETORIO:'sdp_tst_ext_%p.bad'
        discardfile DIRETORIO:'sdp_tst_ext_%p.dsc'
        fields
    notrim
       (
             teste CHAR(2000)
           )
    )
   LOCATION ('teste_2_HOM.dat')
 )
REJECT LIMIT UNLIMITED
NOPARALLEL
NOROWDEPENDENCIES
/
 
 
Solução
 
Alterar:
RECORDS DELIMITED BY NEWLINE
 
Para:
RECORDS DELIMITED BY '\n'
 
Blog de consulta: 
http://gerardnico.com/wiki/database/oracle/external_table