Você está na página 1de 10

PHP Development with Oracle

By Darun
Introduction to Oracle

• Oracle Database - scalability, reliability and


features
• Leading database and is available on many
platforms.
Databases and Instances
• An Oracle database stores and retrieves data.

• Each database consists of one or more data files

• Oracle database server consists of an Oracle


database and an Oracle instance.

• Server is started, a shared memory region called the


system global area (SGA) is allocated and the Oracle
background processes are started.

• The combination of the background processes and


SGA is called an Oracle instance.
Tablespaces
• Tablespaces are the logical units of data storage
made up of one or more datafiles.

• Tablespaces are often created for individual


applications because tablespaces can be
conveniently managed.

• Users are assigned a default tablespace that holds


all the data the users creates.

• A database is made up of default and DBAcreated


tablespaces.
Schemas and Users
• A schema is a collection of database objects such as
tables and indexes.

• A schema is owned by a database user and has the


same name as that user.

• Once you have installed PHP and want to write


scripts that interact with Oracle, you need to connect
as the owner of the schema that contains the objects
you want to interact with.

• For example, to connect to the HR schema, you


would use the username hr in PHP’s connection
string.
Schemas and Users
• Per machine may have more than one database,
typically a single Oracle database contains multiple
schemas.

• Multiple applications can use the same database without


any conflict by using different schemas.

• Instead of using a CREATE DATABASE command for new


applications, use the CREATE USER command to create a
new schema in the database.

• In Oracle Database 10g Express Edition (known as


“Oracle Database XE”) there is a wizard to create new
users in the Oracle Application Express management
console.
Introduction to PHP

• PHP is a interpreted scripting language commonly used for


web applications.

• PHP - open source and free; has a BSD-style license, making it


corporation-friendly.

• PHP is perfect for rapidly developing applications both big and


small, and is great for creating Web 2.0 applications.

• It runs on many platforms and language is dynamically typed


and easy to use.
About PHP
• PHP is typically installed as an Apache module, or
run by the web server using FastCGI.

• It includes the PHP OCI8 extension and is linked


with the Oracle Client Libraries, enabling Oracle
Database access.

• When a user enters the URL of a PHP script


(hello.php) in their browser.
About PHP
• Hello.php
End

Você também pode gostar