ASM Creation in Linux:
create ASM disk command:
step1:
[root@dev140 oracle]# mkdir asm
[root@dev140 asm]# pwd
/oracle/asm[root@dev140 asm]#
/oracle/asm[root@dev140 asm]#
[root@dev140 ~]# dd if=/dev/sda2 of=/oracle/asm/disk-4 bs=1k count=5000000
output:
5000000+0 records in
5000000+0 records out
created 5gb disk
[root@dev140 ~]#
create 4 disk with same type
[root@dev140 ~]# cd /oracle/
[root@dev140 oracle]# chown -R oracle:dba asm/
[root@dev140 oracle]# chmod -R 777 asm/
[root@dev140 oracle]# cd asm/
[root@dev140 asm]# ll
total 20019600
-rwxrwxrwx 1 oracle dba 5120000000 Jan 23 16:53 disk-1
-rwxrwxrwx 1 oracle dba 5120000000 Jan 23 17:04 disk-2
-rwxrwxrwx 1 oracle dba 5120000000 Jan 23 17:06 disk-3
-rwxrwxrwx 1 oracle dba 5120000000 Jan 23 17:06 disk-4
[root@dev140 asm]#
step2:
[root@dev140 bin]$ pwd
/oracle/PROD/db/tech_st/10.2.0/bin
[root@dev140 bin]$
[root@dev140 bin]$ pwd
/oracle/PROD/db/tech_st/10.2.0/bin
[root@dev140 bin]$
[root@dev140 bin]# localconfig all
output:
Usage:/oracle/PROD/db/tech_st/10.2.0/bin/localconfig [add] [delete] [ reset <destination Oracle home> ] [-silent] [-paramfile <Complete path of file specifying parameter values>]
[root@dev140 bin]# localconfig reset
output:
/etc/oracle does not exist. Creating it now.
/oracle/PROD/db/tech_st/10.2.0/bin/localconfig: line 549: /etc/oracle/ocr.loc: No such file or directory
/oracle/PROD/db/tech_st/10.2.0/bin/localconfig: line 571: [: too many arguments
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 30 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.
dev140
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
[root@dev140 bin]#
step3: create ASM pwdfile & pfile
pwdfile:
[oracle@dev140 10.2.0]$ orapwd file=/oracle/PROD/db/tech_st/10.2.0/dbs/orapw+ASM password=sys
pfile: Parameter
_asm_allow_only_raw_disks=false
#asm_diskgroups='PROD_DATA1'
asm_diskstring='/oracle/asm/disk-*'
background_dump_dest=/oracle/PROD/db/tech_st/10.2.0/admin/PROD_dev140/bdump
core_dump_dest=/oracle/PROD/db/tech_st/10.2.0/admin/PROD_dev140/cdump
user_dump_dest=/oracle/PROD/db/tech_st/10.2.0/admin/PROD_dev140/udump
instance_type=asm
remote_login_passwordfile=exclusive
large_pool_size=12M
compatible=10.2.0.4.0
asm_power_limit=6
db_unique_name=+ASM
step 3: Startup steps
[oracle@dev140 dbs]$ export ORACLE_SID=+ASM
[oracle@dev140 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 23 17:31:13 2012
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1265912 bytes
Variable Size 57454344 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> create spfile from pfile;
File created.
SQL> shu immediate
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL> startup nomount
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1265912 bytes
Variable Size 57454344 bytes
ASM Cache 25165824 bytes
SQL>
SQL> CREATE DISKGROUP testdb_data1 NORMAL REDUNDANCY
2 FAILGROUP f1 DISK '/oracle/asm/disk-1','/oracle/asm/disk-2'
3 FAILGROUP f2 DISK '/oracle/asm/disk-3','/oracle/asm/disk-4';
Diskgroup created.
SQL> shu immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1265912 bytes
Variable Size 57454344 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> shu immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup mount
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1265912 bytes
Variable Size 57454344 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> select group_number, name, total_mb, free_mb, state, type from v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB FREE_MB STATE
------------ ------------------------------ ---------- ---------- -----------
TYPE
------
1 TESTDB_DATA1 19528 19422 MOUNTED
NORMAL
SQL>
ADD Disk Existing Group:
SQL> ALTER DISKGROUP PRODDG add
2 FAILGROUP f1 DISK '/oracle/asm/disk-3'
3 FAILGROUP f2 DISK '/oracle/asm/disk-4';
Diskgroup altered.
SQL>
No comments:
Post a Comment