建立ASM資料庫

keeptrying發表於2012-04-24

一、配置ASM

1、使用ASMTOOL建立磁碟

C:\Users\Administrator>asmtool 

ASM-00200: Invalid command option

ASM-00208: asmtool -add [-force] \Device\Harddisk1\Partition1 ORCLDISKasm0 ...

ASM-00209: asmtool -addprefix asm [-force] \Device\Harddisk1\Partition1 ...

ASM-00210: asmtool -create \\server\share\file

ASM-00211: asmtool -delete ORCLDISKasm0 [ORCLDISKasm1 ...]

ASM-00212: asmtool -list [ORCLDISKasm0 ORCLDISKasm1 ...]

=======================================================================

 

C:\Users\Administrator>asmtool -create E:\asmdisk\DISK1 1024   --使用asmtool建立disk1

 

使用作業系統複製disk1,重新命名為disk2disk3(使用作業系統複製比使用asmtool直接建立要快),這樣現在有三塊磁碟disk1disk2disk3

 

2、配置oracle叢集同步服務(CSS

C:\Users\Administrator>localconfig

usage:  crssetup

                         | ladd | shutdown | upgrade | help>

                  config   - configure and startup the cluster on nodes

                  add      - add specified nodes to the cluster

                  del      - delete the specified nodes from the cluster

                  deconfig - wipe out all cluster configuration information

                  ldel     - local css delete from oracle home

                  lres     - local css home reset to new oracle home

                  ladd     - local css add to oracle home

                  shutdown - shutdown the selected nodes

                  upgrade  - upgrade the specified nodes

                  help     - print out this information

=================================================================

 

C:\Users\Administrator>localconfig add

Step 1:  creating new OCR repository

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'administrator', privgrp ''..

Operation successful.

Step 2:  creating new CSS service

successfully created local CSS service

successfully added CSS to home

 

3、  使用DBCA配置自動儲存管理(ASM

1)、DBCA步驟1

asm引數:asm_diskstringE:\asmdisk\*

完成步驟一,+ASM例項已經建立完成。此時使用sqlplus連線例項。

C:\Users\Administrator>set oracle_sid=+asm

 

C:\Users\Administrator>sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Apr 24 11:59:52 2012

 

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

 

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production

With the Partitioning, OLAP and Data Mining options

 

SYS@ +asm > select path from v$asm_disk;          --查詢結果為空。必須完成下面的步驟

 

no rows selected

2)、要使用檔案代替磁碟,此處必須修改一個引數_asm_allow_only_raw_disks

SYS@ +asm > alter system set "_asm_allow_only_raw_disks"=false scope=spfile;

 

System altered.

SYS@ +asm > shutdown immediate

ORA-15100: invalid or missing diskgroup name

 

 

ASM instance shutdown

SYS@ +asm > startup

ASM instance started

 

Total System Global Area   83886080 bytes

Fixed Size                  1289028 bytes

Variable Size              57431228 bytes

ASM Cache                  25165824 bytes

ORA-15110: no diskgroups mounted

 

SYS@ +asm > select path from v$asm_disk;     --現在可以檢視到建立的三塊磁碟!

 

PATH

----------------------------------------

E:\ASMDISK\DISK1

E:\ASMDISK\DISK3

E:\ASMDISK\DISK2

3)、DBCA步驟2,建立磁碟組

dg1:常規(normal)冗餘,disk1disk2,存放資料庫

dg2:外部(external)冗餘,disk3,存放閃回恢復區

 

二、建立資料庫

使用DBCA建立資料庫,資料庫使用dg1,閃回恢復區使用dg2

 

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

相關文章