Quickly resolve error initializing Sql*plus errors

Source: Internet
Author: User

Recently, I often encountered the use of sqlplus in the background to run SQL scripts, and then encountered the error initializing sql*plus errors.

I am running the PL/SQL file Test.sql as follows

Set Serveroutput on;set timing On;declarebegin  dbms_output.put_line (To_char (sysdate, ' Yyyy-mm-dd HH24:MI:SS ')); END;

The file system of the disk on which the home folder is run by the SQL file is Ext4. For file types, you can confirm by viewing the/etc/fstab file.


The commands for running SQL files in the background are as follows

Nohup sqlplus iqm_blk/[email protected] @test. sql > Test.out 2>&1 &


I'm here to summarize the main reasons for the mistake.

    • Test.sql file End: Cannot have blank lines after
    • Test.sql file end: After, need to join/
    • Need to add exit to/after; Command. When the exit is added, the empty line is OK.

The script that can be executed correctly is as follows

Set Serveroutput on;set timing On;declarebegin  dbms_output.put_line (To_char (sysdate, ' Yyyy-mm-dd HH24:MI:SS ')); End;/exit;

Hope to be of help to everyone.

Quickly resolve error initializing Sql*plus errors

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.