Tuesday, September 24, 2013

Multitenant Self-Service Provisioning (BETA) - Database 12c

Today, I found some tweet message from @joelkallman

 After checking, Oracle Database 12c Multitenant Applications: Multitenant Self-Service Provisioning - BETA. The Oracle Multitenant Self-Service Provisioning system provides an interface to Oracle Database12c Multitenant and allows for the self-service provisioning of Pluggable Databases (PDBs). It's useful to learn about PDBs, Really? First thing, I should setup it before answer a question.
Checked Prerequisites:
- Oracle Database 12c Release 1
- Oracle Application Express 4.2.3.00.08
- Oracle Application Express Listener 2.0.4

First of all, I read readme.txt file and created new CDB and patched APEX (p17347169)
SQL> select con_id, comp_id, version from  cdb_registry where comp_id='APEX';
    CON_ID COMP_ID                        VERSION
---------- ------------------------------ ------------------------------
         2 APEX                           4.2.3.00.08
         1 APEX                           4.2.3.00.08

SQL>
SQL> show parameter domain

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_domain                            string
SQL>

SQL> @apex_rest_config_con.sql

PL/SQL procedure successfully completed.

Enter a password for the APEX_LISTENER user              []
Enter a password for the APEX_REST_PUBLIC_USER user              []

Performing installation in multitenant container database in the background.
The installation progress is spooled into apex_rest_config_con*.log files.

Please wait...

Installation completed. Log files for each container can be found in:

apex_rest_config_con*.log

You can quickly scan for ORA errors or compilation errors by using a utility
like grep:

grep ORA- *.log
grep PLS- *.log

SQL>
SQL> alter user APEX_PUBLIC_USER identified by password account unlock;

User altered.

SQL>
SQL> select username, account_status from dba_users where username like 'APEX%';

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
APEX_REST_PUBLIC_USER          OPEN
APEX_PUBLIC_USER               OPEN
APEX_LISTENER                  OPEN
APEX_040200                    EXPIRED & LOCKED

SQL> grant set container to APEX_PUBLIC_USER container=all;

Grant succeeded.

SQL> grant set container to APEX_REST_PUBLIC_USER container=all;
Grant succeeded.

SQL> grant set container to APEX_LISTENER container=all;
Grant succeeded.

SQL>
Then, Configured apex listener.
[oracle@test12c apex_listener]$ pwd
/home/oracle/apex_listener
[oracle@test12c apex_listener]$ ls
apex.war  docs  javadoc  readme.html
[oracle@test12c apex_listener]$ echo db.serviceNameSuffix= > patch.properties
[oracle@test12c apex_listener]$
[oracle@test12c apex_listener]$ cp -a ../patch/images/ .
[oracle@test12c apex_listener]$ pwd
/home/oracle/apex_listener
[oracle@test12c apex_listener]$ ls
apex.war  docs  images  javadoc  patch.properties  readme.html
[oracle@test12c apex_listener]$
[oracle@test12c apex_listener]$ java -jar apex.war
This Listener instance has not yet been configured.
Please complete the following prompts

Enter the location to store configuration data:/home/oracle/apex_listener
Sep 24, 2013 1:46:59 PM oracle.dbtools.common.config.cmds.ConfigDir execute
INFO: Set config.dir to /home/oracle/apex_listener in: /home/oracle/apex_listener/apex.war
Sep 24, 2013 1:47:02 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /home/oracle/apex_listener/apex
Enter the name of the database server [localhost]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
Enter the database service name:testcdb
Enter the database user name [APEX_PUBLIC_USER]:
Enter the database password for APEX_PUBLIC_USER:
Confirm password:
Enter 1 to enter passwords for the RESTful Services database users (APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used for APEX_PUBLIC_USER or, 3 to skip this step [1]:2
Sep 24, 2013 1:47:36 PM oracle.dbtools.common.config.file.ConfigurationFiles update
INFO: Updated configurations: defaults, apex, apex_al, apex_rt
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:1
Enter the APEX static resources location or Enter to skip:/home/oracle/apex_listener/images
Enter the HTTP port [8080]:
Sep 24, 2013 1:47:53 PM oracle.dbtools.standalone.Standalone execute
INFO: NOTE:

Standalone mode is designed for use in development and test environments. It is not supported for use in production environments.

Sep 24, 2013 1:47:53 PM oracle.dbtools.standalone.Standalone execute
INFO: Starting standalone Web Container in:  /home/oracle/apex_listener/apex
Sep 24, 2013 1:47:53 PM oracle.dbtools.standalone.Deployer deploy
INFO: Will deploy application path = /home/oracle/apex_listener/apex/apex/WEB-INF/web.xml
Sep 24, 2013 1:47:54 PM oracle.dbtools.standalone.Deployer deploy
INFO: Deployed application path = /home/oracle/apex_listener/apex/apex/WEB-INF/web.xml
Sep 24, 2013 1:47:54 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /home/oracle/apex_listener/apex
Configuration properties for: apex
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=testcdb
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
security.disableDefaultExclusionList=false
security.maxEntries=2000
db.username=APEX_PUBLIC_USER
Using JDBC driver: Oracle JDBC driver version: 11.2.0.3.0
Sep 24, 2013 1:47:58 PM oracle.dbtools.rt.web.SCListener contextInitialized
INFO: Oracle Application Express Listener initialized
Application Express Listener version : 2.0.4.259.08.57
Application Express Listener server info: Grizzly/1.9.49

Sep 24, 2013 1:47:58 PM com.sun.grizzly.Controller logVersion
INFO: GRIZZLY0001: Starting Grizzly Framework 1.9.49 - 9/24/13 1:47 PM
Sep 24, 2013 1:47:58 PM oracle.dbtools.standalone.Standalone execute
INFO: http://localhost:8080/apex started.

Configuration properties for: apex_al
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=testcdb
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
security.disableDefaultExclusionList=false
security.maxEntries=2000
db.username=APEX_LISTENER

[oracle@test12c apex_listener]$ java -jar apex.war set-properties --conf apex patch.properties
Sep 24, 2013 2:16:45 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /home/oracle/apex_listener/apex
Sep 24, 2013 2:16:45 PM oracle.dbtools.rt.config.setup.SetProperties execute
INFO: Modified: /home/oracle/apex_listener/apex/conf/apex.xml, updated properties: db.serviceNameSuffix
[oracle@test12c apex_listener]$ cat /home/oracle/apex_listener/apex/conf/apex.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Saved on Tue Sep 24 14:16:45 ICT 2013</comment>
<entry key="db.serviceNameSuffix"/>
<entry key="db.username">APEX_PUBLIC_USER</entry>
</properties>
[oracle@test12c apex_listener]$ java -jar apex.war
Sep 24, 2013 2:17:00 PM oracle.dbtools.standalone.Standalone execute
INFO: NOTE:

Standalone mode is designed for use in development and test environments. It is not supported for use in production environments.

Sep 24, 2013 2:17:00 PM oracle.dbtools.standalone.Standalone execute
INFO: Starting standalone Web Container in:  /home/oracle/apex_listener/apex
Sep 24, 2013 2:17:00 PM oracle.dbtools.standalone.Deployer deploy
INFO: Will deploy application path = /home/oracle/apex_listener/apex/apex/WEB-INF/web.xml
Sep 24, 2013 2:17:01 PM oracle.dbtools.standalone.Deployer deploy
INFO: Deployed application path = /home/oracle/apex_listener/apex/apex/WEB-INF/web.xml
Sep 24, 2013 2:17:01 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
INFO: Using configuration folder: /home/oracle/apex_listener/apex
Configuration properties for: apex
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=localhost
db.password=******
db.port=1521
db.servicename=testcdb
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
security.disableDefaultExclusionList=false
security.maxEntries=2000
db.serviceNameSuffix=
db.username=APEX_PUBLIC_USER
Using JDBC driver: Oracle JDBC driver version: 11.2.0.3.0
Sep 24, 2013 2:17:03 PM oracle.dbtools.rt.web.SCListener contextInitialized
INFO: Oracle Application Express Listener initialized
Application Express Listener version : 2.0.4.259.08.57
Application Express Listener server info: Grizzly/1.9.49

Sep 24, 2013 2:17:03 PM com.sun.grizzly.Controller logVersion
INFO: GRIZZLY0001: Starting Grizzly Framework 1.9.49 - 9/24/13 2:17 PM
Sep 24, 2013 2:17:03 PM oracle.dbtools.standalone.Standalone execute
INFO: http://localhost:8080/apex started.
Finally, It's time for Oracle Multitenant Self-Service Provisioning Installation (make sure! setup db.serviceNameSuffix in APEX Listener)
SQL> show user
USER is "SYS"
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> @pdbss_ins.sql
.
. Oracle Multitenant Self-Service Provisioning
..............................................
.
... Checking prerequisites
.

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

.
... Prerequisite checks passed.
.
Allow demonstration mode [yes]:
Enter destination for PDB data files [/u01/app/oracle/oradata/testcdb]:
Enter the port used to access this database [1521]:
Enter the OS user that owns the Oracle installation [oracle]:
Enter the password for the OS user that owns the Oracle installation:
Enter a password for the self-service ADMIN user:
.
. Installing
.
.
.

. Creating APEX PDB
.
.
.
PL/SQL procedure successfully completed.


Session altered.


PL/SQL procedure successfully completed.


Commit complete.

timing for: Complete Install
Elapsed: 00:04:02.84
.
. Done. Please review pdbss_ins.log for any errors.
.
Done! Connecting to http://...:8080/apex/apex/f?p=PDBSS

Scripts in pdbss folder:
-  pdbss_ins.sql : Install Oracle Multitenant Self-Service Provisioning.
- pdbss_remove.sql : Remove Oracle Multitenant Self-Service Provisioning.
- utilities/update_osuser_creds.sql : Update the OS user credentials stored in the database.

However, I thought I should try to test creating PDB on it.
(Sorry! I didn't explain much each step). I just wanted to show how it work!


Step to configure PDB Name
- Maximum Storage : 5GB, 20GB, 50GB, 100GB.
- Resource Limits : Small, Medium, Large.



After creating PDB, I believe The Oracle Multitenant Self-Service Provisioning will help us for PDB learning on Oracle Database 12c.

Reference:
http://www.oracle.com/technetwork/database/multitenant/downloads/multitenant-pdbss-2016324.html

No comments: