Sponsored Content
Top Forums Shell Programming and Scripting connect to sqlplus from shell Post 302106157 by aya_r on Tuesday 6th of February 2007 11:59:55 PM
Old 02-07-2007
connect to sqlplus from shell

I'm writting a shell script and at the begining I login to sqlplus by
sqlplus -l user_name/password@instance
what I would like is to check if the database is down or not , and if the database has started moved to the next step else sleep for a certain time and then check again .
I know how to do the sleep part, but I don't know how to check if the database is not down. can some one help me please.

Thanks,
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sqlplus and shell scripting

i would like to learn how to integrate my little knowledge in shell scripting with sqlplus. well... i know how to make basic query in sqlplus but i dont know how i can integrate it with shell script. can someone :) please help me on this? can you give me some basic example on how to do this kind of... (10 Replies)
Discussion started by: inquirer
10 Replies

2. Shell Programming and Scripting

calling sqlplus from shell

Hi All, I am executing the following code :- sqlplus -s ${DATABASE_USER} |& print -p -- 'set feed off pause off pages 0 head off veri off line 500' print -p -- 'set term off time off serveroutput on size 1000000' print -p -- "set sqlprompt ''" print -p -- "SELECT run_command from... (2 Replies)
Discussion started by: suds19
2 Replies

3. Shell Programming and Scripting

connect to sqlplus in a script

Hi, I want to write a script, in which I will connect to sqlplus and do a quary and then exit sqlplus user/pwd@database select count(*) from table exit. and write the result in a log file. How to write it ? Many thanks before. (1 Reply)
Discussion started by: big123456
1 Replies

4. UNIX for Dummies Questions & Answers

connect sqlplus from unix

hi, I have this basic query. I have created a new user on unix. I have given home directory and permission through chmod to create directory stucture. Now need to connect sqlplus. What permissions should we give, so that this works? Any help is appreciated. Thanks, Neha (1 Reply)
Discussion started by: nehak
1 Replies

5. UNIX for Dummies Questions & Answers

Switch from SQLPlus to shell?

What is the command for when you are in SQLPlus and want to go back to the shell prompt without actually exiting SQLPLus? Thanks. (2 Replies)
Discussion started by: Sepia
2 Replies

6. Programming

Shell SQLPlus

Hi, I am trying to execute the update statment in shell sqlplus.But nothing prompts.if i do ctrl+c i got the below error. SQL> update table set enabled='N' where type_code='xx'; ^C update table set enabled='N' where type_code='xx' * ERROR at line 1: ORA-01013: user requested... (2 Replies)
Discussion started by: nmahendran
2 Replies

7. Shell Programming and Scripting

sqlplus in shell script

Hi When I use sqlplus in shell script, I get sqlplus: command not found. ORACLE_HOME is not set. How to set ORACLE_HOME in unix? Thanks (3 Replies)
Discussion started by: vinoth_kumar
3 Replies

8. UNIX for Advanced & Expert Users

Unable to connect to sqlplus from unix

Hi, I have been trying to connect to sqlplus the same way I used to do in my earlier company but I get these error messages , please suggest way out - user name - xyzuser schema name - xyzschema $ sqlplus xyzuser@xyzschema ksh: sqlplus: not found. $ sqlplus -s xyzuser@xyzschema... (5 Replies)
Discussion started by: dhirajdsharma
5 Replies

9. Shell Programming and Scripting

Connect to Oracle using sqlplus

I have logged into oracle using SQLPLUS. When I type any kind of query, there is only 1 answer - '2'. What is wrong with it? (1 Reply)
Discussion started by: Subhasis
1 Replies

10. Shell Programming and Scripting

Sqlplus shell

friends because when calling a sqlplus from a shell it brings me the following message sqlplus -s $BDDUSER/$BDDPASS@$BDDHOST @$DIR_SQL/prueba.sql echo "bandera 3 " $? STATUS=$? if ;then echo "bandera 4 " $? #log_info "La ejecucion de... (1 Reply)
Discussion started by: tricampeon81
1 Replies
pwck(8) 						      System Manager's Manual							   pwck(8)

NAME
pwck, grpck - Checks the password and group files for inconsistencies SYNOPSIS
pwck [-admNs] [file] grpck [-mNp] [file] FLAGS
Causes both pwck and grpck to additionally check the NIS database entries using the same consistency tests. Users that are defined in the local password or group file without the "+" at the start of the name field are flagged as duplicate entries. pwck Inhibits the running of the /tcb/bin/authck -p command on a system running Enhanced Security. Prevents pwck from checking for the presence of the user's login directory. Directs pwck to check for mixed case usernames. Causes pwck to check for the presence of the optional shell field for each entry. grck If there are no members, causes grpck to display a message indicating the listed group has no members. Directs grpck to not check for a users' existence in the password database (local or NIS). DESCRIPTION
The pwck command scans the /etc/passwd file, or the named file, and writes to standard out any inconsistencies. The scan checks the number of fields, login name, user ID, group ID, and existence of a login directory and optional program name. The grpck command scans the /etc/group file, or the named file, and writes to standard out any inconsistencies. The scan checks the number of fields, group name, group ID, and whether all login names appear in the password file. EXAMPLES
To verify the password information in the /etc/passwd file for consistency, enter: pwck To verify the password information in the /etc/passwd file and the NIS database for consistency without checking each users login directory validity, enter: pwck -Nd To verify the group information in the /etc/group file and the NIS database for consistency, enter: grpck -N FILES
Specifies the command path Specifies the command path Contains user information Contains group information RELATED INFORMATION
Commands: adduser(8), authck(8), groups(1), passwd(1), vipw(8) Files: passwd(4), group(4), ypfiles(4) delim off pwck(8)
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy