Skip to content
Advertisements

Posts from the ‘RAC & ASM’ Category

ora–0845: memory_target not supported on this system while grid installation

I have faced ASM configuration assistant failed while install grid on linux  with very less RAM.  So I crosschecked the log file, It shows below issues

ora–0845: memory_target not supported on this system

So I skip this activity and then started next activity progress is finished. The grid infrastructure installation was successful. After that, I tried to configure asm configuration using by asmca. Here I changed Memory_target parameter to Zero value in init file. Then ASM configuration was successful and asm instance status is started.

 

 

Advertisements

Setup DNS for RAC 12c implementation in virtual Box

If you are plan to implement rac setup in virtul box for your lab practise, you need to setup a dns configuration necessary steps to use single client access name (SCAN) introduced in 11gR2 RAC.

The DNS setup may be a separate server, or you can make it on any one of the nodes you’re preparing for rac implementation.

Here I have chosed to setup on rac first node, so you need to do some setup here

RAC First node :

Step 1:

Below rpm package need to installed on rac first node.

[root@racnode1 ~]# rpm -qa|grep bind
bind-libs-9.3.6-20.P1.el5_8.6
bind-9.3.6-20.P1.el5_8.6
system-config-bind-4.0.3-6.el5
bind-utils-9.3.6-20.P1.el5_8.6

 

Step 2:

check named.conf file available in /etc/ and also /var/named, If it’s not available, Please copy those files from

[root@racnode1 etc]# pwd
/usr/share/doc/bind-9.3.6/sample/etc
[root@racnode1 etc]# ls
named.conf named.conf.bkp named.rfc1912.zones named.root.hints rndc.conf
[root@racnode1 etc]# cp * /etc

 

[root@racnode1 etc]# cd ..
[root@racnode1 sample]# cd var
[root@racnode1 var]# ls
named var
[root@racnode1 var]# cp -r named /var

 

Step 3: edit the file like below

[root@racnode1 var]# cat /etc/named.conf
//
// Sample named.conf BIND DNS server ‘named’ configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator’s Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
directory “/var/named”; // the default
dump-file “data/cache_dump.db”;
statistics-file “data/named_stats.txt”;
// memstatistics-file “data/named_mem_stats.txt”;
forwarders {192.168.1.1;};

};
key ddns_key
{
algorithm hmac-md5;
secret “gTsUbdMeXIAIOfeSUO6abZ2LkFqwOu3gKHih1Y4jqNEJeQXnnBM8S1xx”;
};

zone “racnode.com” IN {
type master;
file “racnode.com.zone”;
allow-update { none; };
};

zone “1.168.192.in-addr.arpa.” IN {
type master;
file “1.168.192.in-addr.arpa”;
allow-update { none; };
};

Step 4:  Create entries in zone file

[root@racnode1 named]# cat 1.168.192.in-addr.arpa

$TTL 86400
$ORIGIN 1.168.192.in-addr.arpa.

@ IN SOA racnode1.racnode.com. root.racnode.com.( 2
3H
1H
1W
1H )
IN NS 192.168.1.101
IN NS 192.168.1.1
101 IN PTR racnode1.racnode.com.
102 IN PTR racnode2.racnode.com.
111 IN PTR racnode1-vip.racnode.com.
112 IN PTR racnode2-vip.racnode.com.
201 IN PTR rac-scan.racnode.com.
202 IN PTR rac-scan.racnode.com.
203 IN PTR rac-scan.racnode.com.

 

[root@racnode1 named]# cat racnode.com.zone
$TTL 86400
@ IN SOA racnode.com. racnode.com.(
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
racnode.com. IN NS 192.168.1.101
localhost IN A 127.0.0.1
racnode1.racnode.com. IN A 192.168.1.101
racnode2.racnode.com. IN A 192.168.1.102
racnode1-vip.racnode.com. IN A 192.168.1.111
racnode2-vip.racnode.com. IN A 192.168.1.112
rac-scan.racnode.com. IN A 192.168.1.201
rac-scan.racnode.com. IN A 192.168.1.202
rac-scan.racnode.com. IN A 192.168.1.203

 

Step 5: Start the named service

 

[root@racnode1 named]# service named start
Starting named: [ OK ]

[root@racnode1 named]# chkconfig named on

Step 6: resolv.conf looks like below

[root@racnode1 named]# cat /etc/resolv.conf

search racnode.com
nameserver 192.168.1.101
options timeout:1
options attempts:2

Step 6:

[root@racnode1 named]# nslookup rac-scan
Server: 192.168.1.101
Address: 192.168.1.101#53

Name: rac-scan.racnode.com
Address: 192.168.1.203
Name: rac-scan.racnode.com
Address: 192.168.1.201
Name: rac-scan.racnode.com
Address: 192.168.1.202

Step 7:  Go to  second node

[root@racnode2 ~]# service named status
named is stopped
[root@racnode2 ~]# cat /etc/resolv.conf
search racnode.com

nameserver 192.168.1.101

options timeout:1
options attempts:2

[root@racnode2 ~]# nslookup rac-scan
Server: 192.168.1.101
Address: 192.168.1.101#53

Name: rac-scan.racnode.com
Address: 192.168.1.201
Name: rac-scan.racnode.com
Address: 192.168.1.202
Name: rac-scan.racnode.com
Address: 192.168.1.203

 

Step 8: /etc/hosts file look like below on each node but don’t added scan address here

[root@racnode1 named]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost6 localhost
# Public
192.168.1.101 racnode1.racnode.com racnode1 racnode1
192.168.1.102 racnode2.racnode.com racnode2
# Private
10.10.1.1 racnode1-priv.racnode.com racnode1-priv
10.10.1.2 racnode2-priv.racnode.com racnode2-priv
# Virtual
192.168.1.111 racnode1-vip.racnode.com racnode1-vip
192.168.1.112 racnode2-vip.racnode.com racnode2-vip

 

Step 9:

[root@racnode1 named]# grep ^hosts /etc/nsswitch.conf
hosts: files dns

find out which device mapped with oracle asm disk

Step 1 :

 

[oracle@asmoracle ~]$ /etc/init.d/oracleasm listdisks

DISK1
DISK2
DISK3
DISK4

 

Step 2 :

[oracle@asmoracle ~]$ /etc/init.d/oracleasm querydisk -d DISK1
Disk “DISK1” is a valid ASM disk on device /dev/sdc1[8,33]

The device noted here is (8,33), so go to

 

[root@asmoracle dev]# ls -l sd*
brw-r—– 1 root disk 8, 0 Aug 18 08:39 sda
brw-r—– 1 root disk 8, 1 Aug 18 08:39 sda1
brw-r—– 1 root disk 8, 2 Aug 18 08:39 sda2
brw-r—– 1 root disk 8, 16 Aug 18 08:39 sdb
brw-r—– 1 root disk 8, 17 Aug 18 08:39 sdb1
brw-r—– 1 root disk 8, 32 Aug 18 08:39 sdc
brw-r—– 1 root disk 8, 33 Aug 18 08:39 sdc1 (its belong to this device)
brw-r—– 1 root disk 8, 48 Aug 18 08:39 sdd
brw-r—– 1 root disk 8, 49 Aug 18 08:39 sdd1
brw-r—– 1 root disk 8, 64 Aug 18 08:39 sde
brw-r—– 1 root disk 8, 65 Aug 18 08:39 sde1
brw-r—– 1 root disk 8, 80 Aug 18 08:39 sdf
brw-r—– 1 root disk 8, 81 Aug 18 08:39 sdf1

asm spfile

The below article useful to know about asm spfile and How asm instance started if spfile in diskgroup without mount.

http://asmsupportguy.blogspot.in/2014/03/asm-spfile-in-disk-group.html

This article he explained for  normal redundancy . If you want to find the spfile on external redundancy level, you can use below command

[oracle@asmoracle ~]$ asmcmd lsdsk -G DATA
Path
/dev/oracleasm/disks/DISK1
/dev/oracleasm/disks/DISK2


[oracle@asmoracle ~]$ kfed read /dev/oracleasm/disks/DISK1 | grep -E 'spf|ausize'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.spfile: 1450 ; 0x0f4: 0x000005aa
kfdhdb.spfflg: 1 ; 0x0f8: 0x00000001

[oracle@asmoracle ~]$ kfed read /dev/oracleasm/disks/DISK2 | grep -E 'spf|ausize'
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
[oracle@asmoracle ~]$ dd if=/dev/oracleasm/disks/DISK1 bs=1048576 skip=1450 count=1 | strings
+ASM.__large_pool_size=16777216
+ASM.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from in memory value
+ASM.asm_diskgroups='DATA','FRA'#Manual Mount
*.asm_diskstring='/dev/oracleasm/disks/*'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oracle'
*.instance_type='asm'
*.large_pool_size=12M
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.054056 seconds, 19.4 MB/s

Force option in ASM

This below url is very useful to know about force option in asm

http://asmsupportguy.blogspot.com/2011/12/forcing-issue.html

Create diskgroup in ASM

Steps for creating diskgroup in ASM (Single Node)

 

Step 1: Add new HDD to server and done partition. Here I added two HDD

[root@asmoracle ~]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): p

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 130 1044193+ 83 Linux

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

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Step 2 :  Just check existing Diskgroup in ASM

[root@asmoracle ~]# oracleasm listdisks
DISK1
DISK2

Step 3:  now try to create new disk in asm

[root@asmoracle ~]# oracleasm createdisk DISK3 /dev/sde1
Writing disk header: done
Instantiating disk: done

[root@asmoracle ~]# oracleasm createdisk DISK4 /dev/sdf1
Writing disk header: done
Instantiating disk: done

Step 4: Verifying asm disk label

[root@asmoracle ~]# oracleasm querydisk /dev/sde1
Device "/dev/sde1" is marked an ASM disk with the label "DISK3"
[root@asmoracle ~]# oracleasm querydisk /dev/sdf1
Device "/dev/sdf1" is marked an ASM disk with the label "DISK4"

Step 5 : listdisks

[root@asmoracle ~]# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4

Step 6:  Checking diskgroup state

SQL> select path,header_status from v$asm_disk;

PATH
--------------------------------------------------------------------------------
HEADER_STATU
------------
/dev/oracleasm/disks/DISK4
PROVISIONED

/dev/oracleasm/disks/DISK3
PROVISIONED

/dev/oracleasm/disks/DISK2
MEMBER

/dev/oracleasm/disks/DISK1
MEMBER

 

PROVISINED -- It is available to be added diskgroup or create diskgroup. It's configuration done by ASMLIB

Step 7 : create diskgroup

SQL> CREATE DISKGROUP FRA EXTERNAL REDUNDANCY DISK '/dev/oracleasm/disks/DISK3','/dev/oracleasm/disks/DISK4';

Diskgroup created.

SQL> select path,header_status from v$asm_disk;

PATH
----------------------------------------------------------------------------------------------------
HEADER_STATU
------------
/dev/oracleasm/disks/DISK2
MEMBER

/dev/oracleasm/disks/DISK1
MEMBER

/dev/oracleasm/disks/DISK4
MEMBER

/dev/oracleasm/disks/DISK3
MEMBER

 

ASM ab_+ASM.dat hc_+ASM.dat

ab_+ASM.dat : This file generated when asm instance startup. this file  is used by the RDBMS instance to determine the appropriate enviornment information whenever the RDBMS instance connects to the asm instance. If this file is removed, RDBMS instance can not able to connect to ASM

For Example :

[oracle@asmoracle ~]$ cd /u01/app/oracle/11.2.0/grid/dbhome_1/dbs/
[oracle@asmoracle dbs]$ ls
ab_+ASM.dat hc_+ASM.dat initasm.ora init.ora orapw+ASM spfile+ASM.ora

Removed this file or rename this file and then try to startup the RDBMS instance

[oracle@asmoracle dbs]$ mv ab_+ASM.dat ab_+ASM.dat_new

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file ‘+DATA/asmoracle/spfileasmoracle.ora’
ORA-17503: ksfdopn:2 Failed to open file +DATA/asmoracle/spfileasmoracle.ora
ORA-27300: OS system dependent operation:open failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: sskgmsmr_7

So I can not able to start the database instance.

After I revert back these file, I can able to connect.

[oracle@asmoracle dbs]$ mv ab_+ASM.dat_new ab_+ASM.dat

SQL> startup
ORACLE instance started.

Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 524290040 bytes
Database Buffers 310378496 bytes
Redo Buffers 2396160 bytes
Database mounted.
Database opened.

Note that the authentication for the connection is not based on the information in the *.dat file.

But I renamed that file and done some transaction and also I try to create tablespace,  it showing end of file communication error. Again i revert back these file and started the database and again i renamed that file and done some transaction and also created tablespace, now its okay even these file not available. then Why this below error occured before? I want to know more detail, I will share this details once my investigate done.

[oracle@asmoracle dbs]$ mv ab_+ASM.dat  ab_+ASM.dat_new

SQL> conn test/test
Connected.
SQL> create table test(empno number,city varchar2(20));

Table created.

SQL> insert into test values(001, ‘dubai’);

1 row created.

SQL> commit;

Commit complete.

SQL> insert into test values(002, ‘trichy’);

1 row created.

SQL> commit;

Commit complete.

SQL> select count(*) from tab;

COUNT(*)
———-
1

SQL> select * from test;

EMPNO CITY
———- ——————–
1 dubai
2 trichy

 

SQL> conn / as sysdba
Connected.
SQL> create tablespace testtbs datafile ‘+DATA’ size 1m;
create tablespace testtbs datafile ‘+DATA’ size 1m
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 4644
Session ID: 1 Serial number: 17

 

Again I revert back these file and started the database and then renamed that file but now i done many activities nothing happen. So want to investigate this details

[oracle@asmoracle dbs]$ mv ab_+ASM.dat_new ab_+ASM.dat

SQL> startup
ORACLE instance started.

Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 524290040 bytes
Database Buffers 310378496 bytes
Redo Buffers 2396160 bytes
Database mounted.
Database opened.

[oracle@asmoracle dbs]$ mv ab_+ASM.dat  ab_+ASM.dat_new

SQL> create tablespace testtbs datafile ‘+DATA’ size 1m;

Tablespace created.

 

hc_+ASM.dat :

EM uses this file for instance health-check monitoring. If this file is removed, the health check information for the instance

will be inaccurate.

Note : Don’t remove these files

ASM Startup

The startup for ASM instance are similar to those for RDBMS instances

For Example Nomount option start  up an asm instance without mounting any diskgroups.

SQL> startup nomount
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2212656 bytes
Variable Size 256552144 bytes
ASM Cache 25165824 bytes

SQL> select name,state from v$asm_diskgroup;

NAME STATE
—————————— ———–
DATA DISMOUNTED

Mount option is used to mount the all diskgroup specified in ASM_DISKGROUPS init.ora parameter.

SQL> ALTER DISKGROUP ALL MOUNT;

Diskgroup altered.

SQL> select name,state from v$asm_diskgroup;

NAME STATE
—————————— ———–
DATA MOUNTED

 

If no diskgroup listed in the init.ora file, then the message “ORA-15110: no diskgroups mounted” is displayed. If the listed diskgroups cannot be mounted, then the following messages appear: “ORA-15032: not all alterations performed,” and, “ORA-5063: ASM discovered an insufficient number of disks for diskgroup <diskgroup name>.”

In Oracle Database 11g, ASM introduced the RESTRICTED startup option for the MOUNT command. When an ASM instance is started with the RESTRICTED option, the starting ASM instance exclusively mounts all of the diskgroups listed in  the ASM_DISKGROUPS parameter, and no RDBMS access is permitted in this mode.When the RESTRICTED startup option is used on a diskgroup in an ASM clustered(RAC) environment, no other ASM instance in the cluster can access that diskgroup.The RESTRICTED option is particularly useful when performing maintenance, such as a rebalance, on a diskgroup or set of diskgroups.

For Example :

SQL> startup restrict

ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2212656 bytes
Variable Size 256552144 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

SQL> SELECT NAME, STATE FROM V$ASM_DISKGROUP;

NAME STATE
—————————— ———–
DATA RESTRICTED

I am trying to start the database but getting error

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file ‘+DATA/asmoracle/spfileasmoracle.ora’
ORA-17503: ksfdopn:2 Failed to open file +DATA/asmoracle/spfileasmoracle.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:DGOpenFile05 Failed to open file +DATA/asmoracle/spfileasmoracle.ora
ORA-17503: ksfdopn:2 Failed to open file +DATA/asmoracle/spfileasmoracle.ora
ORA-15236: diskgroup DATA mounted in restricted mode
ORA-06512: at line 4
SQL>

After maintenance work, you need to shutdown the asm instance and startup the asm

SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown

SQL> startup
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2212656 bytes
Variable Size 256552144 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

SQL> SELECT NAME, STATE FROM V$ASM_DISKGROUP;

NAME STATE
—————————— ———–
DATA MOUNTED

ORA-29701: unable to connect to Cluster Synchronization Service

I try to restart asm service, it shows below error

C:\app\mazar\product\11.2.0\grid\BIN>sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 14 11:14:10 2014

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

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service

C:\app\mazar\product\11.2.0\grid\BIN>crsctl start resource ora.cssd
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Start failed, or completed with errors.

Enable HAS

C:\app\mazar\product\11.2.0\grid\BIN>crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

C:\app\mazar\product\11.2.0\grid\BIN>crsctl start has
CRS-4123: Oracle High Availability Services has been started.

C:\app\mazar\product\11.2.0\grid\BIN>crs_stat -t
Name Type Target State Host
————————————————————
ora.DATA.dg ora….up.type ONLINE ONLINE trai…6-pc
ora….ER.lsnr ora….er.type ONLINE ONLINE trai…6-pc
ora.asm ora.asm.type ONLINE ONLINE trai…6-pc
ora.asmdb.db ora….se.type ONLINE ONLINE trai…6-pc
ora.cssd ora.cssd.type ONLINE ONLINE trai…6-pc

C:\app\mazar\product\11.2.0\grid\BIN>sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 14 11:22:54 2014

Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Automatic Storage Management option

SQL> select status from v$instance;

STATUS
————
STARTED

Viewing disk group clients with V$ASM_CLIENT

How do we see Viewing disk group clients with V$ASM_CLIENT ?

SQL> SELECT dg.name AS diskgroup, SUBSTR(c.instance_name,1,12) AS instance,
2 SUBSTR(c.db_name,1,12) AS dbname, SUBSTR(c.SOFTWARE_VERSION,1,12) AS software,
3 SUBSTR(c.COMPATIBLE_VERSION,1,12) AS compatible
4 FROM V$ASM_DISKGROUP dg, V$ASM_CLIENT c
5 WHERE dg.group_number = c.group_number;
DISKGROUP INSTANCE DBNAME SOFTWARE COMPATIBLE
------------------------------ ------------------------------------ ------------------------ --------------
DATA +ASM ERPPROD 11.2.0.2.0 11.2.0.0.0
FRA +ASM ERPPROD 11.2.0.2.0 11.2.0.0.0
REDO1 +ASM ERPPROD 11.2.0.2.0 11.2.0.0.0
REDO2 +ASM ERPPROD 11.2.0.2.0 11.2.0.0.0