ASM on Linux - quick guide

Using ASM on Linux - a very quick and dirty guide, as always errors and omissions exclude.

Put this together what seems ages ago but still useful.

Oracle ASM on 12c seems to be very popular so just a few notes if you are interested and want to mess about with it.

Download Oracle 12c database for your VM (Oracle VirtualBox – presume already running Linux Release 6.5)

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-1959253.html

linuxamd64_12102_database_1of2.zip
linuxamd64_12102_database_2of2.zip

Don’t worry about this just yet, download the grid controller also.

Use the 12102 grid not the one on the same link

No:
linuxamd64_12c_grid_1of2.zip
linuxamd64_12c_grid_2of2.zip

(If you do use the above 12c grid stuff, you end up with compatibility issues, which I never resolved and ended up upgrading 12.1.0.1 grid to 12.1.0.2 anyway)

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-2240591.html

Yes:

linuxamd64_12102_grid_1of2.zip
linuxamd64_12102_grid_2of2.zip

For this example added two virtual disks on Virtuabox which I used for the ASM stuff. I then used the following web site to create the asm packages and disks:

** http://pierreforstmanndotcom.wordpress.com/2013/08/15/how-to-install-asmlib-on-oracle-linux-6/
** this link is now "dead" see ASMLIB on Linux 6

Follow the link and once you get the bit below you can install the grid infrastructure.

[oracle@mydbhost grid]$ oracleasm listdisks

ASM1
ASM2

If you hit the resource busy error

[root@ora01 /]# oracleasm createdisk DATA /dev/sde1
Unable to open device "/dev/sde1": Device or resource busy

[root@ora01 /]# /usr/sbin/asmtool -C -l /dev/oracleasm -n DATA -s /dev/sde1 -a force=yes

[root@usze2qmbtora01 /]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@ora01 /]# oracleasm listdisks
DATA



Unzip the grid zip files. I would suggest creating a “grid” user when you run the grid runInstaller, can leave as oracle, up to you.

I simply used the oracle user but need to be careful that you set the right oracle home

[oracle@mydbhost grid]$ cat /etc/oratab

+ASM:/media/u03/oracle/product/12.1.0/grid_1:N # line added by Agent

MADRID:/media/u02/oracle/product/12.1.0/dbhome_1:N # line added by Agent




You can change the “Data Group Name” to anything you want.

Needed to change the “Change Discovery Path” to /dev/oracleasm/disks

When you have the grid installation working you need to set up a grid instance (environment set to grid home):


[oracle@mydbhost bin]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 22 11:26:33 2014

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

Connected to an idle instance.

SQL> startup nomount;

ORA-01078: failure in processing system parameters

ORA-29701: unable to connect to Cluster Synchonization Service

SQL> select status from v$instance;

select status from v$instance

*

ERROR at line 1:

ORA-01034: ORACLE not available

Process ID: 0

Session ID: 0 Serial number: 0

Need to run this to get the Cluster stuff working, even though it is on one node.

[root@mydbhost bin]# crsctl start resource -all

……

Start as below.

[oracle@mydbhost ~]$ sqlplus "/as sysasm"

SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 22 11:47:47 2014

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

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Automatic Storage Management option

SQL> shutdown;

ASM instance shutdown

SQL> startup nomount;

ASM instance started

Total System Global Area 1140850688 bytes

Fixed Size 2933400 bytes

Variable Size 1112751464 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL>

So once you have this running, when you run the dbca stuff for 12c you can pick up the +DATA

Et voilla...

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------

+DATA/MADRID/DATAFILE/system.258.861232551
+DATA/MADRID/DATAFILE/sysaux.257.861232347
+DATA/MADRID/DATAFILE/undotbs1.260.861232777
+DATA/MADRID/DATAFILE/users.259.861232775
+DATA/MADRID/DATAFILE/matrix_clob01.db
+DATA/MADRID/DATAFILE/sara.285.861707437



Like I said very quick and dirty.


Let me know if anything wrong with this or any way you can think that will improve it.



Latest downloads - as of Feb 2018


No comments:

Post a Comment