oracle单机使用asm磁盘

举报
snowofsummer 发表于 2021/11/16 10:58:07 2021/11/16
【摘要】 数据库版本:11.2.0.41,grid软件安装选择install Oracle Grid Infrastructure Software Only提示运行脚本:[root@db01 ~]# /u01/app/oraInventory/orainstRoot.shChanging permissions of /u01/app/oraInventory.Adding read,write p...

数据库版本:

11.2.0.4

1,grid软件安装

选择install Oracle Grid Infrastructure Software Only

提示运行脚本:

[root@db01 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@db01 ~]# /u01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install 

/u01/app/11.2.0/grid/crs/install/roothas.pl


To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/11.2.0/grid/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can 

be passed through the response file that is available in the installation media.


#执行完成root.sh ,注意输出,执行提示脚本,配置单节点grid

参考手册:
Configuring Software Binaries for Oracle Grid Infrastructure for a Standalone Server
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ladbi/configuring-software-binaries-for-oracle-grid-infrastructure-for-a-standalone-server.html#GUID-D85BEC0B-D206-492B-8665-6906E2DF34E7

Log in as the root user and run the roothas.pl script located in the Grid_home path, using the following syntax:

Grid_home/perl/bin/perl -I Grid_home/perl/lib -I
Grid_home/crs/install Grid_home/crs/install/roothas.pl 


执行配置命令:

[root@db01 ~]# /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install 

/u01/app/11.2.0/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node db01 successfully pinned.
Adding Clusterware entries to oracle-ohasd.service

db01     2021/11/15 20:55:59     /u01/app/11.2.0/grid/cdata/db01/backup_20211115_205559.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server


查看集群状态:

[grid@db01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
               OFFLINE OFFLINE      db01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        OFFLINE OFFLINE
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       db01

添加asm,并启动:

[grid@db01 ~]$ crsctl start resource ora.cssd
CRS-2672: Attempting to start 'ora.cssd' on 'db01'
CRS-2672: Attempting to start 'ora.diskmon' on 'db01'
CRS-2676: Start of 'ora.diskmon' on 'db01' succeeded
CRS-2676: Start of 'ora.cssd' on 'db01' succeeded


[grid@db01 ~]$ export ORACLE_SID=+ASM


#添加asm
[grid@db01 ~]$ srvctl add asm
[grid@db01 grid]$ srvctl start asm
#默认SID为+ASM
[grid@db01 ~]$ export ORACLE_SID=+ASM
#状态检查
[grid@db01 grid]$ ps -ef|grep ASM
grid      6941     1  0 21:02 ?        00:00:00 asm_pmon_+ASM
grid      6943     1  0 21:02 ?        00:00:00 asm_psp0_+ASM
grid      6945     1  1 21:02 ?        00:00:01 asm_vktm_+ASM
grid      6949     1  0 21:02 ?        00:00:00 asm_gen0_+ASM
grid      6951     1  0 21:02 ?        00:00:00 asm_diag_+ASM
grid      6953     1  0 21:02 ?        00:00:00 asm_dia0_+ASM
grid      6955     1  0 21:02 ?        00:00:00 asm_mman_+ASM
grid      6957     1  0 21:02 ?        00:00:00 asm_dbw0_+ASM
grid      6959     1  0 21:02 ?        00:00:00 asm_lgwr_+ASM
grid      6961     1  0 21:02 ?        00:00:00 asm_ckpt_+ASM
grid      6963     1  0 21:02 ?        00:00:00 asm_smon_+ASM
grid      6965     1  0 21:02 ?        00:00:00 asm_rbal_+ASM
grid      6967     1  0 21:02 ?        00:00:00 asm_gmon_+ASM
grid      6969     1  0 21:02 ?        00:00:00 asm_mmon_+ASM
grid      6971     1  0 21:02 ?        00:00:00 asm_mmnl_+ASM



[grid@db01 grid]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       db01
ora.asm
               ONLINE  ONLINE       db01                     Started
ora.ons
               OFFLINE OFFLINE      db01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       db01
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       db01

添加监听:

/u01/app/11.2.0/grid/bin/srvctl add LISTENER
********必须添加LISTENER否则asm开启启动报错:

2021-11-15 23:30:12.969: [ USRTHRD][3561772800]{0:0:2} ASM Dedicated Thread {
2021-11-15 23:30:12.969: [ USRTHRD][3561772800]{0:0:2} CrsCmd::ClscrsCmdData::stat entity 1 statflag 32 useFilter 0
2021-11-15 23:30:12.985: [ USRTHRD][3561772800]{0:0:2} checkCrsStat 2 CLSCRS_STAT ret: 200
2021-11-15 23:30:12.985: [ USRTHRD][3561772800]{0:0:2} checkCrsStat 2 clscrs_res_get_op_status CLSCRS_STAT status 210 err_msg CRS-0210: Could not find resource 

'ora.LISTENER.lsnr'.
2021-11-15 23:30:12.985: [ USRTHRD][3561772800]{0:0:2} CrsCmd::ClscrsCmdData::stat entity 1 statflag 33 useFilter 0
2021-11-15 23:30:13.005: [ USRTHRD][3561772800]{0:0:2} checkCrsStat 2 CLSCRS_STAT ret: 200
2021-11-15 23:30:13.005: [ USRTHRD][3561772800]{0:0:2} checkCrsStat 2 clscrs_res_get_op_status CLSCRS_STAT status 210 err_msg CRS-0210: Could not find resource 

'ora.LISTENER.lsnr'.
2021-11-15 23:30:13.006: [ USRTHRD][3561772800]{0:0:2} AsmCommonAgent::setLocalListener cls::Exception CRS-0210: Could not find resource 'ora.LISTENER.lsnr'.
2021-11-15 23:30:13.006: [ USRTHRD][3561772800]{0:0:2} ASM Dedicated Thread }
2021-11-15 23:30:13.006: [ USRTHRD][3561772800]{0:0:2} Thread:ASM DedicatedThreadisRunning is reset to false here

+ASM 配置pfile文件: 否则asm磁盘组挂载失败!

***指定磁盘位置::alter system set asm_diskstring='/dev/*';

***创建pfile文件:create pfile from memory; (位置$ORACLE_HOME/dbs)

[grid@db01 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 15 23:43:13 2021
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
SQL> alter system set asm_diskstring='/dev/*';
System altered.
SQL>  create pfile from memory;
File created.



2,数据库软件安装

选择Single instance database installaiton


3,建立数据库,即可选择asm磁盘组

4,oracle软件权限,才能访问asm  /6751/

[root@db01 bin]# pwd
/u01/app/oracle/product/11.2.0/dbhome_1/bin
[root@db01 bin]# ll orac*
-rwxr-xr-x 1 oracle oinstall        46 Nov  7  2000 oracg
-rwsr-s--x 1 oracle asmadmin 239501528 Nov 15 21:28 oracle
-rwxr-x--- 1 oracle oinstall         0 Aug 24  2013 oracleO



5,检查集群状态:

[grid@db01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       db01
ora.LISTENER.lsnr
               ONLINE  ONLINE       db01
ora.asm
               ONLINE  ONLINE       db01                     Started
ora.ons
               OFFLINE OFFLINE      db01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       db01
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       db01
ora.orcl.db
      1        ONLINE  ONLINE       db01                     Open



6,asm添加默认配置参数

#查看asm默认启动参数文件?
[grid@db01 ~]$ asmcmd
ASMCMD> spget
?/dbs/spfile@.ora
ASMCMD> exit

#显示asm配置,默认绑定监听名称和参数文件位置,磁盘路径?
[grid@db01 ~]$ srvctl config  asm
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
Spfile: ?/dbs/spfile@.ora
ASM diskgroup discovery string: ++no-value-at-resource-creation--never-updated-through-ASM++


#添加asm命令帮助?
[grid@db01 ~]$ srvctl add asm -h

Adds an ASM configuration to be managed by Oracle Restart.

Usage: srvctl add asm [-l <lsnr_name>] [-p <spfile>] [-d <asm_diskstring>]
    -l <lsnr_name>           Listener name
    -p <spfile>              Server parameter file path
    -d <asm_diskstring>      ASM diskgroup discovery string
    -h                       Print usage














【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。