티스토리 뷰


DBA를 하다 보니 개발자들이 개발/운영 DB에 CREATE TABLE 하거나 ALTER 문을 날리는 경우가 발생했다.

시노님을 생성해서 작업을 해야 하는게 원칙이긴 하지만 프로젝트 막바지에 이르다 보니 새로 권한 정의가 어렵기 때문에 잠시 트리거(시스템) 을 이용하여 DDL변경을 모니터링 하는 방법을 참고 했다.


Triggers on System Events and User Events

You can use triggers to publish information about database events to subscribers. Applications can subscribe to database events just as they subscribe to messages from other applications. These database events can include:

  • System events

    • Database startup and shutdown

    • Data Guard role transitions

    • Server error message events

  • User events

    • User logon and logoff

    • DDL statements (CREATE, ALTER, and DROP)

    • DML statements (INSERT, DELETE, and UPDATE)

Triggers on system events can be defined at the database level or schema level. The DBMS_AQ package is one example of using database triggers to perform certain actions. For example, a database shutdown trigger is defined at the database level: