2 Replies Latest reply: Mar 30, 2013 6:14 AM by 998890 RSS

    Is it possible to Display custom message on sqlplus on every login

    998890
      Hi Masters ,

      Is it possible to Display custom message on sqlplus on every login using Sqlplus “ / as sysdba”

      i am looking for below three requirements

      1: custom message on sqlplus on every login using Sqlplus “ / as sysdba”
      2: custom message on sqlplus on issuing shutdown immediate command
      3: custom message on sqlplus on issuing startup database command

      something like this,i have created below mention trigger but it's not displaying any message even i used set serveroutput on

      create or replace trigger
      logon_audit_trigger
      AFTER LOGON ON DATABASE
      BEGIN
      DBMS_OUTPUT.GET_LINES ('<custom message>');
      END;
      /


      Regards
      Shiva

      Edited by: 995887 on Mar 24, 2013 11:15 PM
        • 2. Re: Is it possible to Display custom message on sqlplus on every login
          998890
          i have used Raise_application_error. but it did not resolve my problem ,still i am not getting any message on login to database

          16:40:37 SQL> CREATE OR REPLACE TRIGGER afterlogon
          16:41:49 2 AFTER LOGON on DATABASE
          16:41:49 3 BEGIN
          16:41:49 4 RAISE_APPLICATION_ERROR (-20001, 'You are not allowed to logon fro
          m this
          16:41:49 5 terminal');
          16:41:49 6 END;
          16:41:49 7 /

          Trigger created.

          16:41:49 SQL>
          16:41:49 SQL>
          16:41:49 SQL> exit
          Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
          oduction
          With the Partitioning, OLAP, Data Mining and Real Application Testing options

          C:\>sqlplus

          SQL*Plus: Release 11.2.0.1.0 Production on Sat Mar 30 16:41:54 2013

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

          Enter user-name: / as sysdba

          Connected to:
          Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
          With the Partitioning, OLAP, Data Mining and Real Application Testing options

          SQL>
          SQL>