Step 1) Copy Backup copies from Production to Development server using cp command
[Source server Backup]$ scp -p bkup_j93m9af4_95849_1_1 bkup_ja3m9ahh_95850_1_1 bkup_jb3m9aju_95851_1_1 bkup_jc3m9amb_95852_1_1 bkup_jd3m9aqj_95853_1_1 bkup_je3m9aql_95854_1_1 bkup_jf3m9aqn_95855_1_1 c-87645678-20250407-00 oracle@Target server:<Backup Location>
Step 2) Once copy done connect to target server verify spfile and create pfile from spfile
[oracle@sreenu ~]$ !sq
sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Apr 7 08:56:30 2025
Version 19.21.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition 2 Release 19.0.0.0.0 - Production
Version 19.21.0.0.0
SQL>
SQL> sho parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/opt/oracle/dbhome/dbs/spfilePROD.ora
SQL> create pfile from spfile;
File created.
Step 3) Check Listener status and stop Listener on Target server ( It will not allow incoming connections to connect database)
[oracle@sreenu ~]$ lsnrctl status
[oracle@sreenu ~]$ lsnrctl stop
Step 4) Drop Database on target server (Before drooping the database take full backup of the development server )
Note1:Only we can drop/delete database on mount mode only
Note2:Before drooping the database we need to shutdown database and startup restrict mode
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup restrict mount;
ORACLE instance started.
Total System Global Area 5905576504 bytes
Fixed Size 8938040 bytes
Variable Size 3909091328 bytes
Database Buffers 1979711488 bytes
Redo Buffers 7835648 bytes
Database mounted.
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
PROD MOUNTED
SQL> drop database;
Database dropped.
Step 5) Startup database using pfile in nomount mode.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 5905576504 bytes
Fixed Size 8938040 bytes
Variable Size 3909091328 bytes
Database Buffers 1979711488 bytes
Redo Buffers 7835648 bytes
SQL>
SQL> sho parameter pfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
SQL>
Note: Database started using by pfile.
Step 6) Restore controlfile from backup using RMAN tool / Prompt
[oracle@czprg-tcora303 PROD]$ rman target /
connected to target database: PROD (not mounted)
RMAN>
RMAN> restore controlfile from '/u01/opt/oracle/rman_bkup/PROD/c-87645678-20250407-00';
Starting restore at 07-APR-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/opt/oracle/control_files/control01.ctl
output file name=/u01/opt/oracle/control_files/control02.ctl
output file name=/u01/opt/oracle/mpx_PROD/control_files/control03.ctl
Finished restore at 07-APR-25
RMAN>
Step 7) Once controlfile restored we need to bring database to mount mode.
RMAN> alter database mount;
released channel: ORA_DISK_1
Statement processed
RMAN>
Step 8) restore database.
Step 9) Once restore done , we need to recovery the database.
Step 10) Once recovery done , we need to open database using resetlogs.
RMAN> alter database open resetlogs;
Statement processed
RMAN>
Step 11) Once restore and recovery done , we need to start database with spfile
Note: Always run database using spfile only.
Note: To change database from pfile to spfile, need to create spfile from pfile and bounce the database.
SQL> create spfile from pfile;
File created.
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 5905576504 bytes
Fixed Size 8938040 bytes
Variable Size 3909091328 bytes
Database Buffers 1979711488 bytes
Redo Buffers 7835648 bytes
Database mounted.
Database opened.
SQL>
Step 12) Verify Database mode and its running with spfile or not.
SQL> sho parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/opt/oracle/dbhome/dbs/spfilePROD.ora
SQL> select name,open_mode,log_mode from v$database;
NAME OPEN_MODE LOG_MODE
--------- -------------------- ------------
PROD READ WRITE ARCHIVELOG
SQL>
Step 13) Start Listener and check status
[oracle@sreenu ~]$ lsnrctl start
[oracle@sreenu ~]$ lsnrctl status
Step 14) Ask Application team to verify from application end.
No comments:
Post a Comment