Thursday, 18 February 2016

Troubleshooting the 'ORA-01031: insufficient privileges' error when using EMCA to Create or Drop DBconsole

Troubleshooting Steps

1) Confirm that the database is up.  Connect to the database via sql*plus and do:-
select instance_name,status,version from v$instance;

2) Confirm whether the $ORACLE_HOME environmental variable is correct. This involves comparing the current ORACLE_HOME environmental setting, with the one that was set the last time the database was started.

a) To check the current ORACLE_HOME :-
echo $ORACLE_HOME (unix)
set ORACLE_HOME (windows)

b) To check the $ORACLE_HOME which was set at the time when the database was last started:-

connect to sqlplus as SYS as SYSDBA and issue the following:-
SQL> var OHM varchar2(100);
SQL> EXEC dbms_system.get_env('ORACLE_HOME', :OHM) ;

PL/SQL procedure successfully completed.

SQL> PRINT OHM

OHM
<Oracle_Home which was set at the time that the database was last started will be returned here>

Check whether the OHM which is returned here, matches what is set environmentally.

c) If the values returned by 2a) and 2b) above, do not match, find out the 'real' ORACLE_HOME, to do this check:-

- The path to the oracle home as specified in /etc/oratab.
- The ORACLE_HOME which is shown by calling up the installer
- The ORACLE_HOMES listed in /opt/oracle/oraInventory/ContentsXML/inventory.xml

The ORACLE_HOME should not end in a "/" slash character.

d) If the ORACLE_HOME was set wrongly at the time that the database was started (as determined by 2b), then the database will need to be shut down and re-started. To shut the database down, it will be necessary to set the 'wrong' ORACLE_HOME (the one which is returned in the OHM output). After the database has been successfully shut down, then the correct ORACLE_HOME should be set, and the database can be re-started. eg.
export ORACLE_HOME=/u01/testdb/  <--wrong home which ends with a trailing slash
sqlplus sys/oracle1 as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 19 13:14:51 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

After database has shut down:-
export ORACLE_HOME=/u02/testdb  <--correct oracle home with no trailing slash
sqlplus sys/oracle1 as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 19 13:14:51 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup

3) Confirm whether it's possible to connect to the database as the SYSDBA user remotely, using sqlplus. As part of the repository creation/drop process, the SYS user needs to be able to connect as SYSDBA. The ORA-01031: insufficient privileges error is returned when the SYS user is unable to connect as SYSDBA.  To test this outside of dbconsole, test a sqlplus remote connection (one which connects via a tnsnames.ora alias) as sysdba. eg:-
$ORACLE_HOME/bin>sqlplus sys/<password>@<alias> as sysdba
eg.
D:\10205\BIN>sqlplus sys/oracle1@testdb as sysdba

Tip* The alias should exist in the $ORACLE_HOME/network/admin/tnsnames.ora (or $TNS_ADMIN/tnsnames.ora if $TNS_ADMIN is set).  This test is done from the same machine and the same $ORACLE_HOME as the database being configured for dbconsole by EMCA.


If the above returns the ora-1031 error, check the following:-

a) Check whether the REMOTE_LOGIN_PASSWORDFILE initialization parameter is set correctly in the database.  For the purposes of configuring dbconsole, it must be set to 'EXCLUSIVE'.  This value can be checked by logging into the database via sql*plus and typing "show parameter remote".
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- --------------
remote_login_passwordfile string EXCLUSIVE

If this parameter is not set to 'EXCLUSIVE', the following command can be run:-
alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile;

Note* that the database must be stopped and started for this parameter to take effect.

b) Check whether the password file exists.

The location of the password file is $ORACLE_HOME/dbs (on unix systems) or $ORACLE_HOME/database (on windows). If the password file does not exist, create one as follows:-
Unix:
$ orapwd file=$ORACLE_HOME/dbs/orapw<$ORACLE_SID> password=sys entries=5
eg.
orapwd file=/u01/orabase/11db/dbs/orapwtestdb password=sys entries=5
Windows:
C:\> orapwd file=%ORACLE_HOME%\database\pwd<%ORACLE_SID%>.ora password= sys entries=5
eg.
orapwd file=d:\10204\database\PWDtestdb.ora password=sys
Note* The password will be "sys" in the above examples

c) Confirm whether the SYS user has been granted the SYSDBA role.  To do this check the v$pwfile_users view as below:-
select * from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE

If SYSDBA does not show as 'TRUE' , log in as SYS as SYSOPER and grant 'SYSDBA' to SYS.   If no users are returned, the password file will need to be created as per point 3b) above.
4) Check whether it's possible to make a bequeath connection without using the tnsalias - eg.
$ORACLE_HOME/bin>sqlplus sys/<password> as sysdba

If the message "ORA-12162: TNS:net service name is incorrectly specified" is returned, it suggests that the ORACLE_SID has not been set.  If an error such as ORA-12154 is returned, see note:756076.1 "EMCA Fails With The Error 'Failed to unlock all EM-related accounts' when Creating DBConsole" .  If the message  "Connected to an idle instance"  is returned after logging into sqlplus (but it is possible to login to the database using an alias), it suggests that the ORACLE_SID is set incorrectly.
Tip* To check what the ORACLE_SID is set to do:-
echo $ORACLE_SID (unix)
set ORACLE_SID (windows)

5) Unix only:-

a) Check permissions on the oracle executable, it should be as follows :
$ cd $ORACLE_HOME/bin
$ ls -l oracle

-rwsr-s--x 1 oracle oinstall 210824714 Sep 17 2010 oracle

If the permissions on the oracle executable are wrong, they can be changed using 'chmod 6751 oracle'

b) Check that the user running the emca is the same user as created the database. The user is 'oracle' in this example.
c) Check that this user belongs to the dba group - eg.
id oracle

uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)

d) When entering the name of the database in the emca dialogue, check that the correct case (upper or lower) has been used. To do this:-
ps -ef | grep pmon
(this should show the pmon process for all running databases on the machine). Identify this particular database.  For example if the output of the above grep shows:-
oracle 3451 1 0 Sep14 ? 00:04:40 ora_pmon_v11203
oracle 4157 4107 0 10:43 pts/2 00:00:00 grep pmon
oracle 14844 1 0 Sep13 ? 00:05:10 ora_pmon_cloudrep
oracle 29339 1 0 Oct10 ? 00:00:07 ora_pmon_test                <--> This is the database that is being configured by emca
The pmon process shows ora_pmon_test so the "Database SID" as entered in the EMCA dialogue should be "test" (lower case)
oracle@machine1 admin]$ emca -config dbcontrol db -repos create
STARTED EMCA at Oct 11, 2012 10:37:55 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.
Enter the following information:
Database SID: test      <----specify the same case here
Listener port number: 1541
Listener ORACLE_HOME [ /oracle/orabase/11203hometwo ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
The case entered here, should also match the case of the instance used by the listener.  This can be seen in the output of status <listenerName> in lsnrctl.  For example:-
Ouput from a listener where the sid is statically specified
LSNRCTL> LSNRCTL> status listenertest
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=machine1.uk.oracle.com)(PORT=1541)))
STATUS of the LISTENER
------------------------
Alias listenertest
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 11-OCT-2012 10:30:09
Uptime 0 days 0 hr. 14 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/orabase/11203hometwo/network/admin/listener.ora
Listener Log File /oracle/orabase/diag/tnslsnr/rbridden-pc/listenertest/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=machine1.uk.oracle.com)(PORT=1541)))
Services Summary...
Service "test.machine1.uk.oracle.com" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...     <--  The SID specified in the EMCA should be the same case as this.
The command completed successfully
Output from a listener where the sid is dynamically registered
LSNRCTL> status listenerdyn
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=machine2.oracle.com)(PORT=1542)))
STATUS of the LISTENER
------------------------
Alias listenerdyn
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 11-OCT-2012 10:52:25
Uptime 0 days 0 hr. 2 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/orabase/11203/network/admin/listener.ora
Listener Log File /oracle/orabase/diag/tnslsnr/machine2/listenerdyn/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=machine2.oracle.com)(PORT=1542)))
Services Summary...
Service "prodXDB.machine2.uk.oracle.com" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
Service "production.machine2.uk.oracle.com" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...    <--  The SID specified in the EMCA should be the same case as this.
The command completed successfully

e) If the $ORACLE_HOME is a symbolic link, then the symbolic link needs to be removed.
See note:550484.1  point 5.

6) Windows only:-

a) Check that the "Log on as" account, which is specified in the services, is the same for the database and listener. Usually this will be set to "Local System Account", but if it is different, the listener and the database (and the susbsequent dbconsole service) must all use the same account.

b) Check that the user who is creating the dbconsole, is a member of the oracle_dba group.

for example:-
control panel/administrative tools/computer management/local users and groups/groups/ora_dba (double click to see the members of that group)

c) For dbconsole 11.2.0.1 and 11.2.0.2 check whether the %ORACLE_HOME%/network/admin/sqlnet.ora (or %TNS_ADMIN%/sqlnet.ora)  contains the entry:-

SQLNET.AUTHENTICATION_SERVICES = (NTS)

If not, add this entry.   See note:1332546.1  for more information on this.   This is currently logged as unpublished bug 11740099

7) Check that the %ORACLE_HOME%/bin/emca.bat (windows) or $ORACLE_HOME/bin/emca script contains the correct ORACLE_HOME.  If the home is not set correctly here, take a backup of the emca file, then amend so that the correct home is reflected.

eg. emca on unix will show something like:-
#!/bin/sh
ORACLE_HOME="/u01/112dboraclebase/112db"
PLATFORM="Linux"
export ORACLE_HOME

emca.bat on windows will show something like:-
@echo off

setlocal

set OH=D:\10204

8) If any of  the changes listed above have been made, repeat step 3 and check that it is now possible to make the remote SYSDBA connection from sql*plus:-

$ORACLE_HOME/bin>sqlplus sys/<password>@<alias> as sysdba

If this is now successful, drop the 'failed' dbconsole configuration using:
emca -deconfig dbcontrol db -repos drop

and create a fresh dbconsole using:-
emca -config dbcontrol db -repos create
 
Thanks 
Srini

Wednesday, 3 February 2016

Oracle Database Patches:



Oracle Database Patches:

Patch is required for any bug fix or some additional features. Databse patches are mainly applied for security fixes, Priority fixes and patchset is used for upgradation like 10.2.0.1 to 10.2.0.4.

Critical Patch Update(CPU): These are the patches for security fixes and released each quarter.

Patch Set Update(PSU): These are cumulative patches that include both security fixes and priority fixes. PSU are the minor version upgrades (e.g., 11.2.0.1.1 to 11.2.0.1.2).

Once PSU is applied, PSU has to be applied each quarter till we upgrade our database to new base version.

How do we apply Oracle database patches?

Patches are downloaded from metalink (My Oracle Support) and it has readme.txt file with the patching instructions and we can follow as suggested by oracle with read me file.

Basic steps to follow for applying database patch:

  • Check the patch you are going to apply with opatch lsinventry.
  • Download the patch from metalink.
  • Unzip the patch and read the instructions from read me file.
  • Shutdown database and listner.
  • Go to patch directory : Opatch apply
  • Start listener and database.
  • Run sql script catcpu.sql (from $ORACLE_HOME/rdbms/admin)
  • Verify the status of patch applied 
  • Run SQL script utlrp.sql (compile invalid objects if any generated)

Log location of Opatch:
$ORACLE_HOME/cfgtoollogs/opatch

Significance of utlrp.sql and catcpu.sql:
Utlrp.sql :- location of utlrp.sql is $ORACLE_HOME/rdbms/admin. This script is used to compile the invalid objects.

Catcpuu.sql :- catcpu.sql calls a script called catbundle.sql, which is located at $ORACLE_HOME/rdbms/admin.
This script will load sql file in database by looking into bundledata_cpu.xml for file information for a particular patch. It will be creating a dynamic apply sql file and run it.
 
Thanks
Srini

Oracle Database Architecture



Oracle Database Architecture:

Overview of the System Global Area:

When instance is started SGA is allocated the memory from RAM. SGA memory allocation can not be more than the RAM size.Once instance is shut down the memory is given back to Operating system.

If more memory required than the allocated memory to SGA, In that case it will use the SWAP memory and this memory is compulsory component when ora
cle database is installed.

A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance. If multiple users are concurrently connected to the same instance, then the data in the instance's SGA is shared among the users. Consequently, the SGA is sometimes called the shared global area.

SGA and oracle processes(DBWR, LGWR, CHKPT, SMON, PMON REC, ARCH etc.) collectively called as instance of an oracle database.

The SGA components are as given below:
  • Shared pool (Data dictionary cache and Library cache)
  • Database buffer cache
  • Redo log buffer
  • Java pool
  • Large pool 
  • Streams pool
Instance is responsible for fulfilling the request through server process. Server process can be either shared server or dedicated server architecture. Server process takes the required data from database to SGA and then provide to user request.

Logical layer:
The logical layer comprises one or more tablespaces and the database schema. 
The database schema consists of tables, clusters, indexes, views, procedures, triggers, sequences, and so on. The database schema is a collection of schema objects.

The relationship between segments, extents, and data blocks:
  • Tablespaces: These are at the highest level of Oracle disk-space management.
  • Segments: Collection of Extents.
  • Extents: One or more data block collectively called as Extents.
  • Data blocks: These are at the lowest level of Oracle disk-space management.

The physical layer comprises the following files: 

Control File: Though it is very small file, it is the most crucial and critical file. This file is responsible for starting up the database into open mode and availabe for user request. It contains the requisite information to start the database. 
The names and locations of all the control files of the database can be obtained from the V$CONTROLFILE view.
It also contains the name of database, timestamp of database creation, information of data file and redolog files which helps in recovery.

Control file has two section. Fixed section and Rotation section. Rotation section keeps the information till 7 days by default.We can change it by changing the initialization parameter control_file_record_keep_time.

Data files: Data files are used to store data in blocks for each and every tables of a database.Size of datafiles may vary from kilobytes to terabytes(KB,MB,GB and TB). Most of the space is being occupied by data files in any database.

Redo Log files: Any changes made in data block are captured into redo log buffer and then into redo log files. These files are very helpful in recovery in case of system failure. The information in the Redo Log Buffer is written into Redo Log files by the LGWR background process. The Redo Log files are generally multiplexed and copied for recovery purposes. Sets of redo Log files are known as Redo Log groups. Each database has minimum of two Redo Log groups. Redo Log groups are used in a circular fashion. Redo log groups can be added as per our need.

Note: The V$LOGFILE dynamic performance view is used to obtain information about the names and locations of the Redo Log groups and their members.

SGA- It stands for System Global Area. SGA is allocated whenever an Oracle instance starts and gets de-allocated when the Oracle instance is shutdown.
Components of SGA: 

  1. Database Buffer Cache: It contains the data read from data files and data updated.It  has 3 area namely: Free buffer: does not contain any useful data. Dirty buffer: Contains the modified data and ready to be written in data files(by DBWR). Pinned buffer: Currently being used by active user.
  2. Redo Log Buffer: Contains the information modified in data buffer and ready to be written to redo log files(By LGWR).
  3.  Shared Pool: It has two section as : Library cache: The library cache contains the current SQL execution plan information. It also holds stored procedures and trigger code. Data Dictionary Cache: The dictionary cache stores environmental information, which includes referential integrity, table definitions, indexing information, and other metadata stored within Oracle's internal tables.
  4. Large Pool: This area is only used if shared server architecture, also called multi-threaded server (MTS), is used, or if parallel query is utilized. LARGE_POOL_SIZE = integer. Session memory for the shared server and the Oracle XA interface which is used where transactions interact with more than one database.  I/O server processes. Oracle backup and restore operations.
  5. Java Pool: Contains all java files.
  6. Stream Pool: Used for data stream from one system to another.

PGA- Program Global Area is a region in memory that contains data and control information for a single process. This can be either a server or a background process. A PGA is allocated whenever an Oracle database user connects to a database and a session is created for him/her.

PGA components:

  1. Session Area- memory allocated to hold a session variables (login information) and other information related to the session. For a shared server, the session memory is shared and not private.
  2. SQL work area- This is also called as sort area. All SQL operations like joining,sorting,groupby, orderby are done in this area.
  3. Private SQL Area- A private SQL area contains data such as bind information and runtime memory structures. Each session that issues an SQL statement has a private SQL area.
  4. Cursor area - Explicit cursor and Implicit Cursor

Background Process: These are the process which enable the databse to work continuously and are listed below:
  1. DBWR : It writes data blocks from dirty buffer of data buffer cache to data files.
  2. LGWR : It writes data from the Log Buffer to the redo log. LGWR writes to a Redo Log files in case of these events: #Whenever a user commits a transaction. #Whenever the Redo Log Buffer is one-third (1/3) full. #Every three seconds.
  3. CKPT : It updates the header of data file and control file with current timestamp and SCN.
  4. PMON : It stands for process monitor. It keeps track of database processes. It also cleans up the process that has died pre-maturely. The result is that all the cache and the resources are freed up. It also restarts those dispatcher processes that might have failed.
  5. SMON : It stands for system monitor. It performs instance recovery at instance startup. It cleans up the segment which are no longer in use.
Oracle processes:
  • User processes
  • Server processes
The first interaction with the Oracle-based application comes from the user computer that creates a user process. The user process then communicates with the server process on the host computer. Here, PGA is used to store session specific information. 

Oracle instance:
The Oracle instance consists of SGA and all the Oracle background processes. To manage the size of SGA, two initialization parameter files known as PFILE and SPFILE are used. There are a total of 250-initialization parameters. PFILE holds 30 of those 250 initialization parameters. Oracle does not recommend modifying the rest of the 220 initialization parameters. 

Brief of Architecture:
SGA = Shared Pool + Data buffer Cache + Redo Log + LArge Pool + Stream Pool + Java Pool 

Oracle Instance = SGA + Background Process

Oracle database = Oracle Instance + datafiles + Controlfile + Redo log files
 
Thanks
Srini

OC4J Components exiting with status 204,3 and 150



R12-oafm, forms and oacore exiting with status 204, status 3 and status 150 after IP address change:

Recently, I had gone through a problem while, I changed the server IP and started the oracle application with adstrtal.sh script.

adstrtal.sh: Exiting with status 3 and adoafmctl.sh: exiting with status 204

Solution to fix this issue:

Problem: IP address is present in OC4J lock files, Once IP address is changed - lock files contain the wrong IP address which causes the problem to fail OC4J.

Steps to be followed to exit with 0:

  1. Open a new session and set the environment with apps user.
  2. Go to $ADMIN_SCRIPTS_HOME ( cd $INST_TOP/ADMIN/SCRIPTS)
  3. adopmnctl.sh stop
  4. Verify the staus once: ps -ef grep grep opmn
  5. Delete the persistence directory with below commands:
  • rm -r $INST_TOP/ora/10.1.3/j2ee/oacore/persistence/*
  • rm -r $INST_TOP/ora/10.1.3/j2ee/oafm/persistence/*
  • rm -r $INST_TOP/ora/10.1.3/j2ee/forms/persistence/* 
  1. adopmnctl.sh start
  2. Check if the issue has been resolved: adapcctl.sh status
 
Thanks
Srinivas

Tuesday, 2 February 2016

Applying Adpatch or autopatch and maintenance mode


Application Patch – Adpatch or Autopatch:

Why do we need patch?
  • For fixing a bug.
    • Bug: Customization or by release of new product, bug is encountered.
  • Adding new functionality / new module e.g. supplier management functionality.
  • Applying new product enhancement.
  • Upgrade to higher point release or release (like 12.X.1 to 12.X.2 or 12.1.X to 12.2.X)
  • Upgrading to higher family pack
    • It may contain bulk of patches.
    • Bugs reported by customer.

Patch can be downloaded from metalink in zip format and while we unzip any patch, It contains driver file- which directs adpatch for its activity, readme.txt file which is useful for DBA to apply patch and do analysis with preinstall task and post install tasks.

Patch Utilities:
  1. Command line utility
  2. Web based patch utility – Oracle application manager(OAM)

Command line patch utility are adpatch which is used for applying patch in application tier, admrgpatch which is used to merge multiple patch into single and can be applied the merged patch alone instead of applying all patches individually.

Admsi.pl at AD_TOP/bin :
Script for generating customized installation instruction for a patch that helps in tracking and performing manual steps during patch.
It can be executed in CLI (Command Line Interface) or GUI (Graphical User Interface).

We must do some check before we apply patch as:
  • Check the patch number in table ad_bugs and ad_applied_patches (SQL> select * from AD_BUGS where bug_number=’<patch number>’;)
  • Which module it belongs to and what would be the impact.

Step to apply adpatch:

  1. Download patch from metalink.
  2. Go to patch directory and unzip the patch.
  3. Go through readme.txt file and check for any pre-requisite and post requisite and take care accordingly.
  4. Shutdown the application services. (keep in mind database and listener should be up and running).
  5. Bring the application into maintenance mode using adadmin utility (discussed on later part of this post).
  6. Source the environment ( at App_Base/ apps/ apps_st/ appl/ APPS[SID]_[hostname].env).
  7. Apply the patch with adpatch
  8. Monitor the patch from log file at APPL_TOP/admin/SID/log
  9. Once patch is complete, check both adpatch.log and adpatch.lgi
  10. Disable the maintenance mode.
  11. Start all the application services and check for the patch applied.

How do we apply patch without enabling maintenance mode?
I would say use option=hotpatch and It is used when we apply patch when maintenance mode is disabled.
 
Do we need to run autoconfig after patching?
Adpatch takes care of it to update configuration files, if any template files are introduced by the patch.

Do we have to apply patch on all nodes for multimode system?
It depends. In a shared APPL_TOP system, changes made during patching session on one node are immediately available on all nodes.
If APPL_TOP is not shared , then have to apply patch individually to all nodes.

Adpatch.log : main autopatch log file.
Adpatch,lgi : autopatch informational messages.
adworkerXXX.log : for database operations run in parallel and have the worker log details.

Maintenance mode:

Why enable maintenance mode?
Maintenance mode is enabled to ensure optimal performance and reduce downtime during patching session. It shuts down the workflow business event system and set up function security so that oracle applications functions are unavailable to users. This provides a clear separation between normal runtime operation and system downtime for patching.

Enabling Maintenance Mode:

  • Set the environment App_Base/ apps/ apps_st/ appl/ APPS[SID]_[hostname].env.
  • Run the ad administration utility by typing adadmin on unix/linux console.

It will ask a series of questions with application and databse related information along with context file.Then it will show following options:

  1. Generate applications file menu.
  2. Maintain applications file menu.
  3. Compile/Reload Applications Database Entities Menu.
  4. Maintain Applications Database Entities Menu.
  5. Change Maintenance Mode.
  6. Exit ad Administration.

Select option 5. Now it will show the below option:

  1. Enable Maintenance mode.
  2. Disable Maintenance mode.
  3. Return to Main Menu.

Select option 1. Then return to console.

When we enable maintenance mode with adadmin utility, it calls setmmd.sql script located at FND_TOP/sql location. We can also enable / disable maintenance mode with this script.
 
Thanks
Srini