Linux RH5平台下使用Oracle ASM创建数据库

简介:

Linux RH5平台下使用Oracle ASM创建数据库

实验环境

操作系统: linux 5.4

实验目标


Linux RH5平台下使用Oracle ASM创建数据库


实验步骤

一、安装配置先决条件

1.安装oracleasm支持包

创建asm数据库,首先需要ASMLib驱动程序包,可以从相关的网站下载到和操作系统对应的rpm文件,分别为oracleasm-support-2.0.3-1、oracleasm-2.6.18-8.el5-2.0.4-1.el5、oracleasmlib-2.0.3-1.el5。

# rpm -Uvh oracleasm*.rpm

# rpm -qa|grep oracleasm
oracleasm-support-2.0.3-1
oracleasm-2.6.18-8.el5-2.0.4-1.el5
oracleasmlib-2.0.3-1.el5

2.添加磁盘

关闭VMware,添加一块磁盘并格式化。

# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[root@server oracleasmlib]# fdisk -l

Disk /dev/sda: 17.1 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2088 16667437+ 8e Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 83 Linux

3.启动rawdevices

# start_udev
Starting udev: [ OK ]

4.配置oracleasm

以root用户登陆,执行
# /etc/init.d/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) [y]:
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks:
[ OK ]

# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
#
[root@server oracleasmlib]# /etc/init.d/oracleasm listdisks
VOL1
[root@server oracleasmlib]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks:
[ OK ]

二、创建ASM实例

1.创建初始化文件

$ su – oracle
$ cd $ORACLE_HOME/dbs
$ vi init+ASM.ora

*.asm_diskstring='ORCL:VOL*'
*.background_dump_dest='/oracle/admin/+ASM/bdump'
*.core_dump_dest='/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/oracle/admin/+ASM/udump'

2.创建密码文件

$ su – oracle
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapw+ASM password=dba

3. 创建目录结构
$ su – oracle
$ cd $ORACLE_HOME/dbs
$ mkdir –p $ORALCE_BASE/admin/+ASM/udump
$ mkdir –p $ORALCE_BASE/admin/+ASM/bdump
$ mkdir –p $ORALCE_BASE/admin/+ASM/cdump

4. 启动实例
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL> startup
ASM instance started

Total System Global Area 100663296 bytes
Fixed Size 777616 bytes
Variable Size 99885680 bytes
Database Buffers 0 bytes
Redo Buffers 0 bytes
ORA-15110: no diskgroups mounted

因为我们是首次启动asm实例,还没有创建diskgroup,所以显示15110错误是正常的。

如果启动实例的时候碰到如下报错:
ORA-29701: unable to connect to Cluster Manager
那么请检查/etc/inittab 文件,看看是否有下面这行
h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
如果没有请添加,如果被注释了请取消注释。


5.用dbca 创建实例数据 选择asm安装

途中需要执行这两个脚本

使用root用户来执行该脚本,分别执行/opt/app/oracle/oraInventory/orainstRoot.sh和/opt/app/oracle/product/10.2.0/db_1/root.sh














本文转自东方之子736651CTO博客,原文链接:http://blog.51cto.com/ecloud/1184003 ,如需转载请自行联系原作者



相关文章
|
2月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】Oracle数据库配置助手:DBCA
Oracle数据库配置助手(DBCA)是用于创建和配置Oracle数据库的工具,支持图形界面和静默执行模式。本文介绍了使用DBCA在Linux环境下创建数据库的完整步骤,包括选择数据库操作类型、配置存储与网络选项、设置管理密码等,并提供了界面截图与视频讲解,帮助用户快速掌握数据库创建流程。
337 93
|
1月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】使用NetManager创建Oracle数据库的监听器
Oracle NetManager是数据库网络配置工具,用于创建监听器、配置服务命名与网络连接,支持多数据库共享监听,确保客户端与服务器通信顺畅。
176 0
|
1月前
|
安全 Linux iOS开发
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
312 53
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
4月前
|
存储 Oracle 关系型数据库
服务器数据恢复—光纤存储上oracle数据库数据恢复案例
一台光纤服务器存储上有16块FC硬盘,上层部署了Oracle数据库。服务器存储前面板2个硬盘指示灯显示异常,存储映射到linux操作系统上的卷挂载不上,业务中断。 通过storage manager查看存储状态,发现逻辑卷状态失败。再查看物理磁盘状态,发现其中一块盘报告“警告”,硬盘指示灯显示异常的2块盘报告“失败”。 将当前存储的完整日志状态备份下来,解析备份出来的存储日志并获得了关于逻辑卷结构的部分信息。
|
1月前
|
Linux API iOS开发
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
178 14
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
2月前
|
SQL Linux 调度
Timeplus Enterprise 3.0 (Linux, macOS) - 流处理平台
Timeplus Enterprise 3.0 (Linux, macOS) - 流处理平台
82 2
Timeplus Enterprise 3.0 (Linux, macOS) - 流处理平台
|
2月前
|
SQL Oracle 关系型数据库
Oracle数据库创建表空间和索引的SQL语法示例
以上SQL语法提供了一种标准方式去组织Oracle数据库内部结构,并且通过合理使用可以显著改善查询速度及整体性能。需要注意,在实际应用过程当中应该根据具体业务需求、系统资源状况以及预期目标去合理规划并调整参数设置以达到最佳效果。
275 8
|
2月前
|
安全 Linux API
JEB Pro v5.31 (macOS, Linux, Windows) - 逆向工程平台
JEB Pro v5.31 (macOS, Linux, Windows) - 逆向工程平台
145 0
|
4月前
|
SQL Oracle 关系型数据库
比较MySQL和Oracle数据库系统,特别是在进行分页查询的方法上的不同
两者的性能差异将取决于数据量大小、索引优化、查询设计以及具体版本的数据库服务器。考虑硬件资源、数据库设计和具体需求对于实现优化的分页查询至关重要。开发者和数据库管理员需要根据自身使用的具体数据库系统版本和环境,选择最合适的分页机制,并进行必要的性能调优来满足应用需求。
238 11
|
5月前
|
Ubuntu Linux Shell
Linux环境下VSCode快速安装终极指南:debian/ubuntu/linux平台通用
以上就是在Linux环境下安装VSCode的终极指南,抛开繁复的专业词汇,以平易近人的文字、形象生动的比喻让你轻松学会这一过程。别忘了,你的小伙伴VSCode已经在应用菜单里等你了!
1457 23