Sunday 30 June 2013

Concurrent Managers Status shows “System Hold, Fix Manager”

Concurrent Managers Status shows  “System Hold, Fix Manager”  in Concurrent–>Manager–>Administer Screen form


Solution:

a) Ensure Concurrent :GSM Enabled profile is set to ‘Y’

b) Run $FND_TOP/patch/115/sql/afdcm037.sql

c) Go to $FND_TOP/bin

adrelink.sh force=y “fnd FNDLIBR”

adrelink.sh force=y “fnd FNDSM”

adrelink.sh force=y “fnd FNDFS”

adrelink.sh force=y “fnd FNDCRM”

d) Run cmclean.sql

e) Start Application Service (adstrtal.sh)

Saturday 29 June 2013

Oracle SGA - System Global Area

  • SGA is dynamic and sized using SIZE_MAX_SIZE
  •  SGA memory allocated and tracked in granules by SGA components
    – Contiguous virtual memory allocation
     – Size based on SGA_MAX_SIZE                                                                                                 

    The SGA consists of several memory structures
    – Shared pool
    – Database buffer cache
    – Redo log buffer

There are two optional memory structures that can be configured within the SGA:
– Large pool
– Java pool

Shared Pool
The shared pool environment contains both fixed and variable structures. The fixed structures remain relatively the same size, whereas the variable structures grow and shrink based on user and program requirements. The actual sizing for the fixed and variable structures is based on an initialization parameter and the work of an Oracle internal algorithm.
It consists of two key performance-related memory structures:
– Library cache
– Data dictionary cache

  a) Library Cache
The library cache size is based on the sizing defined for the shared pool. Memory is allocated when a statement is parsed or a program unit is called. If the size of the shared pool is too small, statements are continually reloaded into the library cache, which affects performance.
The library cache is managed by a least recently used (LRU) algorithm. As the cache fills, less recently used execution paths and parse trees are removed from the library cache to make room for the new entries. If the SQL or PL/SQL statements are not reused, they eventually are aged out.

The library cache consists of two structures:
• Shared SQL: The Shared SQL stores and shares the execution plan and parse tree for SQL statements run against the database. The second time that an identical SQL statement is run, it is able to take advantage of the parse information available in the shared SQL to expedite its execution. To ensure that SQL statements use a shared SQL area whenever possible, the text, schema, and bind variables must be exactly the same.
• Shared PL/SQL: The shared PL/SQL area stores and shares the most recently executed
PL/SQL statements. Parsed and compiled program units and procedures (functions,
packages, and triggers) are stored in this area.

b) Data Dictionary Cache
The data dictionary cache is also referred to as the dictionary cache or row cache. Caching data dictionary information into memory improves response time. Information about the database (user account data, data file names, segment names, extent locations, table descriptions, and user privileges) is stored in the data dictionary tables. When this information is needed by the database, the data dictionary tables are read, and the data that is returned is stored in the data dictionary cache.


Database Buffer Cache
When a query is processed, the Oracle server process looks in the database buffer cache for any blocks it needs. If the block is not found in the database buffer cache, the server process reads the block from the data file and places a copy in the database buffer cache. Because subsequent requests for the same block may find the block in memory, the requests may not require physical reads. The Oracle server uses a least recently used algorithm to age out buffers that have not been accessed recently to make room for new blocks in the database buffer cache.

Redo Log Buffer Cache
The redo log buffer cache is a circular buffer that contains changes made to data file blocks.This information is stored in redo entries. Redo entries contain the information necessary to recreate the data prior to the change made by INSERT, UPDATE, DELETE, CREATE,ALTER, or DROP operations.

Large Pool
When users connect through the shared server, Oracle needs to allocate additional space in the shared pool for storing information about the connections between the user processes, dispatchers, and servers. The large pool relieves the burden on areas within the shared pool. The shared pool does not have to give up memory for caching SQL parse trees in favor of shared server session information, I/O, and backup and recover processes. The performance gain is from the reduction of overhead from increasing and shrinkage of the shared SQL cache.

Java Pool
The Java pool is an optional setting but is required if installing and using Java. Its size is set, in bytes, using the JAVA_POOL_SIZE parameter.

Saturday 22 June 2013

Oracle Background Processes

There are many Oracle background processes. DBA should have knowledge of atleast Mandatory background processes i.e.,DBWR, PMON, CKPT,LGWR, SMON

Below are the Optional background processes
ARCn, LMON, Snnn,QMNn, LMDn,CJQ0, Pnnn,LCKn, Dnnn

Lets have detailed knowledge of mandatory background processes:

Database Writer(DBWR)
The server process records changes to rollback and data blocks in the buffer cache. Database
Writer (DBWn) writes the dirty buffers from the database buffer cache to the data files. It
ensures that a sufficient number of free buffers—buffers that can be overwritten when server
processes need to read in blocks from the data files—are available in the database buffer
cache. Database performance is improved because server processes make changes only in the
buffer cache.
DBWn defers writing to the data files until one of the following events occurs:
• Incremental or normal checkpoint
• The number of dirty buffers reaches a threshold value
• A process scans a specified number of blocks when scanning for free buffers and cannot fine any.
• Timeout occurs.
• A ping request in Real Application Clusters environment.
• Placing a normal or temporary tablespace offline.
• Placing a tablespace in read only mode.
• Dropping or Truncating a table.
ALTER TABLESPACE tablespace name BEGIN BACKUP

LOG Writer(LGWR)
LGWR performs sequential writes from the redo log buffer cache to the redo log file under the following situations:
• When a transaction commits
• When the redo log buffer cache is one-third full
• When there is more than a megabyte of changes records in the redo log buffer cache
• Before DBWn writes modified blocks in the database buffer cache to the data files
• Every 3 seconds.
Because the redo is needed for recovery, LGWR confirms the commit only after the redo is written to disk.
LGWR can also call on DBWn to write to the data files.
Note: DBWn does not write to the online redo logs.

System Monitor(SMON)
If the Oracle instance fails, any information in the SGA that has not been written to disk is lost. For example, the failure of the operating system causes an instance failure. After the loss
of the instance, the background process SMON automatically performs instance recovery when the database is reopened. Instance recovery consists of the following steps:
1. Rolling forward to recover data that has not been recorded in the data files but that has been recorded in the online redo log. This data has not been written to disk because of
the loss of the SGA during instance failure. During this process, SMON reads the redo log files and applies the changes recorded in the redo log to the data blocks. Because all
committed transactions have been written to the redo logs, this process completely recovers these transactions.
2. Opening the database so that users can log on. Any data that is not locked by unrecovered transactions is immediately available.
3. Rolling back uncommitted transactions. They are rolled back by SMON or by the individual server processes as they access locked data.
SMON also performs some space maintenance functions:
• It combines, or coalesces, adjacent areas of free space in the data files.
• It deallocates temporary segments to return them as free space in data files. Temporary segments are used to store data during SQL statement processing.

Process Monitor(PMON)
The background process PMON cleans up after failed processes by:
• Rolling back the user’s current transaction
• Releasing all currently held table or row locks
• Freeing other resources currently reserved by the user
• Restarts dead dispatchers

Checkpoint(CKPT)
An event called a checkpoint occurs when the Oracle background process DBWn writes all the modified database buffers in the SGA, including both committed and uncommitted data,to the data files.
Checkpoints are implemented for the following reasons:
• Checkpoints ensure that data blocks in memory that change frequently are written to data files regularly. Because of the least recently used algorithm of DBWn, a data block that changes frequently might never qualify as the least recently used block and thus might never be written to disk if checkpoints did not occur.
• Because all database changes up to the checkpoint have been recorded in the data files,redo log entries before the checkpoint no longer need to be applied to the data files if instance recovery is required. Therefore, checkpoints are useful because they can expedite instance recovery.
At a checkpoint, the following information is written:
• Checkpoint number into the data file headers
• Checkpoint number, log sequence number, archived log names, and system change numbers into the control file.
CKPT does not write data blocks to disk or redo blocks to the online redo logs.

Saturday 8 June 2013

startup oracle database instance concepts

startup NOMOUNT: During startup nomount Instance started.It creates the SGA and starts up the background processes but does not provide access to the database.

startup MOUNT: During Startup mount Control file opened for this instance.It mounts the database for certain DBA activities but does not provide user access to the database.

alter database OPEN: During startup database all the files get opened as described by the control file for this instance.It enables users to access the database.

Saturday 1 June 2013

Manage Oracle tablespaces

Here are the commands to Create Tablespace, Resize datafile, tablespace offline/online/read only, drop tablespace

Create tablespace:
CREATE TABLESPACE TEST DATAFILE '/u01/oradata/test01.dbf' SIZE 500m;

Create Undo tablespace:
CREATE UNDO TABLESPACE undo1 DATAFILE '/u01/oradata/undo01.dbf' SIZE 500m;

Create Temporary tablespace:
CREATE TEMPORARY TABLESPACE temp TEMPFILE '/u01/oradata/temp01.dbf' SIZE 500m;

Set Temp tablespace as default tablespace:
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

Take a tablespace offline:
ALTER TABLESPACE TEST OFFLINE;

Take a tablespace online:
ALTER TABLESPACE TEST ONLINE;

Put Tablespace in Read-Only mode:
ALTER TABLESPACE TEST READ ONLY;

Drop tablespace:
DROP TABLESPACE TEST INCLUDING CONTENTS AND DATAFILES;

Enabling Automatic Extension of Data Files
ALTER DATABASE DATAFILE '/u01/oradata/test01.dbf' SIZE 500M AUTOEXTEND ON;

Adding Data Files to a Tablespace:
ALTER TABLESPACE test ADD DATAFILE '/u01/oradata/test02.dbf' SIZE 500M;

Resize Datafile:
alter database datafile '/u01/oradata/test01.dbf' RESIZE 1G;