This approach can be a good way to create a development environment from your production database instance.
Note that you may need to anonimise the data after creation of the new standalone. It is not good practice to use real customer data in a non-production environment.
The Primary has RMAN backups configured. (Add them before continuing if they are missing).
The Standby has RMAN backups configured. (Just skip the "Delete Backup" steps and add backups at the end).
You are not using an RMAN catalog (this is TODO).
You are not using ASM (this is TODO).
The database is on a UNIX (e.g. Linux, AIX etc) Operating System. (Windows needs additional steps and file locations are different).
Any automation has already been disabled (e.g. cron jobs to open as Snapshot Standby etc).
You are using the Data Guard Broker. Although some alternate steps have been included, there are other tasks that the Broker performs automatically that are not documented here.
This is an optional step. It is much easier to delete backups at this stage but harder to rollback. I have also included a later step to delete backups after conversion to standalone is complete.
rman target /
DELETE BACKUP;
dgmgrl /
EDIT CONFIGURATION SET PROTECION MODE AS MAXPERFORMANCE;
REMOVE CONFIGURATION;
On BOTH databases (Primary and Standby)..
SET LINESIZE 200
SET PAGESIZE 40
COLUMN name FORMAT a30
COLUMN value FORMAT a150
SELECT name,
value
FROM v$parameter
WHERE name IN ('log_archive_config',
'db_file_name_convert',
'log_file_name_convert',
'dg_broker_start',
'dg_broker_config_file1',
'dg_broker_config_file2',
'standby_archive_dest',
'standby_file_management',
'fal_server',
'fal_client')
OR name LIKE 'log_archive_dest%';
Copy the output in case you decide to backout the change.
You should also delete the files identified by dg_broker_config_file1 and dg_broker_config_file2 from the OS command line e.g.
rm /full/path/dr1MYSID.dat
rm /full/path/dr2MYSID.dat
On BOTH databases (Primary and Standby)..
ALTER SYSTEM RESET db_file_name_convert SCOPE=SPFILE;
ALTER SYSTEM RESET log_file_name_convert SCOPE=SPFILE;
ALTER SYSTEM SET dg_broker_start=FALSE SCOPE=BOTH;
ALTER SYSTEM RESET dg_broker_config_file1 SCOPE=SPFILE;
ALTER SYSTEM RESET dg_broker_config_file2 SCOPE=SPFILE;
ALTER SYSTEM RESET standby_archive_dest SCOPE=SPFILE;
ALTER SYSTEM RESET standby_file_management SCOPE=SPFILE;
ALTER SYSTEM RESET fal_server SCOPE=SPFILE;
ALTER SYSTEM RESET fal_client SCOPE=SPFILE;
On the old Standby (new Standalone)...
sqlplus / as sysdba
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
On BOTH databases (Primary and Standby)..
SELECT GROUP# FROM V$STANDBY_LOG;
Drop all Standby Redo Logs returned from query above...
ALTER DATABASE DROP STANDBY LOGFILE GROUP &group;
Online redo logs need to exist on the Standby...
@/u01/dba/oraredologs.sql
Verify tempfiles exist on the Standby. Add new if necessary.
@/u01/dba/oratemptscheck.sql
TODO
sqlplus / as sysdba
SHUTDOWN IMMEDIATE
STARTUP MOUNT
exit
nid TARGET=SYS/password DBNAME=MYNEWDBNAME
sqlplus / as sysdba
CREATE PFILE FROM SPFILE;
Update DBNAME in $ORACLE_HOME/dbs/initMYSID.ora
sqlplus / as sysdba
CREATE PFILE FROM SPFILE;
STARTUP MOUNT
ALTER DATABASE OPEN RESETLOGS;
exit
orapwd file=$ORACLE_HOME/dbs/orapwMYNEWDBNAME force=y
Check TNSNAMES.ORA and LISTENER.ORA. Update as necessary.
e.g. In my testing I removed the Data Guard Broker rleated stanza from listener.oralsnrctl stop listener
lsnrctl start listener
You only need to restart if you made any changes to listener.oraIf you were backing up the Physical Standby on this server before converting to standalone, you are likely to have some backups in the FRA (unless you deleted them in the earlier optional step) that you now can't delete from RMAN (due to the change in incarnation caused by the open resetlogs). Assuming RMAN was configured to autobackup the controlfile, you can do this...
export ORACLE_SID=DUMMY
vi $ORACLE_HOME/dbs/initDUMMY.ora
db_name=MYDBNAME
db_unique_name=DUMMY
control_files='/u02/oradata/DUMMY/controlfile/ctlDUMMY1.ctl'
*.compatible='11.2.0.3.0'
sqlplus / as sysdba
startup nomount
Identify the full path of the most recent controlfile autobackup of the previous incarnation of the database. If you pick an autobackup from the new incarnation you won't be able to see the old backups. If you pick an older controlfile autobackup then some autobackups may not be visible.
rman target /
restore controlfile from '/fra/MYDBNAME/autobackup/2025_06_02/o1_mf_s_1202213625_n3thy526_.bkp';
alter database mount;
list backup summary
DELETE BACKUP;
This is critical as opening the database with RESETLOGS will hamper recovery from existing backups.