Oracle
This section provides details about the database objects, backup and recovery strategies, XML Schema Definition Pre-requisites, and sample database creation scripts for Oracle.
Database Objects
You need to create the following objects on the target database.
|
Object |
Action |
|---|---|
|
Table spaces |
Create two tablespaces in each of the database, one each to store data and indexes, with auto-extend functionality. |
|
User |
Create user with sufficient privileges and grant unlimited quota to the user on both the tablespaces created. |
Backup and Recovery Strategies
There are two standard backup types for Oracle—offline and online. You can choose the backup mode depending on whether the application can be shut down or not. If yes, offline mode is the best. If no, online mode needs to be used. Both these methods require the following.
- Database must be in archive log mode to enable point-in-time recovery using Oracle online and archived redo logs.
- Temenos Transact backup must be restored at the same time as the database backup, which means, the Temenos Transact backup and offline backup must start simultaneously, should both be restored.
If the application is shut down and backup is enabled, it is called an offline or cold back up. It is a complete backup of the database, if the data files, control file and on-line redo log files are copied using an operating system copy utility.
You cannot recover any changes made after this backup, if the database is running in NOARCHIVELOG mode. All transactions are recorded in online redo log files irrespective of whether archiving is enabled or not. When redo logs are archived (ARCHIVELOG mode), Oracle allows you to apply these transactions after restoring the damaged files (assuming an active Redo log file was not among the files damaged).
Whenever the schema of the database is changed (like adding a new data file, renaming a file, creating or dropping a tablespace), you need to shut down the database and at least make a copy of the control file and schema changes. It is recommended to do a complete backup of the database.
If the application is running and backup is enabled, it is called an online or hot back up. Online backup is not feasible for sites, which require 24*7 database operations. Hence, Oracle provides an option to enable physical backups while the database is running and available for both read and write.
To enable online backup, the database must be in ARCHIVELOG mode. You need to backup only the data files and current control file. You can enable this backup whenever required, as the unit of an online backup is a tablespace, unlike offline backups. You can back up different data files at different times.
The recovery of a failed batch using a hot backup requires the previous complete online backup restored and redo logs applied, to bring the database to a specified point in time. The number of redo logs required depends on when the backup was taken, which determines the speed of recovery.
You can also select the split and merge methodology for backup. The database will be stored on a triple mirror disk array. Prior to the start of a backup, the database will be shut down and one of the mirror sets will be split from the remaining. The database backup will be started on the split single mirror.
In the remaining mirror disks, the database will be restarted and operational transactions will continue to run. This allows the backup and operational transactions to be executed simultaneously. On successful completion of the backup, the disks would be merged to reform the triple mirror set.
Oracle also provides an option to create standby databases to manage in case of the main database failure. You can maintain one or more physical copies of the online database, usually on a separate server, by transferring Oracle redo log information to keep them synchronised.
If the main database fails, operations can be switched to the standby database, which then takes over as the main database, with little or no outage. You can also enable the standby database in read-only mode for designated periods to enable user reporting, if required.
For more details on split/merge method, refer Re Data Guard Concepts and Administration
For the best practices of backup and recovery, refer http://www.oracle.com/technetwork/server-storage/engineered-systems/database-appliance/documentation/dbappliancebackupstrategies-519664.pdf
XML Schema Definition Pre-requisites
The Oracle Structured Storage (XML DB) usage requires an Oracle Schema Directory (SCHEMA_DIR) configured for the database. This directory is used when registering the XML Schema Definitions.
create or replace directory SCHEMA_DIR as‘c:\t24\bnk\bnk.run\schema’ ;grant all on directory schema_dir to public;
In addition, you need to create an Oracle folder to serve as a repository for the XML schema definitions documents (.xsd) using the following script.
declare result boolean; begin result := dbms_xdb.createFolder(‘/public/t24’); end; /
You can execute the above commands from the options in config-XMLORACLE. To run the createResource and createFolder commands you must get access to be the XDBADMIN from the administrator.
grant xdbadmin to t24; grant create any directory to t24;
The XML schema definitions are normally registered when creating the XML DB table using CREATE-FILE. However, you can also create and register the XML schema definitions manually suing the following scripts.
To create XML schema definition
declare result boolean;
begin result := dbms_xdb.createResource(
abspath => ‘public/t24/ACCOUNT.xsd',
data => BFILENAME('SCHEMA_DIR','ACCOUNT.xsd'));
end;
/
To register XML schema definition
begin
DBMS_XMLSCHEMA.REGISTERSCHEMA(
schemaurl => 'http://localhost:8080//public/t24/ACCOUNT.xsd',
schemadoc => sys.UriFactory.getUri('/public/t24/ACCOUNT.xsd')
);
end;
/
The DELETE-FILE command automatically de-registers the XML schema definitions if the table is the last table associated with the XML Schema. However, you can also delete the XML schema definitions manually suing the following scripts.
To de-register XML schema definition
begin dbms_xmlschema.deleteSchema( SCHEMAURL => '/public/t24/ACCOUNT.xsd', DELETE_OPTION => dbms_xmlschema.DELETE_CASCADE_FORCE); end; /
To delete XML schema definition resource
sql> CALL DBMS_XDB.deleteresource('/public/t24/ACCOUNT.xsd');
To delete SCHEMA_DIR folder
sql> CALL dbms_xdb.deleteresource('/public/t24');
Sample Database Creation Scripts
This section provides example sql scripts to create a sample Oracle database named BENCHORA, data and index table spaces and schema owner.
set echo on
spool createDB.log
startup nomount pfile='%ORACLE_HOME%\dbs\initBENCHORA.ora';
CREATE DATABASE BENCHORA
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/oracle/oradata/BENCHORA/system01.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/oracle/oradata/BENCHORA/sysaux01.dbf' SIZE 350M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oracle/oradata/BENCHORA/temp01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/oracle/oradata/BENCHORA/undotbs01.dbf' SIZE 1000M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL32UTF8
LOGFILE GROUP 1 ('/oracle/oradata/BENCHORA/redo01a.log') SIZE 50M,
GROUP 2 ('/oracle/oradata/BENCHORA/redo02a.log') SIZE 50M,
GROUP 3 ('/oracle/oradata/BENCHORA/redo03a.log') SIZE 50M;
set echo off
spool off
create user t24 identified by t24 default tablespace T24DATA quota unlimited on T24DATA quota unlimited on T24INDEX; grant connect to t24; grant resource to t24; grant query rewrite to t24; grant create synonym to t24; grant drop any procedure to t24; grant create any table to t24; grant select any table to t24; grant update any table to t24; grant insert any table to t24; grant delete any table to t24; grant drop any table to t24; grant create any index to t24; grant alter any index to t24; grant drop any index to t24; grant create any view to t24; grant drop any view to t24; grant create any directory to t24; grant select_catalog_role to t24; grant xdbadmin to t24; grant create any directory to t24; spool off set echo off
############################################################################## # Copyright (c) 1991, 2001, 2002 by Oracle Corporation ############################################################################## ########################################### # Cache and I/O ########################################### db_block_size=8192 ########################################### # Cursors and Library Cache ########################################### open_cursors=300 ########################################### # Database Identification ########################################### db_domain="" db_name=LIVEDB ########################################### # File Configuration ########################################### db_create_file_dest=D:\app\oradata db_recovery_file_dest=D:\app\flash_recovery_area db_recovery_file_dest_size=4102029312 ########################################### # Miscellaneous ########################################### compatible=11.2.0.0.0 diagnostic_dest=D:\app memory_target=1675624448 ########################################### # Processes and Sessions ########################################### processes=150 ########################################### # Security and Auditing ########################################### audit_file_dest=D:\app\admin\LIVEDB\adump audit_trail=db remote_login_passwordfile=EXCLUSIVE ########################################### # Shared Server ########################################### dispatchers="(PROTOCOL=TCP) (SERVICE=LIVEDBXDB)" ########################################### # System Managed Undo and Rollback Segments ########################################### undo_tablespace=UNDOTBS1
# tnsnames.ora Network Configuration File: %ORACLE_HOME%/network/admin\tnsnames.ora
# Generated by Oracle configuration tools.
RODB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.11.11)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RODB)
)
)
# sqlnet.ora Network Configuration File: %ORACLE_HOME%\network\admin\sqlnet.ora # Generated by Oracle configuration tools. # This file is actually generated by netca. But if customers choose to # install "Software Only", this file wont exist and without the native # authentication, they will not be able to connect to the database on NT. SQLNET.AUTHENTICATION_SERVICES= (NTS) NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
# listener.ora Network Configuration File: %ORACLE_HOME%/network/admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = RODB)
(ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.11.11)(PORT = 1521))
)
)
Key Parameter File settings
The following table lists the key parameters and their adjusted settings to be used for a database installation for use with Temenos Transact.
|
Parameter |
Settings |
|---|---|
|
db_block_size |
8192 |
|
open_cursors |
5000 |
|
db_file_multiblock_read_count |
16 |
|
query_rewrite_enabled |
TRUE |
|
Query_rewrite_integrity |
TRUSTED |
|
compatible |
10.2.0.1 |
|
star_transformation_enabled |
FALSE |
|
Fast_start_mttr_target |
0 |
|
undo_management |
AUTO |
|
undo_tablespace |
UNDOTBS1 |
|
open_cursors |
5000 |
|
filesystemio_options |
SETALL |
|
cursor_sharing |
EXACT |
|
optimizer_index_cost_adj |
1 |
The optimization of the following key parameter settings is the responsibility of the DBA depending on the size of the OLTP data.
- asjava_pool_size
- db_cache_size
- sort_area_size
- large_pool_size
- shared_pool_size
- log_buffer
- pga_aggregate_target
- sort_area_size
In this topic