Calling Sqlplus using shell script and saving the sqlplus output in Logfile

Поделиться
HTML-код
  • Опубликовано: 30 янв 2025

Комментарии • 22

  • @nnreddy22
    @nnreddy22 5 лет назад +1

    Can you please make a video on how to check database connectivity test for multiple database in a server.

  • @somnathbose7455
    @somnathbose7455 2 года назад

    can we run multiple sql statements inside a single sqlplus -s command ? or for each statement we need to relogin into the db ?

  • @ramtaur7446
    @ramtaur7446 5 лет назад +1

    Can I use bind variable in shell script?
    if yes,how to use bind variable in shell script?

  • @learnomate
    @learnomate  6 лет назад

    Connect with me for oracle dba training.
    Email: ankush.thavali@gmail.com
    Mob no: +91 9960262955
    Website: www.orcldata.com

  • @Rakesh-nm2op
    @Rakesh-nm2op 3 года назад +1

    Thanku v mch :)

  • @Sidhukoushik
    @Sidhukoushik 4 года назад

    If remove -s from sqlplus command the log file also displays select query. I don't want to use -s and also don't want to display select query. How can I do that?

  • @srinivasua5798
    @srinivasua5798 2 года назад

    How to modify the shall script

  • @ShubhamRai06
    @ShubhamRai06 3 года назад

    how to connect to teradata database and run sql query from unix.

  • @rajesha7184
    @rajesha7184 5 лет назад +1

    How to pass input from Unix shell script to .sql

    • @learnomate
      @learnomate  5 лет назад

      You can define your variable in Unix script and then call to that variable inside SQL script.

    • @rajesha7184
      @rajesha7184 5 лет назад

      @@learnomate how to call variable from Unix to .sql

  • @mohdqader8756
    @mohdqader8756 2 года назад

    You are not providing scripts in description box its time wasting

  • @kabira__shaikh
    @kabira__shaikh 4 года назад

    After connection with oracle DB from bash unix shell, I'm trying to INSERT few records in table but it is not working. No error and no insertion of record in the table. What could be the issue ?

  • @srinivasua5798
    @srinivasua5798 2 года назад

    Hi bro

  • @SuperSriRanjani1
    @SuperSriRanjani1 5 лет назад +2

    ps -eflgrep pmon will show running process with PIDs
    ***************
    $ls -lrt --ls -ltr file* : This command just list the contents of the current directory in the long listing format ( -l ), sorted by modification time ( -t ) in reverse order ( -r ) of all files and directories beginning with file for files like dbcheck.sh
    ls --help
    *************************
    #!/bin/bash on the first line, meaning that the script should always be run with bash, rather than another shell.
    **************************************
    vi dbcheck.sh shows the following lines to edit
    current_date=$(date +%Y-%m-%d)
    sqlplus -s " / as sysdba " database_status is the file name and date is attached to that log file. Any wrong matters will be reported to this log file. here, one arrow will replace the content of log file. If you use EOF>> will append the log file. Two arrows.
    Save the file and comeout.
    $ ls -ltr file* : This command just list the contents of the current directory in the long listing format ( -l ), sorted by modification time ( -t ) in reverse order ( -r ) of all files and directories beginning including file .log
    $./dbcheck.sh --will run this shell. You have t use ./name of shell (to run a shell)
    $date will show current date and time
    $cat database_status_2018_11-21.log will show the contents dumped into this log file.
    $You can see the name of database and current status
    Name Open_mode
    ----------------------------------------
    ORCL READ WRITE
    READ WRITE MEANS it is currently up and running.

    • @axyytube
      @axyytube 5 лет назад

      col name for a30 -will check name of database.
      This is totally wrong.
      This is sqlplus command which just use to formating of column width while displaying value on command prompt.
      Full form of this command as per below.
      column name format a30.
      a30 is used to show column with width of Alphanumeric 30 characters.

  • @ArizuddinGulam
    @ArizuddinGulam 5 лет назад

    N