07-02-2017
Quote:
Originally Posted by
splattty
Assume you mean /etc/resolv.conf for DNS ?
No, he means
TNSNAMES.ora which does a similar thing as
/etc/hosts but for Oracle databases.
bakunin
10 More Discussions You Might Find Interesting
1. HP-UX
Hi:
i have writen a script that needs a finishing
Pourpouse is to find a particular error in a file after we enter file name
and the return msg would describe if >there is a error -> "Contact DBA"
if there is no oracle error ->"No ora error found."
for the same i have written a script... (6 Replies)
Discussion started by: techbravo
6 Replies
2. Shell Programming and Scripting
ghkjkjoj (4 Replies)
Discussion started by: chetankelvin
4 Replies
3. UNIX for Dummies Questions & Answers
Can we find out what is the location of tnsnames.ora file used by the hp unix. (3 Replies)
Discussion started by: Sudipshib
3 Replies
4. Solaris
Hi all,
Am intermittently getting the following errors on one of my databases.
Errors in file /oracle/HRD/saptrace/background/hrd_psp0_13943.trc:
ORA-27300: OS system dependent operation:fork failed with status: 12
ORA-27301: OS failure message: Not enough space
ORA-27302:... (1 Reply)
Discussion started by: newbie_01
1 Replies
5. Shell Programming and Scripting
All:
Can sombodoy help me out with a sed command? Assume I have the following:
PRI =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.3.7)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pri)
... (3 Replies)
Discussion started by: BeefStu
3 Replies
6. UNIX for Advanced & Expert Users
Hi - I am trying to grep all "ORA" errors in a log files.I have to grep all ORA errors except one error for example ORA-01653.How can exclude that error in "grep" command?
In following "grep" command I want to exclude "ORA-01653" error
grep -i ORA alert.log >>/tmp/ora_errors.txt
... (7 Replies)
Discussion started by: Mansoor8810
7 Replies
7. Shell Programming and Scripting
Hi All ,
I am new to programming and here is what i am trying to achieve , i am taking a list of mounted filesystems (based on the HLQ) , passing it on to a txt file and then copying the file to a DSN .The code i am using :
df | grep WAST.*WASCFG.*ZFS | awk '{print $2}' | sort -o log.txt |... (5 Replies)
Discussion started by: AnjanM
5 Replies
8. Shell Programming and Scripting
Hi,
I would like to modify, in script schell, the line right above (DESCRIPTION and check three cases :
if line contain ".world" then line=line-".world" concat "," concat line
if line dont contain ".world" then line=line concat "," concat line concat".world"
else line=line
Keep in... (10 Replies)
Discussion started by: elcaro
10 Replies
9. Shell Programming and Scripting
Hi,
I am trying to write a script or command to remove a section from tnsnames.ora file
in the following example I would like to remove tns_alias2 section
$ cat tnsnames.ora
tns_alias1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host1 )(PORT = 1521))
... (3 Replies)
Discussion started by: ynixon
3 Replies
10. Red Hat
Hi,
User claim that job is running slow from their end.
I DBA found in database the below errors in alert log file.
ORA-27603: Cell storage I/O error, I/O failed on disk o/192.168.10.3/RECO_DM01_CD_01_drm01 at offset 13335789568 for data length 1048576
ORA-27626: Exadata error: 2201 (IO... (2 Replies)
Discussion started by: Maddy123
2 Replies
LEARN ABOUT PHP
examples-with-pdo_4d
EXAMPLES-WITH-PDO_4D(3) 1 EXAMPLES-WITH-PDO_4D(3)
Examples with PDO_4D - Examples PDO_4D
This basic example show how to connect, execute a query, read data and disconnect from a 4D SQL server.
Example #1
Basic example with PDO_4D
<?php
$dsn = '4D:host=localhost;charset=UTF-8';
$user = 'test';
$pass = 'test';
// Connection to the 4D SQL server
$db = new PDO($dsn, $user, $pass);
try {
$db->exec('CREATE TABLE test(id varCHAR(1) NOT NULL, val VARCHAR(10))');
} catch (PDOException $e) {
die("Erreur 4D : " . $e->getMessage());
}
$db->exec("INSERT INTO test VALUES('A', 'B')");
$db->exec("INSERT INTO test VALUES('C', 'D')");
$db->exec("INSERT INTO test VALUES('E', 'F')");
$stmt = $db->prepare('SELECT id, val from test');
$stmt->execute();
print_r($stmt->fetchAll());
unset($stmt);
unset($db);
?>
The above example will output:
Array
(
[0] => Array
(
[ID] => A
[0] => A
[VAL] => B
[1] => B
)
[1] => Array
(
[ID] => C
[0] => C
[VAL] => D
[1] => D
)
[2] => Array
(
[ID] => E
[0] => E
[VAL] => F
[1] => F
)
)
This example shows how to execute a query in 4D language, and how to read the result through PDO_4D.
Example #2
Accessing 4D language from pdo_4d
Set up a 4D method, called method. Make sure in the method properties that the option Available via SQL is checked. The 4D code is
the following.
C_TEXTE($0)
$0:=Version application(*);
The PHP code to use the above 4D method is :
<?php
$dsn = '4D:host=localhost;charset=UTF-8';
$user = 'test';
$pass = 'test';
// Connection to the 4D server
$db = new PDO($dsn, $user, $pass);
$stmt = $db->prepare('SELECT {FN method() AS VARCHAR } FROM _USER_SCHEMAS LIMIT 1');
$stmt->execute();
print_r($stmt->fetchAll());
unset($stmt);
unset($db);
?>
The above example will output:
(
[0] => Array
(
[<expression>] => F0011140
[0] => F0011140
)
)
Example #3
Escaping 4D table names
This examples illustrates how to escape characters in a 4D SQL query.
<?php
$dsn = '4D:host=localhost;charset=UTF-8';
$user = 'test';
$pass = 'test';
// Connection to 4D server 4D
$db = new PDO($dsn, $user, $pass);
$objects = array('[',']','[]','][','[[',']]','[[[',']]]','TBL ]]32[23');
foreach($objects as $id => $object) {
$object = str_replace(']',']]', $object);
print "$object
";
$db->exec('CREATE TABLE IF NOT EXISTS ['.$object.'](['.$object.'] FLOAT)');
$req = "INSERT INTO [$object] ([$object]) VALUES ($id);";
$db->query($req);
$q = $db->prepare("SELECT [$object] FROM [$object]");
$q->execute();
$x[] = $q->fetch(PDO::FETCH_NUM);
$db->exec('DROP TABLE ['.$object.'];');
}
?>
The above example will output:
[
]]
[]]
]][
[[
]]]]
[[[
]]]]]]
TBL ]]]]32[23
PHP Documentation Group EXAMPLES-WITH-PDO_4D(3)