ORACLE Application Express - how to connect to your tables in production - oracle

I've been trying for days but cannot find the answer to this. I am using Oracle Application Express (APEX), someone else setup the initial connection to a "Apex" database in oracle, but I am trying to connect to our production database in oracle. I am making web forms and the web forms are connected to the "Apex" database that was setup already, but I need to connect to our production database so we can create reports from the data entered through the web forms. I need the tables to show up in the create page option from the production database, currently its coming from the apex database, please help.
Create Page View with Tables (from apex)
Thank You so much in Advance!

What is the "production database"? Is it really a different database (than the one you're currently connected to), or is it a user in the same database?
if former:
you could create a database link between those two databases and create synonyms for production users' tables in one of schemas your workspace is assigned to.
another option is to install Apex onto the production database, so that you could use current installation as "development" and then deploy the application into the "production-based" Apex
if latter, you might do the same (i.e. create synonyms, just without the database link), or simply assign the production schema to your workspace

You may be interested to read Mike's response to a question with a similar misunderstanding regarding architecture.
https://community.oracle.com/thread/4135843
Once you have your head wrapped around this, you can consider the parsing schema to your application. This schema defines the table access your application has, in the normal way Oracle handles table privileges.
Then it's up to you to define who has access to what pages, using APEX Authorisation Schemes.

Related

Connecting with another Oracle user within the Oracle Apex platform

I have access to that user in SQL Developer. How can I access this same user in Apex, to make any query?
Talk to your Apex admin. They should map that schema (i.e. user with all its objects) to your workspace.
Alternatively, you could create a database link from your current user (the one you already use in Apex) to the one that contains data you're interested in. Then you could access data over that database link, perhaps create synonyms in your schema (to make it simpler). Though, I'd probably go for the 1st option I suggested.
But, if you don't use Apex yet, then - back to Apex admin again; they should create a workspace for you, let you use schema you're talking about, create an Apex developer for you and - that should do it.

Oracle database, moving changes between databases

We have application where all logic is implemented in oracle database using pl/sql.
We have different oracle databases for development and production.
When developer make changes in development database after testing we move changes from development database to production database using schema compare tool of toad. Problem here is that developer must have password of production database. We want only admin to know this password.
Can somebody advice me better way of moving changes between databases without need of having production database password, what is best practice for this ?
I posted this question on oracle OTN forums and got some advices there. Maybe it will be interesting for somebody.
Her is a link
I do not recommend to use comparison tools for generating of database migration scripts.
Development and production databases (and also test databases) must be identical except for current changes made by developers in development databases. Generally speaking this assertion is not correct, because there are many kinds of differencies between development and production databases, e.g. partitioned objects, additional objects for audit (triggers, tables), replication-based objects (snapshots), different tablespaces etc.
Every developer must know, what changes were made by him and applied to development database.
If developer was able to change schema and data in developer database, then he/she must be able to create programs for these DDL and DML changes.
To delegate the same developer an ability to run these migration programs on production database is a bad idea. But if you don't have a better way of database migration, then you can use one of following:
1. Configure Oracle authentication by OS. OS authentication allows Oracle to pass
control of user authentication to the operating system.
2. TOAD can save passwords without disclose them. DBA will insert required password
to local TOAD installation at developer PC (if developers use PC).

Can OracleXE's APEX access another Oracle Database (10g) on the same Server, or is it Restricted to those Users/Tablespaces in the XE Database?

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.

Drupal modules calling Oracle DB

working on an Drupal architecture where I'd like to have a stand alone Drupal/DrupalCommerce installation with product definition based on content coming from an apart Oracle DB.
Does anybody have experience in integration between Drupal and ORacle.
I'm not speaking about replacing MySQL by ORacle but by using ORacle content in specific modules.
What is the best connections options : XML-RPC, REST, WebServices/SOAP ...
Did you try to define the Oracle database as a secondary database in the Drupal settings file?
http://www.php.net/manual/en/book.oci8.php
http://drupal.org/project/oracle
If you manage to connect, you could then write a custom module to switch to the secondary database, retrieve the data from the Oracle database and bring it into the Drupal context.
I would like to find out if you found other solutions.

Change Oracle Schema at runtime when using SubSonic

In my project, I am using Oracle Database and SubSonic for DAL. I have a problem with SubSonic and Oracle Schema, that is:
When developing, I used a schema DEV in Oracle Database and generate DAL using SubSonic.
After that when release to customer, he used a new schema TEST in Oracle Database and changed the connection string in app.config to connect to Oracle. The error will appear, that is “Table or View does not exist”. I found this error and see that the schema of tables is still DEV.
I do not want re-generate DAL after change schema and when released to the customer. Please help me.
Firstly, your schema should not be DEV. DEV is a user or role.
Your schema name should be related to the data content (eg ACCOUNTS or SALES)
Secondly, consider whether you or the customer is going to decide the schema name. Say you have a product called FLINTSTONE. You may decide that the schema name should be FLINTSTONE. However your customer may want to run two instances of your product (eg one for local sales, the other for international) and use the same database. So they want FS_LOCAL and FS_INTER as the schema names. Is that option a feature of your product ?
Next, decide if your application should connect as the schema owner. There are good security reasons for NOT doing that. For example, the schema owner has privileges to drop tables, which is generally something the application doesn't do and thus, on the principle of least privilege, is something your application shouldn't have privileges to do.
Generally I would recommend some config parameter for the application for the schema name, and after connecting to the database, the app should do an "ALTER SESSION SET CURRENT_SCHEMA = 'whatever was it the config file'". The application database user would need the appropriate insert/update/delete/select/execute privileges on the objects in the application schema. If the application can't do that, you can have a LOGON trigger in the database.
Gary is correct in not using DEV as a schema on your own machine. In using Oracle we typically set up the schema as what the client is going to name their schema. This however does not fix your issue. What you need to do is create a global alias in Oracle that maps say DEV to CLIENTSCHEMA. You should still rename the schema on your machine but this will allow your schema to differ from your clients.

Resources