I've just started checking out the ATP database in oracles cloud.
I have an old pl/sql proc that I want to put on the ATP database.
Happily the procedure with calls to htp.p compiled with no errors...but how do I find the URL to use to get to my procedure?
(And BTW no the proc isn't something that can just be converted into a restful web service through apex.)
The answer I've gone with for this is that the ATP database comes with ORDS configuired and ready to use.
You can expose pl/sql procedures to requests through ORDS. This does require some manual work for each procedure but not a huge amount.
You will need to set up a module in ORDS and a template for each get/put etc call you want to send through to your procedure.
Its documented pretty well here:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-remote-procedure-call-rpc-and-output-parameters
This is using the command line for everything - I've found it easier to use the restful data services available through apex to get a GUI interface to use to set this up. I believe there is a GUI available through sql developer too.
Related
I am writing Scala code to access oracle 12 c.I have PLSQL stored procedure with a line saying (HTP.P (r1.id||r1.name); ). Earlier it used to be a code for apex,do I still need it in my Scala build. if apex is out of the picture.please give some thoughts,thanks.
The Oracle Web Toolkit / mod_plsql predates Apex, so it's possible that your procedure is used by something other than the Apex application. To be honest, I'm not sure how you would check though.
I need to port an application that uses Oracle mod_plsql to PostgreSQL. Currently database procedures are called over HTTP with the use of Apache + mod_plsql. The procedures are easily ported to PostgreSQL, but I can not find a replacement for the Apache + mod_plsql part. Does anybody have any experience on ho to do it and what to use?
UPDATE (to make stuff more clear):
See: http://docs.oracle.com/cd/B14099_19/web.1012/b14010/concept.htm for how mod_plsql work.
What I need is a way to call a function on postgrsql as:
protocol://hostname[:port]/DAD_location/[[!][schema.][package.]proc_name[?query_string]]
ei:
http://www.acme.com:9000/pls/mydad/mypackage.myproc?a=v&b=1
You could fork my NodeJS based implementation of web_plsql as a starting point and "simply" replace the Oracle access with PostgreSQL.
You should be able to use pretty much all of the logic in NodeJS and only need to change the way how the code interacts with the database in the oracle.js module.
My work uses Oracle 10G and is planning on installing Apex. In the meantime, I have downloaded Oracle XE and have taught myself APEX on it; however, I can only access users/tablespaces that I have made in the XE database. What I would like to do is use the XE's Apex to access the users/tablespaces in the production databases of my work.
My colleague says that this should be possible because my workstation is connected to the server, and that there should be a way to configure access from my XE's Apex to the 10g's databases, such as by setting up an appropriate DAD.
I see nothing in the Apex user interface to allow this. I've read every word of the Apex documentation but nothing registered.
XE uses the embedded PL/SQL gateway, as opposed to 10/11G which uses either an Apex Listener or an HTTP Server with the mod_plsql plugin.
Thank you,
Matthew Moisen
I have done this before where we didn't have access to the actual database hosting the data to be worked with save for the standard port 1521 listener access. Apex at the time was new enough to the organization that the DBA's also had a voodoo taboo on using their database server as a webserver gateway as well. You can use your database instance with APEX installed as a "middle tier" or app server with the following steps:
Set up an account on your 10g database that is accessible remotely via dblink.
Set up dblinks to your 10g database table on your workstation with XE installed, use the account and connection information for the 10g database as set up in (1). Note, you may have to update a TNS names file or explicitly indicate your host/networking settings within the dblink itself.
For simple sanity and simplicity in coding your apex projects, set up synonyms for all your dblinked objects (i.e., table1 for table1#dblink) so you're not referencing the dblinks directly in your apex code. Making changes later will be easier if you adhere to this.
That's it. One proviso is that you need to know that LOBs will not work with the out-of-the-box functionality of APEX driven DML operations while using dblinks. This may have changed with the newest version. One workaround you may consider is trying to use a stored procedure which passes your LOB data as a input parameter which will do your DML operation for you.
Otherwise, this approach works nicely. The place where I implemented this model has several production level apps, a test and a development tier all using servers hosting APEX separately from the actual data sources. We used Oracle Standard Edition One (for the support), but Oracle XE should work as well since APEX is the platform in common between either Oracle version.
I have a WCF service that uses Microsoft Enterprise Library Logging to log some messages to the Event Log. That works just fine.
The problem is that i want to log some messages to a table in an Oracle database. I am using the Entity Framework to communicate with that Oracle database.
The next step is a right click on the 'web.config' and choose the option 'Edit Enterprise Configuration'. I get the 'Enterprise Library Configuration' editor. In there i am trying to set the Logging Settings so that it also logs to the database, but when i add a database trace listener it´s asking me to fill in a procedure name. Do i have to add a procedure name to fill the table in Oracle? The msdn tells me to run the script that create an MSSQL database 'Logging' and some tables. But i don't have an MSSQL server, i have an Oracle server. And i don't want to use a seperate logging database, but save the logs to a single table.
Can anybody help me with this?
Kind regards
The Enterprise Library Database Trace Listener uses 2 stored procedures to write to the database: Add Category Procedure and Write To Log Procedure.
There is a SQL Server script to create the tables and stored procedures. This would have to be ported to Oracle.
Unfortunately, it looks like this does not work as easily as you would hope. See the blog post, Enterprise Library Logging to Oracle Database (this is based on EntLib 3, I believe) and the work item Cannot log to oracle Database using logging blocks for a description of some of the issues as well as some downloads to help.
I wrote a PL/SQL procedure to connect to an FTP server. I am able to write a file to that FTP server. Using the same code I tried to connect to an SFTP server, but it failed. How do I connect to SFTP using PL/SQL?
You can try the commercial ORA_SFTP package provided from DidiSoft:
connection_id := ORA_SFTP.CONNECT_HOST(...
ORA_SFTP.UPLOAD(connection_id, data, 'remote_file.dat');
Disclaimer: I work for DidiSoft
SFTP requires SSH plus the implementation of a protocol. As far as my PL/SQL knowledge reaches and Google's, there are currently no available implementation of SSH or this protocol in PL/SQL. There are some alternatives:
Use Java in the database and open sufficient ports. Not recommended when this is the only reason to use Java in the database; it is not as well designed as PL/SQL and can be expensive to maintain by a DBA since most DBA's have no experience with it.
Use PL/SQL to start a job outside the database. For instance, in the past I've used often Pentaho Data Integration (formerly known as Kettle) which provides a free solution to draw your data flow from table/procedure to sftp recipient and then run it. Running from PL/SQL requires a scheduler (I always used our own because it also integrates Kettle, but you can also consider the scheduler integrated with Oracle Apps, Redwood JCS/Cronacle or others). Coding in PL/SQL then becomes something like: 'begin package.submit('SFTP it'); package.wait; end;'.
I would go for the second option. If you need further details, please let me know.