Professional Documents
Culture Documents
How To Add or Extend Datafiles in Sap System Based On Oracle Database ?
How To Add or Extend Datafiles in Sap System Based On Oracle Database ?
What is BRTOOLS?
BRTOOLS can be accessed by logging into database host as ora<sid> user and
calling brtools at the command prompt.
1 = Instance management
2 - Space management
3 - Segment management
4 - Backup and database copy
5 - Restore and recovery
6 - Check and verification
7 - Database statistics
8 - Additional functions
9 - Exit program
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
======================================
Select option 2 - Space management from the above query and press c to
continue.
In the next screen, you will be prompted to enter tablespace name, size/location
of new datafile to be added, initial filesize, maximum filesize, autoextend
(yes/no). Please provide all the relevant details and you can see an SQL query is
being built based on the inputs given by you.
Once all the inputs are provided, press continue to execute the command and the
datafile will be added.
Click on parameters history tab to view the parameters that are changed in the
recent past.
In the above screen click on Show parameters history. It displays window as
below
Provide the date from which you would like to view the database parameter
changes.
And then click on tick mark to view the database parameter changes from the
selected date.
Click on export button (highlighted below) and select table as the output as
shown in below screen and the parameters can be exported to an excel or word
as per the selection by you.
---------------------------------------------------------------------------------------
Goto transaction DB02 and navigate to Space -> Space overview to view
Database name
Database system
Size
Free size
Used percentage
Number of database users
Number of tablespaces
Number of tables and size
Number of indexes and size
In DB02, navigate to Space -> Space overview to find all the above mentioned
details
How to check the users that are present in database at SAP level ?
Background processes are created from the oracle binary when an instance is
started. As the name suggests background processes run in background and
they are meant to perform certain specific activities or to deal with abnormal
scenarios that arise during the runtime of an instance.
From SAP perspective, the following are the 6 most important background
processes of oracle database.
The database writer writes dirty blocks from the database buffer to the datafiles.
Dirty blocks need to be flushed out to disk to make room for new blocks in the
cache. When a buffer in the database buffer cache is modified it is marked as
dirty buffer. A cold buffer is a buffer that has not been recently used according
to the least recently used (LRU) algorithm. The database writer writes cold, dirty
buffers to disk so that new blocks can be read into the cache.
The database writer writes the dirty buffers to disk under the following
conditions :
The log writer process writes data from the redolog buffers to the redolog files on
disk.
The redolog buffer is a circular buffer. When LGWR writes redo entries from the
redolog buffer to the redolog file, server processes can overwrite the entries that
are already copied with new entries in redolog buffer. LGWR writes at a faster
pace so that space is always available in the buffer for new entries.
Checkpoint (CKPT) :
Checkpoint signals the synchronization of all database files with the check point
information. It ensures data consistency and faster database recovery in case of a
crash.
1. Updating the file headers of the data files with information about the last
checkpoint performed
2. Update control files about the last checkpoint
3. Initiates LGWR to flush the redolog buffer entries to redolog files.
4. Writes the checkpoint record to the redolog file
5. Initiates DBWR to write all dirty blocks to disk and thus synchronizes
database
Archiver Process(ARCH) :
The archiver process copies online redolog files to the designation archive log
location after the occurrence of a log switch. It is an optional process. Archiver is
present only when database is running in archive log mode and automatic
archiving is enabled.
However it is not recommended for us to change this value, as Log writer starts a
new archiver process automatically when the current archive processes are
insufficient to handle the workload
The process monitor performs process recovery when a user process fails. PMON
is responsible for cleaning up the database buffer cache and freeing resources
that the user process was using like releasing locks, removing process ids from
active processes list etc.
PMON checks the running status of dispatcher and server processes periodically
and restarts in case any have stopped. Please note that this wont start processes
that are intentionally stopped by Oracle.
PMON also registers information about the instance and dispatcher processes with
the network listener.
PMON wakes up every 3 seconds to perform house keeping activities and should
be running always for an instance.
SMON can be called by other processes in cases of need. SMON wakes up every 5
seconds to perform house keeping activities. SMON must always be running for
an instance.
Goto SQL prompt of oracle database system and provide following command to
view background processes.
SQL>
When an Oracle instance is started, its characteristics are set by reading some
initialization parameters. These parameters are specified either through PFILE or
SPFILE. (0r)
When an oracle instance is being started, it reads either PFILE or SPFILE to set its
characteristics.
What is PFILE ?
A PFILE is a static, client side text file. This file normally resides on the server.
However in case you would like to start oracle from a remote machine, you will
need a local copy of the PFILE in that machine.
This file can be edited with a standard text editor like notepad or vi editor. This
file will be commonly referred as INIT.ORA file.
What is SPFILE ?
SPFILE (Server parameter file) is a persistent server side binary file. SPFILE
should only be modified through ALTER SYSTEM SET command . Editing an
SPFILE directly will corrupt the file and the start up of the database or instance
will not be possible.
As SPFILe is a server side binary file, local copy of the PFILE is not required to
start oracle from a remote machine.
A SPFILE doesnot need a local copy of the pfile to start oracle from a
remote machine. Thus eliminates configuration problems.
SPFILE is a binary file and modications to that can only be done through
ALTER SYSTEM SET command.
Goto SQL prompt and execute the following command to figure out if database is
started with a PFILE or SPFILE.
SQL > SELECT DECODE(value, NULL, PFILE, SPFILE) Init File FROM
sys.v_$parameter WHERE name = spfile;
LOG_MODE
------------------
NO ARCHIVE LOG
sqlplus /nolog
Then you will be connected to database and SQL prompt appears as below:
SQL >
2) Find out the current archive log mode by providing below command as
explained earlier:
3) If current archive log is NO ARCHIVE LOG mode and if you would like to
set to ARCHIVE LOG mode, first of all shut down the oracle database.
Please wait for a while and system brings down the oracle database and
SQL prompt
appears.
4) Please note database should be in mount mode while changing the archive
log mode in Oracle.
Database mounted
Please note : For example, if you would like to set the database in NO
ARCHIVE LOG mode ( or disable archive log mode ) then command should
be
SQL > alter database noarchivelog;
7) Now cross check the current archive mode using the command below
If you have enabled archive log mode then system prompts with a message
like
LOG_MODE
----------------
ARCHIVE LOG
Please note changing archive log mode can also be done through brtools
utility also. Will explain that process for the same in another article
Control file is a small binary file which is necessary for the database to start and
operate successfully.
Each control file is associated with only one database. Oracle continuosly updates
control file during database use so this file must be available for writing whenever
the database is in the open state. Control file will be created at the same time of
database creation.
Oracle to identify the files that are required or available in case database
recovery is needed
Oracle to identify the datafiles and redolog files to open during database
startup.
No. Database cannot function properly if the control file is not available.
Database name
Checkpoint information
-----------------------------------------------------------------------------------------
After executing the above query, System outputs the location of all control files
in the system
Usually there will be 3 control files in oracle database( for SAP applications).
Please execute the below query to display the current value of control_files
parameter
The above command outputs the current value. This value can be changed with
the ALTER SYSTEM command. In other words the current location of the control
files can be changed using ALTER SYSTEM command.
Syntax:
Eg: In the below command set the paths or names for various control files
as per your requirement
D:\ORACLE\..\..\..\Newname2.CTL, D:\ORACLE\..\..\..\Newname3.CTL
SCOPE=SPFILE;
SQL > HOST MOVE <old controlfile with path> <new controlfile with path
>
Eg:
SQL > HOST MOVE D:\ORACLE\ORADATA\CONTROL01.CTL
D:\ORACLE\ORADATA\NEW_CONTROL01.CTL
What are the scenarios in which contol file should be backed up in oracle?
How to backup control file in oracle?
How to recover an instance when one of the control files got corrupted ?
How multiple control files are managed in Oracle ?
---------------------------------------------------------------------------------------
a. Backup the control file to a binary file (duplicate of existing control file)
using the below statement:
b. Produce SQL statements that can later be used to re-create control file.
Above command writes a SQL script to the database trace file where it can
be captured and edited to regenerate the control file.
Oracle recommends to have atleast 2 control files each stored on a different disk.
(Please note, for SAP applications , 3 control files are generally maintained in an
oracle database at different locations)
If a control file got corrupted due to a disk failure the respective instance should
be shut down. Once the disk drive is repaired, the corrupted control file can be
restored using the copy of control file from other disk and the instance can be
brought up. In these cases, media recovery is not required.
All the control files that are listed in the CONTROL_FILES parameter are
updated by the database.
The database reads only the first file listed in the CONTROL_FILES
parameter during database operation
---------------------------------------------------------------------------------------
Please login to SAP system and goto transaction DB02 or DBACOCKPIT