Tuesday, February 2, 2010

ASM ON NON CLUSTER NODE

[root@ceserp ~]# cd /u01/10gRDBMS/app/oracle/product/10.2.0.1/bin/
[root@ceserp bin]# ./localconfig add
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.
ceserp
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
[root@ceserp bin]# ./crsctl check crs
CSS appears healthy
Cannot communicate with CRS
Cannot communicate with EVM
[root@ceserp init.d]# fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 83 Linux
/dev/sda2 2551 10836 66557295 83 Linux
/dev/sda3 10837 17210 51199155 83 Linux
/dev/sda4 17211 30401 105956707+ 5 Extended
/dev/sda5 17211 21034 30716248+ 83 Linux
/dev/sda6 21035 22946 15358108+ 83 Linux
/dev/sda7 22947 23265 2562336 82 Linux swap
/dev/sda8 23266 30401 57319888+ 83 Linux
Disk /dev/sdb: 512 MB, 512483328 bytes
16 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 992 * 512 = 507904 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@ceserp init.d]# 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.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): d
No partition is defined yet!
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1009, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1009, default 1009):
Using default value 1009
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@ceserp init.d]# ./oracleasm enable
Writing Oracle ASM library driver configuration: [ OK ]
Scanning system for ASM disks: [ OK ]
[root@ceserp 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 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 ]
Scanning system for ASM disks: [ OK ]
[root@ceserp init.d]# ./oracleasm createdisk asmprod /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
[root@ceserp init.d]# ./oracleasm listdisks
ASMPROD
[root@ceserp init.d]# ./oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@ceserp bin]# cd /prod
[root@ceserp prod]# mkdir asmprod
[root@ceserp prod]# cd asmprod/
[root@ceserp asmprod]# mkdir bdump cdump udump create pfile
[root@ceserp asmprod]# cd pfile/
[root@ceserp pfile]# vi initasmprod.ora
instance_type=asm
large_pool_size=15M
user_dump_dest=/prod/asmprod/udump
background_dump_dest=/prod/asmprod/bdump
core_dump_dest=/prod/asmprod/cdump
+ASM.instance_name=asmprod
[oracle@ceserp asmprod]$ cd /u01/10gRDBMS/app/oracle/product/10.2.0.1/dbs
[oracle@ceserp dbs]$ ln -s /prod/asmprod/pfile/initasmprod.ora
[root@ceserp asmprod]# vi asmprod.env
export ORACLE_SID=asmprod
export ORACLE_HOME=/u01/10gRDBMS/app/oracle/product/10.2.0.1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[oracle@ceserp asmprod]$ . asmprod.env
[oracle@ceserp asmprod]$ sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 20 17:26:26 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started

Total System Global Area 88080384 bytes
Fixed Size 1217860 bytes
Variable Size 61696700 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted
SQL> desc v$asm_disk
SQL> select PATH,NAME from v$asm_disk;
PATH
--------------------------------------------------------------------------------
NAME
------------------------------
ORCL:ASMPROD
SQL> create diskgroup ASMPROD external redundancy disk 'ORCL:ASMPROD';
Diskgroup created.
[oracle@ceserp asmprod]$ asmcmd
ASMCMD> ls
ASMPROD/
ASMCMD> cd asmprod
ASMCMD> mkdir TST
ASMCMD> cd TST
ASMCMD> pwd
+asmprod/TST
ASMCMD>Exit
[oracle@ceserp asmprod]$ cd /prod
[oracle@ceserp prod]$ mkdir TST
[oracle@ceserp prod]$ cd TST
[oracle@ceserp TST]$ mkdir bdump cdump udump pfile create
[oracle@ceserp TST]$ cd pfile/
[oracle@ceserp pfile]$ vi inittest.ora
sga_target=400m
core_dump_dest=/prod/TST/cdump
background_dump_dest=/prod/TST/bdump
user_dump_dest=/prod/TST/udump
compatible=10.2.0
db_name=TST
control_files='+asmprod/TST/control01.ctl'
undo_management=auto
asmprod1.undo_tablespace=undotbs
[oracle@ceserp pfile]$ cd ../create
[oracle@ceserp create]$ vi cr8asm.sql
[oracle@ceserp create]$ cat cr8asm.sql
create database
datafile '+asmprod/TST/system01.dbf' size 150m
sysaux datafile '+asmprod/TST/sysaux.dbf' size 60m
undo tablespace undotbs1 datafile '+asmprod/TST/undo01.dbf' size 30m
default temporary tablespace tempx tempfile '+asmprod/TST/temp01.dbf' size 30m
logfile
group 1 '+asmprod/TST/redo01.log' size 8m,
group 2 '+asmprod/TST/redo02.log' size 8m
character set UTF8;
[oracle@ceserp TST]$ vi TST.env
export ORACLE_SID=TST
export ORACLE_HOME=/u01/10gRDBMS/app/oracle/product/10.2.0.1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[oracle@ceserp TST]$ . TST.env
[oracle@ceserp TST]$ cd create
[oracle@ceserp create]$ sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 20 18:00:05 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219736 bytes
Variable Size 121635688 bytes
Database Buffers 289406976 bytes
Redo Buffers 7168000 bytes
SQL> @cr8asm.sql
Database created
SQL> !vi file.sql
SQL> !cat file.sql
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
conn system/manager
@?/sqlplus/admin/pupbld.sql
SQL> @file.sql

No comments:

Post a Comment