Home
All Oracle Error Codes
Oracle DBA Forum

Frequent Oracle Errors

TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated

dblink in PL/SQL block..

Onkar N Tiwary

2006-01-23

Replies:
hi all,
 
I have one small problem. Below is my query which is running on the sql prompt:
 
select username||'('||sid||','||serial#||') ospid = ' ||  process ||' program = ' || program username,to_char(LOGON_TIME,' Day HH24:MI') logon_time,to_char(sysdate,' Day HH24:MI') current_time,sql_address, LAST_CALL_ET   from v$session@tmoldb_cochin where status = 'ACTIVE' and rawtohex(sql_address) <> '00' and username is not null order by last_call_et;
 
 select max(decode(piece,0,sql_text,null)) ||max(decode(piece,1,sql_text,null)) ||max(decode(piece,2,sql_text,null)) ||max(decode(piece,3,sql_text,null)) sql_text from v$sqltext_with_newlines@tmoldb_cochin  where address = x.sql_address and piece < 4;
 
 
but when I am using the same sql in the PL/SQL block as below:
 
create or replace procedure showsql as
--    x number;
    cursor c1 is
 select username||'('||sid||','||serial#||
                ') ospid = ' ||  process ||
                ' program = ' || program username,
             to_char(LOGON_TIME,' Day HH24:MI') logon_time,
             to_char(sysdate,' Day HH24:MI') current_time,
             sql_address, LAST_CALL_ET
        from v$session@tmoldb_cochin
       where status = 'ACTIVE'
         and rawtohex(sql_address) <> '00'
         and username is not null order by last_call_et;
    cursor c2 is
 select max(decode(piece,0,sql_text,null)) ||
                          max(decode(piece,1,sql_text,null)) ||
                          max(decode(piece,2,sql_text,null)) ||
                          max(decode(piece,3,sql_text,null))
                               sql_text
                     from v$sqltext_with_newlines@tmoldb_cochin
                    where address = x.sql_address
                      and piece < 4;
begin
    for x in c1 loop
        for y in c2  loop
            if ( y.sql_text not like '%listener.get_cmd%' and
                 y.sql_text not like '%RAWTOHEX(SQL_ADDRESS)%')
            then
                dbms_output.put_line( '--------------------' );
                dbms_output.put_line( x.username );
                dbms_output.put_line( x.logon_time || ' ' ||
                                      x.current_time||
                                      ' last et = ' ||
                                      x.LAST_CALL_ET);
                dbms_output.put_line(
                          substr( y.sql_text, 1, 250 ) );
            end if;
        end loop;
    end loop;
end;
/
Its throwing the following error:

Warning: Procedure created with compilation errors.

SQL> sho err
Errors for PROCEDURE SHOWSQL:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/2      PL/SQL: ORA-04052: error occurred when looking up remote object
         SYS.V_$SESSION@TMOLDB_COCHIN.ONEAPPS.COM
         ORA-02030: can only select from fixed tables/views

4/2      PL/SQL: SQL Statement ignored
15/2     PL/SQL: SQL Statement ignored
21/37    PL/SQL: ORA-00904: "X"."SQL_ADDRESS": invalid identifier
26/13    PL/SQL: Statement ignored
26/18    PLS-00364: loop index variable 'Y' use is invalid
SQL>

Any idea???????

--
Thanks & Regards,
T. Onkar Nath
OneAPPS Enterprise Technology Pvt. Ltd.
       to_onkar@yahoo.com
       onkarnath.tiwary@gmail.com