Question: I'm wondering if I will miss any data if I replace a trigger while my oracle database is in use. I created a toy example and it seems like I won't, but one of my coworkers claims otherwise.

```
create table test_trigger (id number);
create table test_trigger_h (id number);
create sequence test_trigger_seq;

--/
create or replace trigger test_trigger_t after insert on test_trigger for each row
begin
  insert into test_trigger_h (id) values (:new.id);
end;    
/

--/
begin
  for i in 1..100000 loop
    insert into test_trigger (id) values (test_trigger_seq.nextval);
  end loop;
end;
/

--/
begin
  for i in 1..10000 loop
    execute immediate 'create or replace trigger test_trigger_t after insert on test_trigger for each row begin insert into test_trigger_h (id) values (:new.id); end;';
  end loop;
end;
/

ran the two loops at the same time

select count(1) from test_trigger;

COUNT(1)
100000

select count(1) from test_trigger_h;

COUNT(1)
100000

```

Answer: 
`create or replace` is locking the table. So all the inserts will wait until it completes. Don't worry about missed inserts.
Following URL answers that **trigger can be modified while application is running**. its will a "library cache" lock and NOT a "data" lock. Oracle handles it internally without you worrying abt it.

Check out question raised by Ben- [Can a trigger be locked; how would one determine that it is?](https://stackoverflow.com/questions/18460260/can-a-trigger-be-locked-how-would-one-determine-that-it-is)

-- Run this from session 2:
select \* from v$access where object = upper('test\_trigger\_t');