“_ORACLE_SCRIPT”参数首先是个隐藏参数,所以很少有文档中描述他打开了哪些开关,因为它是oracle内部维护时使用,在ORACLE_HOME下的脚本中不少都有alter session set “_oracle_script”=true的SQL, 但是注意执行完后即使的再改回false. 千万不要为了突破oracle的默认限制而随意使用_oracle_script参数,生产库除了oracle要求更不建议修改,因为后期有可能会遇到不些不必要的麻烦。
修改了”_oracle_script”有可能在后面升级时因为破坏了oracle的内部约束而升级失败,或后面在业务数据导出(datapump)时而数据丢失。
因为在set “_oracle_script”=true后,创建的用户,用户属性oracle_maintained会标记为Y。我在之前blog 《Oracle 12c新特性:ORACLE自动维护的Schema或默认创建的USER》中有记录过oracle_maintained是标记是否为ORACLE 内部SCHEMA。 同时如果”_oracle_script”=true,那创建的对象oracle_maintained属性同样为Y, 这样在使用数据泵expdp导出时,认为是系统对象而不再导出,导致数据丢失。
demo
版本oracle 19.2
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> create user anbob identified by oracle;
--fail show ORA-65096
SQL> ho oerr ora 65096
65096, 00000, "invalid common user or role name"
// *Cause: An attempt was made to create a common user or role with a name
// that was not valid for common users or roles. In addition to the
// usual rules for user and role names, common user and role names
// must consist only of ASCII characters, and must contain the prefix
// specified in common_user_prefix parameter.
// *Action: Specify a valid common user or role name.
//
SQL> show parameter common_user
PARAMETER_NAME TYPE VALUE