Saturday, February 26, 2022

Linux 6.7 Virtualbox Images

  Linux Fresh 6.7 Installed Image

Linux 7.8 Virtualbox Images

 Linux Fresh 7.8 Installed Image

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 ?

Oracle Reports 12c: First Step to Complete After a New Forms/Reports 12c Install and Configuration Environment ?


An Example 12c Directory Structure:

Windows:

ORACLE_HOME=C:\Oracle\Middleware\Oracle_Home 
MW_HOME=C:\Oracle\Middleware 
WL_HOME= C:\Oracle\Middleware\Oracle_Home\wlserver 
DOMAIN_HOME= C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

Unix:

ORACLE_HOME=/Oracle/Middleware/Oracle_Home 
MW_HOME=/Oracle/Middleware 
WL_HOME=/Oracle/Middleware/Oracle_Home/wlserver
DOMAIN_HOME=/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain


The first step after running the Configuration Wizard in a new environment with Oracle Reports 12c is to run the WLST command createReportsToolsInstance(). This command will create all the components at file system level needed for Oracle Reports.

** Make sure AdminServer Managed server is running

** Make sure WLS_REPORTS is not running

For Example:

1- Execute wlst.cmd/wlst.sh from ORACLE_HOME/oracle_common/common/bin

2- Connect to AdminServer. 

    connect("weblogic","weblogic_<PASSWORD>","hostname:7001")

3- Run the following wlst command. 

    createReportsToolsInstance(instanceName='reptools1',machine='AdminServerMachine')

** In above createReportsToolsInstance() command example, 'AdminServerMachine' value is the logical machine name that hosts the WebLogic Server instance.

** To log out of WLST, use "exit()".

The following folders are some of the key folders created for Reports 12c after above steps.

DOMAIN_HOME/reports/bin  
DOMAIN_HOME/reports/cache
DOMAIN_HOME/reports/fonts
DOMAIN_HOME/reports/plugins
DOMAIN_HOME/reports/server

Now the Oracle Reports environment is complete and ready to be used.


Reference metalink Doc ID 2072671.1

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

# Adjust paths and domain name to suit your installation.

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