Pages

Sunday, August 20, 2017

expdp process generates trace file with error ORA-31673

=========================
General
=========================
Oracle expdp process completes successfully, but upon completion, <pid>_dw01*.trc trace file is generated.

=========================
Evidences
=========================
Trace file contains following text:

Trace file /software/oracle/diag/rdbms/igt/igt/trace/igt_dw01_32631.trc
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
ORACLE_HOME = /software/oracle/111
System name:    Linux
Node name:      aut-mob-5-aps-1
Release:        2.6.18-194.el5
Version:        #1 SMP Tue Mar 16 21:52:39 EDT 2010
Machine:        x86_64
Instance name: igt
Redo thread mounted by this instance: 1
Oracle process number: 458
Unix process pid: 32631, image: oracle@aut-mob-5-aps-1 (DW01)


*** 2017-08-20 02:01:09.514
*** SESSION ID:(268.30456) 2017-08-20 02:01:09.514
*** CLIENT ID:() 2017-08-20 02:01:09.514
*** SERVICE NAME:(SYS$USERS) 2017-08-20 02:01:09.514
*** MODULE NAME:(Data Pump Worker) 2017-08-20 02:01:09.514
*** ACTION NAME:(SYS_EXPORT_FULL_01) 2017-08-20 02:01:09.514

DM-DBMS_DM_MODEL_EXP:schema_callout: schema=SYSTEM, pre_schema=NOOP for 11g

*** 2017-08-20 02:01:09.514
DM-DBMS_DM_MODEL_EXP:schema_callout: schema=OUTLN, pre_schema=NOOP for 11g

*** 2017-08-20 02:01:09.514
DM-DBMS_DM_MODEL_EXP:schema_callout: schema=TSMSYS, pre_schema=NOOP for 11g

*** 2017-08-20 02:01:09.515
DM-DBMS_DM_MODEL_EXP:schema_callout: schema=SHDAEMON, pre_schema=NOOP for 11g



*** 2017-08-20 02:14:43.329
DM-DBMS_DM_MODEL_EXP:schema_callout: schema=HRV_VIPNE_OVMDQ, pre_schema=NOOP for
 11g

*** 2017-08-20 02:18:53.785
KUPP: Error 31673 detected in worker process DW01, worker id=1
OPIRIP: Uncaught error 447. Error stack:
ORA-00447: fatal error in background process
ORA-31673: worker process interrupt for normal exit by master process
ORA-06512: at "SYS.KUPF$FILE_INT", line 972
ORA-06512: at "SYS.KUPF$FILE", line 7126
ORA-06512: at "SYS.KUPW$WORKER", line 4661
ORA-06512: at "SYS.KUPW$WORKER", line 8624
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_SQL", line 1575
ORA-06512: at "SYS.KUPW$WORKER", line 8342
ORA-06512: at "SYS.KUPW$WORKER", line 1545
ORA-06512: at line 2


=========================
Solution
=========================


This is a known issue, documented in Oracle technote:
 Data Pump Export Completed Successfully With Errors ORA-447 & ORA-31673 (Doc ID 1323792.1)

CAUSE
This is discussed in 
Bug 9962464 - ORA-447 AND ORA-31673 OCCURS IN THE WORKER PROCESS WHEN EXPDP IS EXECUTED.
which has been closed with status 33 - Suspended, Req'd Info not Avail

SOLUTION
Ignore the error as the export has already completed and so this is just an unnecessary trace file being generated on exit of the Data Pump Worker process and so has no impact on the database or export. 

In case you would run into the same issue, you could provide a working test case to restart to bug investigation.

=========================
Workaround
=========================

To avoid trace file occupied space, delete *.trc files with below crontab task


delete_expdp_trace_files.sh
#!/bin/bash

HOME_DIR=/software/oracle/diag/rdbms/igt/igt/trace
WORK_DIR=`pwd`
cd ${HOME_DIR}
ls -lt ${HOME_DIR} | grep dw01 | grep trc | awk '{print $9}' | xargs grep -l 00447 | xargs rm -f
cd $WORK_DIR

crontab -l

0 6 * * * /software/oracle/oracle/scripts/delete_expdp_trace_files.sh


=========================
A Similar Issue:

=========================
1956899.1
Lots of Trace Files Reporting "Kcbzib: Dump Suspect Buffer, Err2=1410" 

As a temporary workaround, you can simply delete the files as these should not have been generated for the non-user-visible errors in the first place.

Oracle hidden parameters

=========================
General
=========================
Oracle has more than 2000 hidden parameters.
There parameters have a '_' prefix.
They cannot be viewed via V$PARAMETER
Instead one can use the SQL below, to query X$KSPPI table.

=========================
Short reference
=========================

oracle@my_server:~>%sqlplus / as sysdba
SQL*Plus: Release 11.1.0.7.0 - Production on Sun Aug 20 08:52:10 2017

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> SELECT name, value from V$PARAMETER WHERE name = '_disable_streams_pool_auto_tuning';

no rows selected

SELECT KSPPI.ksppinm PARAM ,
       KSPPCV.ksppstvl session_val ,
       KSPPSV.ksppstvl instance_val,
       KSPPI.ksppdesc description
FROM   X$KSPPI KSPPI,
       X$KSPPCV KSPPCV ,
       X$KSPPSV KSPPSV
WHERE  KSPPI.indx = KSPPCV.indx 
  AND  KSPPI.indx = KSPPSV.indx 
  AND  KSPPI.ksppinm LIKE '/_%' escape '/' 
  AND  KSPPI.ksppinm = '_disable_streams_pool_auto_tuning';

PARAM                              SESSION_VAL INSTANCE_VAL DESCRIPTION
---------------------------------- ----------- ------------ --------------------------------

_disable_streams_pool_auto_tuning  FALSE       FALSE        disable streams pool auto tuning

There are more than 2000 hidden parameters.

SQL> SELECT COUNT(*) FROM x$ksppi;
  COUNT(*)
----------
      2049

  

Thursday, August 17, 2017

Many trc files with message "KGX cleanup..." filling up disk space to 100%

=========================
General
=========================
Oracle version is 11.1.0.7
In alert.log there are no error messages.
But the trace folder is filled up with many trc files, having same text at the end of trc file:

KGX cleanup...
KGX Atomic Operation Log 0x2570f7e70
 Mutex 0x25ba10558(207, 0) idn 2b2d96fb6306 oper EXCL
 Library Cache uid 207 efd 21 whr 102 slp 0
 oper=0 pt1=(nil) pt2=(nil) pt3=(nil)
 pt4=(nil) pt5=(nil) ub4=0


=========================
Evidences
=========================

ls /software/oracle/diag/rdbms/${ORA_INST}/${ORA_INST}/trace/*.trc | xargs grep -l "KGX cleanup" | wc -l
9207

These file are generated frequently, with no apparent pattern:
-rw-r----- 1 oracle dba 2564096 Aug 17 15:45 igt_ora_7505.trc
-rw-r----- 1 oracle dba 1286144 Aug 17 15:50 igt_ora_4501.trc
-rw-r----- 1 oracle dba 1282048 Aug 17 15:50 igt_ora_5670.trc
-rw-r----- 1 oracle dba 1282048 Aug 17 15:52 igt_ora_7665.trc
-rw-r----- 1 oracle dba 1282048 Aug 17 16:01 igt_ora_9603.trc
-rw-r----- 1 oracle dba 2564096 Aug 17 16:05 igt_ora_465.trc
-rw-r----- 1 oracle dba 1280197 Aug 17 16:15 igt_ora_9351.trc
-rw-r----- 1 oracle dba 1280226 Aug 17 16:16 igt_ora_5427.trc
-rw-r----- 1 oracle dba 1280196 Aug 17 16:16 igt_ora_5794.trc
-rw-r----- 1 oracle dba 1280196 Aug 17 16:17 igt_ora_9574.trc
-rw-r----- 1 oracle dba 2560452 Aug 17 16:17 igt_ora_9579.trc
-rw-r----- 1 oracle dba 2560424 Aug 17 16:18 igt_ora_9848.trc
-rw-r----- 1 oracle dba 1280226 Aug 17 16:23 igt_ora_6918.trc
-rw-r----- 1 oracle dba 2560392 Aug 17 16:25 igt_ora_9280.trc
-rw-r----- 1 oracle dba 2560423 Aug 17 16:26 igt_ora_9282.trc

=========================
Oracle Documentation
=========================
Per oracle technote:

 Bug 6638558 - KGX cleanup trace files produced (Doc ID 6638558.8)

bug 6638558  KGX cleanup trace files produced
Range of versions believed to be affected Versions BELOW 11.2
This issue is fixed in 11.2.0.1 (Base Release)

KGX cleanup trace files containing shared examine mutexes
may be generated when a parse-related error occurs.
Trace files may be generated containing text of the form:
  KGX cleanup...
  KGX Atomic Operation Log c00000010de2cf90
   Mutex c0000000c0c17290(1006, 0) idn 0 oper EXAM
   Cursor Parent uid 1006 efd 5 whr 26 slp 0
   oper=DEFAULT pt1=c00000009b720b00 pt2=c00000009b720ce8 pt3=c00000009b721208
   pt4=0000000000000000 u41=0 stt=0
  *** 2007-11-14 16:19:19.645
  KGX cleanup...
  KGX Atomic Operation Log c00000010de2cf90
   Mutex c0000000c0c17290(1006, 0) idn 0 oper EXAM
   Cursor Parent uid 1006 efd 5 whr 26 slp 0
   oper=DEFAULT pt1=c000000072c5fe30 pt2=c000000072c5fe98 pt3=0000000000000000
   pt4=0000000000000000 u41=0 stt=0
Workaround
  Correct the cause of any parse-related error.
 or
  Ignore the trace entries as these are due to the code unnecessarily 
  logging its cleanup operation.


=========================
Solution
=========================
Create a crontab task to execute script, that will delete *.trc files with text "KGX cleanup"

The script to delete trace files:

less delete_trace_files.sh 
#!/bin/bash

export ORA_INST=igt
BASENAME=`basename $0`
LOG_FILE=`echo $BASENAME | sed s/.sh/.log/`
HOME_DIR=/software/oracle/oracle/scripts
echo Log File: ${LOG_FILE}
cd $HOME_DIR

./write_log.sh $0
echo "About to Delete these Files:" >> $LOG_FILE

ls /software/oracle/diag/rdbms/${ORA_INST}/${ORA_INST}/trace/*.trc | xargs grep -l "KGX cleanup" | xargs ls -ltr >> ./${LOG_FILE}
ls /software/oracle/diag/rdbms/${ORA_INST}/${ORA_INST}/trace/*.trc | xargs grep -l "KGX cleanup" | xargs rm -f

less write_log.sh 
#!/bin/bash

PROGRAM_NAME=$1
WORKDIR=/software/oracle/oracle/scripts
cd ${WORKDIR}
RUN_DATE=`date +"%Y%m%d_%H%M%S"`
DELIMITER="============================================="
BASENAME=`basename $PROGRAM_NAME`
LOG_FILE=`echo $BASENAME | sed s/.sh/.log/`

touch $LOG_FILE
echo $DELIMITER >> $LOG_FILE
echo "Running $PROGRAM_NAME at $RUN_DATE" >>  $LOG_FILE
echo $DELIMITER >> $LOG_FILE


exit 0


The crontab entry
2 * * * * /software/oracle/oracle/scripts/delete_kgx_cleanup_trace_files.sh

Monday, July 17, 2017

Code Example: batch, sqlplus

=========================
General
=========================
Code example
Overall - read data from Database
Generate files using oracle UTL_FILE
FTP files from oracle server to customer serer
Update records in Database

The main is main_send_files.bat

=========================
Code
=========================

=======================================
main_send_files.bat
=======================================

REM set Paths
SET HOME_DIR=D:\CUST_APU_Reports\Files
SET OLD_DIR=D:\CUST_APU_Reports\OldFiles

REM Delete old temp file
IF EXIST DELnewCMD.ini DEL DELnewCMD.ini
IF EXIST del_files.txt DEL del_files.txt
IF EXIST sftp_output.log DEL sftp_output.log 

REM get date
for /f "tokens=2,3,4 delims=/ " %%i in ('date/t') do (set mm=%%i) & (set dd=%%j) & (set yyyy=%%k)
set RUN_DATE=%yyyy%%mm%%dd%

REM Override default Time
REM SET RUN_DATE='20170714'

echo %RUN_DATE% >> cust_log.txt

for /f "tokens=1,2 delims=: " %%i in ('time /t') do (set hh=%%i) & (set mm=%%j)
REM get time
set RUN_TIME=%hh%:%mm%
echo %RUN_TIME% >> cust_log.txt

echo #### >> cust_log.txt
echo Activate database package >> cust_log.txt
echo #### >> cust_log.txt
sqlplus user/pass@oraint @activate_report_new.sql %RUN_DATE%
IF NOT ERRORLEVEL 0 goto :ERROR_DB

:BRING_THE_FILES
echo before FTP >> cust_log.txt
CALL SFTPCMD2 > sftp_output.log 
type sftp_output.log >> cust_log.txt
echo Finished FTP successfully >> cust_log.txt

dir /B D:\cust_APU_Reports\Files\output*.csv /O:d >> del_files.txt
echo cd /software/oracle/admin/igt/utl_file >> DELNEWCMD.ini
for /F %%i in (del_files.txt) do (@echo rm %%i) >> delnewcmd.ini
echo bye >> DELnewCMD.ini
CALL SFTPCMD3 > sftp_output.log 
type sftp_output.log >> cust_log.txt
if NOT ERRORLEVEL 0 GOTO :ERROR_DELETING

echo send the files by sftp to the customer (10.92.40.20)>> cust_log.txt
CALL SFTPCMD SFTPCMD.ini > sftp_output.log 
type sftp_output.log >> cust_log.txt

REM echo send the files by sftp to the customer >> cust_log.txt
REM CALL SFTPCMD4 SFTPCMD4.ini > sftp_output.log 
REM type sftp_output.log >> cust_log.txt

IF NOT ERRORLEVEL 0 GOTO :ERROR_SFTP
echo Rename the sent CSV files to old directory >> cust_log.txt
for /F  %%i in (del_files.txt) do (move %HOME_DIR%\%%i %OLD_DIR%\%%i)
IF NOT ERRORLEVEL 0 GOTO :ERROR_RENAME
echo process finish succefully >> cust_log.txt
goto FINISH
:ERROR_DB
 echo Error in the DAILY_REPORTS package. >> cust_log.txt
REM REM send mail
:ERROR_DELETING
 echo Errors deleting from the cgw! >> cust_log.txt
REM REM send mail
 goto FINISH
:ERROR_SFTP
 echo Errors SFTP the files to CUST >> cust_log.txt
REM REM send mail
 goto FINISH
:ERROR_RENAME
 echo Error moving the files to the oldDir directory >> cust_log.txt
REM send mail
 goto FINISH
:FINISH

=======================================
SFTPCMD.bat
=======================================
sftp -b SFTPCMD.ini user@10.10.10.10

SFTPCMD.ini
lcd D:\CUST_APU_Reports\Files
cd ../VHE
mput CUST_APU*.csv
bye

=======================================
SFTPCMD2.bat
=======================================
sftp -b DWHNEWCMD.ini user@20.20.20.20

dwhnewcmd.ini
lcd D:\CUST_APU_Reports\Files
cd /software/oracle/admin/igt/utl_file
mget output*.csv
bye


=======================================
SFTPCMD3.bat
=======================================
sftp -b DELnewCMD.ini user@30.30.30.30


DELNEWCMD.ini
cd /software/oracle/admin/igt/utl_file 
rm CUST_APU_BHCA_20170716.csv
rm CUST_APU_BHSM_20170716.csv
bye  

=======================================
activate_report_new.sql
=======================================
exec DAILY_REPORTS.CUST_MAIN(&1);
exit;

Tuesday, July 11, 2017

UTL_MAIL error: utl_mail must be declared

=================================
General
=================================
Below error is coming when executing procedure inside UTL_MAIL package:
UTL_MAIL error: utl_mail must be declared

Most likely, the permissions are missing

=================================
UTL_MAIL
=================================
SELECT owner, object_name, object_type 
FROM DBA_OBJECTS 
WHERE object_name = 'UTL_MAIL';

OWNER      OBJECT_NAME                    OBJECT_TYPE
---------- ------------------------------ --------------------
SYS        UTL_MAIL                       PACKAGE BODY
SYS        UTL_MAIL                       PACKAGE
PUBLIC     UTL_MAIL                       SYNONYM

connect as sysdba, and grant missing permission to users:

 sqlplus / as sysdba

SQL> GRANT EXECUTE ON UTL_MAIL TO NEW_USER;

Grant succeeded.

=================================
UTL_MAIL permissions 
=================================
Current status:
SELECT * FROM DBA_TAB_PRIVS WHERE owner = 'SYS' AND table_name LIKE '%MAIL%'


GRANTEE             OWNER      TABLE_NAME        GRANTOR    PRIVILEGE  GRANTABLE HIERARCHY
------------------- ---------- ----------------- ---------- ---------- --------- --
PUBLIC              SYS        UTL_MAIL_INTERNAL SYS        EXECUTE    NO        NO
VIPCREATOR          SYS        UTL_MAIL          SYS        EXECUTE    YES       NO
GBR_VIRGI_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
NGA_MTNNG_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
RWA_TIGOR_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
BGR_MOBIL_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
GNB_MTNGN_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
GHA_TIGOG_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
BFA_TELEC_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
BWA_BTCQQ_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
COG_MTNCO_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
COD_TIGOC_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
GNQ_HITSE_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
COG_AIRTE_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
LBR_LONES_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
MWI_AIRTE_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
KOR_LGTEL_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
BEN_MOOVB_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
BEN_MTNBE_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO
COL_ETBCO_XXXXX     SYS        UTL_MAIL          VIPCREATOR EXECUTE    NO        NO

Generate SQL command to grant this permission to all user who do not have it

SELECT 'GRANT EXECUTE ON UTL_MAIL TO '|| username||';' FROM (
SELECT username as username FROM all_users
MINUS
SELECT grantee as username FROM DBA_TAB_PRIVS 
 WHERE owner = 'SYS' AND table_name LIKE '%MAIL%'
)


GRANT EXECUTE ON UTL_MAIL TO AUT_THREE_XXXXX;
GRANT EXECUTE ON UTL_MAIL TO AUT_THREE_XXXXX;
GRANT EXECUTE ON UTL_MAIL TO AUT_THREE_XXXXX;
GRANT EXECUTE ON UTL_MAIL TO AUT_THREE_XXXXX;
GRANT EXECUTE ON UTL_MAIL TO BDI_ECONE_XXXXX;
GRANT EXECUTE ON UTL_MAIL TO BDI_ECONE_XXXXX;

Sunday, July 9, 2017

Space usage, in Database, In Linux

=========================
General
=========================
Useful way to find space usage + add more space in Database and in Linux

=========================
Database
=========================

Tablespace
SET LINESIZE 120
SET PAGESIZE 200

SELECT TABLESPACE_NAME, 
 (MAX(MAX_SPACE)-MAX(USED_SPACE)  )AS DBA_FREE_SPACE_MB,                                   
 MAX(USED_SPACE) AS USED_SPACE_MB, 
 MAX(MAX_SPACE) AS MAX_SPACE_MB, 
 ROUND(( (MAX(MAX_SPACE)-MAX(USED_SPACE)  ) /MAX(MAX_SPACE) ) *100) as FREE_PCT, 
 CASE WHEN (ROUND(( (MAX(MAX_SPACE)-MAX(USED_SPACE)  ) /MAX(MAX_SPACE) ) *100)<15)  THEN 'Y' ELSE 'N' END AS ADD_MORE_SPACE 
FROM ( 
SELECT tablespace_name,  
  ROUND(SUM(bytes)/1024/2014) AS FREE_SPACE, 
  0 AS MAX_SPACE, 
  0 AS USED_SPACE   
 FROM DBA_FREE_SPACE
 WHERE 1=1
   --AND tablespace_name LIKE '%IGT%' OR tablespace_name LIKE '%DWH%' OR tablespace_name LIKE '%REPORTS%' OR tablespace_name = 'SYSTEM'  OR tablespace_name = 'SYSAUX' 
 GROUP BY tablespace_name  
 UNION ALL 
 SELECT tablespace_name, 
  0 AS FREE_SPACE, 
  ROUND( SUM(CASE WHEN (bytes>maxbytes)  THEN bytes ELSE maxbytes END)/1024/1024) AS MAX_SPACE, 
     0 AS USED_SPACE 
 FROM DBA_DATA_FILES
  WHERE 1=1
   --AND tablespace_name LIKE '%IGT%' OR tablespace_name LIKE '%DWH%' OR tablespace_name LIKE '%REPORTS%' OR tablespace_name = 'SYSTEM'  OR tablespace_name = 'SYSAUX' 
 GROUP BY tablespace_name 
 UNION ALL 
 SELECT tablespace_name, 
     0 AS FREE_SPACE, 
     0 AS MAX_SPACE, 
     ROUND(SUM(bytes/1024/1024)) AS USED_SPACE 
  FROM DBA_SEGMENTS
 WHERE 1=1
   --AND tablespace_name LIKE '%IGT%' OR tablespace_name LIKE '%DWH%' OR tablespace_name LIKE '%REPORTS%' OR tablespace_name = 'SYSTEM'  OR tablespace_name = 'SYSAUX' 
GROUP BY tablespace_name 
) 
GROUP BY tablespace_name;

Segments
SET LINESIZE 120
SET PAGESIZE 200
COL tablespace_name FOR A30
COL owner FOR A30
COL segment_name FOR A30
COL USED_MB FOR 9999999999999


SELECT owner, tablespace_name, segment_name, USED_MB 
   FROM ( 
  SELECT owner, tablespace_name, segment_name, ROUND(SUM(bytes)/1024/1024)AS USED_MB FROM DBA_SEGMENTS
   WHERE tablespace_name LIKE '%TABLE%' 
  GROUP BY owner, tablespace_name,segment_name 
  ORDER BY ROUND(SUM(bytes)/1024/1024) DESC 
) WHERE ROWNUM < 11;


SELECT owner, tablespace_name, segment_name, USED_MB 
   FROM ( 
  SELECT owner, tablespace_name, segment_name, ROUND(SUM(bytes)/1024/1024)AS USED_MB FROM DBA_SEGMENTS
   WHERE tablespace_name LIKE '%INDEX%' 
  GROUP BY owner, tablespace_name,segment_name 
  ORDER BY ROUND(SUM(bytes)/1024/1024) DESC 
) WHERE ROWNUM < 11;


Datafiles
SET LINESIZE 140
SET PAGESIZE 200
COL tablespace_name FOR A30
COL file_name FOR A60
COL Mb FOR 9999999999999
COL MAX_MB FOR 9999999999999

SELECT tablespace_name, file_name, ROUND(bytes/1024/1024) AS Mb, ROUND(maxbytes/1024/1024) AS MAX_MB
  FROM DBA_DATA_FILES
ORDER BY tablespace_name, file_name;  


Add space
ALTER TABLESPACE IGT_TABLE ADD DATAFILE '/oracle_db/db1/db_igt/ora_igt_table_02.dbf' SIZE 1000M AUTOEXTEND ON MAXSIZE 10000M;

--Increase MAXSIZE
ALTER DATABASE DATAFILE '/oracle_db/db1/db_igt/ora_igt_index_01.dbf' AUTOEXTEND ON MAXSIZE 20000M;

--Resize
ALTER DATABASE DATAFILE '/oracle_db/db1/db_igt/ora_igt_index_01.dbf' RESIZE 20000M;

=========================
Linux
=========================

Get top files
find /software/oracle -type f -printf '%s %p\n'|sort -nr | head -10

Get top folders
du  -sh * |sort -nr | head -10

Add space
df -hP | grep oracle 
/dev/mapper/Volume00-LogVol07   7.8G  7.2G  194M  98% /software/oracle

cat /etc/fstab | grep LogVol07
/dev/Volume00/LogVol07  /software/oracle        ext3    defaults,acl        1 2

root@my_server:~>% vgs

  VG       #PV #LV #SN Attr   VSize   VFree 
  Volume00   1  17   0 wz--n- 135.75G 13.19G
  Volume01   1   1   0 wz--n- 136.70G 33.70G

lvextend -L +4G /dev/Volume00/LogVol07 && resize2fs /dev/Volume00/LogVol07
  Extending logical volume LogVol07 to 12.00 GB
  Logical volume LogVol07 successfully resized