Thursday, June 19, 2008

Steps to create a Database Manually

1. Decide a unique SID
2. Set the OS variables (in unix / linux)
3. Create the parameter file
Important Parameters are :
a. DB_NAME

b. DB_DOMAIN

c. CONTROL_FILES

d. DB_BLOCK_SIZE

e. UNDO_MANAGEMENT

f. UNDO_TABLESPACE
4. Create and Set Oracle Service
5. Create password file
6. Start the Instance in NOMOUNT mode.
7. Create the DB : issue the Create Database Command:



CREATE DATABASE [database name]

[CONTROLFILE REUSE]

[LOGFILE [GROUP integer] file specification]

[MAXLOGFILES integer]

[MAXLOGMEMBERS integer]

[MAXLOGHISTORY integer]

[MAXDATAFILES integer]

[MAXINSTANCES integer]

[ARCHIVELOGNOARCHIVELOG]

[CHARACTER SET charset]

[NATIONAL CHARACTER SET charset]

[DATAFILE filespec [autoextend]]

[DEFAULT TEMPORARY TABLESPACE tablespace filespec]

[UNDO TABLESPACE tablespace DATAFILE filespec]
[SET TIME_ZONE [time_zone_region]];

A working example of a CREATE DATABASE script follows:


create database ora10
logfile group 1 ('D:\oracle\databases\ora10\redo1.log') size 10M,
group 2 ('D:\oracle\databases\ora10\redo2.log') size 10M,
group 3 ('D:\oracle\databases\ora10\redo3.log') size 10M
character set WE8ISO8859P1
national character set utf8
datafile 'D:\oracle\databases\ora10\system.dbf'
size 50M
autoextend on
next 10M maxsize unlimited
extent management local
sysaux datafile 'D:\oracle\databases\ora10\sysaux.dbf'
size 10M
autoextend on
next 10M
maxsize unlimited
undo tablespace undo
datafile 'D:\oracle\databases\ora10\undo.dbf'
size 10M
default temporary tablespace temp
tempfile 'D:\oracle\databases\ora10\temp.dbf'
size 10M;

8. Execute the Scripts that generate the Data Dictionary Views.

- CATALOG.sql for data dictionary views
- CATPROC.sql for objects required to use PL/SQL.
- SQL> @?/rdbms/admin/catalog.sql
- SQL> @?/rdbms/admin/catproc.sql

9. Create Server Parameter File from Pfile.
10. Backup the DB (cold backup)
11. Create Additional Tablespaces

Wednesday, June 18, 2008

Guidelines for OFA

1. Create a different directory under the Oracle Home Directory for each Database.
2. Place the Control files, Redo Log files and Datafiles under the database specific
directory.
3. Separate Groups of objects with different fragmentation characteristics.
4. Separate Objects that will contend for disk resources.
5. Separate Groups of objects with different behavioral characteristics.
6. Store at least two copies of Control files on different physical drives.
7. Store the two online Redo Log Members of a Group on different drives.

Tuesday, June 17, 2008

How ADDM Computes Thresholds

Metric baselines are named snapshots of a target's past performance.

When baseline metrics are gathered, the AWR stores the high value and the low value for each metric. The technique that ADDM uses to compute a baseline threshold depends on the comparison operator that is used for spcifying the threshold , and on the associated high and low value.

If the metric comparison operator is a greater than (>), the warning threshold for the metric is computed as

Metric High Value * (1+Warning Percentage/100)

If the metric comparison is a less than (<), the warning threshold for the metric is computed as

Metric Low Value * (1-Warning %/100)

For example, if the high value for the metric Current Open Cursors Count is 500,

* the 85 percent warning threshold is 500*(1+85/100)= 925
* the 95 percent critical threshold is 500*(1+95/100)=975

raising an warning alert whenever the Current Open Cursos Count exceeds 925 or raising a critical alert whenever the Current Open Cursors Count exceeds 975.

if the low value for the metric Large Pool Free % is 300 MB,

* the 85 percent warning threshold is 300*(1-85/100) = 45 MB
* the 95 percent critical threshold is 300*(1-95/100) = 15 MB

raising a warning alert whenever the percentage of free space in the Large Pool fals below 45 MB or raising a critical alert whenever the free space in the Large Pool falls below 15 percent.