Creating An APEX application
Posted: October 4, 2011 Filed under: Application Express (APEX), IT Survival, Oracle Leave a comment »You need a container to house the application, in Oracle this is called a schema or user to us none Oracle DBA’s, confusing yes, but I am sure that an Oracle boffin would be able to explain it. All we need to know is that we need to create one.
You can either create one with the following script or let the create workspace wizzard help you
CREATE USER manufacturing IDENTIFIED BY “A Password”
DEFAULT TABLESPACE “USERS”
TEMPORARY TABLESPACE “TEMP”
PROFILE DEFAULT
QUOTA UNLIMITED ON “USERS”;
This guide will not take you through how to create a workspace or how to create an application as there are loads of books out there including some free Oracle guides, this and associated posts will hopefully get you around issues and tips to solve bits and pieces.
Alistair
Installing Oracle APEX on Oracle XE
Posted: October 4, 2011 Filed under: Application Express (APEX), IT Survival, Oracle 1 Comment »This installation is based on the latest Centos 6 build
cat /etc/redhat-release = CentOS Linux release 6.0 (Final)
Download the xe server and client, for this install I am using the release 10 as my main database is 10gR2 and I hope to port this into the live environment at some point.
As usual I downloaded all the rpm, zip files into /software
So download the relevant xe server and client
Download oracle-xe-10.2.0.1-1.0.i386.rpm
Download oracle-xe-client-10.2.0.1-1.0.i386.rpm
These can be found here http://www.oracle.com/technetwork/database/express-edition/downloads/102xelinsoft-102048.html
For this install you also need the latest JDK (I tried many times to get APEX working so not quite sure if you need this but I don’t think it does any harm)
Download jdk-6u27-linux-i586.rpm
It is work noting that these instructions have been based on the install instructions for APEX, APEX listener and the Glassfish server
The steps are as follows :
Install oracle and configure
Install APEX into oracle
Install Glassfish server & APEX
Install Oracle Listener
Install oracle
rpm -i oracle-xe-client-10.2.0.1-1.0.i386.rpm oracle-xe-10.2.0.1-1.0.i386.rpm
Once installed it will display
Executing Post-install steps…
You must run ‘/etc/init.d/oracle-xe configure’ as the root user to
configure the database.
Executing Post-install steps…
Add these lines to the .bashrc file
cd ~
vi .bashrc
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE
PATH=$PATH:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin
export $PATH
:wq
Configure Oracle
/etc/init.d/oracle-xe configure
Oracle Database 10g Express Edition Configuration
————————————————-
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]: Enter
Specify a port that will be used for the database listener [1521]: Enter
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration: Enter password (do not lose)
Confirm the password:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: Enter
Starting Oracle Net Listener…Done
Configuring Database…
NOTE to stop and start XE use
service oracle-xe start
service oracle-xe stop
We need to change some parameters in Oracle
sqlplus sys/(password)@//localhost/xe as sysdba
ALTER SYSTEM SET SHARED_POOL_SIZE=’100M’ SCOPE=spfile;
exit
service oracle-xe restart
Install APEX into Oracle
Download the APEX software (at the time of writing this was version 4.1), as stated before I have downloaded mined to /software
cd /software/apex_4.1_en/apex
sqlplus sys/(password)@//localhost/xe as sysdba
@@apexins.sql SYSAUX SYSAUX TEMP /i/
@apxchpwd
Enter a password for the ADMIN user Enter admin password that you want
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY ENTER PASSWORD;
exit
Install Glassfish server
Download the latest Glassfish server from Oracle from here
Again I downloaded this to /software
cd /software
mkdir glassfish
cp ogs-3.1.1.zip glassfish/
cd glassfish
unzip ogs-3.1.1.zip
cp -r glassfish3 /opt/
mkdir /opt/glassfish3/glassfish/domains/domain1/docroot/i
Note: The ‘i’ directory is very important, again not from any notes that I have seen, might have missed this. Got it from a YouTube demo installation.
cd /software/apex_4.1_en/apex/images
cp -r * /opt/glassfish3/glassfish/domains/domain1/docroot/i
cd /opt/glassfish3/glassfish/bin
./asadmin start-domain
You may get this error
Waiting for domain1 to start ……..Error starting domain domain1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Record begin marker is not a proper value so using default.
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Record end marker is not a proper value so using default.
Oct 3, 2011 1:44:29 PM com.sun.enterprise.server.logging.LogManagerService postConstruct
WARNING: Log Format field separator is not a character so using default.
[#|2011-10-03T13:44:30.196+0100|INFO|oracle-glassfish3.1.1|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=10;_ThreadName=main;|Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]
[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=12;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 281ms - bound to [0.0.0.0:3700]|#]
[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 339ms - bound to [0.0.0.0:4848]|#]
[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=13;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 406ms - bound to [0.0.0.0:8181]|#]
[#|2011-10-03T13:44:31.188+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=14;_ThreadName=Grizzly-kernel-thread(1);|Grizzly Framework 1.9.36 started in: 243ms - bound to [0.0.0.0:7676]|#]
[#|2011-10-03T13:44:31.374+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=main;|Oracle GlassFish Server 3.1.1 (12) startup time : Felix (3,647ms), startup services(2,020ms), total(5,667ms)|#]
[#|2011-10-03T13:44:31.377+0100|SEVERE|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=main;|Shutting down v3 due to startup exception : No free port within range: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@1bb3e9a|#]
[#|2011-10-03T13:44:31.781+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=15;_ThreadName=Thread-21;|Server shutdown initiated|#]
[#|2011-10-03T13:44:31.812+0100|INFO|oracle-glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=15;_ThreadName=Thread-21;|Already stopped, so just returning|#]
Command start-domain failed.
If you do, then delete then the default doamin needs to be recreated
./asadmin delete-domain domain1
./asadmin create-domain –nopassword domain
./asadmin start-domain
Copy the files etc again
The successful output should look like this
Waiting for domain1 to start ……..
Successfully started the domain : domain1
domain Location: /opt/glassfish3/glassfish/domains/domain1
Log File: /opt/glassfish3/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
You now have a working Glassfish server ready for the listener and Apex to be deployed.
Configure Glassfish
Navigate to http://FQDN:4848 (where FQDN is your DNS server name)
Change the admin password to start with
Click on domain and then choose the Administrator Password tab
Do not forget to press Save
We now need to create two users:
Pick Configuration
Pick Server-config
Pick Security
Select the check box next to Default Principal to Role Mapping.
Save
Pick Realms
Pick File
Manage Users Button
New Button
User ID: managerlistener
Group List: Manager
New Password:
Confirm New Password:
OK
New Button
User ID: adminlistener
Group List: Admin
New Password:
Confirm New Password:
OK
Install Oracle Listener
You should have already downloaded the listener
Select Applications
Click Deploy
Navigate to the downloaded Apex Listener folder and find apex.war file
Click OK
To find the URL that the site will operate on, make sure that you are still in the Applications section from where you deployed the apex.war file. Click on the Launch link under action
This will open a new browser window with the server links, I have two
http://FQDN:55596/apex
https://FQDN:8181/apex
Listener Configure
This area was a little bit of an issue and I still am not quite sure on how it worked in the end to be honest. If you follow the instructions then all should go well. I in stalled this software about six-times on the same server so some of the config was left behind and I am not sure where one of the important files is stored.
The instructions give you the following urls
https://FQDN:8181/apex/listenerConfigure
https://FQDN:8181/apex/listenerAdmin
https://FQDN:8181/apex/listenerStatus
I have yet to get the Status to work (that’s another day)
To configure the listener
Navigate to http://FQDN:8181/apex/listerConfigure
Username:APEX_PUBLIC_USER
Password: As per what was set above with the SQL script
Connection Type: (Mine is basic)
Hostname: FQDN of the sever
Port:1521
SID:XE
The assumption is that you did not change any of the defaults when installing Oracle.
The next bit was the hardest bit, as I am not sure where the documentation is for this, all of this has been gleaned from various bits and pieces.
If you get the dreaded
HTTP Status 403 – Requested url http://:8080/apex/wwv_flow.accept is not allowed.
then the chances are it has something to do with this setting
The following are the settings that I used to get it up and running, if you find any more documentation around this subject please drop me a line.
Security Tab
Allowed procedures
wwv_flow_file*,www_flow_file*, p, n, cust*, apex*, f, wwv*,www*
As soon as you press the Apply button you should see the APEX screen. There are many sources, but there is not one definitive source that I have found. Hopefully this information will add to what is already out there and help others.
Stay tuned to see if I can now develop in this stuff
more posts will be available.
Hope that you get it working and if you need help drop me a line and I will see if I can give you a hand
Alistair
Installing Oracle XE 10g on Debian/Ubuntu
Posted: August 31, 2010 Filed under: IT Survival, Linux, Oracle Leave a comment »Oracle Xe is a good way to start learning Oracle, it is also needed in some software circles and the database
of choice Project.net for example.
There is a brilliant article here that I used to get the database up and running.
If the link is down then a summary is below:
Basic requirements
- Debian based host (32 bit) with minimum 4GB of free space for oracle data + 500Mb for package installation. – Min. 1Gb of ram.
1) As always start up by adding additional lines to sources.list and update package list:
# echo "deb http://oss.oracle.com/debian/ unstable main non-free" >> /etc/apt/sources.list # apt-get update
2) Installation now may begin with installing following 2 packages from freshly updated list:
# apt-get install oracle-xe-client # apt-get install oracle-xe
3) Installation is now completed. Please notice runtime kernel parametar changes: `cat /etc/sysctl.conf`. Proceed further with configuration – just accept defaults – and enter password for SYS and SYSTEM accounts:
# sh /etc/init.d/oracle-sh configure
That’s it. Oracle listener should be up and running on socket 1521: `lsof -n -i TCP:1521`, with web configuration console attached to your loopback device `firefox http://127.0.0.1:8080/apex` – this is a default installation.
Just note, that the database will not allow only allow webadmin from the localhost, therefore you need to open the web manager up, administtraion and allow no localhost connections.
