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

Source: Internet
Author: User
Tags sqlplus

"In the sqlplus operation, very often we want to write our own SQL statements and change 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 above, Keywordspool is the place where you want to save all the actions you want to do next and what format you want to save.

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

You are not going to operate on the database again. Or when you're about to close the Sqlplusclient tool. When you close the 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 Sqlplus's command and can only be used in Sqlplus.

"About spool settings-Frequently used"

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 of the Oracle version number, does not hold, when the case processing}

Set COLSEP ";

ps:{output Field Delimiter}

Set echo off;

ps:{displays each command in the start script, and silently feels on}

Set feedback off;

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

Set heading off;

ps:{the output field header. Default feel on}

Set Linesize 80;

ps {Outputs the number of characters per line.} Default Feel 80}

Set trimout on;

ps:{Remove trailing spaces per line of standard output, default feel off}

Set Termout off;

ps:{Show running results of commands in script}

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

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.