Showing posts with label BestPractices. Show all posts
Showing posts with label BestPractices. Show all posts

Wednesday, October 23, 2019

NUMA on the Exadata and ORA-04031

At the very beginning when Exadata appeared at 2010 the settings of Linux OS and Oracle RDBMS were configured to use flat memory. There were no NUMA settings despite the SUN 4275 server is actualy NUMA server. And some notes at old times prohibited using NUMA settings on the Exadata.

But starting from November 2018 (
Exadata image 18.10), Oracle silently enabled NUMA settings for Exadata. Which can increase appearance of ORA-04031.

Here is a some words about enabling NUMA on Exadata in
2378765.1:
" Normally, PX message buffers come out of the large pool as long as sga_target or memory_target is set. However, when "_enable_NUMA_support" is 'TRUE' and you are running on Exadata (then _px_numa_support_enabled is 'TRUE') causes PX message buffers to be allocated from the numa pool. "

Tuesday, March 20, 2018

"no space left on device"

What you should to do if you got a message "no space left on device" on some file system (/u01 for example) ?


1.

Start from inode analysis:
# date
# df -i

and look the values Inodes, IUsed, IFree, IUse% in the output.

If all 100% inode are in use, then we suspect a lot of files were created recently in one of sub-directories.
To find biggest (by number of files) directory :
# find /u01 -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n | tail -50
You'll got a 50 biggest directories.
Delete redundant files.
Try to do it without rm command, use adrci or find with -mtime 30 option.
Deleteing many files require many time, so run these commands in screen.

Adrci example:

[oracle@edbadm01 trace]$ adrci
adrci> show homes
adrci> set home diag/rdbms/irbis/irbis1
adrci> purge -age 60
       - Purge diagnostic data older than <mins> from the ADR home
Or
adrci> purge -size 10485760000 - Purge diagnostic data from the ADR home until the size of the home reaches <bytes> bytes (approx 10G).

Adrci can remove any number of files without annoing "/bin/rm: Argument list too long" message.
Also this program will work after your terminal window is accidentally closed (or network failure).
But adrci is command from Oracle Home and it can work with Oracle trace files only.

Find example:
use find and -mtime option:
# date; find /u01/app -name *aud -mtime +30 -type f -delete
3rd way: rm. It is the least recommended way because you should to use rm to delete closed files only.  Don't use rm to remove files opened by any process. Test files with fuser command before removing.
It's very easy to make a mistake using rm, so use adrci or find if possible.


2.

If the previous step found many free inodes (ensured there are no obstacles to create a file)
then we need to investigate free space in file system:
# date; df -h

We need to understand how many free space has interestiong file system.
If there is no free space ( Size = Used, Use% = 100% ), then we need to delete some files.

Start analyze biggest directories (by sum of file size ):
# date; du -m /u01/app/|sort -rn |less 

Usually i choose the 1st biggest directory and delete files in it.
Then i choose next biggest directory and so on ... until i have enough space.

Usually i use 2 command to navigate through the catalog tree :
# du -sm * | sort -rn  - to understand which sub-directory is biggest
and
# cd  some_dir - to go to this directory

It may be useful to quickly find big files in your file system:
#  find /u01 -size +50M
Don't forget about -mtime option, it is good addition to point old files.


3.

If you've found enough number of free inodes & enough quantity of free space
but you still get "no space left on device" then this means that some process
has big opened file & this file was removed by rm command & but this process still running and keep this file opened.

Hint:
If the size of big file should be set to zero, then use > command (not rm this file) :

[oracle@ed04dbadm01 log]$ cd /u01/app/oracle/diag/rdbms/killme122/km1221/trace/
[oracle@ed04dbadm01 trace]$ ls -l alert_km1221.log
-rw-r----- 1 oracle asmadmin 430376 Mar 20 08:00 alert_km1221.log
[oracle@ed04dbadm01 trace]$ > alert_km1221.log
[oracle@ed04dbadm01 trace]$ ls -l alert_km1221.log
-rw-r----- 1 oracle asmadmin 0 Mar 20 11:11 alert_km1221.log


If you use rm to delete big files then you will get unexplained loss of disk space.

To know which files are opened use lsof command (list of open files).
It shows all open files for all processes in system, PIDs and names of processes.
Its output produce many lines on the screen so i use lsof | less .

Analyse open files - is difficult case, but you can solve this problem easy and quickly if it is possible
- to kill process[es] (kill -9) which have opened files in our file system (# lsof | grep /u01/app )
  or
- to restart or shutdown process[es] which have opened files in our file system (# lsof | grep /u01/app )
  or
- to restart OS (operation system or server).

After this you will see free space in file system.

4.
If you were not helped by previous recommendations then take new disk and extend your file system ;)
It may be not a joke.
If you inspect all your files and found all files as necessary (no extra files and no free space)
then it is become a time to grow this file system.

Good luck !

Saturday, August 1, 2015

Monday, November 17, 2014

dcli shows nothing or shows error

I wanted to look list alerthistory from DB node across all cells in Exadata quarter rack:

[DB01]# dcli -l root -g cell_group cellcli -e list alerthistory

It works, but it gives too many rows on the screen, so i decided to cut out some old messages.

I connected to cell and picked the right syntax. As we know the each cellcli command has some fields and i decided to use beginTime as filter:

CellCLI> help list alerthistory

  Usage: LIST ALERTHISTORY [<name> | <filters>] [<attribute_list>] [DETAIL]

  Purpose: Displays specified attributes for alerts.

  Arguments:
    <name>:  The id of the alert to be displayed.
    <filters>:  an expression which determines which alerts should
                be displayed.
    <attribute_list>: The attributes that are to be displayed.
                      ATTRIBUTES {ALL | attr1 [, attr2]... }

  Options:
    [DETAIL]: Formats the display as an attribute on each line, with
              an attribute descriptor preceding each value.

 
[CELL01]# cellcli -e list alerthistory detail
     name:                   6_1
     alertDescription:       "A power supply component ..."
     alertMessage:           "A power supply component ..."
     alertSequenceID:        6
     alertShortName:         Hardware
     alertType:              Stateful
     beginTime:              2014-10-15T11:07:33+04:00
     endTime:                2014-10-15T12:59:11+04:00
     examinedBy:           
     metricObjectName:       /SYS/PS1_FAULT
     notificationState:      1
     sequenceBeginTime:      2014-10-15T11:07:33+04:00
     severity:               critical
     alertAction:            "For additional information ..."


CellCLI> list alerthistory where beginTime > 2014-10-11T11:22:52+04:00
                                                  ^
CELL-01504: Invalid command syntax.

And the final command for the cellcli was :

CellCLI> list alerthistory where beginTime > '2014-10-11T11:22:52+04:00'
 

     6_1     2014-10-15T11:07:33+04:00     critical     "A power supply ... "
     6_2     2014-10-15T12:59:11+04:00     clear        "A power supply ..."
     7_1     2014-10-17T03:39:38+04:00     info         "The HDD disk controller is ..."
     7_2     2014-10-17T03:39:41+04:00     clear        "All disk drives are in WriteBack ..."

CellCLI>


But from bash command line this command showed nothing! :

[CELL01]# cellcli -e list alerthistory where beginTime > '2014-10-11T11:22:52+04:00'
[CELL01]# cellcli

Becaus the ">" sign works as redirection to file and created the file on the cell  (many files - are my testing runs):

[CELL01]# ls -l
-rw-r--r-- 1 root root        0 Aug  1 10:16 00
-rw-r--r-- 1 root root       36 Nov 17 10:16 2014-09-15T03:39:41+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:27 '2014-10-11T11:22:52+04:00'
-rw-r--r-- 1 root root       36 Nov 17 10:28 "2014-10-11T11:22:52+04:00"
-rw-r--r-- 1 root root       36 Nov 17 10:28 2014-10-11T11:22:52+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-10-15
-rw-r--r-- 1 root root       36 Nov 17 10:15 2014-10-15T03:39:38+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:16 2014-10-15T03:39:41+04:00
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-01
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-13
-rw-r--r-- 1 root root       36 Nov 17 10:14 2014-11-14
-rw-r--r-- 1 root root       36 Nov 17 10:13 2014-11-15
-rw-r--r-- 1 root root     1480 Aug  1 10:14 CmdTool.log
-rw-r--r-- 1 root root 10485760 Apr 30  2014 $device
-rw-r--r-- 1 root root   576836 Aug  1 10:14 MegaSAS.log

Obviously, we need to use bash shields ' and ":

# cellcli -e list alerthistory where beginTime \> '2014-10-11T11:22:52+04:00'
CELL-01504: Invalid command syntax.

Let look to 





Chapter 9 :




And the final working command is

[DB01]# dcli -l root -g cell_group "cellcli -e list alerthistory where beginTime \> \'2014-10-16T11:00:00+04:00\'"

exa1cel01-priv1: 7_1     2014-10-17T03:39:38+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4286  Battery Type          : ibbu08  Battery Temperature   : 28 C  Full Charge Capacity  : 1329 mAh  Relative Charge       : 100 %  Ambient Temperature   : 21 C"
exa1cel01-priv1: 7_2     2014-10-17T03:39:41+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4286  Battery Type          : ibbu08  Battery Temperature   : 28 C  Full Charge Capactiy  : 1329 mAh  Relative Charge       : 100 %  Ambient Temperature   : 21 C"
exa1cel02-priv1: 7_1     2014-10-17T03:46:30+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4218  Battery Type          : ibbu08  Battery Temperature   : 30 C  Full Charge Capacity  : 1321 mAh  Relative Charge       : 99 %  Ambient Temperature   : 21 C"
exa1cel02-priv1: 7_2     2014-10-17T03:46:33+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4218  Battery Type          : ibbu08  Battery Temperature   : 30 C  Full Charge Capactiy  : 1321 mAh  Relative Charge       : 99 %  Ambient Temperature   : 21 C"
exa1cel03-priv1: 7_1     2014-10-17T04:00:47+04:00     info      "The HDD disk controller battery is performing a learn cycle. Battery Serial Number : 4546  Battery Type          : ibbu08  Battery Temperature   : 32 C  Full Charge Capacity  : 1347 mAh  Relative Charge       : 97 %  Ambient Temperature   : 22 C"
exa1cel03-priv1: 7_2     2014-10-17T04:00:50+04:00     clear     "All disk drives are in WriteBack caching mode.  Battery Serial Number : 4546  Battery Type          : ibbu08  Battery Temperature   : 32 C  Full Charge Capactiy  : 1347 mAh  Relative Charge       : 97 %  Ambient Temperature   : 22 C"


# ocrconfig -add +DATA PROT-30: The Oracle Cluster Registry location to be added is not usable. PROC-50: The Oracle Cluster Registry locatio...