Oracle 10g 手工创建ASM数据库


Oracle10g 手工创建以ASM存储的数据库
项目流程:
0,给电脑增加2块SCSI硬盘
1,安装ASM
2,创建两个ASM磁盘组,分别为:GROUP1、GROUP2
3,  开始创建数据库,首先建立参数文件,保存为 $ORACLE_HOME/dbs/initnestling.ora
4,建立密码文件$ORACLE_HOME/dbs/orapwdnestling
5,建立跟踪、日志文件的路径
6,启动数据库到nomount状态
7,创建并运行建库的脚本
8,创建erp表空间
9,创建数据字典视图
10,建立spfile
11,创建数据库用户
12,配置网络服务
13,扩展应用
a, 查看ASM groups 组号、组名、总大小、空闲空间
b, 删除group2
c, 把ORCL:DISK2添加到GROUP1中去
d, 查看负载信息
e, 重新负载均衡
 
步骤:
Oracle 10g 手工创建数据库
今天尝试除DBCA以外的另一种方法来创建数据库,先前做过oracle10g手工建库的实验;数据版本是10g 10.2.0.1.0 搭配了ASM。
0,给电脑增加2块SCSI硬盘
1,安装ASM
[root@kk ~]# uname -rm
2.6.18-92.el5 i686
[root@kk ~]# cd 32bit/
[root@kk 32bit]# rpm -ivh oracleasm-support-2.1.3-1.el5.i386.rpm
warning: oracleasm-support-2.1.3-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
  1:oracleasm-support      ########################################### [100%]
[root@kk 32bit]# rpm -ivh oracleasm-2.6.18-92.el5
[root@kk 32bit]# rpm -ivh oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm
warning: oracleasm-2.6.18-92.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
  1:oracleasm-2.6.18-92.el5########################################### [100%]
[root@kk 32bit]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
  1:oracleasmlib          ########################################### [100%]
 
[root@kk 32bit]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#      enforcing - SELinux security policy is enforced.
#      permissive - SELinux prints warnings instead of enforcing.
#      disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#      targeted - Only targeted network daemons are protected.
#      strict - Full SELinux protection.
SELINUXTYPE=targeted
~
[root@kk 32bit]# setenforce 0
 
[root@kk 32bit]# /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) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                    [  OK  ]
Scanning the system for Oracle ASMLib disks:              [  OK  ]
[root@kk 32bit]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                    [  OK  ]
Scanning the system for Oracle ASMLib disks:              [  OK  ]
[root@kk 32bit]# cd /opt/oracle/product/10.2.0/db_1/bin/
[root@kk 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.
        kk
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
 
2,创建两个ASM磁盘组,分别为:GROUP1、GROUP2
 
[root@kk bin]# fdisk -l
 
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          25      200781  83  Linux
/dev/sda2              26        286    2096482+  82  Linux swap / Solaris
/dev/sda3            287        5221    39640387+  83  Linux
 
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
 
Disk /dev/sdc: 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/sdc1              1        1044    8385898+  83  Linux
 
[root@kk bin]# /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
Marking disk "DISK1" as an ASM disk:                      [  OK  ]
[root@kk bin]# /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1
Marking disk "DISK2" as an ASM disk:                      [  OK  ]
[root@kk bin]# /etc/init.d/oracleasm listdisk
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@kk bin]# /etc/init.d/oracleasm listdisks 
DISK1
DISK2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 下一页

相关内容