Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我期待有一个简单的 PL/SQL 块,它将查询 gv$session 的特定条件并将其计数与时间戳一起粘贴到临时表中。我希望查询每 1 分钟运行一次。
例如,查询将是这样select count(*) from gv$session where ID='1' 的,并且它的输出应该与它正在执行的时间戳一起粘贴到某个表中。查询应该每 1 分钟运行一次,直到我们手动停止它
select count(*) from gv$session where ID='1'
CREATE TABLE mytable ( id INTEGER , cnt INTEGER , modified_dt DATE ); CREATE TRIGGER mytable_t1 BEFORE INSERT ON mytable FOR EACH ROW BEGIN :new.modified_dt := SYSDATE; END; INSERT INTO mytable ( id, cnt ) VALUES (1, 100); END: