最初にOracle Spatial StudioのZIPファイルをダウンロードします。
echo "exit" | podman run --name sstudio -i -p 8090:8090 -v `pwd`:/opt/oracle/sql_scripts container-registry.oracle.com/database/sqlcl:latest
% echo "exit" | podman run --name sstudio -i -p 8090:8090 -v `pwd`:/opt/oracle/sql_scripts container-registry.oracle.com/database/sqlcl:latest
SQLcl: Release 24.3 Production on Fri Dec 20 02:43:07 2024
Copyright (c) 1982, 2024, Oracle. All rights reserved.
%
podman start sstudio
% podman start sstudio
sstudio
%
コンテナsstudioの起動を確認します。
% podman ps | grep sstudio
c0eeb2a66a0b container-registry.oracle.com/database/sqlcl:latest /nolog 5 minutes ago Up 3 minutes 0.0.0.0:8090->8090/tcp sstudio
%
% podman exec -it sstudio bash
[root@c0eeb2a66a0b sql_scripts]#
これからSpatial StudioのZIPファイルを展開しますが、unzipがインストールされていません。
[root@c0eeb2a66a0b sql_scripts]# dnf -y install unzip
Oracle Linux 8 BaseOS Latest (aarch64) 36 MB/s | 122 MB 00:03
Oracle Linux 8 Application Stream (aarch64) 32 MB/s | 58 MB 00:01 A
Last metadata expiration check: 0:00:06 ago on Fri Dec 20 02:50:17 2024.
Dependencies resolved.
=====================================================================================================
Package Architecture Version Repository Size
=====================================================================================================
Installing:
unzip aarch64 6.0-47.0.1.el8_10 ol8_baseos_latest 189 k
Transaction Summary
=====================================================================================================
Install 1 Package
Total download size: 189 k
Installed size: 474 k
Downloading Packages:
unzip-6.0-47.0.1.el8_10.aarch64.rpm 1.5 MB/s | 189 kB 00:00
-----------------------------------------------------------------------------------------------------
Total 1.4 MB/s | 189 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : unzip-6.0-47.0.1.el8_10.aarch64 1/1
Running scriptlet: unzip-6.0-47.0.1.el8_10.aarch64 1/1
Verifying : unzip-6.0-47.0.1.el8_10.aarch64 1/1
Installed:
unzip-6.0-47.0.1.el8_10.aarch64
Complete!
[root@c0eeb2a66a0b sql_scripts]#
このコンテナではユーザーoracleは作成されています。ユーザーoracleに切り替え、Oracle Spatial StudioのZIPファイルを解凍します。
unzip /opt/oracle/sql_scripts/Oracle_Spatial_StudioQS_24.2.0.0.0.2.zip
[root@c0eeb2a66a0b sql_scripts]# su - oracle
[oracle@c0eeb2a66a0b ~]$ unzip /opt/oracle/sql_scripts/Oracle_Spatial_StudioQS_24.2.0.0.0.2.zip
Archive: /opt/oracle/sql_scripts/Oracle_Spatial_StudioQS_24.2.0.0.0.2.zip
creating: Oracle_Spatial_Studio/
creating: Oracle_Spatial_Studio/conf/
inflating: Oracle_Spatial_Studio/conf/keystore
inflating: Oracle_Spatial_Studio/conf/jetty-realm.properties
inflating: Oracle_Spatial_Studio/conf/server.json
inflating: Oracle_Spatial_Studio/start.sh
inflating: Oracle_Spatial_Studio/stop.sh
[中略]
inflating: Oracle_Spatial_Studio/moduser.sh
inflating: Oracle_Spatial_Studio/README.txt
inflating: Oracle_Spatial_Studio/moduser.bat
inflating: Oracle_Spatial_Studio/restart.bat
inflating: Oracle_Spatial_Studio/start.bat
inflating: Oracle_Spatial_Studio/stop.bat
[oracle@c0eeb2a66a0b ~]$
作成されたディレクトリOracle_Spatial_Studioに移り、conf/server.jsonを修正します。HTTPでの待ち受けの許可とポート番号を変更します。
cd Oracle_Spatial_Studio/
vi conf/server.json
[oracle@c0eeb2a66a0b ~]$ cd Oracle_Spatial_Studio/
[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$ vi conf/server.json
"serverConfig": {
"host": "0.0.0.0",
"httpPort": 8090,
"httpsEnabled": false,
"httpEnabled": true,
"httpsPort": 4040,
ユーザーadminのパスワードを変更します。jetty-util-<バージョン>.jarに含まれるorg.eclipse.jetty.util.security.Passwordを呼び出し、暗号化されたパスワードを出力します。
java -cp servletContainer/jetty-util-9.4.51.v20230217.jar org.eclipse.jetty.util.security.Password admin <パスワード>
CRYPT:として出力された行をコピーします。
[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$ java -cp servletContainer/jetty-util-9.4.51.v20230217.jar org.eclipse.jetty.util.security.Password admin ********
2024-12-20 03:00:29.577:INFO::main: Logging initialized @41ms to org.eclipse.jetty.util.log.StdErrLog
Studio3344
OBF:******************************
MD5:******************************
CRYPT:***********
[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$
conf/jetty-realm.propertiesを開き、adminのパスワードのCRYPT:で始まる部分を、上の作業でコピーしたパスワードで置き換えます。
admin: CRYPT:***********,valid-user,SGTech_SystemAdmin
daustin: CRYPT:**********,valid-user
bruce: CRYPT:**********,valid-user
必要であれば、daustinおよびbruceのパスワードも変更しておきます。
[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$ sh start.sh
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2024-12-20 03:06:25.375:INFO::main: Logging initialized @406ms to org.eclipse.jetty.util.log.StdErrLog
2024-12-20 03:06:25.438:INFO:oejs.Server:main: jetty-9.4.51.v20230217; built: 2023-02-17T08:19:37.309Z; git: b45c405e4544384de066f814ed42ae3dceacdd49; jvm 17.0.10+11-LTS-240
2024-12-20 03:06:25.447:INFO:oejs.AbstractConnector:main: Started ServerConnector@3e598df9{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2024-12-20 03:06:25.447:INFO:oejs.Server:main: Started @479ms
2024-12-20 03:06:25.987:INFO:oag.JettyConfigurerImpl:main: Configuring /spatialstudio with realm 'myrealm', /home/oracle/Oracle_Spatial_Studio/conf/jetty-realm.properties
2024-12-20 03:06:26.569 WARN [bootstrap] [main] o.sgtech.util.localization.Messages - DIFFERENT-LOCALE-FOUND: ResourceBundle 'oracle.sgtech.util.messages.UtilMessages' could not be found for Locale 'en-US', but was found for 'und'. Proceeding with found bundle.
[中略]
INFO: Sync Manager timer is started at Fri Dec 20 03:06:30 UTC 2024
Dec 20, 2024 3:06:35 AM oracle.maps.suggest.repo.Repository <init>
INFO: Creating repository with LOCAL index.
Dec 20, 2024 3:06:35 AM oracle.maps.suggest.cache.MatchCacheService invalidateCache
INFO: Cleaning cache matches...
Dec 20, 2024 3:06:35 AM oracle.maps.suggest.repo.IndexSyncManager finalizeIndexing
INFO: New index is ready for oraclemaps_pub
Dec 20, 2024 3:06:35 AM oracle.maps.suggest.repo.IndexSyncManager run
INFO: Indexing folder does not contain any JSON map layer: /home/oracle/.sgtech/catalogs/oraclemaps_pub/50
INFO: Indexing folder does not contain any JSON map layer: /home/oracle/.sgtech/catalogs/oraclemaps_pub/50
^C[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$
vi $HOME/.sgtech/sgtech_config.json
{
"version": "24.1.0",
"_comments": [
"Product Configuration for Oracle Spatial Studio.",
"Top level properties are: ",
" - work_dir: the runtime working folder of the Studio app; empty to use same folder as this configuration file.",
" - https_only: if set to 'true', then Studio will only allow HTTPS access",
" - master_seed: the randomly generated seed used by Studio for security purposes",
" - metadata_schema: defines details of the Studio's own metadata schema in a 12.2+ Oracle database instance.",
" - upload: defines settings related to dataset uploads",
" - logging: application-wide logging settings",
" - jobs: application-wide settings related to internal job queuing"
],
"work_dir": "",
"https_only": false,
"master_seed": "FLebPfdY17eo0B6KZ5O8mInVTTfEHsou",
"metadata_schema":{
[oracle@c0eeb2a66a0b Oracle_Spatial_Studio]$ sh start.sh
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2024-12-20 03:14:08.056:INFO::main: Logging initialized @416ms to org.eclipse.jetty.util.log.StdErrLog
2024-12-20 03:14:08.118:INFO:oejs.Server:main: jetty-9.4.51.v20230217; built: 2023-02-17T08:19:37.309Z; git: b45c405e4544384de066f814ed42ae3dceacdd49; jvm 17.0.10+11-LTS-240
2024-12-20 03:14:08.127:INFO:oejs.AbstractConnector:main: Started ServerConnector@3e598df9{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2024-12-20 03:14:08.127:INFO:oejs.Server:main: Started @488ms
2024-12-20 03:14:08.189:INFO:oag.JettyConfigurerImpl:main: Configuring /spatialstudio with realm 'myrealm', /home/oracle/Oracle_Spatial_Studio/conf/jetty-realm.properties
2024-12-20 03:14:08.806 WARN [bootstrap] [main] o.sgtech.util.localization.Messages - DIFFERENT-LOCALE-FOUND: ResourceBundle 'oracle.sgtech.util.messages.UtilMessages' could not be found for Locale 'en-US', but was found for 'und'. Proceeding with found bundle.
2024-12-20 03:14:08.807 INFO [bootstrap] [main] o.sgtech.util.localization.Messages - BUNDLE-REGISTRATION-SUCCEEDED: ResourceBundle 'oracle.sgtech.util.messages.UtilMessages' with Locale 'und' was regi
[中略]
Dec 20, 2024 3:14:17 AM oracle.maps.suggest.repo.Repository <init>
INFO: Creating repository with LOCAL index.
Dec 20, 2024 3:14:17 AM oracle.maps.suggest.cache.MatchCacheService invalidateCache
INFO: Cleaning cache matches...
Dec 20, 2024 3:14:17 AM oracle.maps.suggest.repo.IndexSyncManager finalizeIndexing
INFO: New index is ready for oraclemaps_pub
Dec 20, 2024 3:14:17 AM oracle.maps.suggest.repo.IndexSyncManager run
INFO: Indexing folder does not contain any JSON map layer: /home/oracle/.sgtech/catalogs/oraclemaps_pub/97
ブラウザより以下のURLにアクセスします。ポート番号は、デフォルトから変更していなければ8080です。
% podman exec -it apex-db bash
bash-4.4$
bash-4.4$ sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Production on Fri Dec 20 03:25:01 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> alter session set container = freepdb1;
Session altered.
SQL>
create user spatial_studio identified by [パスワード];
SQL> create user spatial_studio identified by *********;
User created.
SQL>
grant connect, create procedure, create sequence, create session, create synonym, create table, create trigger, create type, create view to SPATIAL_STUDIO;
SQL> grant connect, create procedure, create sequence, create session, create synonym, create table, create trigger, create type, create view to SPATIAL_STUDIO;
Grant succeeded.
SQL>
alter user spatial_studio quota unlimited on users;
SQL> alter user spatial_studio quota unlimited on users;
User altered.
SQL>
以上でSpatial Studioのメタデータを保持するスキーマが準備できました。