voyager oracle concepts - anzreg 2014... · voyager oracle concepts ... 22 oracle disk requirements...

50
1 Voyager Oracle Concepts Jesse Jensen Voyager Technical Team Lead [email protected]

Upload: vukien

Post on 20-Jul-2018

243 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

1

Voyager Oracle Concepts

Jesse Jensen

Voyager Technical Team Lead

[email protected]

Page 2: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

2

Copyright Statement

All of the information and material inclusive of text, images, logos, product names is either the

property of, or used with permission by Ex Libris Ltd. The information may not be distributed,

modified, displayed, reproduced – in whole or in part – without the prior written permission of

Ex Libris Ltd.

TRADEMARKS

Ex Libris, the Ex Libris logo, Aleph, Alma, SFX, SFXIT, MetaLib, DigiTool, Verde, Primo, Voyager,

MetaSearch, MetaIndex and other Ex Libris products and services referenced herein are

trademarks of Ex Libris, and may be registered in certain jurisdictions. All other product names,

company names, marks and logos referenced may be trademarks of their respective owners.

DISCLAIMER

The information contained in this document is compiled from various sources and provided on an

"AS IS" basis for general information purposes only without any representations, conditions or

warranties whether express or implied, including any implied warranties of satisfactory quality,

completeness, accuracy or fitness for a particular purpose.

Ex Libris, its subsidiaries and related corporations ("Ex Libris Group") disclaim any and all liability

for all use of this information, including losses, damages, claims or expenses any person may

incur as a result of the use of this information, even if advised of the possibility of such loss or

damage.

© Ex Libris Ltd., 2014

Page 3: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

3

Agenda

Page 4: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

4

Oracle Database

• An Oracle Database is the “physical” store of data residing on disk, consisting of:

• Data files

• Configuration files

• Control files

• Log files

Page 5: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

5

Oracle Instance

• An Oracle Instance is a running Oracle Database consisting of:

• Memory structures (SGA)

• Buffers

• Background processes

• Users & permissions

• Connection processes

• Service Identifier (SID) = VGER

Page 6: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

6

Database and Instance

Page 7: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

7

Agenda

Page 8: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

8

Oracle Files & Directories

Page 9: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

9

Aliases to Directories

• $ORACLE_HOME

• /oracle/app/oracle/product/11.2.0.3/db_1

• $ORA_NET

• /oracle/app/oracle/product/11.2.0.3/db_1/network/admin

• $ORA_LOG

• /oracle/app/oracle/diag/rdbms/vger/VGER/trace

• $ORA_CONFIG

• /oracle/app/oracle/product/11.2.0.3/db_1/dbs

Page 10: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

10

Oracle Files & Directories

Page 11: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

11

/oracle/oradata/

• The physical data inside each Oracle database (SID) is in this directory

• Even if there are multiple releases of Oracle (10g, 11g) on a server, the data is stored here

• The subdirectories for each SID:

• data/

• system/

• cntl/

• redo/

• arch/

Page 12: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

12

Tablespace and Data Files

Page 13: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

13

Redo Logs

Page 14: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

14

Undo Tablespace

• Holds undo data

• Allows Oracle to:

• Roll back an active transaction

• Recover a terminated transaction

• Provide read consistency

• Perform some logical flashback operations

Page 15: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

15

Oracle Files & Directories

Page 16: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

16

/oracle/app/oracle/product/[version]/db_1/

• Binaries, scripts, and configuration files that operate and control the Oracle Instance

• Examples:

• bin/ dbshut, dbshuti, oracle

• dbs/ spfile

• network/admin/ Listener configuration files

• OPatch/ Oracle patch utility

• Note: A different structure for each release! (10g, 11g)

Page 17: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

17

Initialization Files

• spfile

• $ORA_CONFIG/spfileVGER.ora

• Binary file

• Configurable performance parameters used by the Oracle Instance

• Read at startup

• pfile

• $ORA_CONFIG/initVGER.ora

• ASCII text file

• Configurable performance parameters used by the Oracle Instance

• Read at database creation

• Read at startup if the SPFILE cannot be found

Page 18: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

18

Oracle Files & Directories

Page 19: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

19

/oracle/app/oracle/diag/

• Automatic Diagnostic Repository (ADR)

• Instance-level logging

• $ORA_LOG/alert_VGER.logalert_VGER.logalert_VGER.logalert_VGER.log

• Listener log

• $ORACLE_BASE/diag/tnslsnr/`hostname`/listener/alert/log.xml

• Core dumps

• $ORA_LOG/../cdump

• The bdump and udump directories are gone in 11g

Page 20: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

20

User Profile

• ~/.profile

• Defines the default SID at logon

• ORACLE_SID=${1:-VGER}

• Sets up local environment to run Oracle scripts, pointing to the default SID

• ORAENV_ASK=NO

• . /usr/local/bin/oraenv

• Defines $ORA_NET, $ORA_CONFIG, and $ORA_LOG

Page 21: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

21

Other Configuration Files

• /etc/oratab

• Tells server which instances to startup and shutdown automatically when server is rebooted

• Ignored in Solaris 10

• Allows the .profile to successfully configure OS user to point to default SID at login

• VGER:/oracle/app/oracle/product/11.2.0.3/db_1:Y

• $VOYAGER/$DATABASE/ini/voyager.env

• In split server environment, login/password ($USERPASS) must be appended with “@SID”

Page 22: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

22

Oracle Disk Requirements

• Recommend using local physical disks

• NFS requirements:

• rw,bg,hard,nointr,rsize=65536,wsize=65536, tcp,actimeo=0,vers=3,timeo=600

• rw: read/write

• bg: retry mount in the background

• hard: requests are retried indefinitely after timout

• nointr: signals do not interrupt file operations

• rsize: maximum bytes per READ request (64 KB)

• wsize: maximum bytes per WRITE request (64 KB)

• tcp: network protocol

• actimeo: how long to cache file attributes (do not cache)

• vers: NFS protcol version (3)

• timeo: time to wait for response, in deciseconds (1 minute)

Page 23: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

23

Agenda

Page 24: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

24

Oracle Instance Memory Management

• Automatic Shared Memory Management (ASMM) introduced in 10g and Automatic Memory Management (AMM) introduced in 11g

• ASMM – manages SGA (system global area) which includes shared pool, DB buffer cache, large pool, java pool and streams pool, and does not manage PGA (program global area)

• AMM – manages the whole memory area including SGA and PGA

• To enable ASMM, specify sga_target > 0 and memory_target = 0

• To enable AMM, specify memory_target > 0

Page 25: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

25

VGER Instance Memory Management

• VGER instance uses ASMM

• Ensure sga_target>=800M for VGER to run

• Configure sga_target value

• Optionally set sga_max_target >= sga_target, or leave it out (oracle will internally set it equal to sga_target)

• Formula to calculate sga_target is based on:

• base memory value for instance processes

• size of disk space used

• # of processes

• # of voyager instances

• # of CPU threads

Page 26: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

26

VGER Instance Memory Management

• Configure SGA Major Components

• db_cache_size – set a min value of 1%*used_disk_space and round up to 8M to ensure allocation in granule. Oracle will dynamically allocate over run-time

• shared_pool_size – set a min value of 160M for sga_target <= 2G or 320M if sga_target > 2G. Oracle will dynamically allocate over run-time

• java_pool = 0 for auto mgmt (set to 100M during the DB upgrade)

• large_pool=0 for auto mgmt

• stream_pool=0 for auto mgmt (not used at all as no parallel server or oracle stream installed)

Page 27: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

27

VGER Instance Memory Management

• PGA (program global area) is a private memory region that contains data & control info for a server process. It is dedicated to memory intensive operations like sort (order/group by), hash-join, bitmap merge/creation, bulk load, etc.

• Sufficient PGA size allows in-memory operations and yields optimal performance

• ASMM doesn’t manage PGA

Page 28: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

28

VGER Instance Memory Management

• PGA needs to be managed separately

• To enable PGA, set workarea_size_policy=AUTO

• Set pga_aggregate_target based on sga_targetsize instead of system RAM (more in line with Oracle practice)

Page 29: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

29

Oracle Processes Management

• Oracle database instance contains or interacts with 2 main types of processes:

• Client processes – application or oracle tool code (such as sqlplus)

• Oracle processes

• Background processes – start with instance and maintenance

• ora_????_SID

• Server processes – perform work based on a client request

• oracleVGER (LOCAL=[YES|NO])

• Slave processes – perform additional work for background/server processes (I/O slaves for RMAM)

Page 30: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

30

Background Processes

• ora_cjq0_VGER

• ora_ckpt_VGER

• ora_d000_VGER

• ora_dbrm_VGER

• ora_dbw0_VGER

• ora_dia0_VGER

• ora_diag_VGER

• ora_gen0_VGER

• ora_lgwr_VGER

• ora_mman_VGER

• ora_mmnl_VGER

• ora_mmon_VGER

• ora_pmon_VGER

• ora_psp0_VGER

• ora_q000_VGER

• ora_q001_VGER

• ora_qmnc_VGER

• ora_reco_VGER

• ora_s000_VGER

• ora_smco_VGER

• ora_smon_VGER

• ora_vktm_VGER

• ora_w000_VGER

Page 31: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

31

Notable Background Processes

• CKPT - When a checkpoint occurs, Oracle Database must update the headers of all datafiles to record the details of the checkpoint. This is done by the CKPT process. The CKPT process does not write blocks to disk; DBWn always performs that work.

• DBWn - The database writer process writes the contents of buffers to datafiles. The DBWnprocessesare responsible for writing modified (dirty) buffers in the database buffer cache to disk.

• LGWR - The log writer process is responsible for redo log buffer management—writing the redo log buffer to a redo log file on disk. LGWR writes all redo entries that have been copied into the buffer since the last time it wrote.

Page 32: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

32

Notable Background Processes

• PMON - The process monitor performs process recovery when a user process fails. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using.

• SMON - The system monitor process performs recovery, if necessary, at instance startup. SMON is also responsible for cleaning up temporary segments that are no longer in use and for coalescing contiguous free extents within dictionary managed tablespaces.

• VKTM – The virtual keeper of time is responsible for providing a wall-clock time (updated every second) and reference-time counter (updated every 20 ms and available only when running at elevated priority).

Page 33: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

33

Background Processes

Page 34: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

34

Checkpoint Process (CKPT)

Page 35: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

35

Oracle Memory and Processes

http://docs.oracle.com/cd/E29505_01/server.1111/e25789/process.htm

Page 36: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

36

Tech Flow – Single Server

Single-Server Configuration

Oracle Database

Oracle Instance

oracleVGER

LOCAL=N

Oracle listener

tcp/ip

PMON SMON DBWn

LGWR

CKPT

SnnDnnn

oracleVGER

LOCAL=Y

oracleVGER

LOCAL=Y

oracleVGER

LOCAL=N

PC ODBC session

SSH/telnet session

Voyager client

PC SQL session

sbin/bin

processes

ksh /

sqlplus

2a1a

1b

5

3a

3b

2b

4

Page 37: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

37

Tech Flow Outline – Client Sessions

• Run the local application on the PC

• Application’s server process is started

• Application’s server process spawns an Oracle user process

ps -ef |grep oracle |grep LOCAL=Y

• The Oracle user process connects to the Oracle Instance

• The user’s login and password are verified against the Oracle Database

Page 38: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

38

Tech Flow – Split Server

Separate Application Server

Oracle Database

Oracle Instance

Oracle listener

tcp/ip

PMON SMON DBWn

LGWR

CKPT

SnnDnnn

oracleVGER

LOCAL=N

Voyager client

5

32

4

client processes

on App server

1

Page 39: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

39

Difference in Split-Server Config

• The PC’s Voyager application points to an application server, separate from the database server

• The app server is configured with the Oracle SQL*NET client; the tnsnames.ora pointing to the database server.

• In the app server’s voyager.env file, the Oracle SID is appended to the login parameter:

• export USERPASS=xxxdb/pxxxdb@VGER

Page 40: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

40

Order of Verification/Validation

• SQL Connection Request

• Instance up and running for incoming connections

• Login/password valid

• SQL syntax is valid

• Tables and columns are valid

• Locks against tables/rows acquired

• User has privileges to run SQL

Page 41: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

41

Agenda

Page 42: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

42

Voyager Table of Contents Within Oracle

• Oracle Objects

• Tables

• Indexes

• Sequences

• Views

• Procedures

• External Libraries

• Users

Page 43: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

43

A Word About Indexes

• Types of Indexes:

• Voyager indexes = Primary indexes

• Actually an Oracle table (bib_index)

• Oracle indexes = Secondary indexes

• Actually an Oracle index (bib_index_code_norm_disp_idx)

• Keyword indexes = Keyword indexes

• External to Oracle

• Headings keyword indexes

• Utilize Oracle Context feature

Page 44: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

44

Read-Only User Script

• Script: readonly.ksh

• Location: /m1/utility/

• Contact Support if it is not there

• Run by: usually, the “oracle” user

• Syntax: ./readonly.ksh

Page 45: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

45

Agenda

Page 46: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

46

Troubleshooting

• $ORA_LOG/alert_VGER.log

• Look at sequence of events

• Watch for ORA-???? errors!

• lsnrctl status

• ODBC

• Oracle 10g ODBC Installation Guide

• Windows 7 - User Access Control (page 21)

• KCS Articles

Page 47: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

47

Agenda

Page 48: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

48

Recap

• Know your environment

• Check your logs

Page 49: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

49

Agenda

Page 50: Voyager Oracle Concepts - ANZREG 2014... · Voyager Oracle Concepts ... 22 Oracle Disk Requirements • Recommend using local physical disks ... • Oracle 10g ODBC Installation Guide

50

Resources

• Diagrams

• Oracle 10g ODBC Installation Guide

• Oracle Documentation

• Process Architecture: http://docs.oracle.com/cd/E29505_01/server.1111/e25789/process.htm

• Background Processes: http://docs.oracle.com/cd/E11882_01/server.112/e40402/bgprocesses.htm#REFRN104

• Memory Architecture: http://docs.oracle.com/cd/E29505_01/server.1111/e25789/memory.htm