Loop test
I would like to write a PL/SQL to loop the database, and to show there is no disconnection.
any idea ?
I wrote something be
set serveroutput on
set head off
set feed off
alter session set nls_date_format='DD-MON-YY HH24:Mi:SS';
DECLARE
currenttime timestamp;
terminal varchar2(20);
inst_name varchar2(10);
BEGIN
WHILE( true ) loop
select sysdate ,sys_context ('userenv','TERMINAL'),sys_context ('userenv','INSTANCE_NAME') into currenttime,terminal,inst_name from dual;
DBMS_OUTPUT.PUT_LINE('Current time: ' || currenttime || ' from Terminal ' || terminal || ' to Instance: ' || inst_name);
dbms_lock.sleep(2);
END LOOP;
END;
/