文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Oracle DataBase单实例使用ASM案例(3)--Oracle 10g应用

2024-04-02 19:55

关注

Oracle DataBase单实例使用ASM案例(3)--Oracle 10g应用

系统环境:

操作系统:RedHat EL5(64)

Oracle 软件:Oracle 10gR2


   在Oracle 10g单实例环境下使用ASM比较容易实现:

1、建立磁盘分区

[root@rh65 ~]# fdisk -l

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1         487     3911796   83  Linux

/dev/sdb2             488         974     3911827+  83  Linux

/dev/sdb3             975        2610    13141170    5  Extended

/dev/sdb5             975        1461     3911796   83  Linux

/dev/sdb6            1462        1948     3911796   83  Linux

/dev/sdb7            1949        2192     1959898+  83  Linux

/dev/sdb8            2193        2436     1959898+  83  Linux

/dev/sdb9            2437        2610     1397623+  83  Linux

2、安装ASM LIB软件

系统内核版本:

[root@rh65 rh6_xen_asm]# uname -a

Linux rh65 2.6.18-194.el5xen #1 SMP Tue Mar 16 22:08:06 EDT 2010 i686 i686 i386 GNU/Linux

安装ASM软件包:

[root@rh65 rh6_xen_asm]# ls -l

total 236

-rwxr--r-- 1 oracle oinstall 128392 May 27 12:15 oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.i686.rpm

-rwxr--r-- 1 oracle oinstall  13929 May 27 12:14 oracleasmlib-2.0.4-1.el5.i386.rpm

-rwxr--r-- 1 oracle oinstall  85303 May 27 12:14 oracleasm-support-2.1.8-1.el5.i386.rpm

[root@rh65 rh6_xen_asm]# rpm -ivh *

warning: oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

error: failed to stat /media/RHEL_5.5 i386 DVD: No such file or directory

Preparing...                ########################################### [100%]

   1:oracleasm-support      ########################################### [ 33%]

   2:oracleasm-2.6.18-194.el########################################### [ 67%]

   3:oracleasmlib           ########################################### [100%]

3、配置ASM并建立ASM磁盘

[root@rh65 rh6_xen_asm]# service oracleasm configure

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle

Default group to own the driver interface []: dba

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: 

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rh65 rh6_xen_asm]# 

建立ASM磁盘:

[root@rh65 rh6_xen_asm]# service oracleasm createdisk ASM_DSK1 /dev/sdb1

Marking disk "ASM_DSK1" as an ASM disk: [  OK  ]

[root@rh65 rh6_xen_asm]# service oracleasm createdisk ASM_DSK2 /dev/sdb2

Marking disk "ASM_DSK2" as an ASM disk: [  OK  ]

[root@rh65 rh6_xen_asm]# service oracleasm createdisk ASM_DSK3 /dev/sdb5

Marking disk "ASM_DSK3" as an ASM disk: [  OK  ]

[root@rh65 rh6_xen_asm]# service oracleasm createdisk ASM_DSK4 /dev/sdb6

Marking disk "ASM_DSK4" as an ASM disk: [  OK  ]

查看ASM磁盘信息:

[root@rh65 ~]# service oracleasm listdisks;

ASM_DSK1

ASM_DSK2

ASM_DSK3

ASM_DSK4

4、配置ASM实例

[oracle@rh65 dbs]$ cat init+ASM.ora 

instance_type='asm'

asm_diskstring='ORCL:ASM_*'

large_pool_size=12m

asm_diskgroups='DG1','RCY1'

background_dump_dest=/u01/app/oracle/admin/+ASM/bdump

core_dump_dest=/u01/app/oracle/admin/+ASM/cdump

user_dump_dest=/u01/app/oracle/admin/+ASM/udump

建立相应目录:

[oracle@rh65 dbs]$ mkdir -p /u01/app/oracle/admin/+ASM/bdump

[oracle@rh65 dbs]$ mkdir -p /u01/app/oracle/admin/+ASM/cdump

[oracle@rh65 dbs]$ mkdir -p /u01/app/oracle/admin/+ASM/udump

建立口令文件:

[oracle@rh65 dbs]$ orapwd file='orapw+ASM' password=oracle entries=3

启动CSS服务:

[root@rh65 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin

[root@rh65 bin]# ./localconfig add

/etc/oracle does not exist. Creating it now.

Successfully accumulated necessary OCR keys.

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

Operation successful.

Configuration for local CSS has been initialized

Adding to inittab 

Startup will be queued to init within 90 seconds.

Checking the status of new Oracle init process...

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        rh65

CSS is active on all nodes.

Oracle CSS service is installed and running under init(1M)

5、启动ASM Instance

[oracle@rh65 ~]$ export ORACLE_SID=+ASM

[oracle@rh65 ~]$ sqlplus '/as sysdba'

12:44:31 SYS@ +ASM>startup force nomount;

ASM instance started

Total System Global Area   83886080 bytes

Fixed Size                  1217836 bytes

Variable Size              57502420 bytes

ASM Cache                  25165824 bytes

12:44:46 SYS@ +ASM>show parameter name

NAME                                 TYPE        VALUE

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

db_file_name_convert                 string

db_name                              string

db_unique_name                       string      +ASM

global_names                         boolean     FALSE

instance_name                        string      +ASM

lock_name_space                      string

log_file_name_convert                string

service_names                        string      +ASM

12:45:10 SYS@ +ASM>

6、手工建立ASM diskgroup

12:50:33 SYS@ +ASM>create diskgroup dg1 

12:53:57   2  normal redundancy

12:54:01   3  failgroup fg1 disk 'ORCL:ASM_DSK1'

12:54:06   4  failgroup fg2 disk 'ORCL:ASM_DSK2';

Diskgroup created.

Elapsed: 00:00:12.22

12:54:23 SYS@ +ASM>create diskgroup rcy1

12:54:37   2  normal redundancy

12:54:40   3  failgroup fg1 disk 'ORCL:ASM_DSK3'

12:54:50   4  failgroup fg2 disk 'ORCL:ASM_DSK4';

Diskgroup created.

7、查看ASM磁盘组和磁盘信息

12:55:09 SYS@ +ASM>select name ,state from v$asm_diskgroup;

NAME                           STATE

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

DG1                            MOUNTED

RCY1                           MOUNTED

Elapsed: 00:00:00.18

12:56:02 SYS@ +ASM>

12:57:09 SYS@ +ASM>select GROUP_NUMBER ,DISK_NUMBER,STATE,NAME,PATH from v$asm_disk;

GROUP_NUMBER DISK_NUMBER STATE    NAME                           PATH

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

           1           0 NORMAL   ASM_DSK1                       ORCL:ASM_DSK1

           1           1 NORMAL   ASM_DSK2                       ORCL:ASM_DSK2

           2           0 NORMAL   ASM_DSK3                       ORCL:ASM_DSK3

           2           1 NORMAL   ASM_DSK4                       ORCL:ASM_DSK4

Elapsed: 00:00:00.03

8、通过DBCA管理ASM

Oracle DataBase单实例使用ASM案例(3)--Oracle 10g应用


  @至此,Oracle 10g在单实例下ASM磁盘亦可以使用了








阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     807人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     351人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     314人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     433人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     221人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯