2009年6月 8日 (月)

OraTweet 1.0 あそび始めた。

OraTweet v1.0が公開されたということなので早速試してみた。といってもちょっとだけ。細かいところはみてないけどとりあえずは日本語も使えるみたい。ちょうどPL/SQL gatewayからTwitter APIを使って遊んでみようと思っていたところだから少し遊ぶか。
Oratweet01_2

Oratweet02

| | | コメント (0) | トラックバック (0)

2009年6月 5日 (金)

Leopard de Oracle10g R2 (Intel x86-64) #18 (APEX3.2と遊ぶ #11)

Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第十話。

Oracle HTTP ServerとPL/SQL gatewayをORACLE_HOMEごとPowerMacからIntel Mac移動して、Intel Macへインストール、構築したOracle 10g R2 10.2.0.4.0 for MacOSX(Intel x86-64) + APEX3.2へアクセスしちゃいます。RosettaがPowerPC版のOracle HTTP Server mod_plsqlをIntel Mac上で動かしてくれます。


まず、MacBook Proのオラクル所有者の環境変数の設定などはLeopard de Oracle10g R2 (Intel x86-64) #2の設定に加え、Oracle HTTP Server向けaliasと環境変数を追加。
ちなみに、/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apexをIntel Mac上でのAPExのHOMEディレクトリとしてOracle HTTP Serverを起動、停止スクリプトをaliasとして定義。(Oracle 10g R1 10.1.0.3.0 for MacOSXのCompanionCDでインストールされるOracle HTTP Serverは ORACLE_HOME(Oracle HTTP Serverの)/opmn/bin/opmnctl stopall 又は startallではなくORACLE_HOME(Oracle HTTP Serverの)/Apache/Apache/bin/apachectl start又はstopで起動/停止できます。)

guppy:˜ oracle$ cat .bashrc
alias ll='ls -lv'
alias startohs='$ORACLE_HTMLDB_HOME/bin/apachectl start'
alias stopohs='$ORACLE_HTMLDB_HOME/bin/apachectl stop'

export LANG=ja_JP.UTF-8
export ORACLE_BASE=/Users/shared/u01/app/oracle
export ORACLE_SID=leopard1
export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export NLS_LANG=Japanese_Japan.AL32UTF8
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/network/lib:$DYLD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

#for Oracle11g and Jdeveloper Oracle Middleware HOME
export ORACLE_MIDDLEWARE_HOME=/Users/Shared/Oracle/Middleware

#for Oracle10g R1 Oracle HTTP ServerHome (include mod_plsql)
export ORACLE_HTMLDB_HOME=/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache
guppy:˜ oracle$

次に、PowerPC上でzipしたORACLE HTTP ServerのORACLE_HOMEディレクトリ以下を丸ごとIntel Mac上のOracle HTTP ServerのあたらしいHOMEディレクトリへ移動します。移動方法はrcpでもいいし、環境によってはscpでもいいしUSBメモリ経由でもmobileme経由でもお好きな方法でIntel Macへコピー/解凍します。PowerPC上のORACLE HTTP Serverホームディレクトリ以下は不要なのでHOMEディレクトリごと削除するもよし、ちゃんとOUIで削除してもいいですよん。
以下、MacBook Pro上で解凍した状態。MacBook Pro上のあたらしいHOMEディレクトリは、/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex



1

APEX3.2のimagesディレクトリのコピー。
APEX3.2のimagesディレクトリでOracle HTTP Serverのホームディレクトリ/marvel以下にあるimagesディレクトリを置き換えます。
この作業はAPEXのアップデート作業でもよく作業なのでお忘れなく。HTML DB1.5をAPEX3.2にアップデートしたようなものなので。

guppy:apex oracle$ pwd
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/marvel
guppy:marvel oracle$ ls
10ins.sql core doc ins.sql jlib readme.html upgrade.sql
builder coreins.sql images install.lst logs sbs utilities
guppy:marvel oracle$ mv images images_htmldb_1_5
guppy:marvel oracle$ cp -rf /Users/oracle/Downloads/apex/images .
guppy:marvel oracle$


.confファイルの変更
ここからがメイン。PowerPC上でインストール構築したので各種.confファイルなどのパスはホスト名がPowerPC上の値に設定されています。それら全てを移動してきたMacBook Pro(Intel x86)上の値に変更していきます。
最初はOracle HTTP Server向けコンフィグファイルから。(全てのconfファイルを確認し要変更と確定できた変更前の*.confファイルは、*.conf.15として退避しておくことにします。)

/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apexは、MacBook Pro上でのOracle HTTP Serverのホームディレクトリ。


guppy:conf oracle$ pwd

/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf
guppy:conf oracle$
guppy:conf oracle$ ll
total 680
-rwxr-xr-x 1 oracle oinstall 348 11 16 2004 access.conf
-rwxr-xr-x 1 oracle oinstall 348 11 16 2004 access.conf.default
-rw------- 1 oracle oinstall 1623 5 18 14:16 dms.conf
-rw------- 1 oracle oinstall 1633 5 18 14:14 dms.conf.15
-rw------- 1 oracle oinstall 1626 7 2 2004 dms.conf.sbs
-rwxr-xr-x 1 oracle oinstall 41721 5 18 14:41 httpd.conf
-rwxr-xr-x 1 oracle oinstall 42011 5 18 14:16 httpd.conf.15
-rwxr-xr-x 1 oracle oinstall 42011 5 17 12:23 httpd.conf.default
-rwxr-xr-x 1 oracle oinstall 39710 12 17 2004 httpd.conf.tmp
-rwxr-xr-x 1 oracle oinstall 12965 11 16 2004 magic
-rwxr-xr-x 1 oracle oinstall 12965 11 16 2004 magic.default
-rwxr-xr-x 1 oracle oinstall 15161 11 16 2004 mime.types
-rwxr-xr-x 1 oracle oinstall 15161 11 16 2004 mime.types.default
-rw-r--r-- 1 oracle oinstall 484 5 18 14:42 mod_oc4j.conf
-rw-r--r-- 1 oracle oinstall 490 5 18 14:41 mod_oc4j.conf.15
-rw-r--r-- 1 oracle oinstall 490 5 17 12:25 mod_oc4j.conf.default
-rw-r--r-- 1 oracle oinstall 503 7 2 2004 mod_oc4j.conf.tmp
-rwxr-xr-x 1 oracle oinstall 779 5 17 12:23 mod_osso.conf
-rwxr-xr-x 1 oracle oinstall 779 12 17 2004 mod_osso.conf.tmp
-rwxr-xr-x 1 oracle oinstall 323 5 17 12:23 ohs_opmn.xml
-rwxr-xr-x 1 oracle oinstall 323 12 17 2004 ohs_opmn.xml.sbs
-rwxr-xr-x 1 oracle oinstall 566 5 18 14:44 ohstarget.xml
-rwxr-xr-x 1 oracle oinstall 575 5 18 14:44 ohstarget.xml.15
-rwxr-xr-x 1 oracle oinstall 585 12 17 2004 ohstarget.xml.tmp
-rwxr-xr-x 1 oracle oinstall 197 5 18 14:45 oracle_apache.conf
-rwxr-xr-x 1 oracle oinstall 217 5 18 14:45 oracle_apache.conf.15
drwxr-xr-x 2 oracle oinstall 68 5 17 12:23 osso
-rwxr-xr-x 1 oracle oinstall 357 11 16 2004 srm.conf
-rwxr-xr-x 1 oracle oinstall 357 11 16 2004 srm.conf.default
-rwxr-xr-x 1 oracle oinstall 7861 5 18 14:51 ssl.conf
-rwxr-xr-x 1 oracle oinstall 8016 5 18 14:46 ssl.conf.15
-rwxr-xr-x 1 oracle oinstall 7192 12 17 2004 ssl.conf.tmp
drwxr-xr-x 4 oracle oinstall 136 5 17 12:23 ssl.crl
drwxr-xr-x 3 oracle oinstall 102 5 17 12:23 ssl.wlt
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ ls *.*.15
dms.conf.15 httpd.conf.15 mod_oc4j.conf.15
ohstarget.xml.15 oracle_apache.conf.15 ssl.conf.15

guppy:conf oracle$
guppy:conf oracle$

以下、変更したconfファイルのdiff。


PowerPC上のORACLE_HOMEのパスとIntel Mac上のパスが異なるのでパス関連及び、ホスト名関連は変更対象。


例えば、PowerMac G5上でOracle HTTP Server用のORACLE_HOMEは

/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex


だったが、Intel Mac上では
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex
とした。

guppy:conf oracle$
guppy:conf oracle$ diff dms.conf.15 dms.conf
30c30
< Alias /index.html /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/htdocs/index.html
---
> Alias /index.html /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/htdocs/index.html
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff mod_oc4j.conf.15 mod_oc4j.conf
15c15
< Allow from localhost g5server g5server
---
> Allow from localhost guppy guppy
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff ohstarget.xml.15 ohstarget.xml
5c5
< <Property NAME="OracleHome" VALUE="/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex"/>
---
> <Property NAME="OracleHome" VALUE="/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex" />
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff httpd.conf.15 httpd.conf
65c65
< ServerRoot "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache"
---
> ServerRoot "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache"
76c76
< #LockFile /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.lock
---
> #LockFile /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.lock
82c82
< PidFile /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.pid
---
> PidFile /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.pid
90c90
< ScoreBoardFile /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.scoreboard
---
> ScoreBoardFile /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.scoreboard
321c321
< ServerName g5server
---
> ServerName guppy
328c328
< DocumentRoot "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/htdocs"
---
> DocumentRoot "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/htdocs"
353c353
< <Directory "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/htdocs">
---
> <Directory "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/htdocs">
456c456
< TypesConfig /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/mime.types
---
> TypesConfig /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/mime.types
482c482
< MIMEMagicFile /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/magic
---
> MIMEMagicFile /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/magic
502c502
< ErrorLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/error_log
---
> ErrorLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/error_log
547c547
< CustomLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log common
---
> CustomLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log common
553,554c553,554
< #CustomLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/referer_log referer
< #CustomLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/agent_log agent
---
> #CustomLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/referer_log referer
> #CustomLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/agent_log agent
560c560
< #CustomLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log combined
---
> #CustomLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log combined
582,584c582,584
< Alias /icons/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/icons/"
< Alias /jservdocs/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Jserv/docs/"
< Alias /javacachedocs/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/javacache/javadoc/"
---
> Alias /icons/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/icons/"
> Alias /jservdocs/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Jserv/docs/"
> Alias /javacachedocs/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/javacache/javadoc/"
586c586
< Alias /perl/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin/"
---
> Alias /perl/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin/"
589c589
< <Directory "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/icons">
---
> <Directory "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/icons">
604c604
< ScriptAlias /cgi-bin/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin/"
---
> ScriptAlias /cgi-bin/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin/"
608c608
< # "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin" should be changed to whatever your ScriptAliased
---
> # "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin" should be changed to whatever your ScriptAliased
611c611
< <Directory "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin">
---
> <Directory "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin">
824a825,826
> AddType text/xml .xbl
> AddType text/x-compoment .htc
938c940
< Allow from localhost g5server g5server
---
> Allow from localhost quppy guppy
950c952
< # Allow from localhost g5server g5server
---
> # Allow from localhsot guppy guppy
989c991
< # CacheRoot "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/proxy"
---
> # CacheRoot "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/proxy"
1038c1040
< SetEnv PERL5LIB "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/5.6.1:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/site_perl/5.6.1"
---
> SetEnv PERL5LIB "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/5.6.1:
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/site_perl/5.6.1"
1047c1049
< # PerlSetEnv PERL5LIB "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/5.6.1:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/site_perl/5.6.1"
---
> # PerlSetEnv PERL5LIB "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/5.6.1:
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/site_perl/5.6.1"
1084,1086c1086,1088
< Alias /fastcgi/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/fastcgi/"
< ScriptAlias /fcgi-bin/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/fcgi-bin/"
< <Directory "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/fcgi-bin">
---
> Alias /fastcgi/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/fastcgi/"
> ScriptAlias /fcgi-bin/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/fcgi-bin/"
> <Directory "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/fcgi-bin">
1104c1106
< #include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Jserv/etc/jserv.conf"
---
> #include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Jserv/etc/jserv.conf"
1128c1130
< Allow from localhost g5server g5server
---
> Allow from localhost guppy guppy
1134c1136
< Allow from localhost g5server g5server
---
> Allow from localhost guppy guppy
1139c1141
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/mod_oc4j.conf"
---
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/mod_oc4j.conf"
1142c1144
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/dms.conf"
---
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/dms.conf"
1148c1150
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.conf"
---
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.conf"
1151c1153
< #include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/mod_osso.conf"
---
> #include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/mod_osso.conf"
1154c1156
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/oracle_apache.conf"
---
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/oracle_apache.conf"
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff oracle_apache.conf.15 oracle_apache.conf
1,2c1,2
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/plsql.conf"
< include "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/marvel.conf"
---
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/conf/plsql.conf"
> include "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/conf/marvel.conf"
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff ssl.conf.15 ssl.conf
23,25c23,25
< #SSLSessionCache dbm:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache
< #SSLSessionCache shmht:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache(512000)
< SSLSessionCache shmcb:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache(512000)
---
> #SSLSessionCache dbm:/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache
> #SSLSessionCache shmht:/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache(512000)
> SSLSessionCache shmcb:/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_scache(512000)
36c36
< SSLMutex file:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_mutex
---
> SSLMutex file:/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_mutex
45c45
< SSLLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_engine_log
---
> SSLLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_engine_log
81,85c81,85
< DocumentRoot "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/htdocs"
< ServerName g5server
< ServerAdmin you@your.address
< ErrorLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/error_log
< TransferLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log
---
> DocumentRoot "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/htdocs"
> ServerName guppy
> ServerAdmin your@mail.address
> ErrorLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/error_log
> TransferLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/access_log
100c100
< SSLWallet file:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.wlt/default
---
> SSLWallet file/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.wlt/default
117,118c117,118
< #SSLCARevocationPath /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.crl
< #SSLCARevocationFile /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.crl/ca-bundle.crl
---
> #SSLCARevocationPath /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.crl
> #SSLCARevocationFile /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf/ssl.crl/ca-bundle.crl
177c177
< <Directory "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin">
---
> <Directory "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/cgi-bin">
186c186
< CustomLog /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_request_log \
---
> CustomLog /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/ssl_request_log \
guppy:conf oracle$


modplsql関連コンフィグファイルの変更
パスの変更とPlsqlDatabaseUsernameとPlsqlDefaultPageの値が変っているので注意。また接続先は、MacBook proにインストールしたOracle 10g R2 10.2.0.4.0 for MacOSX(Intel x86-64)になるので忘れずに変更する。

変更対象の.confファイルは予め、*.conf.15として退避しておいた。

guppy:conf oracle$ pwd
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/conf
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff cache.conf.15 cache.conf
12c12
< PlsqlCacheDirectory /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/cache
---
> PlsqlCacheDirectory /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/cache
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff marvel.conf.15 marvel.conf
1,2c1,2
< Alias /i/ "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/marvel/images/"
< <Location /pls/htmldb>
---
> Alias /i/ "/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/marvel/images/"
> <Location /pls/apex>
7c7
< PlsqlDatabaseUsername HTMLDB_PUBLIC_USER
---
> PlsqlDatabaseUsername APEX_PUBLIC_USER
9,10c9,10
< PlsqlDatabaseConnectString localhost:1521:tiger.macdeoracle.info ServiceNameFormat
< PlsqlDefaultPage htmldb
---
> PlsqlDatabaseConnectString localhost:1521:leopard1.macdeoracle.jp ServiceNameFormat
> PlsqlDefaultPage apex
15c15
< PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
---
> PlsqlNLSLanguage JAPANESE_JAPAN..AL32UTF8
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$
guppy:conf oracle$ diff plsql.conf.15 plsql.conf
9c9
< LoadModule plsql_module /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/bin/modplsql.so
---
> LoadModule plsql_module /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/bin/modplsql.so
20c20
< PlsqlLogDirectory /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/logs
---
> PlsqlLogDirectory /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/logs
29c29
< include /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/dads.conf
---
> include /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/conf/dads.conf
34c34
< include /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/cache.conf
---
> include /Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/modplsql/conf/cache.conf
guppy:conf oracle$


Oracle HTTP ServerのHOMEディレクトリ以下にあるtnsnames.oraもMacBook ProのOracle 10g R2へ接続するよう変更(念のため)

変更前のtnsnames.oraはtnsnames.ora.15として事前に退避しておいた。

guppy:admin oracle$ pwd
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/network/admin
guppy:admin oracle$
guppy:admin oracle$
guppy:admin oracle$ guppy:admin oracle$ diff tnsnames.ora.15 tnsnames.ora
1c1
< (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tiger.macdeoracle.info))) =
---
> (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=leopard1.macdeoracle.jp))) =
7,16c7
< (SERVICE_NAME = tiger.macdeoracle.info)
< )
< )
< (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tiger.macdeoracle.info))) =
< (DESCRIPTION =
< (ADDRESS_LIST =
< (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
< )
< (CONNECT_DATA =
< (SERVICE_NAME = tiger.macdeoracle.info)
---
> (SERVICE_NAME = leopard1.macdeoracle.jp)
guppy:admin oracle$

apache起動用シェルスクリプトの書き換え(パスの変更が主)

要変更と判断したshell scriptは事前に、*.15として退避しておいた。

guppy:bin oracle$ pwd
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/bin
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff apachectl.15 apachectl
25,26c25,26
< ORACLE_HOME=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex; export ORACLE_HOME
< NLS_LANG=${NLS_LANG="JAPANESE_JAPAN.JA16EUC"}; export NLS_LANG
---
> ORACLE_HOME=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex; export ORACLE_HOME
> NLS_LANG=${NLS_LANG="JAPANESE_JAPAN.AL32UTF8"}; export NLS_LANG
29c29
< PERL5LIB=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/5.8.3:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/lib/site_perl/5.8.3 ; export PERL5LIB
---
> PERL5LIB=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/5.8.3:
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/lib/site_perl/5.8.3; export PERL5LIB
32c32
< TNS_ADMIN=${TNS_ADMIN="/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/network/admin"}; export TNS_ADMIN
---
> TNS_ADMIN=${TNS_ADMIN="/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/network/admin"}; export TNS_ADMIN
37c37
< LD_LIBRARY_PATH=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/lib:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/opmn/lib ; export LD_LIBRARY_PATH
---
> LD_LIBRARY_PATH=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/lib:
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/opmn/lib; export LD_LIBRAR_PATH
39c39
< LD_LIBRARY_PATH=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/lib:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/opmn/lib:${LD_LIBRARY_PATH} ; export LD_LIBRARY_PATH
---
> LD_LIBRARY_PATH=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/lib:
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/opmn/lib:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH
45c45
< DYLD_LIBRARY_PATH=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/lib:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/opmn/lib ; export DYLD_LIBRARY_PATH
---
> DYLD_LIBRARY_PATH=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/lib:
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/opmn/lib; export DYLD_LIBRARY_PATH
47c47
< DYLD_LIBRARY_PATH=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/lib:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/opmn/lib:${DYLD_LIBRARY_PATH} ; export DYLD_LIBRARY_PATH
---
> DYLD_LIBRARY_PATH=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/lib:
/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/opmn/lib:${DYLD_LIBRARY_PATH}; export DYLD_LIBRARY_PATH
52c52
< PIDFILE=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.pid
---
> PIDFILE=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/httpd.pid
55c55
< HTTPD=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/bin/httpd
---
> HTTPD=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/bin/httpd
91c91
< if eval $HTTPD -d /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache $args
---
> if eval $HTTPD -d /Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache $args
129c129
< if eval $HTTPD -d /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache $args
---
> if eval $HTTPD -d /Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache $args
149c149
< if eval $HTTPD -d /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache -t $args > /dev/null
---
> if eval $HTTPD -d /Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache -t $args > /del/null
261c261
< if eval $HTTPD -d /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache -t "$args"
---
> if eval $HTTPD -d /Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache -t "$args"
guppy:bin oracle$

以下、apachectlと同じディレクトリにあるが利用されているか不明なシェルスクリプトもとりあえず変更した。

guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff apxs.15 apxs
1c1
< #!/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/bin/perl
---
> #!/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/bin/perl
78,79c78,79
< my $CFG_PREFIX = q(/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache);
# substituted via APACI install
< my $CFG_SBINDIR = q(/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/bin);
# substituted via APACI install
---
> my $CFG_PREFIX = q(/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache);
> my $CFG_SBINDIR = q(/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/bin);
81,82c81,82
< my $CFG_LIBEXECDIR = q(/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/libexec);
# substituted via APACI install
< my $CFG_SYSCONFDIR = q(/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/conf);
# substituted via APACI install
---
> my $CFG_LIBEXECDIR = q(/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/libexec);
> my $CFG_SYSCONFDIR = q(/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/conf);
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff dbmmanage.15 dbmmanage
1c1
< #!/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/bin/perl
---
> #!/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/bin/perl
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff iasobf.15 iasobf
11c11
< ORACLE_HOME=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex
---
> ORACLE_HOME=/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff log_server_status.15 log_server_status
1c1
< #!/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/perl/bin/perl
---
> #!/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/perl/bin/perl
70c70
< $wherelog = "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/graph/";
# Logs will be like "/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/logs/graph/19960312"
---
> $wherelog = "/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/graph/";
# Logs will be like "/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/logs/graph/19960312"
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff root_sh_append.sh.15 root_sh_append.sh
3c3
< ORACLE_HOME="/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex";export ORACLE_HOME
---
> ORACLE_HOME="/Users/shared/u01/app/oracle/oracle/product/10.1.0/apex"; export ORACLE_HOME
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$
guppy:bin oracle$ diff ssl2ossl.15 ssl2ossl
8c8
< ORACLE_HOME=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex
---
> ORACLE_HOME=Users/shared/u01/app/oracle/oracle/product/10.1.0/apex
guppy:bin oracle$


実行してみる(listenerおよびOracle Databaseインスタンスは起動ずみ)
尚、startohsは、apachectl startをalias定義しておいたもの(本エントリの最初の部分参照)

guppy:˜ oracle$ startohs
/Users/Shared/u01/app/oracle/oracle/product/10.1.0/apex/Apache/Apache/bin/apachectl start: httpd started
guppy:˜ oracle$


まずOralce HTTP Serverにアクセスしてみる・・・・OK.

4


APEX3.2の管理画面にアクセスしてログイン.....OK
ログインしたついでに開発ユーザと作業領域を作成しておく。


5

6

13

14


開発ユーザでログインしてみる。......OK。やった〜〜〜!!!!! うまくいった

15

16


最後にバージョン等も確認しておく。

3


19

「Oracle 10g R2 10.2.0.4.0 for MacOSX (Intel x86-64)で未サポートとなっているOracle HTTP ServerとPL/SQL gatewayをOracle 10g R1 10.1.0.3.0 for MacOSX (PowerPC)環境から移動し、Rosettaの力でそれらを動かしてAPEX3.2を使う!。」・・・・・一件落着。。。。次回はOraTweetでも遊んでみますか...



バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)
Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)
Leopard de Oracle10g R2 (Intel x86-64) #13 (APEX3.2と遊ぶ #6)
Leopard de Oracle10g R2 (Intel x86-64) #14 (APEX3.2と遊ぶ #7)
Leopard de Oracle10g R2 (Intel x86-64) #15 (APEX3.2と遊ぶ #8)
Leopard de Oracle10g R2 (Intel x86-64) #16 (APEX3.2と遊ぶ #9)
Leopard de Oracle10g R2 (Intel x86-64) #17 (APEX3.2と遊ぶ #10)

| | | コメント (0) | トラックバック (0)

2009年6月 2日 (火)

Leopard de Oracle10g R2 (Intel x86-64) #17 (APEX3.2と遊ぶ #10)

Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第九話。

Intel版MacへOracle HTTP ServerとPL/SQL gatewayをORACLE_HOMEごと移動するための環境作りとしてPowerPC上でOracle 10g R1 10.1.0.3.0 + Oracle HTTP Server + HTMLDB 1.5をインストール及び構成する。のづづき。
前回、HTMLDB 1.5の構成でエラーが発生したが今回はそれを解決後、再実行してHTMLDBのログイン画面にアクセスするまで




78


発生したエラーを確認すると、前々回の場合と同様にjavaへのパスがおかしなことになってる。

--------------------------------------
次のConfiguration Assistantが正常に完了していません。これらのアシスタントは、製品を完全に構成するため、完了する必要があります。
ファイル/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/cfgtoollogs/configToolCommandsを実行して、
スキップまたは失敗したすべてのConfiguration Assistantを再実行します。
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdk/jre/bin/java
-classpath /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/marvel/jlib/htmlDBConfigClasses.jar:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdbc/lib/classes12.jar:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdk/jre/lib/rt.jar:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jlib/ojmisc.jar:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/oui/jlib/OraInstaller.jar: htmlDBConfig
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex
localhost 1521 tiger.macdeoracle.info SYSAUX * 保護された値。ログは取られません。
* * 保護された値。ログは取られません。 *
en,ja (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tiger.macdeoracle.info)))
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/marvel
--------------------------------------

上記赤太字部分を実行してみると・・・・

G5Server:˜ oracle$ /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdk/jre/bin/java
-su: /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdk/jre/bin/java: No such file or directory
G5Server:˜ oracle$

javaが見えてないね。細かく見ていくとシンボリックリンクjreが原因。ただ前々回のようにconfigToolCommandsを変更して再実行することはできない。
理由はconfigToolCommands内に全てのパラメータが記録されていない(「保護された値。ログは取られません。」となっている部分があるから...

ということでjavaへパスが通るように修正・・・・・

Oracle HTTP ServerをインストールしたORACLE_HOME/jdkへ移動してシンボリックリンクjreを作り直す。

G5Server:˜ oracle$ cd /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/jdk
drwxr-xr-x 42 oracle oinstall 1428 May 17 12:22 bin
lrwxrwxr-x 1 oracle oinstall 26 May 17 12:22 include -> /Library/Java/Home/include
lrwxrwxr-x 1 oracle oinstall 22 May 17 12:22 jre -> /Library/Java/Home/jre
drwxr-xr-x 38 oracle oinstall 1292 May 17 12:22 lib
lrwxrwxr-x 1 oracle oinstall 22 May 17 12:22 man -> /Library/Java/Home/man
G5Server:˜/u01/app/oracle/product/10.1.0/apex/jdk oracle$ rm jre
G5Server:˜/u01/app/oracle/product/10.1.0/apex/jdk oracle$ ln -s /System/Library/Frameworks/JavaVM.framework/Home jre
G5Server:˜/u01/app/oracle/product/10.1.0/apex/jdk oracle$ ll
total 24
drwxr-xr-x 42 oracle oinstall 1428 May 17 12:22 bin
lrwxrwxr-x 1 oracle oinstall 26 May 17 12:22 include -> /Library/Java/Home/include
lrwxr-xr-x 1 oracle oinstall 48 May 17 12:58 jre -> /System/Library/Frameworks/JavaVM.framework/Home
drwxr-xr-x 38 oracle oinstall 1292 May 17 12:22 lib
lrwxrwxr-x 1 oracle oinstall 22 May 17 12:22 man -> /Library/Java/Home/man
G5Server:˜/u01/app/oracle/product/10.1.0/apex/jdk oracle$


次Oracle HTTP ServerをインストールしたORACLE_HOME/oui/binへ移動後、OUIを起動。HTMLDBだけを再インストール、構成しちゃえば解決!!(これが嫌な場合はJDK1.4.2か1.5をデフォルトにしておいた方が無難だと思う。(但し、それでこの問題が再現しなくなるか確認したわけではありません。)

また、念には念ということでJAVA_HOME環境変数へもシンボリックリンクjreへ設定したパスを設定しておいた。JAVA_HOMEの設定が必要なのかどうか? という点に関して、ちょいとヤッツケモードだったので本当に必要なのかどうか確認していません。m(_ _)m

G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ pwd
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/oui/bin
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ ll
total 336
-rwxr-xr-x 1 oracle oinstall 412 May 17 12:22 addNode.sh
-rwxr-xr-x 1 oracle oinstall 20576 Aug 17 2004 lsnodes
drwxr-xr-x 12 oracle oinstall 408 May 17 12:22 resource
-rwxr-xr-x 1 oracle oinstall 136524 Aug 17 2004 runInstaller
-rwxr-xr-x 1 oracle oinstall 105 May 17 12:22 runInstaller.sh
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ ./runInstaller &
[1] 7026
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-05-17_01-26-05PM.
Please wait ...Oracle Universal Installer, バージョン 10.1.0.3.0 製品版
Copyright (C) 1999, 2004, Oracle. All rights reserved.

Executing install_name_tool...
Done Executing install_name_tool...



83

84

85

86

87

88

89

90

91

Oracle HTTP Serverにアクセスしてみると・・・OK.うまくいってる。
92

HTML DBにアクセスしてみる・・・OK .準備完了。
93

[1]+  Done                    ./runInstaller
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$ unset JAVA_HOME
G5Server:˜/u01/app/oracle/product/10.1.0/apex/oui/bin oracle$


うまくいった。わははは!


さてPowerMac上での最後の作業は、Oracle HTTP Server+HTMLDBをインストールしたORACLE_HOMEごとIntel Macへ移動する前にmarvel.confのPlsqlDatabasePasswordを再設定しておきます。(OUIで設定したHTML DBのパスワードとIntel MacにインストールしたAPEX3.2のパスワードを同じパスワードにすればこの作業は不要だと思われます。また、パスワードが分からなくなった場合でもAPEX3.2のパスワードを再設定後、以下の方法でmarvel.confのPlsqlDatabasePasswordを再設定、暗号化すれば解決できます。)

Oracle HTTP Server+HTMLDBをインストールしたORACLE_HOME/Apache/modplsql/confに移動して....
(ちなみに、Oracle HTTP Serverはdads.confでもmarvel.confでも使えるようになっているが、HTML DBの構成情報はmarvel.confに書き込まれるためmarvel.confを編集している。)

G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ pwd 
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ cp dads.conf dads.conf.org
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ cp marvel.conf marvel.conf.org
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ cp marvel.conf dads.conf
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ export ORACLE_HOME=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex
G5Server:~˜u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ perl dadTool.pl -o
----------------------------------------------------------------------------
Error : Cannot invoke utility 'dadobf'
Reason: The environment setting for PATH/LD_LIBRARY_PATH is not setup to load
the required libraries.
Action: Verify the environment settings needed for running this script


----------------------------------------------------------------------------
Hint: Use the '-h' option to get details on how to invoke the script
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ export PATH=$ORACLE_HOME:bin:.:$PATH
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ perl dadTool.pl -o

Information
----------------------------------------------------------------------------
Backed up older dads.conf as /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/dads.conf.orig.2009-05-17_19-09

All passwords successfully obfuscated. New obfuscations : 0
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$
Information
----------------------------------------------------------------------------
Backed up older dads.conf as /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf/dads.conf.orig.2009-05-17_19-11

All passwords successfully obfuscated. New obfuscations : 1
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ mv dads.conf marvel.conf
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ mv dads.conf.org dads.conf
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$ diff marvel.conf.org marvel.conf
8c8
< PlsqlDatabasePassword apex
---
> PlsqlDatabasePassword @BTpCAhnG7HjcGKTr0ns63KI=
G5Server:˜/u01/app/oracle/product/10.1.0/apex/Apache/modplsql/conf oracle$

Oracle HTTP ServerとHTML DB(関連するPL/SQLパッケージを除く)のORACLE_HOMEごとIntel Macへの移動準備完了。Rosettaの力を借りる。To be continued!



バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)
Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)
Leopard de Oracle10g R2 (Intel x86-64) #13 (APEX3.2と遊ぶ #6)
Leopard de Oracle10g R2 (Intel x86-64) #14 (APEX3.2と遊ぶ #7)
Leopard de Oracle10g R2 (Intel x86-64) #15 (APEX3.2と遊ぶ #8)
Leopard de Oracle10g R2 (Intel x86-64) #16 (APEX3.2と遊ぶ #9)

| | | コメント (0) | トラックバック (0)

2009年6月 1日 (月)

Leopard de Oracle10g R2 (Intel x86-64) #16 (APEX3.2と遊ぶ #9)

Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第九話。

Intel版MacへOracle HTTP ServerとPL/SQL gatewayをORACLE_HOMEごと移動するための環境作りとしてPowerPC上でOracle 10g R1 10.1.0.3.0 + Oracle HTTP Server + HTMLDB 1.5をインストール及び構成する。のづづき。
CompanionCDからOracle HTTP ServerとHTMLDB(現在はAPEX)をインストール、構成しちゃいます。


OTNからOracle 10g R1 10.1.0.3.0 for MacOSX(PowerPC)のCompanion CDをダウンロード、解凍。解凍後に作成されるDisk1ディレクトリへ移動しOUIによるインストール、構成を行います。

G5Server:˜ oracle$ cd /Volumes/DiscusWork/temp/Disk1/ 
G5Server:/Volumes/DiscusWork/temp/Disk1 oracle$ ll
total 24
drwxr-xr-x 15 oracle oinstall 510 May 16 23:34 doc
drwxr-xr-x 7 oracle oinstall 238 May 16 23:34 fonts
drwxr-xr-x 12 oracle oinstall 408 May 16 23:34 install
-rwxr-xr-x 1 oracle oinstall 1259 Dec 17 2004 runInstaller
drwxr-xr-x 15 oracle oinstall 510 May 16 23:36 stage
-rwxr-xr-x 1 oracle oinstall 4188 Dec 17 2004 welcome.htm
G5Server:/Volumes/DiscusWork/temp/Disk1 oracle$ ./runInstaller &
[1] 5831
G5Server:/Volumes/DiscusWork/temp/Disk1 oracle$ Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
・・・・以下略・・・・

以下、OUI各画面のスナップショット。インストール構成が今回のテーマではないのでポイントになる箇所以外解説はしていません。(過去の記事なども参考にしてみてください。)



60

61

ちなみに、インストールするORACLE_HOMEは他のDatabase等とは異なるディレクトリにするところがポイントですよん。
63

64

68

71

HTML DBのパスワードはIntel MacでインストールしたAPEX3.2で設定予定のパスワード(現時点では未設定)と同じにしておくと楽です。(異なっても問題はないです。)
それ以外の項目はこのデータベースのインストールで設定したりした値やパスワードです。
HTML DB(APEX)はSYSAUX以外の表領域でもいいですが、今回はSYSAUX以外にする必要はないのでSYSAUXにしてあります。

73_2

74

77

HTML DB Configuration Assistantでエラーが発生してますが、あとで再実行するのでここでは「OK」ボタンクリック後、エラーを無視してインストールを続行します。
78

79

お約束のroot.shの実行です。指示された場所にあるroot.shをrootユーザで実行します。が・・・・以前とは違いちょっとしたエラーが・・・・
80

お約束のroot.shを実行したら・・・・エラーですか・・・・
root_sh_append.shの該当行を見てみると・・・chownとchmodをfull path指定が間違っていたので修正。

G5Server:˜/u01/app/oracle/product/10.1.0/apex oracle$ sudo sh
Password:
sh-2.05b# /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/root.sh
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/
Apache/bin/root_sh_append.sh: line 7: /usr/bin/chown: No such file or directory
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/
Apache/bin/root_sh_append.sh: line 8: /usr/bin/chmod: No such file or directory
Running Oracle10 root.sh script...
¥nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n

Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
sh-2.05b#
sh-2.05b# which chmod
/bin/chmod
sh-2.05b# which chown
/usr/sbin/chown
sh-2.05b#
sh-2.05b#

root_sh_append.shの修正内容

sh-2.05b#
sh-2.05b# vi /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/bin/root_sh_append.sh
sh-2.05b# diff /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/bin/root_sh_append.sh.org
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/Apache/Apache/bin/root_sh_append.sh
7,8c7,8
< /usr/bin/chown root $SSOMIGRATE
< /usr/bin/chmod 6750 $SSOMIGRATE
---
> chown root $SSOMIGRATE
> chmod 6750 $SSOMIGRATE
sh-2.05b#

root.shを再実行。(こんどは上手く行った)

sh-2.05b#
sh-2.05b#
sh-2.05b# /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex/root.sh
Running Oracle10 root.sh script...
¥nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/apex

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:n

Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
sh-2.05b#

root.shを実行したらOUIを終了しておわり。
81

82


以前は発生していなかったのですが、HTMLDB Configuration Assistantで問題が発生しました。原因は前々回と同じくJavaSE6.0 Developer Preview 1をデフォルトにしていることが影響しているようです。ということで解決方法なども含めて、To be continued.



バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)
Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)
Leopard de Oracle10g R2 (Intel x86-64) #13 (APEX3.2と遊ぶ #6)
Leopard de Oracle10g R2 (Intel x86-64) #14 (APEX3.2と遊ぶ #7)
Leopard de Oracle10g R2 (Intel x86-64) #15 (APEX3.2と遊ぶ #8)

| | | コメント (0) | トラックバック (0)

2009年5月31日 (日)

Leopard de Oracle10g R2 (Intel x86-64) #15 (APEX3.2と遊ぶ #8)

Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第八話。

Intel版MacへOracle HTTP ServerとPL/SQL gatewayをORACLE_HOMEごと移動するための環境作りとしてPowerPC上でOracle 10g R1 10.1.0.3.0 + Oracle HTTP Server + HTMLDB 1.5をインストール及び構成する。のづづき。
dbcaでデータベースインスタンスを作っちゃいます。Oracle10g R1 10.1.0.3.0 for MacOSXをMacOSX Tigerで動作させるためのお約束の作業から開始!


OTNからダウンロードできるOracle 10g R1 10.1.0.3.0 for MacOSX(PowerPC)MacOSX Tiger以降ではdbcaがこけて起動しないのでUS OTNのフォーラムでもおなじみの以下の方法で解決する。

G5Server:˜ oracle$ cd $ORACLE_HOME/lib
G5Server:˜/u01/app/oracle/product/10.1.0/tiger/lib oracle$ mv libnnz10.dylib libnnz10.dylib.org
G5Server:˜/u01/app/oracle/product/10.1.0/tiger/lib oracle$ relink all
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/bin/genclntsh
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/lib/nautab.o

・・・・中略・・・・

Enterprise Manager native components relinked
IMPORTANT NOTE: To complete this Install/upgrade, please login as root and
execute the root.sh script.
G5Server:˜/u01/app/oracle/product/10.1.0/tiger/lib oracle$ mv libnnz10.dylib.org libnnz10.dylib
G5Server:˜/u01/app/oracle/product/10.1.0/tiger/lib oracle$ cd
G5Server:˜ oracle$

relinkが済んだらdbcaを起動してデータベースを作成。

G5Server:˜ oracle$ dbca &
[1] 5600
G5Server:˜ oracle$

以下dbcaの各画面。dbcaの使い方は今回のメインネタじゃないので各画面毎の解説はしていません。Tiger Server de Oracle10gマニュアルを参考にしてくださいね。)



Dbca_1

Dbca_2

Dbca_3

Dbca_4

Dbca_5_2

Dbca_6

Dbca_7

Dbca_8

Dbca_9_2

Dbca_10_2

Dbca_11

Dbca_12

Dbca_13

Dbca_14

Dbca_15

Dbca_16

Dbca_17

Dbca_18

Dbca_21

Dbca_22


データベースが作成できたら、リスナーの状態を確認してデータベースインスタンスの起動を確認!

G5Server:˜ oracle$ lsnrctl status

LSNRCTL for MacOS X Server: Version 10.1.0.3.0 - Production on 17-5月 -2009 12:06:27

Copyright (c) 1991, 2004, Oracle. All rights reserved.

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=g5server)(PORT=1521)))に接続中
リスナーのステータス
------------------------
別名 LISTENER
バージョン TNSLSNR for MacOS X Server: Version 10.1.0.3.0 - Production
開始日 17-5月 -2009 11:46:47
稼働時間 0 日 0 時間 19 分 40 秒
トレース・レベル off
セキュリティ ON: Local OS Authentication
SNMP OFF
パラメータ・ファイル /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/admin/listener.ora
ログ・ファイル /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/log/listener.log
リスニング・エンドポイントのサマリー...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=g5server)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=g5server)(PORT=8080))(Presentation=HTTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=g5server)(PORT=2100))(Presentation=FTP)(Session=RAW))
サービスのサマリー...
サービス"PLSExtProc"には、1件のインスタンスがあります。
インスタンス"PLSExtProc"、状態UNKNOWNには、このサービスに対する1件のハンドラがあります...
サービス"tiger.macdeoracle.info"には、1件のインスタンスがあります。
インスタンス"tiger"、状態READYには、このサービスに対する1件のハンドラがあります...
サービス"tigerXDB.macdeoracle.info"には、1件のインスタンスがあります。
インスタンス"tiger"、状態READYには、このサービスに対する1件のハンドラがあります...
コマンドは正常に終了しました。
G5Server:˜ oracle$ sqlplus /nolog

SQL*Plus: Release 10.1.0.3.0 - Production on 日 5月 17 12:06:32 2009

Copyright (c) 1982, 2004, Oracle. All rights reserved.

SQL> conn sys@tiger as sysdba
パスワードを入力してください:
接続されました。
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Prod
PL/SQL Release 10.1.0.3.0 - Production
CORE 10.1.0.3.0 Production
TNS for MacOS X Server: Version 10.1.0.3.0 - Production
NLSRTL Version 10.1.0.3.0 - Production

SQL> col comp_name for a50
SQL> set linesize 132
SQL> select comp_name,version,status from dba_registry;

COMP_NAME VERSION STATUS
-------------------------------------------------- ------------------------------ -----------
Oracle Database Catalog Views 10.1.0.3.0 VALID
Oracle Database Packages and Types 10.1.0.3.0 VALID
Oracle Workspace Manager 10.1.0.2.0 VALID
JServer JAVA Virtual Machine 10.1.0.3.0 VALID
Oracle XDK 10.1.0.3.0 VALID
Oracle Database Java Packages 10.1.0.3.0 VALID
Oracle Expression Filter 10.1.0.3.0 VALID
Oracle interMedia 10.1.0.3.0 VALID
Oracle Data Mining 10.1.0.3.0 VALID
Oracle Text 10.1.0.3.0 VALID
Oracle XML Database 10.1.0.3.0 VALID
OLAP Analytic Workspace 10.1.0.3.0 VALID
Oracle OLAP API 10.1.0.3.0 INVALID
OLAP Catalog 10.1.0.3.0 VALID
Spatial 10.1.0.3.0 VALID
Oracle Ultra Search 10.1.0.3.0 VALID
Oracle Enterprise Manager 10.1.0.3.0 VALID

17行が選択されました。

SQL>
SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS

SQL>


次回は当時HTMLDBと呼ばれていたAPEXとOracle HTTP ServerをPowerMac上でインストール、構成しちゃいます。

今回はここまで、To be continued.




バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)
Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)
Leopard de Oracle10g R2 (Intel x86-64) #13 (APEX3.2と遊ぶ #6)
Leopard de Oracle10g R2 (Intel x86-64) #14 (APEX3.2と遊ぶ #7)

| | | コメント (0) | トラックバック (0)

Leopard de Oracle10g R2 (Intel x86-64) #14 (APEX3.2と遊ぶ #7)

Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第七話。

Intel版MacへOracle HTTP ServerとPL/SQL gatewayをORACLE_HOMEごと移動するための環境作りとしてPowerPC上でOracle 10g R1 10.1.0.3.0 + Oracle HTTP Server + HTMLDB 1.5をインストール及び構成する。のづづき。
Oracle 10g R1 10.1.0.3.0のインストール中netcaがコケていた。ログから原因を探ると、デフォルトのJDKをJavaSE6.0 Developer Preview 1にしちゃっているのが原因でインストール時にORACLE_HOME内に作成されるjreのシンボリックリンクが正しく作成されていない。(java2 1.4.2のjreへのシンボリックリンクを作成しようとしているみたい・・・)

というところから...


以下、OUIの指示に従い
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/cfgtoollogs/configToolCommandsを実行してみると、/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//bin/javaがNo such file or directoryとなる。
どうもシンポリックリンク先にjreが存在していない。Tiger Server de Oracle10g を試した頃はJDK1.4.2をデフォルトにしていたのでこの問題は発生しなかったがJavaSE6.0 Developer Preview 1に変更してある影響なんだろう。

G5Server:˜ oracle$ /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/cfgtoollogs/configToolCommands
Oracle Net Configuration Assistant
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/cfgtoollogs/configToolCommands: line 2:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//bin/java: No such file or directory
G5Server:˜ oracle$


ということで、/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//bin/javaの部分をjavaに書き換えて再実行すればOK。

G5Server:/u01/app/oracle/product/10.1.0/tiger oracle$ 
--------------------------------------
次のConfiguration Assistantが正常に完了していません。これらのアシスタントは、製品を完全に構成するため、完了する必要があります。
ファイル/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/cfgtoollogs/configToolCommandsを実行して、
スキップまたは失敗したすべてのConfiguration Assistantを再実行します。
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//bin/java
-Duser.dir=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib
-classpath /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//lib/i18n.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//lib/rt.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ewt3.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ewtcompat-3_3_15.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/netcfg.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib/netcam.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib/netca.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/help4.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/jewt4.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/oracle_ice.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/share.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/swingall-1_1_1.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/srvmhas.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/srvm.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/tools
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ldapjclnt9.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ldapjclnt10.jar
oracle.net.ca.NetCA /orahome /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger
/orahnam OraDb10g_tiger /instype custom /inscomp client,oraclenet,javavm,server
/insprtcl tcp /cfg local /authadp NO_VALUE /nodeinfo NO_VALUE /responseFile
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/install/netca_typ.rsp
--------------------------------------

G5Server:˜ oracle$
G5Server:˜ oracle$ cat /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/cfgtoollogs/configToolCommands
G5Server:˜ oracle$ java
-Duser.dir=/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib
-classpath /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//lib/i18n.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jdk/jre//lib/rt.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ewt3.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ewtcompat-3_3_15.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/netcfg.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib/netcam.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/jlib/netca.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/help4.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/jewt4.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/oracle_ice.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/share.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/swingall-1_1_1.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/srvmhas.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/srvm.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/tools
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ldapjclnt9.jar
:/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/jlib/ldapjclnt10.jar
oracle.net.ca.NetCA /orahome /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger
/orahnam OraDb10g_tiger /instype custom /inscomp client,oraclenet,javavm,server
/insprtcl tcp /cfg local /authadp NO_VALUE /nodeinfo NO_VALUE /responseFile
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/install/netca_typ.rsp
コマンドライン引数の解析:
パラメータ "orahome" = /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger
パラメータ "orahnam" = OraDb10g_tiger
パラメータ "instype" = custom
パラメータ "inscomp" = client,oraclenet,javavm,server
パラメータ "insprtcl" = tcp
パラメータ "cfg" = local
パラメータ "authadp" = NO_VALUE
パラメータ "nodeinfo" = NO_VALUE
パラメータ "responsefile" = /Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/network/install/netca_typ.rsp
コマンドライン引数の解析が終了しました。
Oracle Net Servicesの構成:
デフォルトのローカル・ネーミング構成が完了しました。
次のリスナーを構成中:LISTENER
リスナーの構成が完了しました。
Oracle Net Listenerの起動:
リスナーの制御の実行:
/Volumes/Discus/4oracle/oracle/u01/app/oracle/product/10.1.0/tiger/bin/lsnrctl start LISTENER
リスナーの制御が完了しました。
リスナーの起動に成功しました。
プロファイルの構成が完了しました。
プロファイルの構成が完了しました。
デフォルトのローカル・ネーミング構成が完了しました。
作成されたネット・サービス名: tiger
Oracle Net Servicesの構成に成功しました。終了コードは次のとおりです。0
G5Server:˜ oracle$
G5Server:˜ oracle$

以下、netcaでlistenerとその構成中のスナップショット。(細かな解説は入れてませんのであしからず。)


Netca_1

Netca_2_2

Netca_3

Netca_4

Netca_5

Netca_6

Netca_7

Netca_8

Netca_9

Netca_10_2

Netca_11

Netca_12

Netca_13_2

Netca_14

Netca_15

Netca_16

Netca_16_2

Netca_17_2

Netca_18

次回はdbcaを利用したデータベース作成。

今回はここまで、To be continued.




バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)
Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)
Leopard de Oracle10g R2 (Intel x86-64) #13 (APEX3.2と遊ぶ #6)

| | | コメント (0) | トラックバック (0)

2009年5月27日 (水)

Leopard de Oracle10g R2 (Intel x86-64) #12 (APEX3.2と遊ぶ #5)

随分間が空いてしまったが、Oracle10g R2 10.2.0.4.0 for MacOSX (Intel x68-64)でAPEX3.2と遊ぶの第五話。

前回PowerMac G5へインストールしたOracle HTTP ServerとPL/SQL GatewayをそのままIntel Macへ移植移動しただけでOracle HTTP Server+PL/SQL gateway+Oracle Application Express3.2が動作した結果だけをお見せしたが、今回はその手順を。

前提としてIntel Mac以外に、PowerPC版のMacとMacOSX Tiger 10.4.11(ServerでもClient版でも可。)が必要。おそらく、PowerPC版MacはPantherでも可能(だと思う)。


手順の概要

PowerMac G5 (MacOSX Tiger Server 10.4.11)へ、Oracle 10g R1 10.1.0.3.0 for MacOSX (PowerPC版)のDatabase及び、CompanionCDよりOracle HTTP ServerとAPEX(当時はHTMLDBと呼ばれていた)をインストール及び構成(起動するところまで確認)後、Oracle HTTP Server用のORACLE_HOMEディレクトリをまるごとOracle 10g R2 10.2.0.4.0 for MacOSX(Intel x86-64)及びAPEX3.2インストール済みのMacBook Pro - MacOSX Leopard 10.5.6へ移動しコンフィグファイルを書き換えIntel Mac上で未サポート扱いのOracle HTTP Server + PL/SQL gateway + APEX3.2を使えるようにする。

まず、PowerMacの情報

gccは3.3を使うのでそれ以外の場合はgcc_selectで変更する。また、javaに関してはOracle10g R1のリリース当時はJDK1.4.2だったが、以前デフォルトをJavaSE6.0 Developer Preview 1へ切り替えたままで行うことにした。PowerPC版Macの場合JavaSE6.0は正式にリリースされていないのでJavaSE5.0までのほうが問題は少ない。。はずだが。

G5Server:˜ oracle$ sw_vers
ProductName: Mac OS X Server
ProductVersion: 10.4.11
BuildVersion: 8S169
G5Server:˜ oracle$
G5Server:˜ oracle$ uname -a
Darwin G5Server 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007;
root:xnu-792.24.17˜1/RELEASE_PPC Power Macintosh powerpc
G5Server:˜ oracle$
G5Server:˜ oracle$
G5Server:˜ oracle$ /usr/sbin/system_profiler SPHardwareDataType | grep CPU
CPU Type: PowerPC G5 (3.1)
Number Of CPUs: 2
CPU Speed: 2.7 GHz
L2 Cache (per CPU): 512 KB
G5Server:˜ oracle$
G5Server:˜ oracle$
G5Server:˜ oracle$ /usr/sbin/system_profiler SPApplicationsDataType | grep Xcode
Xcode:
Get Info String: Xcode version 2.4.1
Location: /Developer/Applications/Xcode.app

G5Server:˜ oracle$
G5Server:˜ oracle$ gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

G5Server:˜ oracle$
G5Server:˜ oracle$ gcc_select -l
Available compiler versions:
3.3 3.3-fast 4.0

G5Server:˜ oracle$
G5Server:˜ oracle$ sudo gcc_select 3.3
Password:
Default compiler has been set to:
gcc version 3.3 20030304 (Apple Computer, Inc. build 1819)
G5Server:˜ oracle$
G5Server:˜ oracle$ gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1819)
G5Server:˜ oracle$

G5Server:˜ oracle$
G5Server:˜ oracle$ java -version
java version "1.6.0-dp"
Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-34)
Java HotSpot(TM) Core VM (build 1.6.0-b88-17-release, interpreted mode)
G5Server:˜ oracle$

次に、Intel Macの情報

Oracle 10g R2 10.2.0.4.0 for MacOSX(intel x86-64)インストール時のまま。

Macintosh:˜ discus$ /usr/sbin/system_profiler SPHardwareDataType | grep -E '(Processor|Cores|Memory)'
Processor Name: Intel Core 2 Duo
Processor Speed: 2.2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
Memory: 2 GB
Macintosh:˜ discus$
Macintosh:˜ discus$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.6
BuildVersion: 9G55
Macintosh:˜ discus$
Macintosh:˜ discus$ uname -a
Darwin Macintosh.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00
PST 2008; root:xnu-1228.9.59˜1/RELEASE_I386 i386
Macintosh:˜ discus$
Macintosh:˜ discus$ gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5488)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Macintosh:˜ discus$
Macintosh:˜ discus$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)
Macintosh:˜ discus$
Macintosh:˜ discus$ system_profiler SPApplicationsDataType | grep Xcode
Xcode:
Get Info String: Xcode version 3.1.1
Location: /Developer/Applications/Xcode.app
Macintosh:˜ discus$

長くなるので(というより息子が風邪(フツーの)で保育園に行けない。しかも熱が37度台になってきたので走り回ってたり私が集中できないという理由もあり)今日はここまで、次回へつづく。:)

もう、そろそろ昼寝していた息子が起きそうだ...相手してやらないと・・・





バックナンバー

Oracle10g R2 for MacOSX (Intel x86-64) released !!!
Leopard de Oracle10g release 2 (Intel x86-64)
Leopard de Oracle10g R2 (Intel x86-64) #1
Leopard de Oracle10g R2 (Intel x86-64) #2
Leopard de Oracle10g R2 (Intel x86-64) #3 (ちょいと寄り道)
Leopard de Oracle10g R2 (Intel x86-64) #4 (Companion CD installation)
Leopard de Oracle10g R2 (Intel x86-64) #5 (dbstart and dbshut does not work!! But....)
Leopard de Oracle10g R2 (Intel x86-64) #6 (onsがバグっている?件..)
Leopard de Oracle10g R2 (Intel x86-64) #7 (iSQL*Plusのメッセージがものすごく怖い件)
Leopard de Oracle10g R2 (Intel x86-64) #8 - (APEX3.2と遊ぶ #1)
Leopard de Oracle10g R2 (Intel x86-64) #9 - (APEX3.2と遊ぶ #2)
Leopard de Oracle10g R2 (Intel x86-64) #10 (APEX3.2と遊ぶ #3)
Leopard de Oracle10g R2 (Intel x86-64) #11 (APEX3.2と遊ぶ #4)

| | | コメント (0) | トラックバック (0)

2008年4月22日 (火)

PL/SQL で Python Challenge Level 17 - 完

さて、少々間があいてしまったが、Python Challenge Level17の最終回。

前回、つまらないところでモタモタしてしまったが、Oracle Application Express 3.0.xを使わず、単純に mod_plsqlを使えばいいじゃんと言うことで。。。。

Level17は、以前にも書いたがWeb Applicationを書いたことのある人なら簡単に解けると思います。
今回は一部を除き、約90%がPL/SQL、残りをJava stored procedureで処理した。;)

ということで答えを導きだしたスクリーンショット。(答えはぼかしてますよ!)

Python_level17

次回、Python Challenge Level 18はこれまた気が向いたときにても。。。Enjoy Python Challenge!

| | | コメント (0) | トラックバック (0)

2008年4月17日 (木)

埋込みPL/SQL Gatewayで外部URLアクセス

Oracle11g R1 11.1.0.6.0 for Linux x86 and Oracle Application Expressという記事で埋込みPL/SQL GatewayをでPython Challengeを試してみたのだが・・・埋込みPL/SQL Gatewayを利用した場合、UTL_HTTPパッケージで外部のURLへアクセスすることはできないみたいなので、あきらめて通常のmod_plsqlでやってみるか・・・。Oracle11gからならACLで許可してやればアクセスできるのに、Oracle11gに内蔵されているXDB HTTP Serverではそれは効かないのね。。遊べると思ったのに。。orz.(Oracle11gの埋込みPL/SQL Gatewayの備忘録として残しておくか。。)

エラーメッセージは以下の通り。(Apexを3.1にするとできるようになったりして。。。2008/4/19追記)

ORA-31020:操作できません。 理由:For security reasons, ftp and http access over XDB repository is not allowed on server side

以下、埋込みPL/SQL Gatewayを利用したOracle Application Expressのスクリーンショット
9


4/18追記
どうもこれは埋込みPL/SQL GatewayというよりOracle Application Express側の影響のように思えてきた。10gのmod_plsql経由でもApexでは同じエラーだった。
ちなみに、mod_plsql経由で呼び出すだけならACL定義でアクセスするホストを許可してやるだけでOK。

以下にその時のスクリーンショットを載せておく。
答えにLevel17の答えに結びつく部分はぼかしてますよ〜〜。

19


でも何故、ApexからUTL_HTTPを利用するとXDB絡みのエラーになるんだ? 不思議すぎる。。。これは追々調べておくか。。何か手順から漏れていることがあったりして。。。。つづく。

さらに追記、やはり出来ない(11gからはできなくなったと言ったほうがいいだろう)というのが正しいようだ。10gではApexから直接UTL_HTTPパッケージからHTTPリクエスト出してfeedやらHTMLやらアクセスし放題だったのに〜〜〜、プンプンのプン。 ふ〜普通のmod_plsqlでやりますよ〜〜〜〜だ。

| | | コメント (0) | トラックバック (0)

2008年4月16日 (水)

Oracle11g R1 11.1.0.6.0 for Linux x86 and Oracle Application Express

Python Challenge Level17の記事を書く前に、やっておきたい事があったのでそちらを先に。

何をやりたかったのか? それは、APEX(Oracle Application Express)環境を作っておく事。

Python ChallengeではWeb Applicationとして処理して欲しそうな問題も多数存在する。Level17はそうしたほうが自然な感じをだと思ったので。。。(実際にはそこまでしなくても解けたのですが)
Oracle11gからApexがバンドルされたのと同時に、組み込みPL/SQL gateway機能も追加されたのでその辺りも含めて確認しておきたかった。

この組込PL/SQL Gatewayってなによ? って方もいると思うのだが、簡単に言うと、”Oracle11gのデータベース内部にHTTP Server+mod_plsqが内蔵されちゃっている”と思えばイメージしやすいんじゃないかと。

概要はこのあたりのマニュアルを読めば掴めると思います。はい。

マニュアル(英語)Understanding Oracle Application Express Architecture

データベースサーバがHTTPサーバを内蔵なんて言うといや〜な顔する人もいるだろうなぁ。なんて思ったりもします。(笑)
実際の所組込みPL/SQLゲートウェイは、外部に公開するというより開発目的など内部の閉じられた環境で利用されることがほとんどじゃないかなぁと個人的には思います。

Oracle11gをインストールした場合、OUIによるインストールでは明示的に除外しなければOracle Application Expressも同時にインストールされる。尚、埋込みPL/SQLゲートウェイを利用するためには、Oracle XML DBも必要。詳細はマニュアルに記載されているので、よ〜〜〜く読めば簡単に構成できます。
4.5 Postinstallation Tasks for Oracle Application Express

ちなみに、Oracle11g R1 1011.1.0.6.0に含まれるOracle Application Expressは、3.0.1.00.08とのこと、3.1が既にリリースされているのでアップグレードするのもいいが、今回は面倒なのでそのまま使うことにした。

では”素直に”マニュアルに従い作業を進める。。。(笑)

sysdbaで接続後、 $ORACLE_HOME/apex/apexconfを実行しadminユーザのパスワードとapexのport番号を設定してから、anonymousユーザをアンロックします。

G5Server:˜ discus$ ssh oracle@corydoras
oracle@corydoras's password:
Last login: Tue Apr 15 22:09:38 2008 from 192.168.1.19
[oracle@corydoras ˜]$
[oracle@corydoras ˜]$
[oracle@corydoras ˜]$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on 火 4月 15 22:46:50 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

> conn / as sysdba
接続されました。
SYS> spo apexconfig.log
SYS> @?/apex/apxconf

PORT
----------
8080

Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
Default values are in brackets [ ].
Press Enter to accept the default value.


Enter a password for the ADMIN user [] apex
Enter a port for the XDB HTTP listener [ 8080]
...changing HTTP Port

PL/SQLプロシージャが正常に完了しました。


PL/SQLプロシージャが正常に完了しました。


セッションが変更されました。

...changing password for ADMIN

PL/SQLプロシージャが正常に完了しました。


コミットが完了しました。

SYS> alter user anonymous account unlock;

ユーザーが変更されました。

SYS>

さて、お継ぎはマニュアルに記載されている通り(コピペでOKです。)外部のネットワークにアクセスする為にACLを変更しました。
(この例ではマニュアルと同様、どこでもアクセスできるようにしておきます。今回の場合は、python challengeのサイトだけアクセス許可しておけば問題ないのですが、いろいろと試したいことがあるので今回マニュアルの例をそのまま利用させてもらいました。)

SYS> l
1 DECLARE
2 ACL_PATH VARCHAR2(4000);
3 ACL_ID RAW(16);
4 BEGIN
5 -- Look for the ACL currently assigned to '*' and give FLOWS_030000
6 -- the "connect" privilege if FLOWS_030000 does not have the privilege yet.
7 SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
8 WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
9
10 -- Before checking the privilege, make sure that the ACL is valid
11 -- (for example, does not contain stale references to dropped users).
12 -- If it does, the following exception will be raised:
13 --
14 -- ORA-44416: Invalid ACL: Unresolved principal 'FLOWS_030000'
15 -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
16 --
17 SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
18 FROM XDB.XDB$ACL A, PATH_VIEW P
19 WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
20 EQUALS_PATH(P.RES, ACL_PATH) = 1;
21
22 DBMS_XDBZ.ValidateACL(ACL_ID);
23
24 IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'FLOWS_030000', 'connect')
25 IS NULL THEN
26 DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
27 'FLOWS_030000', TRUE, 'connect');
28 END IF;
29
30 EXCEPTION
31 -- When no ACL has been assigned to '*'.
32 WHEN NO_DATA_FOUND THEN
33 DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
34 'ACL that lets power users to connect to everywhere',
35 'FLOWS_030000', TRUE, 'connect');
36 DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
37* END;
SYS> /

PL/SQLプロシージャが正常に完了しました。

SYS>
SYS> commit;

コミットが完了しました。

SYS>


apexの管理画面にログインするには...以下のような形式のURLでブラウザからアクセスする。もちろん、ホストはOracle11g Databaseインスタンスがあるサーバですよ。

http://host:port/apex/apex_admin

Apex_admin_1

Apex_admin_2

Apex_admin_3

Apex_admin_4

ここまでで、application expressは利用可能な状態なのだが1つ問題がある、それは英語版のままだということ。(これは以前のOracle Application Expressでも同じですね。)
ということで、日本語リソースをロードします。尚、環境変数NLS_LANGは、AL32UTF8である必要があります。(これも以前と同じなので利用したことがあれば間違うことは無いと思いますが、注意しなければならない点ですよ。うっかりミスというのもありますから。)

[oracle@corydoras ˜]$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on 火 4月 15 23:06:03 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved.

> conn / as sysdba
接続されました。
SYS> !echo $NLS_LANG
japanese_japan.AL32UTF8

SYS> alter session set current_schema=FLOWS_030000;

セッションが変更されました。

SYS> @?/apex/builder/ja/load_ja
. ____ ____ ____ ____
. / \ | \ /\ / | /
.| || / / \ | | |
.| ||--- ---- | | |--
.| || \ / \ | | |
. \____/ | \/ \ \____ |____ \____
.
. Application Express Hosted Development Service Installation.
.........................................................

PL/SQLプロシージャが正常に完了しました。

Install Application Express applications

PL/SQLプロシージャが正常に完了しました。

APPLICATION 4420 - APEX - System Messages
Set Credentials...
Check Compatibility...
API Last Extended:20070525
Your Current Version:20070525
This import is compatible with version: 20070108
COMPATIBLE (You should be able to run this import without issues.)
Set Application ID...
...authorization schemes
...navigation bar entries
...application processes
...application items
...application level computations
...Application Tabs
...Application Parent Tabs
...Shared Lists of values
...Application Trees
...page groups
...PAGE 1.442: メッセージ
...lists
...breadcrumbs

中略

...PAGE 91.4009: 検証の作成 - 検証タイプ
...PAGE 92.4009: 標準タブの作成の確認
...PAGE 93.4009: 既存のタブ・セットの選択
...PAGE 94.4009: タブ情報の指定
...PAGE 95.4009: 親タブ・セット
...PAGE 96.4009: 新しいタブ名
...PAGE 97.4009: 表形式フォーム
...PAGE 98.4009: 検証の作成 - SQL検証
...PAGE 99.4009: SQLレポートの作成
...PAGE 100.4009: カレンダ・ページの作成
...PAGE 101.4009: ボタンのコピー
...PAGE 102.4009: リージョンの削除の確認
...PAGE 103.4009: ビルド・ステータス
...PAGE 104.4009: ビルド・チャート問合せ
...PAGE 105.4009: スクリプト・ファイルのエクスポート
...PAGE 106.4009: ビルド・チャート問合せ
...PAGE 107.4009: 作成ウィザード
...PAGE 108.4009: 作成ウィザード
...PAGE 109.4009: 作成ウィザード
...PAGE 110.4009: 作成ウィザード
...PAGE 111.4009: 作成ウィザード
...PAGE 112.4009: ツリー・ウィザード
...PAGE 113.4009: ツリー・ウィザード
...PAGE 114.4009: ツリー・ウィザード

中略

......scheme 108165525079033088.4709
...done
Adjust instance settings

PL/SQLプロシージャが正常に完了しました。


最後に、job_queue_process初期化パラメータが1以上になっているか確認します。
私も初めて気付いたがデフォルトで1000になっているんですね。びっくり。以前は1桁か2桁だったようなきがするが。

SYS> 
SYS> show parameter job_queue_processes

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
job_queue_processes integer 1000
SYS>

尚、今回はSSLの設定は行わないので早速Apexの管理ユーザログインし直し開発用作業領域と開発ユーザを作っておく。

Apex_ja_1

Apex_ja_2

Apex_ja_3

Apex_ja_4

Apex_ja_7

Apex_ja_8

Apex_ja_10

Apex_ja_9

さて、準備もできたので次へ行くか!

| | | コメント (0) | トラックバック (0)

2007年6月 6日 (水)

PL/SQL de File Upload / Download #5



Kate Bush - The Whole Story - Experiment IV Kate Bush - The Whole Story - Experiment IV


PL/SQL de File Upload / Download の最終回。

さて、前回は、日本語ファイル名のファイルをダウンロードするとFirefoxやMozilla以外のブラウザでは文字化け等が発生するというところまでだった。

また、IE6では、Content-Disposition: attachment; filenameを指定する方法であれば文字化けを回避できるということも確認した。

ただ、Mac De Oracleでは一番大切な Safari。そのSafariでは常に文字化けしていた。残念!〜〜で終わらせないのがMac De Oracle.

調べた結果、文字エンコードをUTF-8で統一すれば回避できるのでは? という考えに至り、即実行!



OTN-J の Code Tipsでも公開されました。(2007/6/16更新)
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2235
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2236


下記手順で mod_plsqlのファイルアップロード/ダウンロード環境を再構築した。

  1. データベースキャラクタセットをAL32UTF8で新たなデータベースを作成する。JA16SJISTILDEからAL32UTF8へデータベースキャラクタセットを変更することはできないため、新たにデータベースを作成することになる。
  2. dads.confのPlsqlNLSLanguageをJAPANESE_JAPAN.JA16SJISTILDEからJAPANESE_JAPAN.AL32UTF8へ変更する。
  3. ストアドプロシージャで生成するHTMLのcharsetをShift_JISからUTF-8へ変更する。
  4. utl_url.escapeプロシージャでURLエンコードする際の文字コードをShift_JISからAL32UTF8へ変更する。

1.データベースの作成

DBCA (Database Configuration Assistant)を利用し、データベースキャラクタセット:AL32UTF8のデータベースをサクッと作成しちゃいます。時間のかかるのはこの部分だけですね。
既に、データベースキャラクタセットがAL32UTF8であればこのステップはスキップしてください。

2.dads.confの変更

PlsqlNLSLanguageをJAPANESE_JAPAN.JA16SJISTILDEからJAPANESE_JAPAN.AL32UTF8へ変更します。
# ============================================================================ 
# mod_plsql DAD Configuration File
# ============================================================================
# 1. Please refer to dads.README for a description of this file
# ============================================================================

# Note: This file should typically be included in your plsql.conf file with
# the "include" directive.

# Hint: You can look at some sample DADs in the dads.README file

# ============================================================================
<Location /plsql_de_fileupload>
SetHandler pls_handler
Order deny,allow
Allow from all
AllowOverride None
PlsqlDatabaseUsername scott
PlsqlDatabasePassword tiger
PlsqlDatabaseConnectString 192.168.1.19:1521:amazon
PlsqlAuthenticationMode Basic
PlsqlDefaultPage scott.fileUploadForm
PlsqlDocumentTablename scott.discusDocTable
PlsqlDocumentPath docs
PlsqlDocumentProcedure scott.fileDownloader
PlsqlNLSLanguage JAPANESE_JAPAN.AL32UTF8
</Location>

3.プロシージャの変更
(1)ファイルを最大5件同時にアップロードするフォームを表示するプロシージャの変更。

charsetをShift_JISからUTF-8へ変更するだけ。
CREATE OR REPLACE PROCEDURE fileUpLoadForm
IS
numOfFiles CONSTANT PLS_INTEGER := 5;
BEGIN
htp.htmlopen;
htp.headopen;
htp.meta('CONTENT-Type',null,'text/html; charset=UTF-8');
htp.title('PL/SQL de File Upload');
htp.headclose;

htp.bodyopen;
htp.centeropen;
htp.print('<div align="center" style="width:500; height:600">');
htp.STRONG(
cattributes=> 'style="font-size:24px; color:#ff0000; '
|| 'text-shadow:1px 2px 3px #7f7f7f"',
ctext=> 'PL/SQL de ファイルアップロード'
);
htp.prn('<br><br>');
htp.formopen(
cenctype=>'multipart/form-data',
curl=>'action',cmethod=>'POST'
);

FOR i IN 1..numOfFiles LOOP
htp.prn(
'<p><span style="text-shadow:1px 2px 3px #7f7f7f">ファイルの選択:</span>'
);
htp.formfile(cname=>'file');
htp.br;
END LOOP;
htp.prn('<br><br><p>');
htp.formsubmit(cattributes=>'align=right',cvalue=>'アップロード');

htp.formclose;
htp.print('</div>');
htp.centerclose;
htp.bodyclose;
htp.htmlclose;
END;
/


(2)<FORM>要素のaction属性に指定するプロシージャの変更

charsetをShift_JISからUTF-8へ変更するだけ。
CREATE OR REPLACE PROCEDURE action
(
file IN owa_util.vc_arr
) IS
vOpe# number(10);
BEGIN
htp.htmlopen;
htp.meta('CONTENT-TYPE',null,'text/html; charset=UTF-8');
htp.headopen;
htp.title('PL/SQL de File Upload (Action)');
htp.headclose;
htp.bodyopen;
htp.header(1,'アップロード・ステータス');
htp.print('以下のアップロードが終了しました。<br><br>');
htp.prn('<span style="color:#ff0000; text-shadow:1px 2px 3px #7f7f7f">');
FOR i IN file.FIRST..file.LAST LOOP
IF FILE(i) IS NOT NULL THEN
htp.print('-&gt; ' || file(i) || '<br>');
END IF;
END LOOP;
htp.print('</span>');

-- 同一操作でアップロードしたファイルへ、同一操作番号を設定する。
SELECT upload_operation#.nextval INTO vOpe# FROM dual;
FOR i IN file.FIRST..file.LAST LOOP
UPDATE DISCUSDOCTABLE SET operation# = vOpe# WHERE name=file(i);
END LOOP;

htp.bodyclose;
htp.htmlclose;
END;
/


(3)ダウンロード可能なファイルリストを表示するプロシージャの変更。

charsetをShift_JISからUTF-8へ変更、utl_url.escapeでURLエンコードする際の文字コードをShift_JISからAL32UTF8へ変更。
CREATE OR REPLACE PROCEDURE fileList
IS
BEGIN
htp.htmlopen;
htp.headopen;
htp.meta('CONTENT-Type',null,'text/html; charset=UTF-8');
htp.title('PL/SQL de File upload - ダウンロード可能なファイル一覧');
htp.headclose;
htp.bodyopen;
htp.print(
'<span style="text-shadow:1px 2px 3px #7f7f7f; font-size: 22px">'
|| 'ダウンロードファイル一覧</span><br><br>'
);
FOR doc IN (SELECT name FROM discusDocTable) LOOP
htp.anchor('docs/' || utl_url.escape(doc.name, false, 'AL32UTF8'), 'docs/' || doc.name);
htp.br;
END LOOP;
htp.bodyclose;
htp.htmlclose;
END;
/

(4)ファイルのダウンロード時にmod_plsqlから呼び出されるプロシージャの変更。

charsetをShift_JISからUTF-8へ変更。
CREATE OR REPLACE PROCEDURE fileDownloader
IS
vFilePath VARCHAR2(256);
BEGIN
vFilePath := SUBSTR(owa_util.get_cgi_env('PATH_INFO'), 2);
wpg_docload.download_file(vFilePath);
EXCEPTION
WHEN OTHERS THEN
htp.htmlopen;
htp.headopen;
htp.meta('Ccntent-Type',null,'text/html; charset=UTF-8');
htp.headclose;
htp.bodyopen;
htp.print('ダウンロードファイル:' || vFilePath);
htp.print('<strong style="color:#ff0000">' || sqlerrm() || '</strong>');
htp.bodyclose;
htp.htmlclose;
END fileDownloader;
/


最後に、各プラットフォーム、各ブラウザでダウンロードしているスクリーンショットを。
MacOSX
Safari:
Macosx_safari

Firefox:
Macosx_firefox

Opera9.2:
Macosx_opera92

Linux(TurboLinux8 , CentOS4.4)
Firefox:
Centos44_firefox

SeaMonkey:
Centos44_seamonkey103

Mozilla1.4.2(TurboLinux8):
Turbolinux_mozilla142

Windows XP Professional
IE6:
Windows_ie6

FIrefox:
Windows_firefox


結果として、データベースからHTMLまでの文字エンコードを UTF-8 に統一することで、Firefox以外のブラウザで発生していた文字化けを回避することができるということになる。   (^▽^)v

追記、Oracle10gでは、(おそらく Oracle11g以降も)、新規に作成するデータベースのキャラクタセットは、Unicodeが推奨されているので、データベース作成時のキャラクタセットは、AL32UTF8にしておいたほうがいいだろうね。

以下、マニュアルより引用


データベース・キャラクタ・セットとしてのUnicodeの選択

すべての新規システム配置にUnicodeを使用することをお薦めします。レガシー・システムも最終的にはUnicodeに移行することをお薦めします。現在システムをUnicodeで配置すると、利便性、互換性および拡張性の面で多くの利点があります。Oracle Databaseの包括的なサポートにより、Unicodeの利点を活かしながら高パフォーマンス・システムを高速かつ容易に配置できます。現時点で多言語データをサポートする必要がない場合、またはUnicodeが必要ない場合でも、長期的には新規システムに最適な選択となる可能性が高く、結局は時間を短縮してコストを節減し、競争上の優位性を得ることになります。Unicodeの詳細は、第6章「Unicodeを使用した多言語データベースのサポート」を参照してください。


ついでに、グローバリゼージョンガイドの6 Unicodeを使用した多言語データベースのサポートあたりも熟読して最終的にどの文字コードやエンコーディングにするか判断するべし。

| | | コメント (0) | トラックバック (0)

2007年6月 5日 (火)

PL/SQL de File Upload / Download #4



Howard Jones - The Peaceful Tour - Things Can Only Get BetterHoward Jones - The Peaceful Tour - Things Can Only Get Better

PL/SQL de File Upload / Download のつづきです。


前回は、MacOSXのSafariで発生する問題。日本語ファイル名のファイルをダウンロードした際、ファイル名が、 hostname.拡張子 のような形式で保存されてしまうというところまでだった
Firefoxでは全く問題が発生していないので、ブラウザ依存の問題ということなのだろうか。


ということで、今回は、MacOSX以外のプラットフォームで試した結果+αも。



OTN-J の Code Tipsでも公開されました。(2007/6/16更新)
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2235
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2236


ファイル名が日本語であるファイルをダウンロードした場合のファイル名の文字化けについて

・Firefox 2 (Mozilla含む) : MacOSX/Linux/Windows XP すべてのプラットフォームで
 文字化け等の問題は発生しない。

Firefox2macosxok Firefox2windowsok Mozillalinuxok


・IE6 : 文字化け。

Ieng_1


・Safari : 前述の通り。 hostname.拡張子 という形式で保存されてしまう。

・Opera 9.2 (MacOSX版): URLエンコードされた文字列.拡張子 という形式で保存されてしまう


Operamacosxng



文字エンコードが統べてUTF-8だったらどうなんだろう。。。解決できたりして。。。という思いつきは置いといて、今日は、Shift_JISのままでIE6での文字化けを(無理矢理?)解決する方法があったので載せておくことにする。

参考:
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1011220


※2007/6/8一部修正
以下のようにContent-Disposition: attachment; filename=UTF-8でURLエンコードしたファイル名を指定する方式であれば、IE6でも正しいファイル名で保存できるようになる。
MacOSXのSafariでは依然として改善されず、下記方法では文字化けしてしまう。 

以下の方法もマニュアルに記載されている方法だが、あくまで英語圏で作成されたマニュアルの翻訳なので、ファイル名が日本語である場合の文字化け回避方法までは記載されていない。
文字化けの回避はブラウザにも依存する部分なのでなかなか面倒ですね。文字コードやエンコーディングがいろいろとありすぎてうれしくないな〜。

create or replace PROCEDURE fileDownloader
IS
vFilePath VARCHAR2(256);
vUserAgent VARCHAR2(512);
vContentType discusdoctable.BLOB_CONTENT%TYPE;
vMimeType discusdoctable.MIME_TYPE%TYPE;
vDocSize discusdoctable.DOC_SIZE%TYPE;
vFileName discusdoctable.NAME%TYPE;

BEGIN
vFilePath := SUBSTR(owa_util.get_cgi_env('PATH_INFO'), 2);
vUserAgent := owa_util.get_cgi_env('HTTP_USER_AGENT');
IF INSTR(vUserAgent,'MSIE') != 0 THEN
-- IE (かなり無理矢理な対応)
-- IE6 - Version 6.0.290000.2180.xpsp_sp2_dgr.070227-2254 で動作確認!
-- 他のバージョンのIEではどうなるか未確認。。。
SELECT
SUBSTR(name, INSTR(name, '/')+1),
blob_content,
mime_type,
doc_size
INTO
vFileName,
vContentType,
vMimeType,
vDocSize
FROM
discusDocTable
WHERE
name = vFilePath;
OWA_UTIL.mime_header(vMimeType, FALSE);
HTP.p('Content-Length: ' || TO_CHAR(vDocSize));
HTP.p(
'Content-Disposition: attachment; filename=' || utl_url.escape(vFileName,false, 'AL32UTF8')
);
OWA_UTIL.http_header_close;
wpg_docload.download_file(vContentType);
ELSE
-- その他のブラウザ(MacOSX Safariでは日本語ファイル名のダウンロードは文字化けする)
wpg_docload.download_file(vFilePath);
END IF;
EXCEPTION
WHEN OTHERS THEN
htp.htmlopen;
htp.headopen;
htp.meta('Ccntent-Type',null,'text/html; charset=Shift_JIS');
htp.headclose;
htp.bodyopen;
htp.print('ダウンロードファイル:' || vFilePath);
htp.print('<strong style="color:#ff0000">' || sqlerrm() || '</strong>');
htp.bodyclose;
htp.htmlclose;
END fileDownloader;
/

IE6で日本語ファイル名のファイルをダウンロードしたスクリーンショット。
Ieok

| | | コメント (0) | トラックバック (0)

2007年6月 4日 (月)

PL/SQL de File Upload / Download #3



Foundation - The Best of House, Vol 2 - Somebody's Watching Me Foundation - The Best of House, Vol 2 - Somebody's Watching Me



PL/SQL de File Upload / Download のつづきです。

前回は、プロシージャの実装まで行ったので実際にアップロードとダウンロードを行った結果を載せておく。


以下、MacOSXのSafariとFirefox2でファイルアップロードを行ったスクリーンショット

Modplsql3_1
Modplsql3_2
Modplsql3_3





OTN-J の Code Tipsでも公開されました。(2007/6/16更新)
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2235
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2236


5.ファイルアップロード後のドキュメント表の内容の例

(1)〜(4)のようなプロシージャを実装するだけで簡単にファイルアップロード/ダウンロードを行うWebアプリケーションを作成できる。
ただし、多少の癖はあるようですが。。。

尚、OPERATION#が等しいファイルは同一操作でアップロードされたことを意味する。今回、拡張した部分です!。想定通りうまくいきました。 (^^。

SCOTT> col name for a46
SCOTT> col content_type for a10
SCOTT> set linesize 132
SCOTT> set pagesize 1000
SCOTT> select name,content_type,doc_size,operation# from discusdoctable;

NAME CONTENT_TY DOC_SIZE OPERATION#
---------------------------------------------- ---------- ---------- ----------
F1416265333/DSC00002.JPG BLOB 32970 1
F462708383/CocoaAdvanced.zip BLOB 6189625 1
F701507294/Cocoaセミナー上級編.pdf BLOB 2673700 2
F622467197/MyQuickTimeMovieSoundTrack#3.m4a BLOB 663868 2
F1413335442/PLSQL_COLLECTION_sample.txt BLOB 15865 2
F612154227/ユーザの等価化.txt BLOB 1706 2
F1814846582/secondLife.jpg BLOB 231581 2
F621341128/ピクチャ 1.png BLOB 904551 3

8行が選択されました。

SCOTT>


まず、MacOSXの SafariとFirefoxで同じファイルをダウンロードしてみたのだが、ファイル名が日本語のファイルについては、Safariでダウンロードしたファイルのファイル名称は元のファイル名称とは異なりダウンロード元サーバのIPアドレスになっていた。(ホスト名を指定していればホスト名になっていただろう)。
また、Firefox(Mozillaでも)であればWindows/Linux上であっても文字化け等は発生しなかった。という結果であった。

Modplsql3_4

SafariとFirefoxで ピクチャ 1.pngというファイルを開いてたところなのだが、どちらもファイルは開けるものの、Safariではファイル名が192.168.1.19.pngとなっている。。
Modplsql3_5


Safariでも Cocoaセミナー上級編スライド.pdfをダウンロードしたのだが、ダウンロードされたファイル名は、192.168.1.19.pdfとなってしまった。FirefoxやMozillaでは問題ないんですが。。。

Modplsql3_6 Modplsql3_7

Modplsql3_8

初回にも書いたのだが、今回の環境は全てのレイヤーで文字コードはシフトJISにしてある。それがSafariの挙動に影響しているような・・・・・。
ということで、今日はここまで。 次回へつづく。

| | | コメント (0) | トラックバック (0)

2007年6月 3日 (日)

PL/SQL de File Upload / Download #2



Ultravox - Vienna - ViennaUltravox - Vienna - Vienna


さて、環境が整ったのでプロシージャを作成する。
(今回はマニュアルに記載されているサンプルのようにそれぞれ独立したプロシージャとしたが、これらを纏めてパッケージ化しても問題ない。 私が仕事で依頼されたものならパッケージとして実装するでしょうね。)



OTN-J の Code Tipsでも公開されました。(2007/6/16更新)
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2235
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2236

4.ファイルアップロード/ダウンロードプロシージャの例

注)style属性のtext-shadowを利用していますが、MacOSXのSafari以外のブラウザではドロップシャドウ効果はありません。


URLの例)- hostnameが discus 、 portが 7780 である場合、以下のようなURLでアクセスする。
http://discus:7780/plsql_de_fileupload/fileuploadform


(1)ファイルを最大5件同時にアップロードするフォームを表示するプロシージャ。

参考:
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1005985
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1011204

CREATE OR REPLACE PROCEDURE fileUpLoadForm
IS
numOfFiles CONSTANT PLS_INTEGER := 5;
BEGIN
htp.htmlopen;
htp.headopen;
htp.meta('CONTENT-TYpe',null,'text/html; charset=Shift_JIS');
htp.title('PL/SQL de File Upload');
htp.headclose;

htp.bodyopen;
htp.centeropen;
htp.print('<div align="center" style="width:500; height:600">');
htp.STRONG(
cattributes=> 'style="font-size:24px; color:#ff0000; '
|| 'text-shadow:1px 2px 3px #7f7f7f"',
ctext=> 'PL/SQL de ファイルアップロード'
);
htp.prn('<br><br>');
htp.formopen(
cenctype=>'multipart/form-data',
curl=>'action',cmethod=>'POST'
);

FOR i IN 1..numOfFiles LOOP
htp.prn(
'<p><span style="text-shadow:1px 2px 3px #7f7f7f">ファイルの選択:</span>'
);
htp.formfile(cname=>'file');
htp.br;
END LOOP;
htp.prn('<br><br><p>');
htp.formsubmit(cattributes=>'align=right',cvalue=>'アップロード');

htp.formclose;
htp.print('</div>');
htp.centerclose;
htp.bodyclose;
htp.htmlclose;
END;
/


(2)<FORM>要素のaction属性に指定するプロシージャの例

下記サンプルコードでは、マニュアルに記載されているサンプルの他に、同一操作でアップロードされたファイルに対してシーケンスから採番した操作番号を設定する処理を追加している。

CREATE OR REPLACE PROCEDURE action
(
file IN owa_util.vc_arr
) IS
vOpe# number(10);
BEGIN
htp.htmlopen;
htp.meta('CONTENT-TYPE',null,'text/html; charset=Shift_JIS');
htp.headopen;
htp.title('PL/SQL de File Upload (Action)');
htp.headclose;
htp.bodyopen;
htp.header(1,'アップロード・ステータス');
htp.print('以下のアップロードが終了しました。<br><br>');
htp.prn('<span style="color:#ff0000; text-shadow:1px 2px 3px #7f7f7f">');
FOR i IN file.FIRST..file.LAST LOOP
IF FILE(i) IS NOT NULL THEN
htp.print('-&gt; ' || file(i) || '<br>');
END IF;
END LOOP;
htp.print('</span>');

-- 同一操作でアップロードしたファイルへ、同一操作番号を設定する。
SELECT upload_operation#.nextval INTO vOpe# FROM dual;
FOR i IN file.FIRST..file.LAST LOOP
UPDATE DISCUSDOCTABLE SET operation# = vOpe# WHERE name=file(i);
END LOOP;

htp.bodyclose;
htp.htmlclose;
END;
/


(3)ダウンロード可能なファイルリストを表示するプロシージャの例。

URLの例) - hostname = discus, port = 7780である場合。
http://discus:7780/plsql_de_fileupload/filelist

マニュアルに記載されているファイルダウンロードのサンプルは、同マニュアルに記載されている他のサンプルコードに比べ、少々不親切(端折り過ぎ)なサンプルコードになっている。(CGIなどのWebアプリケーションに慣れている方なら想像できなくもないのだが・・・・。)
下記サンプルコードを見れば容易に理解できると思うのだが、アップロードしたファイルをダウンロードするには、dads.confのPlsqlDocumentPathパラメータで指定したドキュメントルートのパスと、ドキュメント表のname列の値を連結したパスでダウンロードするファイル指すURLを生成できる。

CREATE OR REPLACE PROCEDURE fileList
IS
BEGIN
htp.htmlopen;
htp.headopen;
htp.meta('CONTENT-Type',null,'text/html; charset=Shift_JIS');
htp.title('PL/SQL de File upload - ダウンロード可能なファイル一覧');
htp.headclose;
htp.bodyopen;
htp.print(
'<span style="text-shadow:1px 2px 3px #7f7f7f; font-size: 22px">'
|| 'ダウンロードファイル一覧</span><br><br>'
);
FOR doc IN (SELECT name FROM discusDocTable) LOOP
htp.anchor('docs/' || utl_url.escape(doc.name, false, 'Shift_JIS'), 'docs/' || doc.name);
htp.br;
END LOOP;
htp.bodyclose;
htp.htmlclose;
END;
/

(4)ファイルのダウンロード時にmod_plsqlから呼び出されるプロシージャの例。

このプロシージャは、(3)の方法でダウンロードする場合には必須であり、dads.confのPlsqlDocumentProcedureパラメータで指定する。
このプロシージャのサンプルコードはマニュアルにも記載されているのだが少々難解ですね。
実際には、以下のように wpg_docload.download_file()プロシージャを実行するだけの処理なのだがマニュアルのサンプルコードを見ると少々混乱してしまう! 私も少々考えましたもん!!!

以下コードを見てもらうと実は非常にシンプルな操作であることに気付くと思う。 解説するまでも無いと思うが念のために解説しておくと、wpg_docload.download_file(環境変数PATH_INFOの値)を実行しているだけなのである。

CREATE OR REPLACE PROCEDURE fileDownloader
IS
vFilePath VARCHAR2(256);
BEGIN
vFilePath := SUBSTR(owa_util.get_cgi_env('PATH_INFO'), 2);
wpg_docload.download_file(vFilePath);
EXCEPTION
WHEN OTHERS THEN
htp.htmlopen;
htp.headopen;
htp.meta('Ccntent-Type',null,'text/html; charset=Shift_JIS');
htp.headclose;
htp.bodyopen;
htp.print('ダウンロードファイル:' || vFilePath);
htp.print('<strong style="color:#ff0000">' || sqlerrm() || '</strong>');
htp.bodyclose;
htp.htmlclose;
END fileDownloader;
/


以上でプロシージャの作成は終わり。 簡単ですよね!。 

次回へつづく。

| | | コメント (0) | トラックバック (0)

2007年6月 1日 (金)

PL/SQL de File Upload / Download #1

先日、OTN-Jでmod_plsqlが提供するファイルアップロード/ダウンロードフレームワークに関連するスレッドがあり、その中でのやり取りと、作成したサンプルコードに多少手を加えて公開しておく。
ファイルダウンロード及び、ドキュメント表の拡張方法など明確な解説が無いこともあり、一部マニュアルの行間を読みつつ試した結果を含む。
(OTN-JのCodeTipsへも投稿する予定)
http://otn.oracle.co.jp/forum/message.jspa?messageID=35011699&tstart=0


mod_plsqlのファイルアップロード/ダウンロードに関する詳細は、下記ドキュメント参照のこと。
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1009257
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1005866


※ファイルアップロード/ダウンロードサンプルの概要

・複数のファイル(この例では最大5件)を1操作でアップロードする。
・同一操作でアップロードされた複数のファイルは、同一の操作番号(OPERATION#)を
 設定する。

※環境

HTTP Servetとデータベースは同ーサーバ上に構築。(尚、$ORACLE_HOMEは別にしてインストールする必要がある。)
尚、今回はWindows XP Professional上に構築し、Oracle SQL Developer for MacOSXを利用してプロシージャを作成した。

・サーバ

・Oracle10g HTTP Server (Apache Standalone 10.1.2.0.0)
  - Oracle Database 10g Compaion CD Release 1 (10.1.0.3.0)
・Oracle10g Database R1 EE
  - Oracle Database 10g Release 1 (10.1.0.3.0)
  - データベースキャラクタセット: JA16SJISTILDE
・OWA - 10.1.2.0.6

・クライアント(ブラウザ)

・Safari 2 - MacOSX 10.4.9
・Opera 9.2 - MacOSX 10.4.9
・FireFox 2 - MacOSX 10.4.9
・Firefox 2 - Linux (TurboLinux 8 - powered by United Linux1.0)
・FireFox 2 - Linux (CentOS 4.4)
・IE6 - Windows XP Professional
・FireFox 2 - Windows XP Professional



OTN-J の Code Tipsでも公開されました。(2007/6/16更新)
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2235
http://otn.oracle.co.jp/otn_pl/otn_tool/code_detail?n_code_id=2236


1.ドキュメント表の定義

ドキュメント表で定義する必要のある列に加て、OPERATION#という列を追加した。
尚、アップロードするコンテンツはすべて BLOB列へ格納する。
(同一操作でアップロードされたファイルに同一操作番号を設定する為に利用する。)
SCOTT> desc discusdoctable
名前 NULL? 型
----------------------------------------- -------- ----------------------------
NAME NOT NULL VARCHAR2(128)
MIME_TYPE VARCHAR2(128)
DOC_SIZE NUMBER
DAD_CHARSET VARCHAR2(128)
LAST_UPDATED DATE
CONTENT_TYPE VARCHAR2(128)
BLOB_CONTENT BLOB
OPERATION# NUMBER(10)

SCOTT>

2.操作番号を取得するシーケンスの定義

CREATE SEQUENCE UPLOAD_OPERATION#  
MINVALUE 1 MAXVALUE 9999999999
INCREMENT BY 1 START WITH 1
NOCACHE NOORDER NOCYCLE;

3.dads.confの定義

dads.confに関連するマニュアルは以下の通り。
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1012038
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1011190
http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19260-01/concept.htm#i1010512

# ============================================================================ 
# mod_plsql DAD Configuration File
# ============================================================================
# 1. Please refer to dads.README for a description of this file
# ============================================================================

# Note: This file should typically be included in your plsql.conf file with
# the "include" directive.

# Hint: You can look at some sample DADs in the dads.README file

# ============================================================================
<Location /plsql_de_fileupload>
SetHandler pls_handler
Order deny,allow
Allow from all
AllowOverride None
PlsqlDatabaseUsername scott
PlsqlDatabasePassword tiger
PlsqlDatabaseConnectString 192.168.1.19:1521:amazon
PlsqlAuthenticationMode Basic
PlsqlDefaultPage scott.fileUploadForm
PlsqlDocumentTablename scott.discusDocTable
PlsqlDocumentPath docs
PlsqlDocumentProcedure scott.fileDownloader
PlsqlNLSLanguage JAPANESE_JAPAN.JA16SJISTILDE
</Location>


環境、構成ファイル、ドキュメント表及び、その拡張部分の定義はこれで終了。次回へつづく。
Making1

| | | コメント (0) | トラックバック (0)