Spool File In SQL*PLUS in Multiple Small Files ? (Doc ID 2152654.1) | 编辑To Bottom |
In this Document
APPLIES TO:Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.2 [Release 10.2 to 12.1]Oracle Database Cloud Schema Service - Version N/A and later Oracle Database Exadata Cloud Machine - Version N/A and later Oracle Cloud Infrastructure - Database Service - Version N/A and later Oracle Database Backup Service - Version N/A and later Information in this document applies to any platform. GOALWe have an Unix environment with file size limitation (2GB), and we have a routine shell script that generates a large spool file. SOLUTIONThere is no option to limit size in spool command as below: SQL> help spool SPOOL SPO[OL] [file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT] However you can use below Unix Split and mknod command to split the spool file. cd /tmp SQL> spool tmp/spool.txt You will get multiple spool files with maxsize 2000m and name as xaa xab xac xad and so on at /tmp location. SQL> ! prw-r--r-- 1 grdbms grdbms 0 Jun 24 18:48 spool.txt |