How to save all your actions and results records to the file you specified in Sqlplus

Source: Internet
Author: User
Tags sqlplus

"In the sqlplus operation, many times we want to write our own SQL statements and modify log or result information to record"

"First" must be properly connected to the Oralce database.

and then

After you log in to the Oralce database with the user you specified, in the Sqlplus workspace

Sql>spool D:\oracle.txt;
As on the command, the keyword spool after you want to save all the actions you want to do next and what format you want to save.

............

When you are not going to operate on the database again, or if you intend to close the Sqlplus client tool, close spool and then in the path you just set, you will see the file record you want to save.

Sql>spool D:\oracle.txt;

"About Spool command"

Spool is a sqlplus command that can only be used in Sqlplus.

"About spool settings--common"

Set pagesize 0;

ps:{output the number of pages per line, the default value is 0, in order to avoid paging can be set to 0, but in some Oracle version, does not hold, and when the case processing}

Set COLSEP ";

ps:{output Field Delimiter}

Set echo off;

ps:{displays each command in the start script, which defaults to on}

Set feedback off;

ps:{echo the number of record bars processed by this SQL command, default is on}

Set heading off;

ps:{output domain header, default to On}

Set Linesize 80;

ps {Output the number of characters per line, default is 80}

Set trimout on;

ps:{Remove trailing spaces per line of standard output, default to OFF}

Set Termout off;

ps:{Show execution results of commands in script}

How to save all your actions and results records to the file you specified in Sqlplus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.