Balance
Balance (http://www.inlab.de/balance.html) is a useful tool to route TCP to another server. Consider a server A that can not get to server C directly due to firewall rules but can get to Server B. Server B will act as a proxy. If I am routing oracle commands on port 1521, I would start it up [...]
SOAP Service and Client Example
Server: This test server will query a MySQL database and return tables with names matching the selection criteria. #!/usr/bin/perl #use SOAP::Lite +trace=>”all”; use SOAP::Transport::HTTP; my $daemon = SOAP::Transport::HTTP::CGI ->new (LocalPort => 8080) ->dispatch_to(‘Services’) ->handle; BEGIN { package Services; use vars qw(@ISA); @ISA = qw(Exporter SOAP::Server::Parameters); use SOAP::Lite; use DBI; use Data::Dumper; $SOAP::Constants::DO_NOT_USE_CHARSET = 1; # [...]
mod_plsql XML example
To add a mod_plsql procedure to an Oracle application server is pretty straightforward. The first step is to add the DAD to the server using the console. After logging into the application server console (http://app:1156) select HTTP_server > Administration > PLSQL > Create DAD. Add the database connectivity information and restart the server. Then create [...]
Compiling PHP on Centos
The precompiled PHP binary does not include MySQL support so it must be recompiled from source. Download the PHP package and untar it Download the httpd headers yum install httpd-devel Configure ./configure –with-mysql=/usr/bin/ –with-libdir=lib64 –with-apxs2 –with-pic –without-aolserver make make test make install edit http.conf LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so AddType application/x-httpd-php .php Alias /php/ “/var/www/html/php/htdocs/” <Directory “/var/www/html/php/htdocs/”> [...]
Database Stats
The Oracle automated process for gathering statistics is hidden away under schedules. To find if it is active, SELECT * FROM DBA_SCHEDULER_JOBS; The stored procedure can be run at another time by SYS using EXEC DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC;
MySQL backup
A good fast backup mysqldump –all-databases –single-transaction –flush-logs –quick –user=xxx –password=yyy | gzip -4 >backup.gz
Insert on a table reports: ORA-01536.
The following query will report dependent objects which may be causing quotas to be exceeded. select /*+ rule */ distinct owner, object_type from dba_objects where OBJECT_NAME in (select distinct NAME from dba_dependencies where REFERENCED_NAME in (select table_name from dba_tables where tablespace_name = ‘ZZTSPACE’)) order by owner, object_type;
Create standby database script
#!/bin/sh # ora_create_standby.sh # Script to create a standby database # Howard Brinsmead # # Assumptions: # Oracle is installed on the destination server # TNS entry for the standby database # TNS entry for the myprod database on the destination server # Listener configured on the destination server # Mount points exists on the [...]
Useful SQL Plus formats
set echo off — suppress showing sql in result set set feedback off — eliminate row count message set linesize 100 — make line long enough to hold data set pagesize 0 — suppress headings and page breaks set sqlprompt ” — eliminate SQL*Plus prompt from output set trimspool on — eliminate trailing blanks set [...]
Oracle TNS less connections
C:\>sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 – Production on Sat Sep 15 23:04:00 2007 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> connect scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=testsrv)(Port=1521))(CONNECT_DATA=(SID=TEST))) Connected. SQL> If you think about above connection, it is more like specifying complete address in the connect string as you have in the tnsnames.ora file. For 10g, you can use [...]