Monday, October 17, 2011

Manually corrupting the data block in Linux and recovering it using BLOCKRECOVER command of RMAN

Manually corrupting the data block in Linux and recovering it using BLOCKRECOVER command of RMAN
Sometimes, in order to test the RMAN’s  BLOCKRECOVER command, we need to corrupt the specific data block and recover it for testing purpose.
To do it in Linux, use dd command. In the following example, let’s create a table and corrupt it manually
 (Don’t try it on the production database  or you’ll be fired work from the job )


SQL> create table manu (id number ,name char(15));
Table created.

SQL> insert into manu values(1,'tanu');
1 row created.

SQL> commit;
Commit complete.

SQL> select * from manu;
        ID   NAME
———-------
         1   tanu


SQL> select header_blockfrom dba_segments where segment_name=’MANU’;
HEADER_BLOCK
————
          61201

[oracle@localhost ~]$ dd of=/u01/app/oradata/orcl/system01.dbf bs=8192 conv=notrunc seek=61202 << EOF
> testing corruption
> EOF
0+1 records in
0+1 records out


SQL> ALTER SYSTEM FLUSH BUFFER_CACHE;
System altered.


SQL> select * from manu;
select * from manu
                     *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 61202)
ORA-01110: data file 1: ‘/u01/app/oradata/orcl/system01.dbf’

SQL>

Now connect to the RMAN and recover the data block (not the whole datafile or database) using BLOCKRECOVER command as follows:
SQL> ! rman target /
RMAN>

RMAN>blockrecover datafile 1 block 61202;
Starting blockrecover at 15-OCT-11
<… underprocess … >
<… underprocess … >

Finished blockrecover at 15-OCT-11
RMAN> exit

Connect to SQL*Plus and query the table:SQL> select * from manu;
        ID NAME
———--------
         1     tanu




ALL THE BEST TO ALL...... :)

Saturday, September 17, 2011

ORA-00600: internal error code, arguments: [kcratr1_lastbwr]

Some time we encounter this error while starting the database.
Below is the solution for recovering through this error.

Error:

SQL> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size  83888372 bytes
Database Buffers 79691776 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00600: internal error code, arguments: [kcratr1_lastbwr], [], [], [], [],[], [], []


Cause:

Oracle is unable to perform instance recover but it works when is invoked manually.

Solution:

SQL> startup mount
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 83888372 bytes
Database Buffers 79691776 bytes
Redo Buffers 2973696 bytes
Database mounted.

SQL> recover database

Media recovery complete.
SQL> alter database open;
Database altered.

All The Best ............




Thursday, June 2, 2011

Database Startup fails with ORA-00444, ORA-07446

Problem Description
When I start my database my instance fails with ORA-00444 and ORA-07446 as follows.


SQL> startup
ORA-00444: background process "MMAN" failed while starting
ORA-07446: sdnfy: bad value '' for parameter.



Cause of The Problem
Database startup event is logged into alert log file. And alert log file is defined by the background_dump_dest parameter inside the initialization parameter. While starting up the instance if instance fail to write into the alert log file then instance crushes and fail to startup.

Solution of The Problem
There may be different scenario whenever oracle fails to write alert log contents. Suppose the partition reside alert log file is full. In that case delete/move unnecessary file from the alert log partition directory.

There may be the case the the directory defined by the background_dump_dest does not exist in the OS.

In both case you may also like to change the background_dump_dest location inside the pfile.

If you have spfile then,
1.create pfile='/u01/abc.ora' from spfile;
2.edit the pfile /u01/abc.ora
3.Modify the background_dump_dest to a valid location and in a patition where there is sufficient space available.
4.start the database isntance.
startup pfile=' /u01/abc.ora';
5.create spfile again.
create spfile from pfile= '/u01/abc.ora';

Thursday, April 21, 2011

DIM-00014: Cannot open the Windows NT Service Control Manager. O/S-Error: (OS 5) Access is denied.

This error is common in Windows Vista and windows 7 .
Its means that the user from which you are using oradim has not sufficient privileges .But most of the users complaint that they are performing this task from Administrator user or they have only one account in windows and its administrator ,but still they are facing this problem .
So the solution is very simple ,
just go to start wirte cmd ,cmd icon appears ,right click on it ....
Then click on "Run as administrator" and then create your required service .


oradim -new -sid myservice ;

Saturday, March 26, 2011

Instance Memory Structures

Instance Memory Structures:
The System Global Area is a shared memory region that conatains data and control information for
one oracle instance. Oracle allocates the SGA when instance is starts and deallocates it when
instance is shutdown. Each instance has its own  SGA. SGA is divided into serveral type of memory
structure:
1.  Database buffer : store the most recently used blocks of data. The buffer cache contains
modified as well as unmodified blocks.becouse the most recently used data is kept in memory ,less
disk I/O is necessary and performance is improved.
The buffers in the cache are organized in two lists: the write list and the least recently used (LRU)
list. The write list holds dirty buffers, which contain data that has been modified but has not yet
been written to disk. The LRU list holds free buffers, pinned buffers, and dirty buffers that have
not yet been moved to the write list. Free buffers do not contain any useful data and are available
for use. Pinned buffers are currently being accessed.
2. The Redo log buffer: stores redo entries  a lot of changes made to the database . redo log buffer is
used if database recovery is necessary . the size of the redo log is static.
3. Shared pool : contains shared memory constructs ,suchas shared SQL areas which is required to
process every unique SQL statement submitted to a database and contains information  such as the
parse tree and execution plan for the corresponding statement and used by multiple applications that
issue the same statement leaving more shared memory for other uses.
The library cache: includes the shared SQL areas, private SQL areas (in the case of a shared server
configuration), PL/SQL procedures and packages, and control structures such as locks and library
cache handles
The data dictionary :is a collection of database tables and views containing reference information
about the database, its structures, and its users. Oracle accesses the data dictionary frequently
during SQL statement parsing. This access is essential to the continuing operation of Oracle.
4. Large Pool: The database administrator can configure an optional memory area called the large pool
to provide large memory allocations for:
Session memory for the shared server and the Oracle XA interface (used where transactions
interact with more than one database)
I/O server processes
Oracle backup and restore operations
By allocating session memory from the large pool for shared server, Oracle XA, or parallel query
buffers, Oracle can use the shared pool primarily for caching shared SQL and avoid the performance
overhead caused by shrinking the shared SQL cache.
In addition, the memory for Oracle backup and restore operations, for I/O server processes, and for
parallel buffers is allocated in buffers of a few hundred kilobytes. The large pool is better able to
satisfy such large memory requests than the shared pool.
5. Java Pool memory : is used in server memory for all session-specific Java code and data within the
JVM. Java pool memory is used in different ways, depending on what mode the Oracle server is
running in.
6. Streams:Oracle Streams enables information sharing. Using Oracle Streams, you can share
data and events in a stream. The stream can propagate information within a
database or from one database to another. The stream routes specified information
to specified destinations. The result is a feature that provides greater functionality
and flexibility than traditional solutions for capturing and managing events, and
sharing the events with other databases and applications. Streams provides the
capabilities needed to build and operate distributed enterprises and applications,
data warehouses, and high availability solutions. You can use all of the capabilities
of Oracle Streams at the same time. If your needs change, then you can implement a
new capability of Streams without sacrificing existing capabilities.

ORACLE DATABASE ARCHITECTURE

ORACLE DATABASE ARCHITECTURE:
An oracle database which is a collection of data treated as a unit is to store and retrieve related information and is solving the problem of information management.
A Server: reliably manages a large amount of data in a multiuser environment so that many users can
concurrently access the same data and database server prevents unauthorized access and provides
efficient solution for failure recovery.
oracle database is the first database designed for enterprise grid computing the most flexible and
cost effective way to manage information and application.
The database has logical and physical structures because the physical and logical structures are
separate , the physical storage of data can be managed without affecting the access to logical
storage structures.
                             
Overview of oracle Grid architecture :
The oracle grid architecture pools large numbers of servers, storage and networks into a flexible,on
demand computing resource for enterprise computing needs.The grid computing infrastructure
continually analyzes demand for resources and adjusts supply accordingly.
Grid computing uses sophisticated(intricate) workload management that makes it possible for
applications to share resources across many servers.data processing capacity can be added or
removed on demand,resources within a location can be dynamically provisioned. Web services can
quicakly integrate application to create new buiness processes.

grid computing offers high performance and scalability ,because all computing resources can be
flexibly allocated applications as needed.
Oracle Database enables enterprise grid computing in the following ways:
Performance and scalability with low cost hardware clusters, like Itanium and Linux.
Reliability: Continuous availability of data and applications
Security and privacy: security features that lets you share enterprise grid resources with confidence
that privacy is maintained
Self-management: Oracle infrastructure automates many functions so that a single administrator can
manage hundreds of servers.
Distributed computing: Oracle has advanced integration features that allow applications and data to
run anywhere in the network
Difference between a cluster and a grid: Clustering is one technology used to create a grid
infrastructure. Simple clusters have static resources for specific applications by specific owners.
Grids, which can consist of multiple clusters, are dynamic resource pools shareable among many
different applications and users. A grid does not assume that all servers in the grid are running the
same set of applications. Applications can be scheduled and migrated across servers in the grid. Grids
share resources from and among independent system owners.

Thursday, February 17, 2011

SQL Server Reporting Services

SQL Server Reporting Services :-

 is a comprehensive, server-based solution that enables the creation, management, and delivery of both traditional, paper-oriented reports and interactive, Web-based reports. An integrated part of the Microsoft Business Intelligence framework, Reporting Services combines the data management capabilities of SQL Server and Microsoft Windows Server with familiar and powerful Microsoft Office System applications to deliver real-time information to support daily operations and drive decisions.