专注于数据库技术研究和实践,目前就职于互联网金融企业,提供Oracle数据库技术支持和维护。 联系电话:18616803656
分类: Oracle
2011-06-04 18:13:37
Partition disk
# fdisk /dev/sdc
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.
# fdisk /dev/sdd
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.
# partprobe
Create raw devices
# cat > /etc/sysconfig/rawdevices <
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdc1
/dev/raw/raw2 /dev/sdd1
EOF
# service rawdevices restart
ls /dev/raw -ltrAssigning devices:
/dev/raw/raw1 --> /dev/sdc1
/dev/raw/raw1: bound to major 8, minor 33
/dev/raw/raw2 --> /dev/sdd1
/dev/raw/raw2: bound to major 8, minor 49
done
# ls /dev/raw -ltr
# chown -R oracle.oinstall /dev/raw/raw*
modify permissions
# sed -i '/raw\/\*/ c\raw\/\*\:oracle\:oinstall\:0660' /etc/udev/permissions.d/50-udev.permissions
configure ccsd sercies
# /u01/app/oracle/product/10.2.0/db_1/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.
dblife10
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
# su - oracle
$ export ORACLE_SID=+ASM
create directory
$ mkdir /u01/app/oracle/admin/+ASM/udump -p
$ mkdir /u01/app/oracle/admin/+ASM/cdump
$ mkdir /u01/app/oracle/admin/+ASM/bdump
create password file
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapw+ASM password=oracle
create ASM pfile
$ cat > init+ASM.ora <
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.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'
EOF
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jun 4 18:06:56 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL> startup nomount
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
SQL> create diskgroup data external redundancy disk '/dev/raw/raw1';
Diskgroup created.
SQL> alter diskgroup data add disk '/dev/raw/raw2';
Diskgroup altered.
SQL> select name,state,total_mb,usable_file_mb from v$asm_diskgroup;
NAME STATE TOTAL_MB USABLE_FILE_MB
------------------------------ ----------- ---------- --------------
DATA MOUNTED 16378 16326
SQL> alter system set asm_diskgroups='DATA' scope=both;
System altered.
SQL> create pfile from spfile;
File created.
SQL> shutdown
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
$ cat init+ASM.ora
+ASM.asm_diskgroups='DATA'#Manual Mount
*.asm_diskgroups='DATA'
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump'
*.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'