{"id":194,"date":"2014-02-07T21:10:50","date_gmt":"2014-02-07T18:10:50","guid":{"rendered":"http:\/\/meekconsulting.com\/?p=194"},"modified":"2022-01-08T16:26:32","modified_gmt":"2022-01-08T13:26:32","slug":"oracle-spool-sql-to-file-with-on-the-fly-gzip-compression","status":"publish","type":"post","link":"https:\/\/meekconsulting.com\/?p=194","title":{"rendered":"Oracle  &#8211; spool sql to file with on the fly gzip compression"},"content":{"rendered":"<p>To run SQL dumps through gzip compression on the fly<\/p>\n<p>1) Create a named pipe to destination for the sql spool using this command:<\/p>\n<blockquote><p>\nmknod output.pipe p<\/p><\/blockquote>\n<p>2) run a process in the background to compress any data sent to the named pipe<\/p>\n<blockquote><p>\nnohup gzip -c < output.pipe > output.gz &<\/p><\/blockquote>\n<p>3) Set up your SQL to spool to the named pipe<\/p>\n<blockquote><p>\nset feedback off<br \/>\nset heading off<br \/>\nset pagesize 0<br \/>\nset linesize 2000<br \/>\nset space 0<br \/>\nset newpage 0<br \/>\nset verify off<br \/>\nset termout off<br \/>\nset echo off<br \/>\nset wrap off<br \/>\nset flush off<br \/>\nset trimspool on<br \/>\nspool \u2018output.pipe\u2019;<br \/>\nselect XXXX from XXXX<br \/>\nspool off;<br \/>\nexit;<\/p><\/blockquote>\n<p>4) Run the SQL and the output will be zipped up as it is created and put in the output.gz file\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To run SQL dumps through gzip compression on the fly 1) Create a named pipe to destination for the sql spool using this command: mknod output.pipe p 2) run a process in the background to compress any data sent to &hellip; <a href=\"https:\/\/meekconsulting.com\/?p=194\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/194"}],"collection":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":2,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}