-
Startup Trigger
I am trying to truncate a sys-owned custom table called 'IS_BACKUP_RUNNING'.
I have used a sys startup trigger but it doesn't seem to be working.
ex:
CREATE OR REPLACE TRIGGER CLEAR_BACKUP_FLAG
AFTER STARTUP on database
begin
execute immediate 'TRUNCATE TABLE IS_BACKUP_RUNNING';
exception when others then null;
end;
/
SHOW ERRORS;
I bounced the instance, but the table isn't truncated. Is there a restriction on DDL for these types of triggers?
-
Why don't you move the table to a non Oracle schema? I'm not sure about the trigger restriction, but it seems like you want to separate out your stuff from that of Oracle.
-
1- I would write a proper EXCEPTION section, be sure to show the Oracle account executing the trigger alongside with the actual error.
2- I would fully qualify the target table.
3- I would be sure ORACLE account has the right privs on target table.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
I am having trouble capturing the EXCEPTION b/c it fires on startup, co I can't use DBMS_OUTPUT... any ideas on being able to insert SQLERRM into a log table?
I have heard that DDL is not allowed on startup triggers. Can anybody confirm?
-
just use an insert statement, thats dml not ddl
-
DML is definitely out in STARTUP TRIGGERS, but thanks.
-
Originally Posted by sqlsurf
DML is definitely out in STARTUP TRIGGERS, but thanks.
You can send messages to the alert log.
http://www.oracle.com/technology/ora...03/011203.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|