[RAC]ORACLE Database 10g RAC for Administrators學習筆記(二)

chenyan995發表於2009-01-06

4. RAC Database Administration

Use Enterprise Manager cluster database pages

Redo Log Files and RAC

每個例項必須擁有至少兩組redo

使用alter database add logfile thread…命令來指定為哪個例項增加redo file

Automatic Undo Management and RAC

為每個例項指定一個專用的undo tablespace

RAC01.UNDO_TABLESPACE=undotbs3

RAC02.UNDO_TABLESPACE=undotbs2

Starting and Stopping RAC Instances

RAC instances can be started and stopped by using:

Enterprise Manager

Server Control (SRVCTL) utility

SQL*Plus

Starting and Stopping RAC Instances with SRVCTL

srvctl start|stop instance -d -i

[-o open|mount|nomount|normal|transactional|immediate|abort>]

[-c | -q]

srvctl start|stop database -d

[-o open|mount|nomount|normal|transactional|immediate|abort>]

[-c | -q]

Switch Between the Automatic and Manual Policies

srvctl modify database -d RACB -y MANUAL;

RAC Initialization Parameter Files

所有instance使用同一個spfilespfile在共享儲存上。

使用以下命令為設定單個instance或全域性的引數,sid優先於“*

ALTER SYSTEM SET SCOPE=spfile sid='';

使用以下命令刪除spfile中的一行

ALTER SYSTEM RESET SCOPE=SPFILE sid='';

RAC Initialization Parameters

CLUSTER_DATABASE-TRUE

CLUSTER_DATABASE_INSTANCES-instance個數

CLUSTER_INTERCONNECTS-定義額外的interconnect,一般情況下無須修改

DB_NAME

DISPATCHERS

MAX_COMMIT_PROPAGATION_DELAY-已被廢棄

SPFILE-如果使用spfile啟動,則必須使用同一個spfile。每個instance本地有一個pfile檔案指定spfile在共享儲存上的路徑

THREAD-如果定義,則在每個instance上的值必須唯一。指定使用哪一個threadredo

Parameters That Require Identical Settings

ACTIVE_INSTANCE_COUNT

ARCHIVE_LAG_TARGET

CLUSTER_DATABASE

CONTROL_FILES

DB_BLOCK_SIZE

DB_DOMAIN

DB_FILES

DB_NAME

DB_RECOVERY_FILE_DEST

DB_RECOVERY_FILE_DEST_SIZE

DB_UNIQUE_NAME

MAX_COMMIT_PROPAGATION_DELAY

TRACE_ENABLED

UNDO_MANAGEMENT

Parameters That Require Unique Settings

THREAD

ROLLBACK_SEGMENTS

INSTANCE_NAME

INSTANCE_NUMBER

UNDO_TABLESPACE (When using Automatic Undo Management)

Quiescing RAC Databases

SQL> ALTER SYSTEM QUIESCE RESTRICTED; / ALTER SYSTEM UNQUIESCE

在一個單一的instance上執行,命令執行後其他instance無法開啟資料庫。一般用於一些維護操作。在此期間無法進行資料庫冷備,因為後臺程式在此期間仍可能對資料庫進行更新。

How SQL*Plus Commands Affect Instances

The ALTER SYSTEM SET CHECKPOINT LOCAL statement affects only the local instance.

ALTER SYSTEM CHECKPOINT LOCAL affects the current instance.

ALTER SYSTEM CHECKPOINT or ALTER SYSTEM CHECKPOINT GLOBAL affects all instances in the cluster database.

ALTER SYSTEM SWITCH LOGFILE affects only the current instance.

To force a global log switch, use the ALTER SYSTEM ARCHIVE LOG CURRENT statement.

The INSTANCE option of ALTER SYSTEM ARCHIVE LOG enables you to archive each online redo log file for a specific instance.

Transparent Data Encryption and Wallets in RAC

One wallet shared by all instances on shared storage:

No additional administration required

One copy of the wallet on each local storage:

Local copies need to be synchronized each time master key is changeds

RAC and ASM Instances Creation

rac環境下建立ASM例項時,先選擇Oracle Real Application Clusters database選項,再選擇所有節點。Dbca自動建立兩個名為+ASM1+ASM2的例項。

ASM: General Architecture

ASM instances do not mount databases, but instead manage the metadata needed to make ASM files available to ordinary database instances.

Database instances access the contents of ASM files directly, communicating with an ASM instance only to obtain information about the

layout of these files.

ASM側後臺程式

RBAL- responsible for coordinating rebalance activity for disk groups

ARBn- actually performs the data extent movements

GMON- responsible for certain disk group-monitoring operations that maintain ASM metadata inside disk groups

DB側後臺程式

ASMB- connects to foreground processes in ASM instances. Over those connections, periodic messages are exchanged to update statistics and to verify that both instances are healthy.

RBAL- performs global opens of the disks in the disk groups

當執行一些需要ASM干預的操作,如建立資料檔案時,DB的前臺程式直接連線ASM例項進行操作。

一個db instance只能同時連線到一個asm instance

Group Services: is used to register the connection information needed by the database instances to find ASM instances. When an ASM instance mounts a disk group, it registers the disk group and connect string with Group Services. Group Services is a functionality provided by Oracle Clusterware, which is automatically installed on every node that runs Oracle Database 10g.

ASM Instance and Crash Recovery in RAC

如一個ASM例項crash,則所有的相關的db instance也失敗。單例項情況下,該例項重啟時讀取disk group’ log進行恢復。多例項下其他例項進行恢復。Db instance crash並不影響ASM例項。

ASM Instance Initialization Parameters and RAC

CLUSTER_DATABASE: This parameter must be set to TRUE.

ASM_DISKGROUP:

Multiple instances can have different values.

Shared disk groups must be mounted by each ASM instance.

ASM_DISKSTRING:

Multiple instances can have different values.

With shared disk groups, every instance should be able to see the common pool of physical disks.

ASM_POWER_LIMIT: Multiple instances can have different values.

ASM and SRVCTL with RAC

You can use SRVCTL to perform the following ASM administration tasks:

ADD

ENABLE

DISABLE

START

STOP

CONFIG-displays configuration information stored in the OCR for a particular ASM instance.

STATUS

REMOVE

MODIFY INSTANCE-establishes a dependency between an ASM instance and a db instance.

5. Managing Backup and Recovery in RAC

Archived Log File Configurations Cluster file

Cluster file system scheme: Archive logs from each instance are written to the same file location.

Local archive with NFS scheme: Each instance can read mounted archive destinations of all instances.

RAC and the Flash Recovery Area

Cluster file system

ASM

Certified NFS directory

Archived Redo File Conventions in RAC

%r : Resetlogs identifier

%s: Log sequence number

%t : Thread number

Configure RMAN Snapshot Control File Location

在每個實施備份的節點上必須存在有效路徑

When RMAN needs to resynchronize from a read-consistent version of the control file, it creates a temporary snapshot control file. RMAN needs a snapshot control file only when resynchronizing with the recovery catalog or when making a backup of the current control file.

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘’;

Configure Control File and SPFILE Autobackup

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+FRA';

Channel Connections to Cluster Instances

多個channel可以連線到多個instance。如同時連線到多個instance,則這些instance必須全部mount或全部open

RMAN Channel Support for the Grid

使用未確定的連線字串並定義並行度,則備份作業可以自動選擇負載較輕的節點進行備份。

RMAN Default Autolocation

Rman可在備份或恢復中自動定位以下檔案:

Backup pieces

Archived redo logs during backup

Data file or control file copies

archive檔案在本地時,一個節點只能備份本地的歸檔檔案。當restore時,一個節點只能restore從該節點備份的歸檔檔案。

Distribution of Backups

Three possible backup configurations for RAC:

A dedicated backup server performs and manages backups for the cluster and the cluster database.

One node has access to a local backup appliance and performs and manages backups for the cluster database.

Each node has access to a local backup appliance and can write to its own local backup media.

Restoring and Recovering

Media recovery may require one or more archived log files from each thread.

The RMAN RECOVER command automatically restores and applies the required archived logs.

Archive logs may be restored to any node performing the restore and recover operation.

Logs must be readable from the node performing the restore and recovery activity.

Recovery processes request additional threads enabled during the recovery period.

Recovery processes notify you of threads no longer needed because they were disabled.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8558093/viewspace-1015730/,如需轉載,請註明出處,否則將追究法律責任。

相關文章