Oracle uses shell scripting to link databases

Source: Internet
Author: User
zabbix#vi/opt/script/conf/config.sh
name_pw= ' Username/password '
Export NAME_PW
zabbix#vi/opt/script/logger.sh

#!/bin/bash
. /opt/script/conf/config.sh
Export Oracle_sid=oracle1 #数据库实例名
Export oracle_home=/oracle/procduct/9.2
Su oracle-c "${oracle_home}/bin/sqlplus-s/nolog" <<eof
SET FEEDBACK OFF;
SET ECHO OFF;
CONN $NAME _PW
Insert into Table_test (id,date.messages) VALUES (' $! ', Sysdate, ' $ $ ') #向表table_test中插入数据
Commit
Exit
Eof

zabbix#sh/opt/script/logger.sh 1,test# writing data to the database

Oracle uses shell scripting to link databases

Related Article

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.