関数作成時or replaceの役割

761 ワード

今日、Oracleの公式ドキュメントを見ていると、or replaceの重要な役割が見つかりました.以前にこの関数に付与された権限がor replaceを使用する場合、異なる再付与が可能である.すなわち、or replaceを使用する場合、他のユーザーの関数上の権限は失われず、変更されません.
 
Specify OR REPLACE to re-create the function if it already exists. Use this clause to change the definition of an existing function without dropping, re-creating, and regranting object privileges previously granted on the function. If you redefine a function, then Oracle Database recompiles it.
Users who had previously been granted privileges on a redefined function can still access the function without being regranted the privileges.
If any function-based indexes depend on the function, then Oracle Database marks the indexes DISABLED .