Hello
I'm very new to unix, am learning it as part of my new job.
I have a book which has a list in the back, of a number of commands and their command line flags, detailing what these flags are used for.
I've been looking everywhere for an electronic copy of this type of list, so I can... (4 Replies)
Has anyone scripted an OEM (Oracle Enterprise Manager) blackout within a shell script? I can script the "emctl blackout" command, however, there are issues with unique names, etc. in 10g and I hate to re-create the wheel if someone has found a great way to do this. Thanks for your time. (0 Replies)
Hi, a simple question : How can I sent user and password to the command su.
I need this for a script, but the problem is the command su wait for the password.
Thanks. (2 Replies)
I tried opening the windows command line and typing UNIX commands, but they don't work. It kept saying that it was not recognized as an internal or external command, operable program or batch file.
Removed strange sentence with even stranger link
I need to use UNIX commands such as 'less',... (9 Replies)
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Hi guys,
I have some echo scripts and awk scripts like these:
echo "some text" > output1
.
.
awk '{....}{print}' input > output2Both output1 and output2 are saved with unix END Of Line, then,
is there an option to include within echo command and awk command to save the output as DOS END Of... (3 Replies)
RHEL 6.2/Bash shell
root user will be executing the below script. It switches to oracle user and expect to do the following things
A. Source the environment variables for BATGPRD Database (the file used for sourcing is shown below after the script)
B. Shutdown the DB from sqlplus -- The... (13 Replies)
Hello Forum,
I'm making very good progress on my report thanks to the very helpful people on this forum. I've been able to successfully create my report for my Red Hat servers. But I do have a few ubuntu servers in the mix and I'd like to capture some data from them when an ssh connection is... (8 Replies)
Discussion started by: greavette
8 Replies
LEARN ABOUT PHP
maxdb_change_user
MAXDB_CHANGE_USER(3) 1 MAXDB_CHANGE_USER(3)maxdb_change_user - Changes the user of the specified database connection
Procedural style
SYNOPSIS
bool maxdb_change_user (resource $link, string $user, string $password, string $database)
DESCRIPTION
Object oriented style
bool maxdb::change_user (string $user, string $password, string $database)
maxdb_change_user(3) is used to change the user of the specified database connection as given by the $link parameter and to set the current
database to that specified by the $database parameter.
In order to successfully change users a valid $username and $password parameters must be provided and that user must have sufficient per-
missions to access the desired database. If for any reason authorization fails, the current user authentication will remain.
Note
Using this command will always cause the current database connection to behave as if was a completely new database connection,
regardless of if the operation was completed successfully. This reset includes performing a rollback on any active transactions,
closing all temporary tables, and unlocking all locked tables.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Object oriented style
<?php
/* connect database test */
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
if ($result = $maxdb->query("SELECT * FROM dual")) {
$row = $result->fetch_row();
printf("Result: %s
", $row[0]);
$result->free();
}
/* reset all and select a new database */
if (!$maxdb->change_user("DBADMIN", "SECRET", "DEMODB")) {
printf("Database not running
");
} else {
printf("Database running
");
}
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (!$link) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
if ($result = maxdb_query($link, "SELECT * FROM dual")) {
$row = maxdb_fetch_row($result);
printf("Result: %s
", $row[0]);
maxdb_free_result($result);
}
/* reset all and select a new database */
if (!maxdb_change_user($link, "DBADMIN", "SECRET", "DEMODB")) {
printf("Database not running
");
} else {
printf("Database running
");
}
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
Result: a
Database running
SEE ALSO maxdb_connect(3), maxdb_select_db(3).
PHP Documentation Group MAXDB_CHANGE_USER(3)