Blog

High Swap Usage On Oracle Database Server

SITUATION

When investigating into client’s Oracle database performance issue, we found the swap space usage is constantly very high on this Linux server.

OS: RHEL 7.3
DB: Oracle 12.2.0.1

FINDINGS

1)top
Tasks: 352 total, 2 running, 350 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.4%us, 4.1%sy, 0.0%ni, 79.3%id, 2.2%wa, 0.3%hi, 0.8%si, 0.0%st
Mem: 32172820k total, 32015956k used, 156864k free, 14528k buffers
Swap: 16777208k total, 7435428k used, 9341780k free, 11129844k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
137049 oracle 15 0 16.2g 5.3g 5.3g S 20.6 17.4 10:14.17 oracle
 72457 oracle 15 0 16.2g 4.7g 4.7g S 15.3 15.3 10:50.15 oracle
...
..
.
2) pmap
$ pmap -x 137049
137049: oracleRACTEST1 (LOCAL=NO)
Address          Kbytes   RSS     Dirty Mode Mapping
0000000000400000 96356    11704   0     r-x-- oracle
0000000006419000 444      140     4     rwx-- oracle
0000000006488000 148      100     80    rwx-- [ anon ]
000000001966e000 532      176     92    rwx-- [ anon ]
0000000060000000 16779264 5444888 1485768 rwxs- [ shmid=0x670005 ]
00000032b6a00000 112      108     0     r-x-- ld-2.5.so
00000032b6c1c000 4        0       0     r-x-- ld-2.5.so
...
..
.
00007fff4c504000 160 136 132 rwx-- [ stack ]
00007fff4c5d2000 12 4 0 r-x-- [ anon ]
ffffffffff600000 8192 0 0 ----- [ anon ]
---------------- ------ ------ ------
total kB 16954204 5477952 1490448
3) swappiness
$ cat /proc/sys/vm/swappiness
10

Subscribe to get access

Read more of this content when you subscribe today.

ohasd failed to start

SITUATION

1) Two 11.2.0.4 RAC nodes( racnode1/2). Deleted node racnode2 . Upgraded OS from RHEL 4  to RHEL 7 for racnode2, then tried to add node racnode2 back into cluster .

2) export IGNORE_PREADDNODE_CHECKS=Y, Ran addnode.sh ->  orainstRoot.sh->root.sh, then got “ohasd failed to start” error.

...
..
.
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2017-07-24 16:11:23.098:
[client(11401)]CRS-2101:The OLR was formatted using version 3.
2017-07-24 16:11:24.001:
[client(11424)]CRS-1001:The OCR was formatted using version 3.

ohasd failed to start at /u01/app/11.2.0.4/grid/crs/install/roothas.pl line 377, line 4.

SOLUTION

Subscribe to get access

Read more of this content when you subscribe today.

Copy Oracle Home Binary from One RAC Node to Another RAC Node

For some reason RAC oracle home binary corrected on racnode2, so it needs to be copied and reconfigured from racnode1.

Subscribe to get access

Read more of this content when you subscribe today.

Move OCR, Voting Disk File, ASM SPILE to New Diskgroup

It is recommended to put OCR, Voting File and ASM SPILE onto a dedicated diskgroup.

This exercise is to move everything from old OCR/VOTING diskgroup OCR_VOTE  to a new diskgroup OCR_VOTE2 in 11.2.0.4.

Subscribe to get access

Read more of this content when you subscribe today.

Dropping an Empty Partition Without “Update Indexes” Necessary

“Update Indexes” option can be omitted when dropping an empty partition.

As we know  the ‘update indexes’ clause is used  to drop the local indexes and update the global index  when we drop a partition. So the indexes will still be VALID”

The following example shows when we drop an empty partition,  the ” Update Indexes” clause is not required.

1) Create partition table
SQL>CREATE TABLE TEST_TBL
    ( 
       id number, 
       name varchar2(80)
    )
    PARTITION BY RANGE ( id )
     ( PARTITION p1 VALUES LESS THAN (1000), 
       PARTITION p2 VALUES LESS THAN (2000)
     );

Table created.
2) Insert records into partition
SQL>begin 
  for i in 1..1800 loop 
    insert into TEST_TBL values (i, 'TEST'||to_char(i) ); 
  end loop; 
  commit;
end;

PL/SQL procedure successfully completed.

3)Create global index:

SQL> create index id_idx on TEST_TBL (id) global;
Index created.

SQL>  select index_name, index_type, status 
       from all_indexes
       where index_name='ID_IDX';

INDEX_NAME    INDEX_TYPE  STATUS
------------- ----------- --------
ID_IDX        NORMAL      VALID
4) Empty partition p2 by deleting all records in p2 partition
SQL> select count(*) from TEST_TBL ;

COUNT(*)
----------      
1800

SQL>  select count(*) from TEST_TBL partition ( p1);

COUNT(*)
----------       
999

SQL>  select count(*) from TEST_TBL partition ( p2);

COUNT(*)
----------       
801

SQL>  delete from TEST_TBL where ID >= 1000;
801 rows deleted.

SQL>commit;
Commit complete
5) Drop the empty partition p2, and confirm the global index is still valid
SQL>alter table TEST_TBL drop partition p2;
Table altered.

SQL> select index_name, index_type, status 
      from all_indexes 
     where index_name='ID_IDX';

INDEX_NAME           INDEX_TYPE                  STATUS
-------------------- --------------------------- --------
ID_IDX               NORMAL                      VALID