Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> ORA-2083 DATABASE name has illegal character '-'

ORA-2083 DATABASE name has illegal character '-'

From: <Rick_Cale_at_teamhealth.com>
Date: Tue, 03 Dec 2002 11:10:11 -0800
Message-ID: <F001.005111B9.20021203111011@fatcity.com>


Hi,

Oracle 8.1.6.0.0 NT 4.0

I have the following logon trigger. It works fine as long I insert into local table. If I try to insert into a table across a database link the record get inserted but upon exiting the app whether it is sqlplus,forms,etc I get ora-2083. I think it is probably a bug since I have exact same environment and it works Ok. It fails on 3 other identical environments. Anyone heard of any possible bugs using database link in logon trigger? I search metalink and google but no such reported error.

DROP PUBLIC DATABASE LINK utilities_a12345_dblink; CREATE PUBLIC DATABASE LINK utilities_a12345_dblink CONNECT TO utilities IDENTIFIED BY 123x456x USING 'a123456';

GRANT SELECT ON v_$session TO PUBLIC;
GRANT SELECT ON v_$instance TO PUBLIC;
DROP TRIGGER login_capture;
CREATE OR REPLACE TRIGGER login_capture AFTER LOGON ON DATABASE DECLARE
  CURSOR temp_rec IS
SELECT user AS user_name,

       NVL(UPPER(SUBSTR(osuser,1,30)),'SERVER') AS os_user_name,
       RTRIM(NVL(SUBSTR(machine,instr(machine,'\') +1,12),'SERVER'),CHR(0))
AS machine_name,
       sid AS session_id,
       serial# AS serial_no,
       SYSDATE AS logon_time,
       SYS_CONTEXT('userenv','ip_address') AS ip_address,
       NVL(SUBSTR(program,1,64),'INTERNAL') AS program_name,
       i.instance_name AS instance_name,
       i.host_name AS host_name,
       i.version AS version

FROM v$session s,v$instance i
WHERE s.username = user
AND s.logon_time = (SELECT MAX(x.logon_time)
                      FROM v$session x
                      WHERE x.username = user);
BEGIN
FOR rec IN temp_rec LOOP
INSERT INTO login_history_at_utilities_itport02_dblink  (user_name,
  os_user_name,
  machine_name,
  session_id,

  serial_no,
  logon_time,
  ip_address,
  program_name,
  instance_name,
  host_name,
  version)
VALUES (rec.user_name,
  rec.os_user_name,
  rec.machine_name,
  rec.session_id,
  rec.serial_no,
  rec.logon_time,
  rec.ip_address,
  rec.program_name,
  rec.instance_name,
  rec.host_name,
  rec.version);

END LOOP;
EXCEPTION
 WHEN OTHERS THEN
   NULL;
END;
/
ALTER TRIGGER login_capture ENABLE;

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Rick_Cale_at_teamhealth.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Dec 03 2002 - 13:10:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US