I'm trying to remsh to another server and then execute a for loop command there but I'm getting unexpected errors and would appreciate any suggestions.
Ideally what I want to do is this:
Now my understanding is that you can't use new lines for remsh logic so the code would have to look like this:
Unfortunately I get the following error:
So clearly I'm doing something wrong. I've tried chaning the placement of the semi colons but to no avail.
Help!
I'm would like to log in su - within a script an contuine to run the commands within the script. Every time I log in as su - I have to exit for the rest of the script to run! e.g.
#!/bin/ksh
su - oracle
ps -ef |grep som <--- doesn't excute command until I log out su
oracle.... (1 Reply)
Hi folks,
I have the following configuration file:
DB_LAYER=NO
ADMIN_LAYER=NO
RTESUB_LAYER=NO
DB_HOST_NAME=tornado
ADMIN_HOST_NAME=tornado
RTESUB_HOST_NAME=tornado
RESPONSE_FILE_SR=/tmp/SR.rsp
INSTALL_SR_1=/home/Upgrade_4.7.1/Utilities/Install_SR:Y... (8 Replies)
Hi,
In ksh how can I execute something like this:
remsh newhost "for i in 1 2 3 4 5 do echo file$i; cat file$i; done"
I cannot pass the contrl J or enter in th above line which is required by the for loop.
Thanks... (1 Reply)
I have a space delimited file containing: hostname OracleSID connectstring
I want to loop through the file and execute remsh to check the database processes.
cat $filename | while read HOST SID CONNECT
do
{
result=`remsh $HOST "ps -ef | grep pmon_${SID}$| grep -v grep"`
if ........ (1 Reply)
Boy I hope someone can answer this question. I've been beating my head against the wall all day trying to come up with a solution.
I have a carrot delimited file that looks like this:
ANDERSON^678934^1974^BOB
JONES^564564345^1954^ABRAHAM
SMITH^47568465^1948^JON
If I run this command:
awk... (6 Replies)
Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
I have the below code which runs on multiple databases , but this runs one-after-one. I will need this to run in parallel so that i could save a lot of time. Please help!!! Thanks in advance
for Db in `cat /var/opt/oracle/oratab |egrep -v "ASM" |grep -v \# |cut -d\: -f1`
do
{
export... (5 Replies)
OS : RHEL 6.1
Shell : Bash
I had a similair post on this a few weeks back. But I didn't explain my requirements clearly then. Hence starting a new thread now.
I have lots of files in /tmp/stage directory as show below.
I want to loop through each files to run a command on each file.
I... (8 Replies)
Discussion started by: kraljic
8 Replies
LEARN ABOUT REDHAT
alter_database
ALTER DATABASE(7) SQL Commands ALTER DATABASE(7)NAME
ALTER DATABASE - change a database
SYNOPSIS
ALTER DATABASE name SET variable { TO | = } { value | DEFAULT }
ALTER DATABASE name RESET variable
DESCRIPTION
ALTER DATABASE is used to change the session default of a run-time configuration variable for a PostgreSQL database. Whenever a new session
is subsequently started in that database, the specified value becomes the session default value. The database-specific default overrides
whatever setting is present in postgresql.conf or has been received from the postmaster.
Only a superuser or the database owner can change the session defaults for a database.
PARAMETERS
name The name of the database whose session defaults are to be altered.
variable
value Set the session default for this database of the specified configuration variable to the given value. If value is DEFAULT or, equiv-
alently, RESET is used, the database-specific variable setting is removed and the system-wide default setting will be inherited in
new sessions. Use RESET ALL to clear all settings.
See SET [set(7)] and the Administrator's Guide for more information about allowed variable names and values.
DIAGNOSTICS
ALTER DATABASE
Message returned if the alteration was successful.
ERROR: database "dbname" does not exist
Error message returned if the specified database is not known to the system.
NOTES
Using ALTER USER [alter_user(7)], it is also possible to tie a session default to a specific user rather than a database. User-specific
settings override database-specific ones if there is a conflict.
EXAMPLES
To disable index scans by default in the database test:
ALTER DATABASE test SET enable_indexscan TO off;
COMPATIBILITY
The ALTER DATABASE statement is a PostgreSQL extension.
SEE ALSO
ALTER USER [alter_user(7)], CREATE DATABASE [create_database(l)], DROP DATABASE [drop_database(l)], SET [set(l)]
SQL - Language Statements 2002-11-22 ALTER DATABASE(7)