Look in:

Web oracle-core-dba.blogspot.com

Saturday, June 30, 2007

Tuning Database Buffer Cache

Introduction

Buffer pool or buffer cache is a memory structure within Oracle SGA that is used for caching data blocks in the memory. Accessing data from the memory is significantly faster than accessing data from disk. The goal of block buffer tuning is to efficiently cache frequently used data blocks in the buffer cache (SGA) and provide faster access to data.

Tuning block buffer is a key task in any Oracle tuning initiative and is a part of an ongoing tuning and monitoring of production databases. The task of database performance optimization by allocating appropriate memory structure within SGA is a very interesting and challenging task for a DBA. Generally, it takes a few iterations before you can reach to a satisfactory memory allocation. This article presents a tuning approach that greatly simplifies the tuning effort. The methodology discussed here will help DBAs in creating a proactive database tuning and monitoring strategy for their production databases. If you are a DBA responsible for tuning a database without enough physical memory on the server, you will find this article very informative and useful. With the help of an established methodology and tuning strategy, you can easily identify the problem areas and tune the SGA memory structure.

Step 1: Identify the amount of memory that you can allocate to block buffers. Create buffer pool without inducing significant paging or swapping.

Deciding the size of block buffer is critical to the overall system performance. A large block buffer will provide more memory space for caching data blocks in the SGA. In such a case, most SQL statements will find data blocks in the memory and a less time consuming IO will be performed by the database. The more the data cached in the memory, the faster is the database response. Life of DBAs would have been much simpler if we could cache the entire database (or even 50% of the database) in the block buffers, but we are limited by the physical memory available on the server. If we allocate a very large block buffer, the server may swap / page the SGA into a swap space on the disk (If SGA in not locked in the physical memory). In such circumstances, data will no longer be accessed from the memory, and CPU will have to work harder to manage the virtual memory of the server, thus degrading the overall system performance. A very large block buffer may defeat the purpose of caching data in memory for faster access, if the operating system is swapping / paging SGA pages. Within the limitations of the physical memory, the DBA should allocate block buffers to cache data in the SGA without inducing paging or swapping on the server. Hence, understanding the amount of memory available for block buffers is key to tuning the block buffers.

You can set the buffer cache by specifying DB_CACHE_SIZE (or DB_BLOCK_BUFFERS) initialization parameter as:-

DB_CACHE_SIZE = 128 M

Step 2: Identify how frequently data blocks are accessed from the buffer cache (a. k. a Block Buffer Hit Ratio).

Once you have allocated the available memory to block buffers, the next step is to identify the efficiency of block buffer usage. Oracle database maintains dynamic performance view V$BUFFER_POOL_STATISTICS with overall buffer usage statistics. This view maintains the following counts every time a data block is accessed either from the block buffers or from the disk:

NAME – Name of the buffer pool
PHYSICAL_READS – Number of physical reads
DB_BLOCK_GETS – Number of reads for INSERT, UPDATE and DELETE
CONSISTENT_GETS – Number of reads for SELECT

DB_BLOCK_GETS + CONSISTENT_GETS = Total Number of reads

Based on above statistics we can calculate the percentage of data blocks being accessed from the memory to that of the disk (block buffer hit ratio). The following SQL statement will return the block buffer hit ratio:

SELECT NAME, 100 – round ((PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS))*100,2) HitRatio
FROM V$BUFFER_POOL_STATISTICS;

Before measuring the database buffer hit ratio, it is very important to check that the database is running in a steady state with normal workload and no unusual activity has taken place. Buffer hit ratio can be skewed depending on the type of SQL statements running in the database since startup. For example, when you run a SQL statement just after database startup, no data blocks have been cached in the block buffers. At this point, Oracle reads the data blocks from the disk and will cache the blocks in the memory. If you run the same SQL statement again, then most likely the data blocks will still be present in the cache, and Oracle will not have to perform disk IO. If you run the same SQL statement multiple times you will get a higher buffer hit ratio. On the other hand, if you either run SQL statements that rarely query the same data, or run a select on a very large table, the data block may not be in the buffer cache and Oracle will have to perform disk IO, thereby lowering the buffer hit ratio.

A hit ratio of 95% or greater is considered to be a good hit ratio for OLTP systems. The hit ratio for DSS (Decision Support System) may vary depending on the database load. A lower hit ratio means Oracle is performing more disk IO on the server. In such a situation, you can increase the size of database block buffers to increase the database performance. You may have to increase the physical memory on the server if the server starts swapping after increasing block buffers.

Step 3: Identify frequently used and rarely used data blocks. Cache frequently used blocks and discard rarely used blocks.

If you have a low buffer hit ratio and you cannot increase the size of the database block buffers, you can still gain some performance advantage by tuning the block buffers and efficiently caching the data block that will provide maximum benefits. Ideally, we should cache data blocks that are either frequently used in SQL statements, or data blocks used by performance sensitive SQL statements (A SQL statement whose performance is critical to the system performance). An ad-hoc query that scans a large table can significantly degrade overall database performance. A SQL on a large table may flush out frequently used data blocks from the buffer cache to store data blocks from the large table. During the peak time, ad-hoc queries that select data from large tables or from tables that are rarely used should be avoided. If we cannot avoid such queries, we can limit the impact on the buffer cache by using RECYCLE buffer pool.

A DBA can create multiple buffer pools in the SGA to store data blocks efficiently. For example, we can use RECYCLE pool to cache data blocks that are rarely used in the application. Typically, this will be a small area in the SGA to store data blocks for current SQL statement / transaction that we do not intend to hold in the memory after the transaction is completed. Similarly, we can use KEEP pool to cache data blocks that are frequently used by the application. Typically, this will be big enough to store data blocks that we want to always keep in memory. By storing data blocks in KEEP and RECYCLE pools you can store frequently used data blocks separately from the rarely used data blocks, and control which data blocks are flushed from the buffer cache. Using RECYCLE pool, we can also prevent a large table scan from flushing frequently used data blocks. You can create the RECYCLE and KEEP pools by specifying the following init.ora parameters:

DB_KEEP_CACHE_SIZE =
DB_RECYCLE_CACHE_SIZE = < size of RECYCLE pool>

When you use the above parameters, the total memory allocated to the block buffers is the sum of DB_KEEP_CACHE_SIZE, DB_RECYCLE_CACHE_SIZE, and DB_CACHE_SIZE.

Step 4: Assign tables to KEEP / RECYCLE pool. Identify buffer hit ratio for KEEP, RECYCLE, and DEFAULT pool. Adjust the initialization parameters for optimum performance.

By default, data blocks are cached in the DEFAULT pool. The DBA must configure the table to use the KEEP or the RECYCLE pool by specifying BUFFER_POOL keyword in the CREATE TABLE or the ALTER TABLE statement. For example, you can assign a table to the recycle pool by using the following ALTER TABLE SQL statement.

ALTER TABLE TABLE_NAME STORAGE (BUFFER_POOL RECYCLE)

The DBA can take help from application designers in identifying tables that should use KEEP or RECYCLE pool. You can also query X$BH to examine the current block buffer usage by database objects (You must log in as SYS to query X$BH). The following query returns a list of tables that are rarely used and can be assigned to the RECYCLE pool.

Col object_name format a30
Col object_type format a20
SELECT o.owner, object_name, object_type, COUNT(1) buffers
FROM SYS.x$bh, dba_objects o
WHERE (tch = 1 OR (tch = 0 AND lru_flag < 8))
AND obj = o. object_id
AND o.owner not in ('SYSTEM','SYS')
GROUP BY o.owner, object_name, object_type
ORDER BY buffers;

The following query will return a list of tables that are frequently used by SQL statements and can be assigned to the KEEP pool.

SELECT o.owner, object_name, object_type, COUNT(1) buffers
FROM SYS.x$bh, dba_objects o
WHERE tch > 10
AND lru_flag = 8
AND obj = o.object_id
AND o.owner not in ('SYSTEM','SYS')
GROUP BY o.owner, object_name, object_type
ORDER BY buffers;

Once you have setup the database to use KEEP and RECYCLE pools, you can monitor the buffer hit ratio by querying V$BUFFER_POOL_STATISTICS and V$DB_CACHE_ADVICE to adjust the buffer pool initialization parameters.

Step 5: Identify the amount of memory needed to maintain required performance.

Oracle 9i maintains block buffer advisory information in V$DB_CACHE_ADVICE. This view contains simulated physical reads for a range of buffer cache sizes. The DBA can query this view to estimate buffer cache requirement for the database. The cache advisory can be activated by setting DB_CACHE_ADIVE initialization parameter.

DB_CACHE_ADVICE = ON

There is a minor overhead associated with cache advisory collection. Hence, it is not advisable to collect these statistics in production databases until there is a need to tune the buffer cache. The DBA can turn on DB_CACHE_ADVISE dynamically for the duration of sample workload period and collect advisory statistics.

Conclusion

Using this methodical approach, a DBA can easily identify the problem areas, and tune the database block buffers. The DBA can create the following buffer pool to efficiently cache data blocks in SGA:

KEEP: Cache tables that are very critical for system performance. Typically, lookup tables are very good candidates for the KEEP pool. The DBA should create the KEEP pool large enough to maintain 99% buffer hit ratio on this pool.

RECYCLE: Cache tables that are not critical for system performance. Typically, a table containing historical information that is either rarely queried or used by batch process is a good candidate for the RECYCLE pool. The DBA should create the RECYCLE pool large enough to finish the current transaction.

DEFAULT: Cache tables that do not belong to either KEEP or RECYCLE pool.
The DBA can setup OEM jobs, Oracle statspack, or custom monitoring scripts to monitor your production database block buffer efficiency, and to identify and tune the problem area.

Friday, June 29, 2007

Sql Statement We Use to Generate Tablespace Usage Report

A Sql Statement We Use to Generate Tablespace Usage Report Taking Autoextend Into Consideration

This article describes the query we created in order to generate Database level Tablespace usage in percentage with Autoextend on.
In past we used a query which was showing total assigned space to a particular tablespace and was not including future growth when Autoextend On.

So it was giving wrong numbers:
:-> Example: Size of tablespace is 1GB – Used Space is 900MB – Free Space is 100MB –

Now it has Autoextend On with 4GB Total extension capabilities.

It was sending us Paging telling only 10 Percentage free –instead it should take Total 4GB in consideration and by that it has total 3.1GB Free. Soo we dug into the data dictionary and found base sys views/tables from where we can get that information and refined our query with the same.

Query:

REM Following Sql statement will generate tablespace usage report taking autoextend into consideration
sqlplus "/ as sysdba"
set linesize 250
set pagesize 70
col tablespace_name format a20
select a.tablespace_name, SUM(a.bytes)/1024/1024 "CurMb",
SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)) "MaxMb",
(SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024)) "TotalUsed",
(SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)) - (SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024))) "TotalFree",
round(100*(SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024))/(SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)))) "UPercent"
from dba_data_files a,
sys.filext$ b,
(SELECT c.tablespace_name , sum(c.bytes) "Free" FROM DBA_FREE_SPACE c GROUP BY TABLESPACE_NAME) c
where a.file_id = b.file#(+)
and a.tablespace_name = c.tablespace_name
GROUP by a.tablespace_name, c."Free"/1024
/
exit;

An Approach to Tuning a SQL Statement

While application knowledge and experience is helpful, We've got a methodical approach to use when asked to tune a SQL statement.

Here's the basic approach/process that can be used to diagnose and analyze a SQL statement..

Analyze the Statement

1. We can start by reviewing the WHERE clause, dividing it into clauses that restrict rows and those that join tables.

2. We can locate candidate Driving Tables by looking at the "restrict rows" clauses as determining which table has the most restrictive clauses ( i.e. those that will result in the fewest rows). If not sure between a couple of candidates, we can pick one.

3. Next we have to list all the tables in the FROM clause, starting with the driving table, using the JOIN criteria to link from one table to the next. This generates an ordered list of how the database should be accessing the tables, starting with the candidate driving table. This exercise generates all possible ways to join the tables together as well as making sure there are Join criteria for all the tables in the FROM clause.

4. Look for indexes on the driving table and determine which should be used or if a full table scan would be best. If we find a better index than the one the optimizer picks then we add an Index hint to get the desired index to be used. If a full table scan is in order, we consider adding a parallel hint.

5. We can try to join two tables that have restrictive where clauses before joining two tables that don't have any such clauses.

6. We now have one or more candidate explain plan(s) that need to be tested.
Compare Plans

1. Next we compare the actual explain plan of the statement in question with the candidate plans generated in the above exercise

2. Looking at the actual data (and running some queries to collect metrics) we consider trying different driving tables and join orders.

3. We review and compare each, and subjectively arrive at a best guess plan.

Test it out

1. The most effective hint we've found is the ORDERED hint. This works especially well when you have a lot of tables in the FROM clause.

2. We add /*+ ordered */ after the Select verb and the list the tables in the from clause from first to last the way we listed them in Analysis Step 3. Adding other hints like /*+ Full (driving table alias) */ is also a good way to get the optimizer to use the proper driving table.

3. Run an explain plan using the above HINTs.

4. If the plan looks good, execute it for real. Set Timing On and set Autotrace On (hopefully you have that enabled in your database)

5. Run the old and new statements several times to see how the timings work out. The Autotrace summary of blocks touched is a. good indicator of performance: the fewer blocks touched, the better.

Tuning Hints and Tips

1. There are many other hints and techniques that can influence an explain plan. Keep in mind that a Hash Join is nearly always better than a Merge Join

2. Nested Loop is better only if a few rows are being retrieved.

3. Tuning sub-selects can be tricky. We will often rewrite a statement to replace " IN (Select...) or a NOT IN" with a join to an in-line view and achieve significant performance increase by avoiding executing thousands of Nested Loop index reads with a hash join. Listing more statement rewrite options is beyond the scope of this article.

Those are the basic steps We follow. Give them a try and over time we are confident your SQL tuning skills will expand.

Manually un-installed Oracle 10g

How we Manually un-installed Oracle 10g - Windows

As a testing box for RMAN and Flashback query, we are supposed to install and perform the required tests on 10g DB. During the first iteration we encountered that OUI was not responding, I believed it to be the security settings on the Windows box. But it was not getting better after changing the security settings on Windows.

Here the steps we took to manually un-install Oracle 10g on Windows 2003 / XP.

On the desktop, we Right Click on MyComputer Icon and selected "Manage".  On the left hand pane, we selected "Service and Applications" from Computer Management.

** Alternatively you can also select Services from Control Panel.

In the next step we Shutdown Oracle Instance and related Oracle Services. Some of them might give errors " Unable to shutdown". It could be because of improper installation.  Now after shutting down the Oracle services, we had to locate the registry entries for Oracle and delete them manually.

We made a backup of registry.

We then clicked on Start --> Run --> Regedit.

Looked for the following entries:
=============================================================================
HKEY_CURRENT_USER\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Oracle.oracle
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleDBConsole
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle10g_home
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OraclService
=========================================================================
Deleting  the above entries from the registry required a reboot, so we did a Reboot of the windows box.
Some entries in the registry like registering of some components required cleaning software. We did it using "CleanMyPCRegistry”. This removed any discrepancies in the registry.

Now in the next step we deleted the physical directories.

C:\Oracle

Deleted the Oracle Program Files directory:
C:\Program Files\Oracle
Deleted the Oracle Start Menu shortcuts directory:
C:\Documents and Settings\All Users\Start Menu\Programs\Oracle

Removed Oracle references from the path. To edit the path we went to:

Start->Settings->Control Panel->System->Advanced->Environment Variables

We edited both of the environment variables user PATH and system PATH. Remove any Oracle references in them.

Then we removed Oracle.DataAccess and any Polic.Oracle files from the GAC which is at:
C:\Windows\assembly\

We also received an error while removing the $ORACLE_HOME/bin directory. While un-installing oci.dll (Oracle Call interface could not be deleted.

To resolve this, we renamed the Oracle/bin folder and re-boot the machine. After reboot, we are able to delete the oci.dll. We then proceeded with the proper installation of Oracle 10g R2.

Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms

PURPOSE
-------

To address the growing need for use of more memory on 32-Bit Windows platforms,
and explain how AWE is implemented by Oracle on Windows.

SCOPE & APPLICATION
-------------------
Oracle DBA's running on the Microsoft Windows platform.
Oracle Support Analysts, Field Engineers troubleshooting problems
related to AWE and/or memory issues on Windows.

AWE Memory implementation on Windows 2000
------------------------------------------

A common question on the Windows NT/Windows 2000 platform revolves around
how to take advantage of systems with more than 4 GB of RAM. As discussed
in Metalink Note 46001.1 and Note 46053.1, the 32-Bit process address
space for any process on Windows equates to a total of 4GB of addressable
RAM. Of this, by default, 2GB is reserved for the process itself, and 2GB
for the kernel. On systems running either Windows 2000 Advanced Server,
or Windows NT 4.0 Enterprise Edition, this ratio can be changed by adding
the /3GB switch to the boot.ini, allowing a process to address 3GB and
reserving 1GB for the kernel. However, the total addressable memory for
a single process is still only 4GB.
See also Note 1036312.6 : Utilizing Up to 3GB Virtual Memory on Windows NT Server 4.0

__________________________________________________________________

What can be done to address memory beyond 4GB?:
===============================================

The answer is to take advantage of Physical Address Extensions (PAE), or
Address Windowing Extensions (AWE)(These two terms are used interchangeably,
so the rest of this document will refer to this simply as AWE).
AWE support is available if you are running on a machine with more than 4GB
of physical RAM which is running any of the below Windows operating systems:

* Windows 2000 Datacenter Server
* Windows 2000 Advanced Server
* Windows 2003 Data Center Edition (32-Bit)
* Windows 2003 Enterprise Edition (32-Bit)

On the above operating systems, AWE support is built into the OS. No
special drivers are needed to take advantage of the additional memory.

AWE CANNOT be used on the following Operating Systems:

* Windows 2000 Server (Standard)
* Windows 2000 Professional
* Windows XP Home Edition
* Windows XP Professional
* Windows 2003 Standard Edition
* Windows 2003 Web Edition

NOTE Also that on 64-Bit Windows operating systems, there is no need for AWE
implementation support, because the directly addressable memory for a single
process on 64-Bit Windows is 8 Terabytes.

__________________________________________________________________

Oracle versions that can use AWE:
=================================

Oracle can take advantage of AWE in the following RDBMS releases:

* Oracle 8.1.6.x
* Oracle 8.1.7.x
* Oracle 9.2.x
* Oracle 10.1.x

Oracle does NOT implement AWE support in release 9.0.1.x

AWE support is available on both the Enterprise Edition of Oracle and
the Standard Edition of Oracle. However, on Standard Edition of 9.2.0.1,
you may receive the following error if trying to start the database with
USE_INDIRECT_DATA_BUFFERS=TRUE:

ORA-439 - FEATURE NOT ENABLED: VERY LARGE MEMORY

In Standard Edition 9.2.0.2 and 9.2.0.3, you will not receive the above errors,
but VLM functionality is still not enabled. Refer to BUG#2945011 for more detail.
This BUG is fixed in 9.2.0.3 Patch 2, and will be fixed in 9.2.0.4 as well.

__________________________________________________________________

Enabling support at the OS level:
==================================

AWE can be enabled at the OS by adding the /PAE switch to the boot.ini
as such:

multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /PAE

It IS possible to have BOTH the /PAE and /3GB switch in place on the same
machine, as such:

multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /3GB /PAE

However, be aware that if BOTH switches are in place, the server will only
be able to recognize up to 16GB of RAM. If you are working with a server
with more than 16GB of RAM, you will need to choose between the two.

It is important to note that once either or both of these switches are in
place in the boot.ini, ALL processes running can take advantage of these
switches. Thus, in a case where multiple Oracle instances are running on
the same server, ALL instances can take advantage of the additional memory
afforded by these switches, up to the amount of physical memory on the box.


Operating System Privileges Needed at the OS Level:
====================================================

In order to take advantage of the additional memory afforded through PAE,
the operating system user account which is used to start the OracleService
must be granted the 'Lock Pages in Memory' system privilege at the operating system
level. By default, the OracleService starts as the LocalSystem account.
The LocalSystem account has the privilege to Lock Pages in Memory granted to
it by default.

However, if you change the OracleService to logon as a user OTHER than
LocalSystem, you may see the following errors when attempting to start the
database with USE_INDIRECT_DATA_BUFFERS set to TRUE :


SQL> startup pfile=c:\temp\initscott.ora
ORA-27102: out of memory
OSD-00010: Message 10 not found; product=RDBMS; facility=SOSD

O/S-Error: (OS 1300) Not all privileges referenced are assigned to the caller.


To rectify this, you must grant the 'Lock pages in memory' privilege to the user
that the OracleService starts as. To do this, click on:
Start -> Programs -> Administrative Tools -> Local Security Policy
(on a Domain Controller, click on 'Domain Security Policy' instead of 'Local Security Policy')
Double-click on the 'Lock Pages in memory' policy.
Add the appropriate user and click 'Ok'.
Restart the OracleService


__________________________________________________________________

Understanding the Oracle implementation of AWE support:
=======================================================

What the PAE switch allows you to do from the Oracle perspective is to
increase the amount of memory that can be used for the Oracle Database
Block Buffer Cache. It is important to note that this additional memory
can ONLY be used by Oracle in the form of an increased value for
DB_BLOCK_BUFFERS.

There is still confusion on the old style of VLM versus AWE on Windows 2000.
With VLM on Windows NT 4.0, there was the concept of pointers pointing to
the extended memory area, but that is no longer the case on Windows 2000.
Instead, the windowing technology as described in these articles is being
used. For more information on AWE/PAE implementation on the Windows
platform, refer to Microsoft's website.

As mentioned previously, with AWE enabled, this allows the process(es)
(in this case ORACLE.EXE) to use memory above and beyond the 4GB
mark defined by a 32-Bit Process Address space. The physical location of
these blocks does not matter. However, the database blocks must still be
accessed from within a ‘window’, which exists (logically) in that regular
3GB process address space.
The size of this window is defined by a registry setting in the HOME key for
Oracle (HKLM\Software\Oracle\Homex) called AWE_WINDOW_MEMORY. By default,
this value is 1GB, so if this value is not set in the registry,
AWE_WINDOW_MEMORY will be 1GB.

It is important to realize that any database blocks accessed by Oracle
(or any user/background thread within Oracle.exe) must first be mapped into
the 'window' defined by AWE_WINDOW_MEMORY. In this scenario, it does not
matter where the blocks are physically located - there is no need to be
concerned with where the blocks are physically residing. The window will be
drawn around the block (i.e. the block will be mapped) wherever it is located
in memory. If the block is in memory but has not been mapped into the
‘window’, then it may be necessary to unmapped another block that IS in the
window, in order to accommodate the new block. While this mapping and
unmapping of blocks does add some cost, it is still faster than incurring
an I/O operation to read the block from disk. This will be discussed
further down in the section on troubleshooting.

Note:

Keep in mind that if there are multiple instances on a machine with
the /PAE switch enabled, ALL instances can take advantage of the additional
memory. However, AWE_WINDOW_MEMORY cannot be set on a per-instance basis,
so all databases that are running out of the HOMEx key where
AWE_WINDOW_MEMORY is set will inherit the same value.


__________________________________________________________________

Enabling AWE Support at the Database/Instance Level:
====================================================

To enable the AWE implementation on Oracle, you must set the following
parameter in the init file (or spfile) used to start the instance:

USE_INDIRECT_DATA_BUFFERS=TRUE

Note again that the buffer cache MUST be defined using the parameter
DB_BLOCK_BUFFERS, no matter what version of the RDBMS you are running.
The 9.2 feature allowing for Multiple block sizes in a database will be
disabled if you set USE_INDIRECT_DATA_BUFFERS=TRUE, and you cannot specify
the DB_CACHE_SIZE parameter to define the size of the buffer cache.


On 9.2, if you attempt to startup a database with this combination of
parameters:

USE_INDIRECT_DATA_BUFFERS=TRUE
DB_CACHE_SIZE=xxxxx (Any number)

The startup will fail with the following error:


SQL> startup
ORA-00385: cannot enable Very Large Memory with new buffer cache
parameters

You must change DB_CACHE_SIZE to use DB_BLOCK_BUFFERS instead, as was the
syntax under Oracle8i and earlier.



__________________________________________________________________

AWE_WINDOW_MEMORY Within the 3GB Process Address Space:
=======================================================

If you are using /PAE and the /3GB switch together, the address space for
ORACLE.EXE will be 3GB. The value for AWE_WINDOW_MEMORY must come from the
normal address space used by the ORACLE.EXE process. Memory that comes
from that 3GB address space addressable by the oracle.exe process includes
the following:


·The Value for AWE_WINDOW_MEMORY
·The rest of the SGA (shared_pool, large_pool, java_pool, log_buffers, etc)
·Overhead for Oracle.exe and DLL’s (65-100M depends on version & options)
·Stack space for all threads (Defaults to 1MB/thread, unless orastack
is used)
·PGA and UGA memory for all user sessions

Therefore, the value for AWE_WINDOW_MEMORY should be tuned such that mapping
and unmapping operations are avoided as much as possible, while still
allowing enough memory within the 3GB address space for the rest of the
process memory that MUST fit within the 3GB (i.e. overhead, remaining SGA
components and all user connection memory (stack + uga + pga) noted above).

The total size of the buffer cache can then be set to the amount of
physical memory remaining above the 4GB barrier, plus AWE_WINDOW_MEMORY.
On a machine with 12GB of RAM, using the default value of 1GB for
AWE_WINDOW_MEMORY, your total buffer cache could theoretically be as high
as 9GB:

(Total RAM - 4GB + AWE_WINDOW_MEMORY) = 12GB - 4GB + 1GB = 9GB

In reality, your maximum buffer cache size will be somewhat less than
this, allowing for some overhead and additional processes running on the
system.

Attempting to startup the database with a buffer cache larger than the
maximum value as calculated above may result in the following errors:

ORA-27102 out of memory
OSD-00034 Message 34 not found; Product=RDBMS;facility =SOSD
O/S Error: (OS 8) Not enough storage is available to process this command

(Note - If you are on Release 9.2, another possible cause for these errors
is noted further down, in the troubleshooting section)

As mentioned above, the buffer cache must be specified using
DB_BLOCK_BUFFERS rather than DB_CACHE_SIZE, so assuming an 8K block
size (8192), to get a 9GB buffer cache, you would set the following init
parameters:

DB_BLOCK_BUFFERS = 1179648
DB_BLOCK_SIZE = 8192


__________________________________________________________________

Troubleshooting AWE_WINDOW_MEMORY implementation:

=========================
=========================

Minimum Value Required for AWE_WINDOW_MEMORY in 9.2 and Above:
==============================================================

Here are key points to understand when using AWE_WINDOW_MEMORY:

1. Under Oracle 8.1.7 we do NOT enforce a minimum value for
AWE_WINDOW_MEMORY to be able to start the database.
2. This was changed under Oracle9i Release 2, such that we DO
enforce a minimum value for AWE_WINDOW_MEMORY. This change was
done to help improve performance by enforcing a larger window size.
3. You can alter the minimum required value for AWE_WINDOW_MEMORY
under 9.2 by changing/setting the value of the parameter
_DB_BLOCK_LRU_LATCHES. Under 8.1.7, this parameter was named
DB_BLOCK_LRU_LATCHES. However, under 9.x, this parameter was
changed to be a hidden parameter.

The minimum value for AWE_WINDOW_MEMORY starting with 9.2 is calculated as such:

MIN(AWE_WINDOW_MEMORY)=(4096 * DB_BLOCK_SIZE * _DB_BLOCK_LRU_LATCHES)/8

Starting with 9.2, to calculate the value for _DB_BLOCK_LRU_LATCHES, we need
this formula:

_DB_BLOCK_LRU_LATCHES = (Max buffer pools * SETS_PER_POOL)

Max Buffer Pools is a constant = 8
SETS_PER_POOL is variable, and depends on whether or not VLM is enabled.

SETS_PER_POOL = 2* CPU_COUNT (if VLM is enabled)
SETS_PER_POOL= CPU Count /2 (If VLM is NOT enabled)

/* Recall that VLM is enabled by setting USE_INDIRECT_DATA_BUFFERS=TRUE

So, as you can see, the value for _DB_BLOCK_LRU_LATCHES in 9.2 and above is
dependent on the number of CPU's in the box, and therefore
MIN(AWE_WINDOW_MEMORY) is dependent on the # of CPU's as well as the
DB_BLOCK_SIZE. The larger the Block Size, and the more CPU's in a system,
the higher the value for MIN(AWE_WINDOW_MEMORY). Here are a couple of
example configurations and caclulations showing MIN(AWE_WINDOW_MEMORY).


Example #1:
----------------
# of CPU's = 8
DB_BLOCK_SIZE = 8192
Total RAM = 8GB

SETS_PER_POOL = 2 * CPU_COUNT = 16
_DB_BLOCK_LRU_LATCHES = (max buffer Pools * sets_per_pool) = 8*16 = 128
MIN(AWE_WINDOW_MEMORY) =(4096*DB_BLOCK_SIZE*_DB_BLOCK_LRU_LATCHES)/8 =
( 4096 * 8192 * 128) / 8 = 536870912 bytes = 512 MB


Example #2:
---------------
# of CPU's = 16
DB_BLOCK_SIZE = 8192
Total RAM = 16 GB

SETS_PER_POOL = 2 * CPU_COUNT = 32
_DB_BLOCK_LRU_LATCHES = (max buffer Pools * sets_per_pool) = 8*32 = 256
MIN(AWE_WINDOW_MEMORY) =(4096*DB_BLOCK_SIZE*_DB_BLOCK_LRU_LATCHES)/8 =
( 4096 * 8192 * 256) / 8 = 1073741824 bytes = 1024 MB



These values above are the minimum values required for AWE_WINDOW_MEMORY
to be set to, UNLESS you explicitly set _DB_BLOCK_LRU_LATCHES to a lower
value. If AWE_WINDOW_MEMORY is not set to the minimum value, you will
receive the following errors:

ORA-27102 out of memory
OSD-00034 Message 34 not found; Product=RDBMS;facility =SOSD
O/S Error: (OS 8) Not enough storage is available to process this command

If you receive these errors when trying to start the database under 9.2 or 10g,
this may be because the AWE_WINDOW_MEMORY value in the registry is set
too low for the calculated minimum value. If you cannot increase the
value for AWE_WINDOW_MEMORY, then you can explicitly set
_DB_BLOCK_LRU_LATCHES to a value lower than the calculated value, and
retry the startup.

_DB_BLOCK_LRU_LATCHES must be at least 8 (Equal to the maximum number of
buffer pools)

Note #1 - Recall from the earlier section that these errors may also occur if
you are trying to start up with a buffer cache that is too large for the
physical memory available.

Note #2 - The same errors above have also been observed with a buffer
cache that is too small. When USE_INDIRECT_DATA_BUFFERS is set to TRUE
the value for DB_BLOCK_BUFFERS should equate to a buffer cache that is
AT LEAST equal to AWE_WINDOW_MEMORY. In most cases, the total buffer
cache size will be greater than AWE_WINDOW_MEMORY. If you attempt to
start up with a buffer cache that is too small (i.e. < AWE_WINDOW_MEMORY)
that may also result in the ORA-27102 error.

Note#3 - It has been observed on some systems that you may need to add a few
additional meg to AWE_WINDOW_MEMORY to calculate for overhead. Therefore, if
you go through the above calculations, and the instance still does not start,
try adding an additional 10 Meg or so to the calculated value.

Note#4 - Also, keep in mind that when calculating the # of CPU's in the system,
you have to take hyperthreading into account. On a hyperthreaded system, the OS
will think that you have double the # of CPU's in the system over what you actually
have, and this is the number that must be used in the calculations.


How to calculate the maximum used memory
=========================================
With respect to awe_window_memory the following maximum amount of memory can be used
from physical memory:

The SGA size is composed from:
((db_block_buffers * block size) + (shared_pool_size + large_pool_size +
java_pool_size + log_buffers) + 1MB
The size of SGA + Oracle's overhead must not exceed the available virtual memory.

The size of buffer cache depends on the available virual memory and can be calculated with
buffer cache = db_block_buffer * db_block_size


CPU Spins Possible When Using AWE Implementation:
=================================================

Use caution when setting _DB_BLOCK_LRU_LATCHES or AWE_WINDOW_MEMORY too low.
If we are unable to map a requested buffer into the window because all of
the space defined by AWE_WINDOW_MEMORY is in use with buffers already
actively being accessed, then we spin and wait, checking every so often
until an existing buffer in the window can be unmapped, and a new buffer can
be mapped in.

This spin will consume CPU cycles until enough buffers can be
Mapped/Unmapped to satisfy the request. In some cases, there may be so
many buffers needing to be mapped into the window, that DBWR will consume
100% of cycles on all CPUs, effectively locking up the machine. This is
normal behavior under some circumstances, and is simply an indication that
AWE_WINDOW_MEMORY is too small.

Monitoring Mapping Operations in 9.2 and later releases:
========================================================

Starting with 9.2, we have added additional statistics which can be
measured in v$sesstat (sesssion-level stats) and v$sysstat (system-wide
stats):

STATISTIC# NAME
---------- ------------------------------
154 number of map operations
155 number of map misses

This query below will give you system-wide information on map
operations and map misses:

SQL> select * from v$sysstat where statistic# in (154, 155);

If the # of Map misses is relatively high, or particularly of the # of map
misses increases consistently over time, this may be an indication that the
value for AWE_WINDOW_MEMORY is set too low.


Dynamic Memory Management/Automatic Memory Management with AWE Enabled
=============================================================

Oracle10g introduces the concept of Automatic Memory Management,
whereby the Oracle RDBMS will dynamically adjust SGA parameters
such as SHARED_POOL_SIZE, JAVA_POOL_SIZE, DB_CACHE_SIZE, etc.

This is enabled by setting the parameter SGA_TARGET to a non-zero value.
However, in order for this to work properly, you must use DB_CACHE_SIZE
for the buffer cache. When setting USE_INDIRECT_DATA_BUFFERS, you cannot
set DB_CACHE_SIZE, as noted above. Therefore, SGA_TARGET should not be set
when using AWE - these two features are mutally exclusive.
When setting USE_INDIRECT_DATA_BUFFERS=TRUE on Oracle10g, you should also
set SGA_TARGET to 0.


Diagnosing Spins Associated With AWE in 8.1.x:
==============================================

The above stats are not available in 8.1.7, so if you are encountering
problems with CPU spins, with AWE_WINDOW_MEMORY enabled, it is more
difficult to diagnose.

You can start by identifying and monitoring the thread associated with
DBWR via the following query:

SQL> select b.name, p.spid from v$process p, v$bgprocess b
where p.addr=b.paddr;

NAME SPID
----- ---------
PMON 1900
DBW0 1956
LGWR 572
CKPT 1908
SMON 1808
RECO 920
SNP0 1784
SNP1 1892
SNP2 1896
SNP3 1844

10 rows selected.

As you can see, DBWR has an SPID of 1956, which will equate to the
Thread ID of that thread within the Oracle executable. This thread can
then be monitored using Performance Monitor and/or the PSLIST utility,
which is available as a free download from http://www.sysinternals.com

If your monitoring shows that DBWR is consuming excessive CPU, you can
attempt to get an errorstack from that thread using oradebug:

SQL> oradebug setospid 1956
Oracle pid: 3, Windows thread id: 1956, image: ORACLE.EXE
SQL> oradebug unlimit
Statement processed.
SQL> oradebug dump errorstack 3
Statement processed.

This should dump the errorstack to the DBWR trace file, found in BDUMP.
If the errorstack contains the function SKGMMAP, this is an indication
that DBWR is working to map/unmap database block buffers.

Note: In 8.1.7 of the RDBMS, you cannot use DBWR_IO_SLAVES in combination with
USE_INDIRECT_DATA_BUFFERS, due to BUG#3042660/BUG#2215894. You must leave
DBWR_IO_SLAVES at its default value - otherwise, buffers are not unmapped
and eventually a spin of the process will result.
This problem is resolved in 9.2.0.1 - the fix is NOT backported to 8.1.7

KNOWN ISSUES
--------------------
BUG#2461474 - SHOW SGA DOES NOT SHOW CORRECT # OF DB BUFFERS WITH AWE
BUG#1412485 - LONG SHUTDOWN TIME WITH AWE_WINDOW_MEMORY: FIXED IN 8.1.7.1
BUG#1406194 - AWE_WINDOW_MEMORY NOT RELEASED WHEN DB SHUTDOWN: FIXED IN 8.1.7.1
BUG#2520796 - ORA-439 TRYING TO ENABLE VLM IN STANDARD EDITION OF ORACLE - FIXED IN 9.2.0.4
BUG#2945011 - VLM DOES NOT WORK ON STANDARD EDITION ORACLE 9.2.0.2 ON WINDOWS - FIXED IN 9.2.0.4
BUG#3120033 - ORA-600[KCBVMAP] may occur with AWE, or DBWR may crash with ORA-471 on 9.2.0.4 - FIXED 9.2.0.4 PATCH 2
BUG#3042660 / BUG#2215894 - IO SLAVES DON'T UNMAP BUFFERS ON LINUX IN VLM MODE (APPLIES TO WINDOWS AS WELL)

CONFIGURING AUTOMATIC SHARED MEMORY MANAGEMENT

AUTOMATIC SHARED MEMORY MANAGEMENT

In Oracle 10g, the memory components are collectively known as the System Global area. Some of the memory components also referred to as pools need to have their size configured properly. The main pools are the shared pool, the large pool, the database cache size and the Java Pool. The appropriate individual sizes need to configured based on the overall SGA size. This can be quite a challenge by itself. Under-sizing may lead to poor performance and out-of-memory errors, while over-sizing may result in wasting of memory.

In Oracle 10g, all you need to specify is the total amount of memory to be used by all SGA components. The database uses this value to redistribute memory between the various components based on the current workload of the database.

•The new initialization parameter (SGA_TARGET) can include all the memory in the SGA, manually and automatically seized components and any internal allocations during startup.

•The initialization parameters used in Oracle 9i and earlier namely DB_CACHE_SIZE, LARGE_POOL_SIZE, SHARED_POOL_SIZE and JAVA_POOL_SIZE are now considered auto-tuned SGA parameters. When the SGA_TARGET is set, the total for the manual SGA size parameters is subtracted from the SGA_TARGET to obtain the amount of memory that can be allocated to auto-tuned memory components.

•The Automatic Shared Memory Management feature uses a background process called Memory Manager (MMAN). This background process is responsible for coordinating the sizes of the various memory components dynamically based on the current workload. This process checks the current workload on the database every few minutes, to ensure that memory is always present wherever needed.

•The basic method used by automatic shared memory is given below:
•Statistics are gathered periodically
•Different memory advisories are used to make recommendations
•"What If" analysis is performed to determine best distribution of memory.
•Memory is moved to wherever it is required.





GUIDELINES


•Automatic Shared memory management is configured by setting the SGA_TARGET initialization parameter. If the parameter is set to the default value of 0, then automatic shared memory management is disabled. If set to a non-zero value then Oracle automatically sizes of the shared pool, the large pool, the java pool and the Database buffer cache accordingly.

•Within the SGA the buffers whose sizes can be configured manually are the Log Buffer (LOG_BUFFER), Keep and Recycle Pools (DB_KEEP_CACHE_SIZE and DB_RECYCLE_CACHE_SIZE), A streams pool (STREAMS_POOL_SIZE) which is new Oracle 10g , fixed SGA and other internal allocations and caches to accommodate non-standard tablespace blocks (DB_nk_CACHE_SIZE, n=2,4,8,16,32).

•The initialization parameter STATISTICS_LEVEL must be set to TYPICAL or ALL.

•You can query the values of the auto-tuned parameters from the V$PARAMETER dynamic performance view. If you set a value for the SGA_TARGET and do not specify sizes for the auto-tuned size parameters, the value that is displayed by the V$PARAMETER view against these parameters is 0.

•The SGA_TARGET should be less than the SGA_MAX_SIZE initialization parameter. It can be reduced upto a minimum value defined for an individual auto-tuned component. Any change you make to the SGA_TARGET only affects the auto-tuned initialization parameters. You can dynamically increase the SGA_TARGET to the absolute maximum specified by adjusting the value of SGA_MAX_SIZE.

•You can disable automatic shared memory tuning by setting the SGA_TARGET to value of 0. If this is done, the values taken by the individual auto-tuned memory components freeze to their current sizes. They do not take any defaults or previous values.

•When an auto-tuned parameter is resized, the resize results in a change to the size of the component only if the new value is larger than the present size of the component. If you change JAVA_POOL_SIZE to 2G. This change will take effect immediately ensuring there is always 2G for this parameter, however if you reduce to 1G, where the current size is 1.5G. The change may not occur immediately, and the memory tuning algorithm can reduce to this value if it needs to.




CONFIGURING AUTOMATIC SHARED MEMORY MANAGEMENT.



You can configure Automatic Shared Memory Management either:
•Manually
•Using Enterprise Manager Console
•The Enterprise Manager can be used to configure Automatic Shared Memory Management. To do so, select the Database -> Administration Tab -> Memory Parameters -> SGA Tab -> Enable button. Specify the total SGA size in Megabytes.

•The ALTER SYSTEM command may be used to configure Automatic Shared Memory Management manually.

SQL> ALTER SYSTEM SET SGA_TARGET = 500M SCOPE=spfile;

Also modify the initialization parameter listed below to zero, or completely remove them from the parameter file.

SHARED_POOL_SIZE=0
LARGE_POOL_SIZE=0
JAVA_POOL_SIZE=0
DB_CACHE_SIZE=0
DATA DICTIONARY

Once configured you can check the sizes with the following:

SQL> SELECT CURRENT_SIZE FROM V$BUFFER_POOL;

Display output

SQL> SELECT POOL, SUM(BYTES)/1024/1024 Mbytes FROM V$SGASTAT GROUP BY POOL;

The total sum of values of the above two queries will be the same as the value you set for SGA_TARGET.

Wednesday, June 27, 2007

Oracle DBA Checklist

Oracle DBA Checklist



I. Daily Procedures

A. Verify all instances are up

Make sure the database is available. Log into each instance and run daily reports or test scripts. Some sites may wish to automate this.
Optional implementation: use Oracle Enterprise Manager's 'probe' event.


B. Look for any new alert log entries

. Connect to each managed system.
. Use 'telnet' or comparable program.
. For each managed instance, go to the background dump destination, usually $ORACLE_BASE/ /bdump. Make sure to look under each managed database's SID.
. At the prompt, use the Unix 'tail' command to see the alert_ .log, or otherwise examine the most recent entries in the file.
. If any ORA-errors have appeared since the previous time you looked, note them in the Database Recovery Log and investigate each one. The recovery log is in .


C. Verify DBSNMP is running

1. Log on to each managed machine to check for the 'dbsnmp' process. For Unix: at the command line, type ps -ef | grep dbsnmp. There should be two dbsnmp processes running. If not, restart DBSNMP. (Some sites have this disabled on purpose; if this is the case, remove this item from your list, or change it to "verify that DBSNMP is NOT running".)

D. Verify success of database backup

E. Verify success of database archiving to tape

F. Verify enough resources for acceptable performance
1. Verify free space in tablespaces.
For each instance, verify that enough free space exists in each tablespace to handle the day's expected growth. As of , the minimum free space for : [ < tablespace > is < amount > ]. When incoming data is stable, and average daily growth can be calculated, then the minimum free space should be at least

Recreate the Database Control Repository

How to Recreate the Database Control Repository - (Oracle10g R1)

http://www.idevelopment.info/data/Oracle/DBA_tips/Enterprise_Manager/OEM_3.shtml

Installation of Oracle on Linux Links

http://www.oracle-base.com/articles/linux/OracleEnterpriseLinux4Installation.php
http://www.oracle-base.com/articles/linux/RHEL4Installation.php
http://www.oracle.com/technology/obe/obe10gdb/install/linuxinst/linuxinst.htm
http://www.puschitz.com/OracleOnLinux.shtml

Oracle Database 11g Overview Presentation

Oracle Database 11g Overview Presentation

The following is a presentation by Mark Townsend, the vice president of database product management, titled The Future of Database Technology. Towards the middle of the presentation, there is a high level overview of many Oracle database 11g features like SQL replay, online table and index redefinition, automatic diagnostic workflow, support for online hot patching and other highlights.

Here is the full document:

http://awads.net/wp/2007/06/25/oracle-database-11g-overview-presentation/

Tuesday, June 12, 2007

STATSPACK

STATSPACK

Below are the steps for generating a statspack Report:

1. User must have SYSDBA privs

set ORACLE_SID=orcl
sqlplus sys/pwd as sysdba

2.You should create SEPARATE TABLESPACE for statspack report.

create tablespace PERFSTAT
datafile 'c:\perf01.dbf' size 100m
autoextend on
segment space management auto;

We should generate STATSPACK report DURING PEAK TIME
run SPCREATE.SQL script
Located : $ORACLE_HOME\rdbms\admin\spcreate.sql

conn sys as sysdba
@$ORACLE_HOME\rdbms\admin\spcreate.sql

4.connect with PERFSTAT user
perfstat user create automatically when we run SPCREATE.SQL script

conn perfstat/password

5.run STATSPACK.SNAP procedure

exec statspack.snap;

Note: After 15 minutes run again STATSPACK.SNAP procedure

6.run SPREPORT for generate statspack report in text format.

@$ORACLE_HOME\rdbms\admin\spreport.sql

7.connect with SYSDBA privs user ( sys user)
and execute SPDROP.SQL script for drop PERFSTAT user and all related tables

conn sys as sysdba
@$ORACLE_HOME\rdbms\admin\spdrop.sql

8.DROP TABLESPACE use for STATSPACK REPORT

conn sys as sysdba
drop tablespace [TABLESPACE NAME]
including contents and datafiles

Note: analyze your report

http://www.statspackanalyzer.com/analyze.asp
http://www.oraperf.com

Script to Schedule a Full Database Export backup

Script to Schedule a Export backup daily three times at 6:00AM,2:30PM,10:30PM.

SCRIPT:

schtasks /create /sc hourly /mo 8 /sd 06/07/2007 /ST 22:30:00 /tn MyDailyBackup /tr C:\sree_backup\SREE_BACKUP.bat /RU sree\kasukurthi.sridhar /RP sreetest@9


Where

/sc = Schedule Creation
/mo = Modification time
/sd = schedule date
/st = schedule time
/tn = transaction name
/tr = transaction to run( Batch file along with path )
/ru = remote user (if not specified it will takke local user name)
/ru = remote password ( if not specified it will prompt at the run time )



To delete above task issue below command at OS prompt

SCHTASKS /Delete /TN "MyDailyBackup" /f

Batch file contents:

@echo off
move old_sree.dmp "C:\sree_backup\move_old\"
move old_sree.log "C:\sree_backup\move_old\"
rename sree.dmp old_sree.dmp
rename sree.log old_sree.log
exp userid=edr/sree@edr file=c:\sree_backup\sree.dmp log=c:\sree_backup\sree.log full=y buffer=2000000

ORA-12528: TNS:listener: all appropriate instances are blocking new connections

ORA-12528: TNS:listener: all appropriate instances are blocking new connections

It is known issue with ORACLE 10G.

Suggestion: Don't Use "@(tns_entry string)" with userid/pwd.
just export or set ORACLE_SID and connect WITHOUT "@"tns_entry.

SQL> grant SYSDBA to system;

Grant succeeded.

SQL> conn system/oracle@oracle as sysdba
Connected.

SQL> STARTUP FORCE
ORA-12528: TNS:listener: all appropriate instances are blocking new connections

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

C:\>sqlplus sys as sysdba

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Feb 19 17:13:20 2007

Copyright (c) 1982, 2004, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS
------------
STARTED

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> conn system as sysdba
Enter password:
Connected.
SQL> SHOW PARAMETER DB_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ORACLE
SQL> STARTUP FORCE
ORACLE instance started.

Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.
SQL>