_ORACLE_SCRIPT hidden parameter in Oracle

Hidden Parameter “_Oracle_SCRIPT” use in multitenant database.

_ORACLE_SCRIPT parameter helps us to override the things that we want to do in multitenant database in CDB$ROOT. Suppose we want to create an User in CDB$ROOT database but in CDB$ROOT throw error : ORA-65096: invalid common user or role name in oracle.

Note: For create a user in CDB$ROOT need to use prefix  C## or c## prefixes.

For disable this using PREFIX for create use, Set the hidden parameter as follows:

-- Enable the _ORACLE_SCRIPT Parameter
alter session set "_oracle_script"=true;
Example:
Create user test identified by test;
--Successfully executed in CDB$ROOT DB.

--Disable the _ORACLE_SCRIPT Parameter:
alter session set "_oracle_script"=FALSE;
Example:
Create user test identified by test;
-- Throw error ORA-65096

For drop such user, we need to set this also.

Note: this hidden parameter is used to open the PDB$SEED database in READ WRITE mode.

alter session set "_oracle_script"=true;
alter pluggable databsae pdb$seed close;
alter pluggable database pdb$seed open read write;

--Again readonly
alter session set "_oracle_script"=true;
alter pluggable databsae pdb$seed close;
alter pluggable database pdb$seed OPEN READ ONLY;

--Disable _ORACLE_SCRIPT
alter session set "_oracle_script"=FALSE;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.