2013年9月25日水曜日

Oracle Database 12c Tips - Configure APEX / APEXを構成する

English Follows Japanese 

Oracle Database 12cにはデフォルトでAPEX(Oracle Application Express)がインストールされている。

APEXを構成し、使用可能にしてみる。
##なお、以下の設定ではOracle APEXリスナーやOracle HTTPサーバを使用せず、DBにEmbeddedされているPL/SQL Gatewayを使用する構成となる。

1)コマンドラインでORACLE_HOME\APEXフォルダに移動

2)SQLPLUSでプラガブルDBに接続
  ・直接接続
    sqlplus sys/****@pdborcl as sysdba
  ・コンテナDB経由で接続
    sqlplus sys/**** as sysdba
    alter session set container = pdborcl;
     ##接続しているDB名の確認
     show con_name
     ####パラメータのDB_nameはコンテナDBもプラガブルDBも同一(コンテナDBの名前)になるのでDB_nameでの接続籍確認は不可

3)APEX構成スクリプトを実行
   @apxconf
    ##XDB HTTP Listner portはデフォルトの8080に指定
    ##Apex ADMINのパスワードは大文字1文字以上、数字1文字以上、記号1文字以上を含むこと
4)コンテナDBに接続しANONYMOUSアカウントをUNLOCKする
  alter user ANONYMOUS account unlock;

5)APEXCoreEngineユーザへのConnect権限を追加
  プラガブルDBへSYSDBAで接続
  以下のページの4.5.3.1 Granting Connect Privilegesに記載されている2つのスクリプトをコピペして実行
    http://st-doc.us.oracle.com/12/121/install.121/e17958/db_install.htm#HTMIG214

6)APEXのAdmin専用Pageへ接続
  http://hostname:port/apex/apex_admin
  User:ADMIN
  Password:上記のStep3で設定したPassword
  ##このADMIN専用ページはWorkspace名:INTERNAL

7)APEX Admin PageでUserのWorkspaceを作成

---これで構築は終了

おまけ)プラガブルDBのEM ExpressのPort番号を再設定
  exec DBMS_XDB_CONFIG.SETHTTPSPORT(5510)
  ##なぜかStep3の設定以降EM Expressへの接続が不可になったので再設定

------------------------------------------------

APEX(Oracle Application Express) will be installed when installing Oracle Database 12c.

You can only configure to enable APEX on your DB

##The following is the way to use PL/SQL Gateway, embedded in DB, instead of Oracle APEX Listner or Oracle HTTP Server.
##My case is having one pluggable DB on one container DB.
##Container DB name : orcl
##Pluggable DB name : pdborcl

1)on command prompt, change your working directry to ORACLE_HOME\APEX

2)connect a pluggable DB through SQLPLUS as sysdba
  ・Direct connection
    sqlplus sys/****@pdborcl as sysdba
  ・Through the container DB
    sqlplus sys/**** as sysdba
    alter session set container = pdborcl;
     ##Confirm the db name you have made a connection
     show con_name
     ####You cannot ensure the DB name with DB parameter:DB_name, as the both have the same value for the parameter: this case, orcl

3)run APEX configuration script
   @apxconf
    ##XDB HTTP Listner port: 8080
    ##Apex ADMIN password requires one capital letter, one numeric character and one symbol letter(!$%#&, etc..)

4)on container DB, unlock ANONYMOUS account
  alter user ANONYMOUS account unlock;

5)on pluggable DB, Add connect privilege to APEXCoreEngine user
  copy and paste the two scripts from [4.5.3.1 Granting Connect Privileges] on the following URL
    http://st-doc.us.oraclele .com/12/121/install.121/e17958/db_install.htm#HTMIG214

6)go to APEX Admin Page
  http://hostname:port/apex/apex_admin
  User:ADMIN
  Password:teh password you have set on the Step3
  ##The Admin Page is also one APEX application -> Workspace name:INTERNAL

7)create new workspace on APEX Admin Page


Note: If you have configured EM Express for the pluggable DB, you might now face the issue you cannot access to the page. Here is the solution.
  Solution: re-set EX Express Port number on the pluggable DB
            exec DBMS_XDB_CONFIG.SETHTTPSPORT(5510)

0 件のコメント:

コメントを投稿