unix and linux operating commands

Improving Performance Through Persistent Connections


 
Thread Tools Search this Thread
# 1  
Old 04-06-2008
Improving Performance Through Persistent Connections

The concept of persistent database connections is a question mark for many PHP developers. When exactly is it a wise decision to use them?

More...
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Having too many connections could affect performance ?

Good evening, i need your help please I will try to describe the scenario briefly: In a Telecom Production system application receives a certain files called CDRs(call detail records) to be processed by doing some operating systems operations and then database operations like creating indexes... (4 Replies)
Discussion started by: alexcol
4 Replies

2. Shell Programming and Scripting

Improving code

Gents, I did the below code to get an output (report) ,.. the code works fine but I believe it can be more shorted using better method. Please if you can help, to generate same output improving the code , will be great. here my code. # get diff in time awk '{$9=$8-prev8;prev8=$8;print... (8 Replies)
Discussion started by: jiam912
8 Replies

3. Shell Programming and Scripting

Need help improving my script.

Thank you for taking the time to look at this and provide input. To start, I am not a linux/unix expert but I muddle through the best I can. I am also in no way shape or form a programmer. Please keep that in mind as you read this script. This script is designed to find all files in a given... (8 Replies)
Discussion started by: garlandxj11
8 Replies

4. Shell Programming and Scripting

Basic help improving for in loop

I'm obviously very new to this. I'm trying to write a simple for loop that will read the directory names in /Users and then copy a file into the same subdir in each user directory. I have this, and it works but it isn't great. #!/bin/bash HOMEDIRS=/Users/* for dirs in $HOMEDIRS; do if ];... (5 Replies)
Discussion started by: Heath_T
5 Replies

5. Shell Programming and Scripting

Improving this validate function

Hi guys, I use this function which was provided to me by someone at this site. It works perfectly for validating a users input option against allowed options.. example: validateInput "1" "1 3 4 5" would return 0 (success) function validateInput { input=$1 allowedInput=$2 for... (4 Replies)
Discussion started by: pyscho
4 Replies

6. Shell Programming and Scripting

Persistent variable

I found a way to make a numeric variable persistent for a script : #!/bin/bash function Persist() { # 1:Expression like VARIABLE=Value (numeric) local V=${1%=*} eval "$1" sed -i "s/^$V=*/$1/" $(which $(basename $0)) || return 1 }And how to use itAA=12 read -p "Enter a... (2 Replies)
Discussion started by: frans
2 Replies

7. UNIX for Dummies Questions & Answers

Improving Unix Skills

Kindly any advice to improve my unix skills as electronic books i can download or valuable sites as this one etc... (3 Replies)
Discussion started by: sak900354
3 Replies

8. Shell Programming and Scripting

improving my script

Hi; I want to access our customer database to retreive all clients that have as language index 2 or 3 and take their client number. My input is a file containing all client numbers. i access the data base using a function call "scpshow". The total number of clients i want to scan is 400 000... (6 Replies)
Discussion started by: bcheaib
6 Replies
Login or Register to Ask a Question
OCI_PASSWORD_CHANGE(3)													    OCI_PASSWORD_CHANGE(3)

oci_password_change - Changes password of Oracle's user

SYNOPSIS
bool oci_password_change (resource $connection, string $username, string $old_password, string $new_password) DESCRIPTION
resource oci_password_change (string $dbname, string $username, string $old_password, string $new_password) Changes password for user with $username. The oci_password_change(3) function is most useful for PHP command-line scripts, or when non-persistent connections are used throughout the PHP application. PARAMETERS
o $connection - An Oracle connection identifier, returned by oci_connect(3) or oci_pconnect(3). o $username - The Oracle user name. o $old_password - The old password. o $new_password - The new password to be set. o $dbname - The database name. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 oci_password_change(3) example changing the password of an already connected user <?php $dbase = 'localhost/orcl'; $user = 'cj'; $current_pw = 'welcome'; $new_pw = 'geelong'; $c = oci_pconnect($user, $current_pw, $dbase); oci_password_change($c, $user, $current_pw, $new_pw); echo "New password is : " . $new_pw . " "; ?> Example #2 oci_password_change(3) example of connecting and changing the password in one step <?php $dbase = 'localhost/orcl'; $user = 'cj'; $current_pw = 'welcome'; $new_pw = 'geelong'; $c = oci_pconnect($user, $current_pw, $dbase); if (!$c) { $m = oci_error(); if ($m['code'] == 28001) { // "ORA-28001: the password has expired" // Login and reset password at the same time $c = oci_password_change($dbase, $user, $current_pw, $new_pw); if ($c) { echo "New password is : " . $new_pw . " "; } } } if (!$c) { // The original error wasn't 28001, or the password change failed $m = oci_error(); trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR); } // Use the connection $c ?> NOTES
Note Changing the password either with this function or directly in Oracle should be done carefully. This is because PHP applications may continue to successfully reuse persistent connections by authenticating with the old password. The best practice is to restart all web servers whenever the user password is changed. Note If upgrading the Oracle client libraries or the database from a release prior to 11.2.0.3 to version 11.2.0.3 or higher, oci_pass- word_change(3) may give the error "ORA-1017: invalid username/password" unless both client and server versions are upgraded at the same time. Note The second oci_password_change(3) syntax is available since OCI8 version 1.1. Note In PHP versions before 5.0.0 you must use ocipasswordchange(3) instead. This name still can be used, it was left as alias of oci_password_change(3) for downwards compatability. This, however, is deprecated and not recommended. PHP Documentation Group OCI_PASSWORD_CHANGE(3)