当前位置:数据库 > Oracle >>

创建ASM With Oracle 10G

创建ASM With Oracle 10G
 
由于后文会相关的演示操作会用到ASM实例,因此在文章的开始就先创建一个简单的ASM实例,后面再开始详细的介绍ASM。  www.zzzyk.com  
下面是创建一个ASM Instance的具体操作过程:
创建ASM实例的相关目录
[oracle@gtser1~]$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
[oracle@gtser1~]$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump
[oracle@gtser1~]$ mkdir -p $ORACLE_BASE/admin/+ASM/hdump
[oracle@gtser1~]$ mkdir -p $ORACLE_BASE/admin/+ASM/pfile
[oracle@gtser1~]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
准备pfile的初始化参数
[oracle@gtser1~]$ vi /tmp/init+ASM.ora
INSTANCE_TYPE=ASM
"/tmp/init+ASM.ora"6L, 225C 已写入                                                                                                                       
[oracle@gtser1~]$ cat /tmp/init+ASM.ora
INSTANCE_TYPE=ASM
*.instance_name='+ASM'
*.asm_diskstring='/dev/raw/raw*'
background_dump_dest=/u01/oracle/10g/admin/+ASM/bdump
core_dump_dest=/u01/oracle/10g/admin/+ASM/cdump
user_dump_dest=/u01/oracle/10g/admin/+ASM/udump
启动ASM实例
[oracle@gtser1~]$ export ORACLE_SID=+ASM
[oracle@gtser1~]$ sqlplus "/as sysdba"
 
SQL*Plus:Release 10.2.0.5.0 - Production on Sat Feb 23 15:20:17 2013
 
Copyright(c) 1982, 2010, Oracle.  All RightsReserved.
 
Connectedto an idle instance.
 
SQL>startup pfile='/tmp/init+ASM.ora'
ASMinstance started
 
TotalSystem Global Area  125829120 bytes
FixedSize                  2094512 bytes
VariableSize              98568784 bytes
ASMCache                  25165824 bytes
ORA-15110:no diskgroups mounted
 
创建spfile
SQL>create spfile from pfile;
createspfile from pfile
*
ERROR atline 1:
ORA-01078:failure in processing system parameters
LRM-00109:could not open parameter file
'/u01/oracle/10g/product/10.2.0/db_1/dbs/init+ASM.ora'
 
 
SQL>create spfile from pfile='/tmp/init+ASM.ora';
 
Filecreated.
查看实例信息
SQL>select instance_name,host_name,version,database_status from v$instance;
 
INSTAHOST_NAM VERSION    DATABASE
------------- ---------- --------
+ASM  gtser1  10.2.0.5.0 ACTIVE
查看磁盘信息
GROUP_NUMBERDISK_NUMBER NAME  HEADER_STATUS            FAILGROUP CREATE_DATE     PATH
----------------------- ----- ------------------------ --------- ----------------------------
           0           0       CANDIDATE                                         /dev/raw/raw4
           0           1       CANDIDATE                                         /dev/raw/raw2
           0           2       CANDIDATE                                         /dev/raw/raw3
           0           0       CANDIDATE                                        /dev/raw/raw1
查看磁盘组信息
SQL>select group_number,name,state,type,total_mb,free_mb from v$asm_diskgroup orderby 1,2;
 
no rowsselected
 
SQL>exit
Disconnectedfrom Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bitProduction
With thePartitioning, OLAP, Data Mining and Real Application Testing options
在OS查看相关进程
[oracle@gtser1~]$  ps -ef | grep asm
oracle    3323    1  0 15:20 ?        00:00:00 asm_pmon_+ASM
oracle    3325    1  0 15:20 ?        00:00:00 asm_psp0_+ASM
oracle    3327    1  0 15:20 ?        00:00:00 asm_mman_+ASM
oracle    3329    1  0 15:20 ?        00:00:00 asm_dbw0_+ASM
oracle    3331    1  0 15:20 ?        00:00:00 asm_lgwr_+ASM
oracle    3333    1  0 15:20 ?        00:00:00 asm_ckpt_+ASM
oracle    3335    1  0 15:20 ?        00:00:00 asm_smon_+ASM
oracle    3337    1  0 15:20 ?        00:00:00 asm_rbal_+ASM
oracle    3339    1  0 15:20 ?        00:00:00 asm_gmon_+ASM
oracle    3361 3256  0 15:28 pts/1    00:00:00 grep asm
[oracle@gtser1~]$ sqlplus "/as sysdba"
 
SQL*Plus:Release 10.2.0.5.0 - Production on Sat Feb 23 15:30:12 2013
 
Copyright(c) 1982, 2010, Oracle.  All RightsReserved.
 
 
Connectedto:
OracleDatabase 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>show parameter spfile;
 
NAME                                 TYPE
----------------------------------------------------------
VALUE
------------------------------
spfile                               string
 
SQL>startup force;
ASMinstance started
 
TotalSystem Global Area  125829120 bytes
FixedSize                  2094512 bytes
VariableSize              98568784 bytes
ASMCache                  25165824 bytes
ORA-15110:no diskgroups mounted
 
 
SQL>show parameter spfile;
 
NAME                                 TYPE
----------------------------------------------------------
VALUE
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,