Saturday, February 26, 2022
RMAN Database Full Backup & Recovery
RMAN Database Full Backup & Recovery
-Take RMAN DB FULL Backup
-Simulate Failure
-Start Database Recovery
nohup rman target / cmdfile=/u01/mqm/MQM_RMAN_Backup_script.sh log=/u01/mqm/rman_fullbackup_db.log &
cat mqm_rmanbackup.txt
run
{
allocate channel t1 type disk;
backup format '/u01/mqm/full_db_%t_%p%p' database;
backup format '/u01/mqm/archive_%t_%p%p' archivelog all;
backup format '/u01/mqm/cntrl_%s_%p_%t' current controlfile;
Backup format '/u01/mqm/spfile_%s_%p_%t' spfile;
release channel t1;
}
cat rman_exec.sh
rman target / cmdfile=mqm_rmanbackup.txt
nohup ./rman_exec.sh &
RMAN> list backup of database summary;
RMAN> list backup summary;
Simulate Failure:
Take the location of spfile, datafile & control file
SQL> select name from v$datafile;
SQL> select member from v$logfile;
SQL> select name from v$controlfile;
SQL> show parameter spfile;
SQL> create pfile from spfile;
File created.
Delete all the spfile, datafiles & Control files from the server.
SQL> startup;
ORACLE instance started.
Total System Global Area 801112064 bytes
Fixed Size 8797872 bytes
Variable Size 423625040 bytes
Database Buffers 360710144 bytes
Redo Buffers 7979008 bytes
ORA-00205: error in identifying control file, check alert log for more info
Restore Controlfile:
run
{
allocate channel c1 type disk;
set until time "to_date('2022/02/26 15:47:00','yyyy/mm/dd HH24:MI:SS')";
restore controlfile from '/u01/mqm/cntrl_23_1_1097682448';
release channel c1;
}
Bring the database at mount state
RMAN> alter database mount;
Statement processed
(or)
sqlplus / as sysdba
SQL> alter database mount;
Database altered.
Restore Database:
run
{
allocate channel c1 type disk;
set until time "to_date('2022/02/26 15:47:00','yyyy/mm/dd HH24:MI:SS')";
restore database;
recover database;
release channel c1;
}
RMAN> alter database open resetlogs;
Statement processed
(or)
sqlplus / as sysdba
SQL> alter database open resetlogs;
Database altered.
Wednesday, January 5, 2022
Oracle Reports 12c: First Step to Complete After a New Forms/Reports 12c Install and Configuration Environment ?
How to enable and check Maintenance mode status - (11i & R12)
How to enable and check Maintenance mode status - (11i & R12)
Use the Query below:
To Enable maintenance mode from SQLPLUS on MT node
sqlplus apps/*****
SQL> @$AD_TOP/patch/115/sql/adsetmmd ENABLE
PL/SQL procedure successfully completed.
Commit complete.
To Disable maintenance mode from SQLPLUS on MT node
sqlplus apps/*****
SQL> @$AD_TOP/patch/115/sql/adsetmmd DISABLE
PL/SQL procedure successfully completed.
Commit complete.
To check status:
SQL> select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;
FND_PROFILE.VALUE('APPS_MAINTENANCE_MODE')
--------------------------------------------------------------------------------
MAINT/NORMAL
How to create startup & shutdown scripts form Oracle forms & reports ?
How to create startup & shutdown scripts form Oracle forms & reports ?
Startup Script:
cat start_services.sh
export ORACLE_BASE=/u01/oraclefrs
export MW_HOME=$ORACLE_BASE/middleware
export WLS_HOME=$MW_HOME/wlserver
export WL_HOME=$WLS_HOME
export DOMAIN_HOME=$ORACLE_BASE/middleware/user_projects/domains/basenew_domain
export OHS_INST=$DOMAIN_HOME/config/fmwconfig/components/OHS/instances/ohs1
# Start NodeManager
nohup $DOMAIN_HOME/bin/startNodeManager.sh > /dev/null 2>&1 &
sleep 15
# Start WebLogic Domain
nohup $DOMAIN_HOME/bin/startWebLogic.sh > /dev/null 2>&1 &
sleep 60
# Start the managed Servers
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_FORMS > /dev/null 2>&1 &
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_REPORTS > /dev/null 2>&1 &
sleep 15
# Start the web tier.
$DOMAIN_HOME/bin/startComponent.sh ohs1
echo " All services are up and Running.... "
Shutdown Script:
cat stop_services.sh
export ORACLE_BASE=/u01/oraclefrs
export MW_HOME=$ORACLE_BASE/middleware
export WLS_HOME=$MW_HOME/wlserver
export WL_HOME=$WLS_HOME
export DOMAIN_HOME=$ORACLE_BASE/middleware/user_projects/domains/basenew_domain
export OHS_INST=$DOMAIN_HOME/config/fmwconfig/components/OHS/instances/ohs1
# Stop the web tier.
$DOMAIN_HOME/bin/stopComponent.sh ohs1
# Stop the managed Servers
$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_FORMS
$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_REPORTS
# Stop WebLogic Domain
$DOMAIN_HOME/bin/stopWebLogic.sh
# Stop NodeManager
$DOMAIN_HOME/bin/stopNodeManager.sh