# man > Apache::Session::Store::Oracle

---
type: CommandReference
command: Apache::Session::Store::Oracle
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference
- `tie %hash, 'Apache::Session::Oracle', $id, { DataSource => 'dbi:Oracle:database', UserName => 'user', Password => 'pass' }` — bind session hash to Oracle storage
- `$store->insert($ref)` — insert new session data
- `$store->materialize($ref)` — load session data from database
- `$store->update($ref)` — update existing session data
- `$store->remove($ref)` — remove session from database
- `CREATE TABLE sessions ( id varchar2(32) NOT NULL PRIMARY KEY, a_session long )` — required schema
- `{ Handle => $dbh }` — provide a pre-opened DBI handle instead of DataSource/User/Password
- `{ LongReadLen => 65536 }` — increase max session size from default 8 KB

## Name
Store persistent session data in an Oracle database.

## Synopsis
perl
use Apache::Session::Store::Oracle;

my $store = new Apache::Session::Store::Oracle;

$store->insert($ref);
$store->update($ref);
$store->materialize($ref);
$store->remove($ref);
## Options
Configure via the options hash (see [Apache::Session](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession/markdown)).

- `DataSource` — DBI datasource string (e.g. `dbi:Oracle:database`)
- `UserName` — database username
- `Password` — database password
- `Handle` — pre-opened DBI database handle (alternative to the above three)
- `LongReadLen` — maximum session object size in bytes; default 8192 (8 KB)

## Examples

**Tie interface:**
perl
tie %hash, 'Apache::Session::Oracle', $id, {
    DataSource => 'dbi:Oracle:database',
    UserName   => 'database_user',
    Password   => 'K00l'
};
**Using an existing DBI handle:**
perl
tie %hash, 'Apache::Session::Oracle', $id, {
    Handle => $dbh
};
**Direct store object usage:**
perl
use Apache::Session::Store::Oracle;
my $store = Apache::Session::Store::Oracle->new({
    DataSource => 'dbi:Oracle:mydb',
    UserName   => 'user',
    Password   => 'secret'
});
$store->insert($session_ref);
## See Also
- [Apache::Session](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession/markdown)
- [Apache::Session::Store::DBI](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AStore%3A%3ADBI/markdown)

## Exit Codes
Not documented.