Re: [oracle_br] Views inválidas com DB_LINK

2009-02-02 Por tôpico Gari Einsfeldt
Uma pergunta bem simples que pode soar estranha, mas só para desencargo de
consciencia:
os database links públicos e/ou privados estão criados e operacionais no
banco de importação?

2009/1/30 Júlio César Corrêa 

> Estranho Thiago.Você está colocando o nome da view em upper?Look d's:
>
> Microsoft Windows XP [versão 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\Console2>sqlplus /nolog
>
> SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:21:35 2009
>
> Copyright (c) 1982, 2005, Oracle.  All rights reserved.
>
> idle> conn c...@hmlg
> Informe a senha:
> Conectado.
> c...@cmt> desc cmt.vw_order;
>  Nome  Nulo?Tipo
>  - 
> 
>  PRV_IDNOT NULL NUMBER(10)
>  ROM_TRANIDNOT NULL NUMBER(10)
>  ROM_SEQNBRNOT NULL NUMBER(3)
>  ROM_DATE  NOT NULL DATE
>  ROM_REMOTEORDERID  NUMBER(10)
>  ROM_REMOTEORDERDATEDATE
>  ROM_STATUSNOT NULL CHAR(1)
>  ROM_RECSTATCHAR(1)
>  ISS_ID NUMBER(4)
>  CD_ID  NUMBER(2)
>  CRD_SNRNUMBER(10)
>  ROD_AMOUNT
> NUMBER(10,2)
>  ISS_DESCLONG
> VARCHAR2(50)
>  APP_DESCLONG
> VARCHAR2(50)
>
> c...@cmt> ed
> Gravou file afiedt.buf
>
>  1  select owner,object_name,object_type,status
>  2  from all_objects
>  3* where object_name ='vw_order'
> c...@cmt> /
>
> nÒo hß linhas selecionadas
>
> c...@cmt> ed
> Gravou file afiedt.buf
>
>  1  select owner,object_name,object_type,status
>  2  from all_objects
>  3* where object_name ='VW_ORDER' --upper case
> c...@cmt> /
>
> OWNER  OBJECT_NAMEOBJECT_TYPE
>  STATUS
> -- --
> --- ---
> PUBLIC VW_ORDER   SYNONYM
>  VALID
> CMTVW_ORDER   VIEW
>  VALID
>
> c...@cmt>
>
>
> And look it:
> C:\>sqlplus /nolog
>
> SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:17:24 2009
>
> Copyright (c) 1982, 2005, Oracle.  All rights reserved.
>
> idle> conn c...@dsnv
> Informe a senha:
> Conectado.
> c...@dsnv> create or replace view bla
>  2  as select * from users where rownum = 1;
>
> View criada.
>
> c...@dsnv> select object_name,object_type,status
>  2  from all_objects
>  3  where object_name ='BLA';
>
> OBJECT_NAMEOBJECT_TYPE STATUS
> -- --- ---
> BLAVIEWVALID
>
> c...@dsnv>
>
>
>
>
>
>
>
> 2009/1/30 Thiago Delfim 
>
> > Julio, veja isso:
> > SQL> create view blabla as
> >  2  select * from bla...@dbl_blabla;
> >
> > Warning: View created with compilation errors
> >
> > SQL> select * from dba_objects where object_name = 'BLABLA';
> >
> > OWNER  OBJECT_NAME
> >   SUBOBJECT_NAME
>  OBJECT_ID
> > DATA_OBJECT_ID OBJECT_TYPECREATED LAST_DDL_TIME TIMESTAMP
> >STATUS  TEMPORARY GENERATED SECONDARY
> > --
> >
> >
> 
> > -- -- --
> --
> > --- - --- --- - -
> > -
> >
> > SQL>
> >
> > Ele fala que criou com erro de compilação, mas não cria nada mesmo.
> >
> >
> >
> > 2009/1/30 Júlio César Corrêa 
> >
> > > Você verificou qual owner está criando estas views?
> > > Se warning( advice,suggestion,não error),é View created with
> compilation
> > > errors",90% de chance de estas  views estarem em algum schema.
> > >
> > > select * from all_objects -- ou dba_objects
> > > where owner ='your owner'
> > > and object_type ='VIEW'
> > > and status = 'INVALID'
> > >
> > >
> > > 2009/1/30 Thiago Delfim 
> > >
> > > >   Pessoal,
> > > > Recentemente eu fiz um import em um Oracle 10g e todas as views e
> > > > procedures
> > > > que usavam DB_LINK foram criadas, porém ficaram inválidas porque os
> > > > DB_LINKS
> > > > não estavam acessíveis.
> > > >
> > > > Hoje fiz o mesmo import em um Oracle 9i e essas mesmas views e
> > procedures
> > > > não foram criadas. Quando eu tento criar direto no SQL Plus, aparece
> a
> > > > mensagem "Warning: View created with compilation errors", mas a VIEW
> > não
> > > é
> > > > criada.
> > > >
> > > > Alguém já passou por algo parecid

Re: [oracle_br] Views inválidas com DB_LINK

2009-01-30 Por tôpico Thiago Delfim
Julio, o problema só ocorre nos casos em que eu uso um db_link inválido. Só
acho estranho retornar que a view foi criada com erro, mas ela não é criada.
SQL> create view bla as
  2  select * from user_tables;

View created

SQL> select * from dba_objects where object_name = 'BLA';

OWNER  OBJECT_NAME
   SUBOBJECT_NAME  OBJECT_ID
DATA_OBJECT_ID OBJECT_TYPECREATED LAST_DDL_TIME TIMESTAMP
STATUS  TEMPORARY GENERATED SECONDARY
--

-- -- -- --
--- - --- --- - -
-
REMOTE BLA
   26060
   VIEW   30/1/2009 1 30/1/2009 17:
2009-01-30:17:10:49 VALID   N N N

SQL> create view blabla as
  2  select * from bla...@dbl_blabla;

Warning: View created with compilation errors

SQL> select * from dba_objects where object_name = 'BLABLA';

OWNER  OBJECT_NAME
   SUBOBJECT_NAME  OBJECT_ID
DATA_OBJECT_ID OBJECT_TYPECREATED LAST_DDL_TIME TIMESTAMP
STATUS  TEMPORARY GENERATED SECONDARY
--

-- -- -- --
--- - --- --- - -
-

SQL>



2009/1/30 Júlio César Corrêa 

> Estranho Thiago.Você está colocando o nome da view em upper?Look d's:
>
> Microsoft Windows XP [versão 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\Console2>sqlplus /nolog
>
> SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:21:35 2009
>
> Copyright (c) 1982, 2005, Oracle.  All rights reserved.
>
> idle> conn c...@hmlg
> Informe a senha:
> Conectado.
> c...@cmt> desc cmt.vw_order;
>  Nome  Nulo?Tipo
>  - 
> 
>  PRV_IDNOT NULL NUMBER(10)
>  ROM_TRANIDNOT NULL NUMBER(10)
>  ROM_SEQNBRNOT NULL NUMBER(3)
>  ROM_DATE  NOT NULL DATE
>  ROM_REMOTEORDERID  NUMBER(10)
>  ROM_REMOTEORDERDATEDATE
>  ROM_STATUSNOT NULL CHAR(1)
>  ROM_RECSTATCHAR(1)
>  ISS_ID NUMBER(4)
>  CD_ID  NUMBER(2)
>  CRD_SNRNUMBER(10)
>  ROD_AMOUNT
> NUMBER(10,2)
>  ISS_DESCLONG
> VARCHAR2(50)
>  APP_DESCLONG
> VARCHAR2(50)
>
> c...@cmt> ed
> Gravou file afiedt.buf
>
>  1  select owner,object_name,object_type,status
>  2  from all_objects
>  3* where object_name ='vw_order'
> c...@cmt> /
>
> nÒo hß linhas selecionadas
>
> c...@cmt> ed
> Gravou file afiedt.buf
>
>  1  select owner,object_name,object_type,status
>  2  from all_objects
>  3* where object_name ='VW_ORDER' --upper case
> c...@cmt> /
>
> OWNER  OBJECT_NAMEOBJECT_TYPE
>  STATUS
> -- --
> --- ---
> PUBLIC VW_ORDER   SYNONYM
>  VALID
> CMTVW_ORDER   VIEW
>  VALID
>
> c...@cmt>
>
>
> And look it:
> C:\>sqlplus /nolog
>
> SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:17:24 2009
>
> Copyright (c) 1982, 2005, Oracle.  All rights reserved.
>
> idle> conn c...@dsnv
> Informe a senha:
> Conectado.
> c...@dsnv> create or replace view bla
>  2  as select * from users where rownum = 1;
>
> View criada.
>
> c...@dsnv> select object_name,object_type,status
>  2  from all_objects
>  3  where object_name ='BLA';
>
> OBJECT_NAMEOBJECT_TYPE STATUS
> -- --- ---
> BLAVIEWVALID
>
> c...@dsnv>
>
>
>
>
>
>
>
> 2009/1/30 Thiago Delfim 
>
> > Julio, veja isso:
> > SQL> create view blabla as
> >  2  select * from bla...@dbl_blabla;
> >
> > Warning: View created with compilation errors
> >
> > SQL> select * from dba_objects where object_name = 'BLABLA';
> >
> > OWNER  OBJECT_NAME
> >   SUBOBJECT_NAME
>  OBJECT_ID
> > DATA_OBJECT_I

Re: [oracle_br] Views inválidas com DB_LINK

2009-01-30 Por tôpico Júlio César Corrêa
Estranho Thiago.Você está colocando o nome da view em upper?Look d's:

Microsoft Windows XP [versão 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Console2>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:21:35 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

idle> conn c...@hmlg
Informe a senha:
Conectado.
c...@cmt> desc cmt.vw_order;
 Nome  Nulo?Tipo
 - 

 PRV_IDNOT NULL NUMBER(10)
 ROM_TRANIDNOT NULL NUMBER(10)
 ROM_SEQNBRNOT NULL NUMBER(3)
 ROM_DATE  NOT NULL DATE
 ROM_REMOTEORDERID  NUMBER(10)
 ROM_REMOTEORDERDATEDATE
 ROM_STATUSNOT NULL CHAR(1)
 ROM_RECSTATCHAR(1)
 ISS_ID NUMBER(4)
 CD_ID  NUMBER(2)
 CRD_SNRNUMBER(10)
 ROD_AMOUNT NUMBER(10,2)
 ISS_DESCLONG   VARCHAR2(50)
 APP_DESCLONG   VARCHAR2(50)

c...@cmt> ed
Gravou file afiedt.buf

  1  select owner,object_name,object_type,status
  2  from all_objects
  3* where object_name ='vw_order'
c...@cmt> /

nÒo hß linhas selecionadas

c...@cmt> ed
Gravou file afiedt.buf

  1  select owner,object_name,object_type,status
  2  from all_objects
  3* where object_name ='VW_ORDER' --upper case
c...@cmt> /

OWNER  OBJECT_NAMEOBJECT_TYPE
  STATUS
-- --
--- ---
PUBLIC VW_ORDER   SYNONYM
  VALID
CMTVW_ORDER   VIEW
  VALID

c...@cmt>


And look it:
C:\>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Sex Jan 30 16:17:24 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

idle> conn c...@dsnv
Informe a senha:
Conectado.
c...@dsnv> create or replace view bla
  2  as select * from users where rownum = 1;

View criada.

c...@dsnv> select object_name,object_type,status
  2  from all_objects
  3  where object_name ='BLA';

OBJECT_NAMEOBJECT_TYPE STATUS
-- --- ---
BLAVIEWVALID

c...@dsnv>







2009/1/30 Thiago Delfim 

> Julio, veja isso:
> SQL> create view blabla as
>  2  select * from bla...@dbl_blabla;
>
> Warning: View created with compilation errors
>
> SQL> select * from dba_objects where object_name = 'BLABLA';
>
> OWNER  OBJECT_NAME
>   SUBOBJECT_NAME  OBJECT_ID
> DATA_OBJECT_ID OBJECT_TYPECREATED LAST_DDL_TIME TIMESTAMP
>STATUS  TEMPORARY GENERATED SECONDARY
> --
>
> 
> -- -- -- --
> --- - --- --- - -
> -
>
> SQL>
>
> Ele fala que criou com erro de compilação, mas não cria nada mesmo.
>
>
>
> 2009/1/30 Júlio César Corrêa 
>
> > Você verificou qual owner está criando estas views?
> > Se warning( advice,suggestion,não error),é View created with compilation
> > errors",90% de chance de estas  views estarem em algum schema.
> >
> > select * from all_objects -- ou dba_objects
> > where owner ='your owner'
> > and object_type ='VIEW'
> > and status = 'INVALID'
> >
> >
> > 2009/1/30 Thiago Delfim 
> >
> > >   Pessoal,
> > > Recentemente eu fiz um import em um Oracle 10g e todas as views e
> > > procedures
> > > que usavam DB_LINK foram criadas, porém ficaram inválidas porque os
> > > DB_LINKS
> > > não estavam acessíveis.
> > >
> > > Hoje fiz o mesmo import em um Oracle 9i e essas mesmas views e
> procedures
> > > não foram criadas. Quando eu tento criar direto no SQL Plus, aparece a
> > > mensagem "Warning: View created with compilation errors", mas a VIEW
> não
> > é
> > > criada.
> > >
> > > Alguém já passou por algo parecido? Eu preciso que o objeto seja
> criado,
> > > mesmo que fique inválido.
> > >
> > > Obrigado,
> > >
> > > --
> > > Thiago Delfim
> > > Oracle & SQL Server Database Administrator
> > > Oracle 9i Database Certified Professional
> > > tdel...@gmail.com  (MSN)
> > > Campinas/SP
> > > (19) 8204-2681 / 9111-1439
> > >
> > > [

Re: [oracle_br] Views inválidas com DB_LINK

2009-01-30 Por tôpico Thiago Delfim
Julio, veja isso:
SQL> create view blabla as
  2  select * from bla...@dbl_blabla;

Warning: View created with compilation errors

SQL> select * from dba_objects where object_name = 'BLABLA';

OWNER  OBJECT_NAME
   SUBOBJECT_NAME  OBJECT_ID
DATA_OBJECT_ID OBJECT_TYPECREATED LAST_DDL_TIME TIMESTAMP
STATUS  TEMPORARY GENERATED SECONDARY
--

-- -- -- --
--- - --- --- - -
-

SQL>

Ele fala que criou com erro de compilação, mas não cria nada mesmo.



2009/1/30 Júlio César Corrêa 

> Você verificou qual owner está criando estas views?
> Se warning( advice,suggestion,não error),é View created with compilation
> errors",90% de chance de estas  views estarem em algum schema.
>
> select * from all_objects -- ou dba_objects
> where owner ='your owner'
> and object_type ='VIEW'
> and status = 'INVALID'
>
>
> 2009/1/30 Thiago Delfim 
>
> >   Pessoal,
> > Recentemente eu fiz um import em um Oracle 10g e todas as views e
> > procedures
> > que usavam DB_LINK foram criadas, porém ficaram inválidas porque os
> > DB_LINKS
> > não estavam acessíveis.
> >
> > Hoje fiz o mesmo import em um Oracle 9i e essas mesmas views e procedures
> > não foram criadas. Quando eu tento criar direto no SQL Plus, aparece a
> > mensagem "Warning: View created with compilation errors", mas a VIEW não
> é
> > criada.
> >
> > Alguém já passou por algo parecido? Eu preciso que o objeto seja criado,
> > mesmo que fique inválido.
> >
> > Obrigado,
> >
> > --
> > Thiago Delfim
> > Oracle & SQL Server Database Administrator
> > Oracle 9i Database Certified Professional
> > tdel...@gmail.com  (MSN)
> > Campinas/SP
> > (19) 8204-2681 / 9111-1439
> >
> > [As partes desta mensagem que não continham texto foram removidas]
> >
> >
> >
>
>
>
> --
> Júlio César Corrêa
> IS Technologist - Oracle DBA
> http://jccorrea.blogspot.com
>
> "To stay competitive in the tech industry, never stop
> learning. Always be on the lookout for better ways of
> doing things and new technologies. Our industry does
> not reward people who let themselves stagnate"
> –John Hall, Senior Vice President, Oracle University
>
>
> [As partes desta mensagem que não continham texto foram removidas]
>
>
> 
>
>
> --
> >Atenção! As mensagens do grupo ORACLE_BR são de acesso público e de
> inteira responsabilidade de seus remetentes.
> Acesse: http://www.mail-archive.com/oracle_br@yahoogrupos.com.br/
>
> --
> >Apostilas » Dicas e Exemplos » Função » Mundo Oracle » Package » Procedure
> » Scripts » Tutoriais - O GRUPO ORACLE_BR TEM SEU PROPRIO ESPAÇO! VISITE:
> http://www.oraclebr.com.br/
> 
> Links do Yahoo! Grupos
>
>
>


-- 
Thiago Delfim
Oracle & SQL Server Database Administrator
Oracle 9i Database Certified Professional
tdel...@gmail.com (MSN)
Campinas/SP
(19) 8204-2681 / 9111-1439


[As partes desta mensagem que não continham texto foram removidas]




--
>Atenção! As mensagens do grupo ORACLE_BR são de acesso público e de inteira 
>responsabilidade de seus remetentes.
Acesse: http://www.mail-archive.com/oracle_br@yahoogrupos.com.br/ 
--
>Apostilas » Dicas e Exemplos » Função » Mundo Oracle » Package » Procedure » 
>Scripts » Tutoriais - O GRUPO ORACLE_BR TEM SEU PROPRIO ESPAÇO! VISITE: 
>http://www.oraclebr.com.br/  

 Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
http://br.groups.yahoo.com/group/oracle_br/

<*> Para sair deste grupo, envie um e-mail para:
oracle_br-unsubscr...@yahoogrupos.com.br

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
http://br.yahoo.com/info/utos.html




Re: [oracle_br] Views inválidas com DB_LINK

2009-01-30 Por tôpico Júlio César Corrêa
Você verificou qual owner está criando estas views?
Se warning( advice,suggestion,não error),é View created with compilation
errors",90% de chance de estas  views estarem em algum schema.

select * from all_objects -- ou dba_objects
where owner ='your owner'
and object_type ='VIEW'
and status = 'INVALID'


2009/1/30 Thiago Delfim 

>   Pessoal,
> Recentemente eu fiz um import em um Oracle 10g e todas as views e
> procedures
> que usavam DB_LINK foram criadas, porém ficaram inválidas porque os
> DB_LINKS
> não estavam acessíveis.
>
> Hoje fiz o mesmo import em um Oracle 9i e essas mesmas views e procedures
> não foram criadas. Quando eu tento criar direto no SQL Plus, aparece a
> mensagem "Warning: View created with compilation errors", mas a VIEW não é
> criada.
>
> Alguém já passou por algo parecido? Eu preciso que o objeto seja criado,
> mesmo que fique inválido.
>
> Obrigado,
>
> --
> Thiago Delfim
> Oracle & SQL Server Database Administrator
> Oracle 9i Database Certified Professional
> tdel...@gmail.com  (MSN)
> Campinas/SP
> (19) 8204-2681 / 9111-1439
>
> [As partes desta mensagem que não continham texto foram removidas]
>
>  
>



-- 
Júlio César Corrêa
IS Technologist - Oracle DBA
http://jccorrea.blogspot.com

"To stay competitive in the tech industry, never stop
learning. Always be on the lookout for better ways of
doing things and new technologies. Our industry does
not reward people who let themselves stagnate"
–John Hall, Senior Vice President, Oracle University


[As partes desta mensagem que não continham texto foram removidas]




--
>Atenção! As mensagens do grupo ORACLE_BR são de acesso público e de inteira 
>responsabilidade de seus remetentes.
Acesse: http://www.mail-archive.com/oracle_br@yahoogrupos.com.br/ 
--
>Apostilas » Dicas e Exemplos » Função » Mundo Oracle » Package » Procedure » 
>Scripts » Tutoriais - O GRUPO ORACLE_BR TEM SEU PROPRIO ESPAÇO! VISITE: 
>http://www.oraclebr.com.br/  

 Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
http://br.groups.yahoo.com/group/oracle_br/

<*> Para sair deste grupo, envie um e-mail para:
oracle_br-unsubscr...@yahoogrupos.com.br

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
http://br.yahoo.com/info/utos.html