1. Login as root and edit /etc/oratab to reflect “Y”
orcl:/opt/oracle/product/11.1.0/db_1:Y
2. oracle startup script:
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/product/11.1.0/db_1"
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac
3. Oracle EMCTL
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME="/opt/oracle/product/11.1.0/db_1"
case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac
4. chkconfig –add /etc/init.d/oracle
5. chkconfig –add /etc/init.d/oraemctl
Got this one from IRC this morning.. In order to recache single tiles in TC, as long as it is not metatile (metatile=false), then we can simply append “FORCE=1″ in the URL..
http://192.168.2.14/tilecache/tilecache.py?FORCE=1&LAYERS=beijing_900913_wide_en&MAP=%2Fmyhome%2Fmap%2Fbeijing%2Fnew%2Fbeijing_900913_wide_en%2Fbeijing.map&FORMAT=jpg&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=12951949.03168994,4852222.893873828,12952101.905746482,4852375.767930372&WIDTH=256&HEIGHT=256

Well for completeness, I gave my ofcmate a DELETE tool which wipes out everything in the /tilecache/map_dir directory..
I have a small project to use a jar file for sending/receiving SMS in chinese. I could send the SMS fine from Eclipse, so I thought creating a Java Class wrapper to be used by ColdFusion so it can be called from HTTP could do the trick.
After a few minutes, I have the class up and running and fully tested within Eclipse.
1. I dropped the class, dll and its jar in C:\ColdFusion8\lib. Take note its a Windows box, since the Jar is using a dll to talk to the Wavecom modem using AT commands.
GSMModem.jar
GSMMultiPort.dll
GSMMultiPortForJ.dll
2. The crux was to specify the file.encoding for Java as an argument from the CFIDE Administrator. After specifying GB18030, a quick restart.. voila..
Java Version 1.6.0_01
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home C:\ColdFusion8\runtime\jre
Java File Encoding GB18030
Java Default Locale en_US
File Separator \
Path Separator ;
Line Separator Chr(13)
User Name SYSTEM
User Home C:\
Files:
CFSend.java
Stumbled upon an error in reprojecting data from 900913 (Google Speherical Mercator) to 4326 (WGS84). I’m recalling this from my head now, the error was something related to “NAD sth”. Workaround was to convert it as follows:
1. 900913
2. 32650 (UTM for your area)
3. 4326
I’ll get the SQL from my ofcmate and paste it here…
EXPLAIN PLAN
1. Create the PLAN_TABLE
SQL> $ORACLE_HOME/rdbms/admin/utlxplan.sql
2. Run EXPLAIN PLAN for an SQL
SQL> EXPLAIN PLAN
2 SET STATEMENT_ID = ‘example’ FOR
3 SELECT ename,dname
4 FROM emp inner join dept
5 ON ( emp.deptno = dept.deptno )
6 /
Explained.
3. DISPLAY Results
SQL> $ORACLE_HOME/rdbms/admin/utlxpls.sql
AUTOTRACE is a SQL*Plus facility that may be enabled in your database. To get this up and running you need to have administration rights to the system and perform the following steps:
* Log into SQL*Plus as SYSDBA
* Run the script $ORACLE_HOME/sqlplus/admin/plustrce
* Grant PLUSTRACE to SPATIAL (or to specific users/roles)
To Use:
SQL> SET autotrace ON
SQL> SELECT ename,dname
2 FROM emp INNER JOIN dept
3 ON ( emp.deptno = dept.deptno )
4 /
ENAME DNAME
---------- --------------
SMITH RESEARCH
ALLEN SALES
WARD SALES
JONES RESEARCH
MARTIN SALES
BLAKE SALES
CLARK ACCOUNTING
SCOTT RESEARCH
KING ACCOUNTING
TURNER SALES
ADAMS RESEARCH
JAMES SALES
FORD RESEARCH
MILLER ACCOUNTING
14 rows selected.
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=14 Bytes=252)
1 0 HASH JOIN (Cost=3 Card=14 Bytes=252)
2 1 TABLE ACCESS (FULL) OF 'DEPT' (Cost=1 Card=4 Bytes=44)
3 1 TABLE ACCESS (FULL) OF 'EMP' (Cost=1 Card=14 Bytes=98)
Statistics
----------------------------------------------------------
0 recursive calls
4 db block gets
3 consistent gets
0 physical reads
0 redo size
1132 bytes sent via SQL*Net TO client
503 bytes received via SQL*Net FROM client
2 SQL*Net roundtrips TO/FROM client
0 sorts (memory)
0 sorts (disk)
14 rows processed
Courtesy of Beginning Oracle Programming by Sean Dillon et al
Read more…