当前位置: 首页 > news >正文

spool 管道 小文件 mknod

Spool File In SQL*PLUS in Multiple Small Files ? (Doc ID 2152654.1)​编辑To Bottom


In this Document

Goal
Solution

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.

GOAL

We have an Unix environment with file size limitation (2GB), and we have a routine shell script that generates a large spool file.

We would like to know if it´s possible to split this big spool file in many small files of 2GB max size during the generating of spool file.

 

SOLUTION

There is no option to limit size in spool command as below:

SQL> help spool

SPOOL
-----
Stores query results in a file, or optionally sends the file to a printer.

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
rm spool.txt
mknod spool.txt p
split -b2000m </tmp/spool.txt &
sqlplus / as sysdba

SQL> spool tmp/spool.txt
OR
SQL>@<any script>.sql #put the spool file path as /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> !
[xxx]/grdbms/home> cd /tmp
[xxx]/tmp> ls -ltr x*

prw-r--r-- 1 grdbms grdbms 0 Jun 24 18:48 spool.txt
-rw-r--r-- 1 grdbms grdbms 1003249664 Jun 24 18:48 xaa

http://www.dtcms.com/a/10814.html

相关文章:

  • OPPO高级项目经理曹帆受邀为第十三届中国PMO大会演讲嘉宾
  • liunx查看日志
  • 什么叫防御式编程
  • 【最新鸿蒙应用开发】——ArkUI两种开发范式
  • 28.找零
  • C语言每日一题——分数加减(以最简形式输出)
  • Python中的迭代器是什么
  • 高考分数查询结果自动推送至微信(卷II)
  • 小程序真题合集
  • 29、matlab算数运算汇总2:加、减、乘、除、幂、四舍五入
  • 欢乐打地鼠小游戏html源码
  • leetcode刷题记录34-100297. 找到连续赢 K 场比赛的第一位玩家
  • LeetCode 算法:轮转数组c++
  • selenium-java自动化教程
  • Linux基础指令(一)
  • 主成分分析学习
  • 【嵌入式】波特率9600,发送8个字节需要多少时间,如何计算?
  • 国标GB/T 28181详解:校时流程详细说明
  • ChatGPT-4o体验demo
  • 泛微开发修炼之旅--13通过Ecology拦截器(注解的方式),拦截后端接口,实现接口执行成功后或执行前操作源码示例
  • COMPUTEX 2024 国际电脑展即将举行,英伟达宣布将Copilot+引入RTX系列设备,赋能游戏本AI助理
  • Websocket前端传参:深度解析与实战应用
  • 论文浅尝 | THINK-ON-GRAPH:基于知识图谱的深层次且可靠的大语言模型推理方法...
  • 著名AI人工智能社会学家唐兴通谈数字社会学网络社会学主要矛盾与数字空间社会网络社会的基本议题与全球海外最新热点与关注社会结构社会分工数字财富数字游民数字经济
  • Redis是单线程的,但是为什么还那么快?
  • Java 泛型类,泛型方法,泛型接口和通配符(用来限定类和方法的使用范围)
  • 用c#开发在linux环境下运行的程序
  • Flink窗口理论到实践
  • Go语言的GoFly快速开发框架已经支持Postgresql和Mysql两种数据库
  • L48---1637. 两点之间不包含任何点的最宽垂直区域(排序)---Java版