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