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?
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 ?
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.
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.
Thanku v mch :)
Thanks 😊
can we run multiple sql statements inside a single sqlplus -s command ? or for each statement we need to relogin into the db ?
Can you please make a video on how to check database connectivity test for multiple database in a server.
Can I use bind variable in shell script?
if yes,how to use bind variable in shell script?
How to modify the shall script
Connect with me for oracle dba training.
Email: ankush.thavali@gmail.com
Mob no: +91 9960262955
Website: www.orcldata.com
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?
how to connect to teradata database and run sql query from unix.
Hi bro
Did you connect to teradata database from Unix if yes please guide me
How to pass input from Unix shell script to .sql
You can define your variable in Unix script and then call to that variable inside SQL script.
@@learnomate how to call variable from Unix to .sql
You are not providing scripts in description box its time wasting
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 ?
Hi bro
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.
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.
N