Wednesday, December 10, 2014

ORACLE - ADD DISK ASM/Diskgroup - Automatic Storage Management (ASM)

Automatic Storage Management (ASM)

login as: root
root@192.168.0.239's password:
Last login: Tue Dec  9 19:10:42 2014 from 192.168.0.206
[root@db1 ~]# fdisk -l

Disk /dev/sda: 150.3 GB, 150323855360 bytes
255 heads, 63 sectors/track, 18275 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dc94c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        4203    33554432   82  Linux swap / Solaris
/dev/sda3            4203        9303    40960000   83  Linux
/dev/sda4            9303       18276    72080384    5  Extended
/dev/sda5            9303       18276    72079360   83  Linux

Disk /dev/sdc: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x90a18a8c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        6527    52428096   83  Linux

Disk /dev/sdd: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3a45183b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        6527    52428096   83  Linux

Disk /dev/sde: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xde587821

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        6527    52428096   83  Linux

Disk /dev/sdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x50b618df

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        6527    52428096   83  Linux

Disk /dev/sdf: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2932987d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1        6527    52428096   83  Linux

Disk /dev/sdh: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdg: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbe2c0835

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1       26108   209712478+  83  Linux
[root@db1 ~]# fdisk -l /dev/sdh

Disk /dev/sdh: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@db1 ~]# cat /proc/partitions
major minor  #blocks  name

   2        0          4 fd0
  11        0    1048575 sr0
   8        0  146800640 sda
   8        1     204800 sda1
   8        2   33554432 sda2
   8        3   40960000 sda3
   8        4          1 sda4
   8        5   72079360 sda5
   8       32   52428800 sdc
   8       33   52428096 sdc1
   8       48   52428800 sdd
   8       49   52428096 sdd1
   8       64   52428800 sde
   8       65   52428096 sde1
   8       16   52428800 sdb
   8       17   52428096 sdb1
   8       80   52428800 sdf
   8       81   52428096 sdf1
   8      112  104857600 sdh
   8       96  209715200 sdg
   8       97  209712478 sdg1

[root@db1 ~]# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xbe78fa85.
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)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):
Using default value 13054

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@db1 ~]# cat /proc/partitions
major minor  #blocks  name

   2        0          4 fd0
  11        0    1048575 sr0
   8        0  146800640 sda
   8        1     204800 sda1
   8        2   33554432 sda2
   8        3   40960000 sda3
   8        4          1 sda4
   8        5   72079360 sda5
   8       32   52428800 sdc
   8       33   52428096 sdc1
   8       48   52428800 sdd
   8       49   52428096 sdd1
   8       64   52428800 sde
   8       65   52428096 sde1
   8       16   52428800 sdb
   8       17   52428096 sdb1
   8       80   52428800 sdf
   8       81   52428096 sdf1
   8      112  104857600 sdh
   8      113  104856223 sdh1
   8       96  209715200 sdg
   8       97  209712478 sdg1
[root@db1 ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdb (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdc (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdd (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sde (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdf (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdg (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
[root@db1 ~]# /etc/init.d/oracleasm listdisks
ASM01
ASM02
ASM03
ASM04
ASM05
[root@db1 ~]# su - oracle
[oracle@db1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 12:04:36 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected to an idle instance.
SQL> quit
Disconnected
[oracle@db1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 10-DEC-2014 12:05:09

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                09-DEC-2014 18:35:20
Uptime                    0 days 17 hr. 29 min. 49 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/app/oracle/product/11.2.0/grid/network/admin/listener.ora
Listener Log File         /opt/app/oracle/diag/tnslsnr/db1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=blogger.blogger.intranet)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@db1 ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 10-DEC-2014 12:05:17

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@db1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 12:05:26 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1.5667E+10 bytes
Fixed Size                  2268632 bytes
Variable Size            2113929768 bytes
Database Buffers         1.3522E+10 bytes
Redo Buffers               28127232 bytes
SQL> select name, path from v$asm_disk;

NAME                     PATH
---------------------    ------------------------------------
DSKDATA_0000   /dev/oracleasm/disks/ASM01

DSKDATA_0001   /dev/oracleasm/disks/ASM02

DSKDATA_0002    /dev/oracleasm/disks/ASM03

DSKDATA_0003   /dev/oracleasm/disks/ASM04

DSKDATA_0004   /dev/oracleasm/disks/ASM05


SQL> quit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
[oracle@db1 ~]$ su -
Password:
[root@db1 ~]# /etc/init.d/oracleasm createdisk AMS06 /dev/sdh1
Marking disk "AMS06" as an ASM disk:                       [  OK  ]
[root@db1 ~]# su - oracle
[oracle@db1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 12:10:44 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> select path from v$asm_disk;

PATH
--------------------------------------------------------------------------------
/dev/oracleasm/disks/AMS06
/dev/oracleasm/disks/ASM03
/dev/oracleasm/disks/ASM02
/dev/oracleasm/disks/ASM04
/dev/oracleasm/disks/ASM01
/dev/oracleasm/disks/ASM05

6 rows selected.

SQL> select name, total_mb, free_mb from v$asm_diskgroup;

NAME                             TOTAL_MB    FREE_MB
------------------------------ ----------            ----------
DSKDATA                       255995             57

SQL> quit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
[oracle@db1 ~]$ cat /etc/oratab
#Backup file is  /opt/app/oracle/product/11.2.0/grid/srvm/admin/oratab.bak.db1 line added by Agent
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/opt/app/oracle/product/11.2.0/grid:N
TESTE:/opt/app/oracle/product/11.2.0/db_1:N             # line added by Agent
PRD:/opt/app/oracle/product/11.2.0/db_1:N          # line added by Agent
[oracle@db1 ~]$ export ORACLE_SID=+ASM
[oracle@db1 ~]$ export ORACLE_HOME=/opt/app/oracle/product/11.2.0/grid
[oracle@db1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@db1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 12:13:09 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys as sysasm
Enter password:
Connected.
SQL> alter diskgroup DSKDATA add disk '/dev/oracleasm/disks/AMS06';

Diskgroup altered.

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
[oracle@db1 ~]$ export ORACLE_SID=PROD
[oracle@db1 ~]$ export ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1
[oracle@db1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@db1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 12:17:15 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> select name, total_mb, free_mb from v$asm_diskgroup;

NAME                             TOTAL_MB    FREE_MB
------------------------------ ----------            ----------
DSKDATA                       358393              102453

SQL>



 

1 comment:

  1. emperor casino no deposit bonus - Shootercasino.com
    Is Emperor casino no deposit bonus legit? How 제왕카지노 가입 코드 about casino no deposit bonus? Learn about bonus codes, how to withdraw, and more.

    ReplyDelete