Oracle Startup scripts.

Source: Internet
Author: User

. #!/bin/bashset-xsu-oracle >>eonlsnrctl Startsqlplus/nolog >>eofconn/as SysdbastartupexitEOFexitEON

We often use the <<eof redirect input in the shell script to input the command string we entered as an execution program, so that we do not need to manually enter the command in that program environment in order to automate the functions we need, such as:

[Plain]View Plaincopy
  1. Sqlplus EMSSXJK/EMSSXJK <<eof
  2. Select COUNT (*) from Sncn_yxyj where create_date like sysdate;
  3. Eof

The SQL statement is equivalent to the input in the Sqlplus program environment, so that the input content is sandwiched between two eof, can be long and short, EOF can also be replaced by any other character, case, as long as the pair appears, for example:

[Plain]View Plaincopy
  1. SQLPLUS&NBSP;EMSSXJK/EMSSXJK&NBSP;<<STD&NBSP;&NBSP;
  2. Select COUNT (*) from Sncn_yxyj where create_date like sysdate;
  3. STD

Of course , this iconic character cannot be reserved, the most commonly used or EOF.

Note that the first EOF must start with the redirect character <<, and the second EOF must be shelf written, otherwise it will be an error.

Let's look at an example of automatic ftp:

[Plain]View Plaincopy
  1. #ftp data to 10.178.37.244
  2. rq= ' Date +%y%m%d '
  3. Cd/data/product/song
  4. Ftp-i-N <<!
  5. Open 10.178.37.244
  6. User Oracle Post
  7. CD EMS
  8. Bin
  9. Put ${rq}.dat
  10. Bye
  11. !


Oracle Startup scripts.

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.