You have a trouble when you got your localhost (your computer) has no route to XWindows public server (linux, unix base). Your computer only has route to one of computer in the network which has route to public server that you want.
Somebody that ever install Oracle via remote connection will find this problem.
Example:
Your local computer is "localhost"
Your server #1 is private IP "10.80.123.203"
Your server #2 is public IP "203.13x.xxx.xx"
Localhost ----- Server #1 ------- Server #2
|______ XWindows Application _______|
|___________ No Route ______________|
How to get connection via SSH so you can remote your public server include the XWindows application ?
Here are the steps must be done :
SSH tunneling from 10.80.123.203 to public IP 202.13x.xxx.xx
# ssh konang@10.80.123.203 -p 2350
# ssh -L 2211:127.0.0.1:2350 konang@203.13x.xxx.xx -p 2350
SSH tunneling from localhost to 10.80.123.203
# ssh -L 2211:127.0.0.1:2211 konang@10.80.123.203 -p 2350
SSH to 203.13x.xxx.xx via tunnel + forward X
# ssh -X konang@localhost -p 2211
For example on X environment :
# xclock &
You will get "xclock" program from remote 203.13x.xxx.xx
Monday, September 3, 2007
SSH Tunneling
Diposting oleh
Web Documentation
di
6:43 PM
0
komentar
Thursday, August 30, 2007
When Oracle Going Down
So what? when you at the night found your Oracle was dead. Trying start Oracle but occuring the error messages:
Thu Aug 30 21:43:16 2007
Errors in file /data/oracle/home/admin/pep/bdump/pep_arc0_31074.trc:
ORA-16014: log 1 sequence# 56 not archived, no available destinations
ORA-00312: online log 1 thread 1: '/data/oracle/data/pep/redo01.log'
Thu Aug 30 21:44:16 2007
ARC1: Archiving not possible: No primary destinations
ARC1: Failed to archive thread 1 sequence 56 (4)
Thu Aug 30 21:48:17 2007
Errors in file /data/oracle/home/admin/pep/bdump/pep_arc1_31076.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 100.00% used, and has 0 remaining bytes available.
Thu Aug 30 21:48:17 2007
************************************************************************
You have following choices to free up space from flash recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
system command was used to delete files, then use RMAN CROSSCHECK and
DELETE EXPIRED commands.
************************************************************************
Thu Aug 30 21:48:17 2007
Errors in file /data/oracle/home/admin/pep/bdump/pep_arc1_31076.trc:
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 48500736 bytes disk space from 2147483648 limit
ARC1: Error 19809 Creating archive log file to '/data/oracle/home/flash_recovery_area/PEP/archivelog/2007_08_30/o1_mf_1_56_1_.arc'
ARC1: Failed to archive thread 1 sequence 56 (19809)
ARCH: Archival stopped, error occurred. Will continue retrying
DONT WORRY
You just make Oracle can be startup and then rebuild your configuration by RESIZE your Archive Log file. The steps are :
[oracle@black]# sqlplus /nolog
SQL> conn / as sysdba
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup nomount pfile="/data/oracle/home/admin/pep/pfile/init.ora.618200774625"
ORACLE instance started.
Total System Global Area 1002438656 bytes
Fixed Size 1223080 bytes
Variable Size 247465560 bytes
Database Buffers 746586112 bytes
Redo Buffers 7163904 bytes
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.
SQL> select * from tab;
Browse : http://your.oracle.web:1158/em/
Please resize your Archive log file and or the other configuraions.
Diposting oleh
Web Documentation
di
7:19 PM
6
komentar
Tuesday, August 21, 2007
Oracle Instant Client for PHP & Linux
Service
instantclient-basic-linux32-10.2.0.2-20060331
instantclient-sdk-linux32-10.2.0.2-20060331
Download
http://www.oracle.com/technology/software/tech/oci/instantclient/index.htm
http://www.oracle.com/technology/software/htdocs/client_lic.html?url=http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.h
http://download.oracle.com/otn/linux/instantclient/10202/instantclient-sdk-linux32-10.2.0.2-20060331.zip
Links
http://us3.php.net/oci8
Configure Oracle Client
Install Oracle instant client
# mkdir -p /usr/lib/oracle/10.2.0.2/client
# unzip -jd /usr/lib/oracle/10.2.0.2/client \
instantclient-basic-linux-x86-32-10.2.0.2-20060331.zip
# mkdir -p /usr/include/oracle/10.2.0.2/client
# unzip -jd /usr/include/oracle/10.2.0.2/client \
instantclient-sdk-linux-x86-32-10.2.0.2-20060331.zip
# ln -s /usr/lib/oracle/10.2.0.2/client/libclntsh.so.10.1 \
/usr/lib/oracle/10.2.0.2/client/libclntsh.so
# cp /usr/include/oracle/10.2.0.2/client/* /usr/lib/oracle/10.2.0.2/client/
Configure Apache
# ./configure --prefix=/usr/local/apache \
--enable-shared=max --enable-module=vhost_alias
Alternate compile to another directory
## ./configure --prefix=/usr/local/apache4 \
--enable-shared=max --enable-module=so \
--enable-module=vhost_alias
## Reconfigure PHP 4.x.x
# ./configure --with-mysql \
--with-ldap \
--with-gettext \
--with-apxs=/usr/sbin/apxs \
--with-oci8-instant-client=/usr/lib/orale/10.2.0.2/client
## Reconfigure PHP 5.x.x
# ./configure --with-mysql=/usr --with-ldap \
--with-gettext --enable-versioning \
--enable-memory-limit --enable-zend-multibyte \
--enable-zip --enable-track-vars \
--with-apxs=/usr/local/apache/bin/apxs \
--with-calendar \
--with-oci8=instantclient,/usr/lib/oracle/10.2.0.2/client
# export LD_LIBRARY_PATH=\
/usr/lib/oracle/10.2.0.2/client:$LD_LIBRARY_PATH
# make
# make install
Please restart apache and test connection with source code below :
### Test your PHP Oracle connection ####
### oci.php ###
<?
define("_USER","ora");
define("_PASSWD","ora");
define("_DB","10.8.8.8/ORA");
$conn = OCILogon(_USER,_PASSWD,_DB) or die(OCIError());
if ($conn){
print "Terkoneksi ke database ". _DB . " sebagai user "
. _USER."<BR>";
echo "CONN=".$conn."<br>";
} else {
exit;
}
$cmdstr = "select * from TB_VENDOR";
$parsed = ociparse($conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed, $results);
echo "<html><head><title>Oracle PHP Test</title></head><body>";
echo "<center><h2>Oracle PHP Test for <i><u>Obsolete</u></i>
Command</h2></center>";
echo "<center><h2>Connecting & Accessing Oracle Database</h2><br>";
echo "<table border=1 cellspacing='0' width='50%'>\n<tr>\n";
echo "<td><b>NAMA PT</b></td>\n<td><b>ALAMAT</b></td>\n</tr>\n";
for ($i = 0; $i < $nrows; $i++ )
{
echo "<tr>\n";
echo "<td>" . $results["NM_VENDOR"][$i] . "</td>";
echo "<td> " . $results["ALAMAT"][$i] . "</td>";
echo "</tr>\n";
}
echo "<tr><td colspan='2'> Number of Rows:
$nrows</td></tr></table>";
echo "<br><em>If you see data, then it works!</em><br></center></body></html>\n";
print "<hr>";
echo "<center><h2>Oracle PHP Test for <i><u>Newest</u></i>
Command</h2></center>";
echo "<center><h2>Connecting & Accessing Oracle Database</h2><br>";
$conn = OCILogon(_USER,_PASSWD,_DB) or die(OCIError());
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
$query = 'SELECT * FROM TB_SOLUSI';
$stid = oci_parse($conn, $query);
if (!$stid) {
$e = oci_error($conn);
print htmlentities($e['message']);
exit;
}
$r = oci_execute($stid, OCI_DEFAULT);
if (!$r) {
$e = oci_error($stid);
echo htmlentities($e['message']);
exit;
}
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
}
print '</tr>';
}
print '</table>';
echo "<center><br><em>If you see data, then it works!</em><br></center>";
oci_close($conn);
?>
Diposting oleh
Web Documentation
di
8:21 PM
32
komentar