Friday, May 10, 2013

ORACLE FUNDAMENTAL CONCEPT

ORACLE INSTANCE:  Oracle Instance is  consist of  SGA(System Global Area)  memory structure and  background  process.an Instance can open and use only one database at time.

List of Physical files in Oracle Database
* Data files
* Redo log files
* Control files
* Parameter file(init.ora)
* password file
* Configuration files(sqlnet.ora,tnsnames.ora,listener.ora )

SQL Query Execution  PHASE CYCLE

1*loading into Shared pool (sql code loaded into RAM)
2*Syntax Phase(Check for syntax error)
3*Semantic Phase(check table/column access)
4*Query Transformation(transform complex query into simple)
5*Optimization (Create Execution plan)
6*Create Executable



Memory Structure
 *SGA
 * PGA

*SGA(System/Shared Global Area):
 it is a group of shard memory structure.
 It's allocate when instance is startup.
 its have several memory structure components.
 it is use to store the information that is shared by oracle database and background process.

Mandatory memory structure
 ->Shard Pool : it is use to store most recently executed sql query and most recently used data definition.the shared pool area is RAM area with in RAM heap that is created start up time.
.it contain two performance related memory structure components
         ->Library Cache : its size depend on the shard pool size .its store information about the most
                                     recently used sql and pl/sql statement. is manage by LRU(Least Recently Used
                                    Algo). Library cache consist  with  two  structure.

                *Shard SQL: its store and share the information about execution plan and parse tree for sql
                                     statement against run database.if second time again run same sql ans parse information is available in the shared sql area then not  use resource to perform parse and execution plan.
if the cache memory is not available in LC then  LRU Algo. is use to free memory  for perform operation.


                *Shard PL/SQL: its contain information about pl/sql statement execution plan and parse information . like(Procedure,Function,Trigger etc.)

         ->Dictionary Cache: it is a collection of most recent used definition in database.its  include information about table,index,privilege user and other database objects.

 during the parse phage  the server process look in the data dictionary to validate statements.

 in database two type parsing available
   *Hard Parse: if execution plan and parse tree available in  shared pool(LC+DC)

   * Soft Parse: if server create execution plan and parse tree means not available in Shard pool(LC+DC)

->Database Buffer Cache: Its store copies of data block that have been retrieved from data files.
buffer cache organized two list(MRU,LRU)
->Redo log Buffer

Optional memory structure
-> Large Pool
-> Java Pool
-> Stream Pool



*PGA(Program/Process Global Area):It's allocated when server process start.

ABOUT RAID


#########################
ERROR FACING  FRM-92095
FRM-92095: Oracle JInitiator version too low. Please install version 1.1.8.2 You can use Java7 in Windows or Mac
In Control Panel of Java
click Java click view in version7 Parameters write:
write in runtime parameters field
-Djava.vendor="Sun Microsystems Inc."
Enjoy !

###########################


RAID (redundant array of independent disks; originally redundant array of inexpensive disks) is a way of storing the same data in different places (thus, redundantly) on multiple hard disks. By placing data on multiple disks, I/O (input/output) operations can overlap in a balanced way, improving performance. Since multiple disks increases the mean time between failures (MTBF), storing data redundantly also increases fault tolerance.

A RAID appears to the operating system to be a single logical hard disk. RAID employs the technique of disk striping, which involves partitioning each drive's storage space into units ranging from a sector (512 bytes) up to several megabytes. The stripes of all the disks are interleaved and addressed in order.
In a single-user system where large records, such as medical or other scientific images, are stored, the stripes are typically set up to be small (perhaps 512 bytes) so that a single record spans all disks and can be accessed quickly by reading all disks at the same time.
In a multi-user system, better performance requires establishing a stripe wide enough to hold the typical or maximum size record. This allows overlapped disk I/O across drives.
There are at least nine types of RAID plus a non-redundant array (RAID-0):
  • RAID-0: This technique has striping but no redundancy of data. It offers the best performance but no fault-tolerance.
  • RAID-1: This type is also known as disk mirroring and consists of at least two drives that duplicate the storage of data. There is no striping. Read performance is improved since either disk can be read at the same time. Write performance is the same as for single disk storage. RAID-1 provides the best performance and the best fault-tolerance in a multi-user system.
  • RAID-2: This type uses striping across disks with some disks storing error checking and correcting (ECC) information. It has no advantage over RAID-3.
  • RAID-3: This type uses striping and dedicates one drive to storing parity information. The embedded error checking (ECC) information is used to detect errors. Data recovery is accomplished by calculating the exclusive OR (XOR) of the information recorded on the other drives. Since an I/O operation addresses all drives at the same time, RAID-3 cannot overlap I/O. For this reason, RAID-3 is best for single-user systems with long record applications.
  • RAID-4: This type uses large stripes, which means you can read records from any single drive. This allows you to take advantage of overlapped I/O for read operations. Since all write operations have to update the parity drive, no I/O overlapping is possible. RAID-4 offers no advantage over RAID-5.
  • RAID-5: This type includes a rotating parity array, thus addressing the write limitation in RAID-4. Thus, all read and write operations can be overlapped. RAID-5 stores parity information but not redundant data (but parity information can be used to reconstruct data). RAID-5 requires at least three and usually five disks for the array. It's best for multi-user systems in which performance is not critical or which do few write operations.
  • RAID-6: This type is similar to RAID-5 but includes a second parity scheme that is distributed across different drives and thus offers extremely high fault- and drive-failure tolerance.
  • RAID-7: This type includes a real-time embedded operating system as a controller, caching via a high-speed bus, and other characteristics of a stand-alone computer. One vendor offers this system.
  • RAID-10: Combining RAID-0 and RAID-1 is often referred to as RAID-10, which offers higher performance than RAID-1 but at much higher cost. There are two subtypes: In RAID-0+1, data is organized as stripes across multiple disks, and then the striped disk sets are mirrored. In RAID-1+0, the data is mirrored and the mirrors are striped.
  • RAID-50 (or RAID-5+0): This type consists of a series of RAID-5 groups and striped in RAID-0 fashion to improve RAID-5 performance without reducing data protection.
  • RAID-53 (or RAID-5+3): This type uses striping (in RAID-0 style) for RAID-3's virtual disk blocks. This offers higher performance than RAID-3 but at much higher cost.
  • RAID-S (also known as Parity RAID): This is an alternate, proprietary method for striped parity RAID from EMC Symmetrix that is no longer in use on current equipment. It appears to be similar to RAID-5 with some performance enhancements as well as the enhancements that come from having a high-speed disk cache on the disk array.
  •  
  • to check
http://rog.asus.com/77402012/rampage-iv-motherboards/what-is-raid-setup-guide/ 

Wednesday, May 8, 2013

ORACLE 11G CONNECT WITH PHP ON WINDOWS




STEP-1

 CREATE DSN USING ADMINISTRATOR TOOL




<html>
<body>

<?php
$conn=odbc_connect('orcl11g','hr','hr');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM test";
$rs=odbc_exec($conn,$sql);
if (!$rs)
  {exit("Error in SQL");}
echo "<table><tr>";
echo "<th>ID</th>";
echo "<th>Name</th></tr>";
while (odbc_fetch_row($rs))
  {
  $compname=odbc_result($rs,"id");
  $conname=odbc_result($rs,"name");
  echo "<tr><td>$compname</td>";
  echo "<td>$conname</td></tr>";
  }
odbc_close($conn);
echo "</table>";
?>

</body>
</html>