Posts

Showing posts from December, 2025

Mandatory Profile in Oracle Database

Image
  As you know, profiles can be used to impose restrictions on each user in two areas:   resource consumption   and   password complexity . Profiles are set at the user level, and each user can have only one profile. In Oracle 21c , a new type of profile called  Mandatory Profile  was introduced. It can be created at the root container level and can be assigned to one or more PDBs. In this case, the policies defined in the profile will apply to all users in the assigned PDB(s). A  Mandatory Profile  is specifically intended to enforce password-related restrictions, such as ensuring that a user’s password has at least  n  characters. These restrictions can be implemented by creating a  FUNCTION  and assigning it to the  PASSWORD_VERIFY_FUNCTION  parameter in the profile. Example:  In this example, by creating a function  func_pass_limit  and using it in a Mandatory Profile, we aim to enforce a restriction...

Restoring a Lost Datafile from Standby Using RMAN

Image
  If an operating system–level datafile is lost in the primary database environment, this loss can be compensated using the existing datafile on the Data Guard server (provided that the files are compatible). In versions prior to  12c , the DBA needed to manually transfer the datafile from the Data Guard environment to the primary database at the OS level. In  12c , this task can be performed using a single  RMAN  command: — Primary: SQL> create tablespace tbs1 datafile ‘/u01/test1.dbf’ size 10m; SQL> !mv /u01/test1.dbf /u01/test2.dbf rman target / RMAN> RESTORE DATAFILE ‘/u01/test1.dbf’ FROM SERVICE stb; Starting restore at 05 -JUL- 16 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID= 4 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: using network backup set from service stb channel ORA_DISK_1: specifying datafile(s) to restore f...