I'm working on writing some batch scripts for my company, and I see in some historical batch scripts with the following steps:
- There is one
Delete from table where
.... statement - The Oracle import tool is used to import a single record
- Recompile the schema
I don't believe you would need to recompile the schema after a delete and then import (insert). Am I wrong? Is it ever p开发者_运维知识库ossible that DDL statements such as delete and insert could case an object to be invalid?
I assume you're specifying TABLES parameter on the import? If so, you're in TABLE mode, which means that procedural objects, views, etc. are not imported. The imp command does perform a COMPILE on any PL/SQL program units that may be imported by the process. This could conceivably invalidate other dependent objects, hence the recompile step in the batch script. Of course, many times this sort of thing is put into a script based on another script that was used as a template, and could easily be unnecessary.
Can't think of a reason why this would happen, unless your DML is messing with the data-dictionary, which sounds like a very bad idea...
As another thought, maybe the recompilation has the side-effect of doing a needed COMMIT?
精彩评论