Code and core tables in different schemas

Hi,
My db version : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
I would like to understand, the pros and cons of the following situation:
We have a single application.
The db design for this application has 44 tables out of which 28 are core tables related by PK and FK relationships. The remaining 16 are look up and reference tables which are not related to any.
The team decided to place the 28 core tables in one schema A and the remaining 16 in another schema B within same database. (The reason for this is..since it is done in other projects lets do it here too).
Now comming to the code (stored procs, functions, packages etc). The teams wants to place most of the code in the schema B that has the 16 ref tables. (the reason again being the same).
What are the pros and cons doing this???
Please advice.
PS:
I have googled and found sth on these lines:
cons: 
o harder to manage
o harder to upgrade
o harder to patch
o harder to maintain
o causes your shared pool size to increase 1,000 times (shared sql goes down the tubes)
o takes more space
o queries against the dictionary will be impacted
o latching on the shared pool goes WAY up (latching = locks = serialization device =
slows you down)
pros:
o none that I can think of.

>
I would like to understand, the pros and cons of the following situation:
Yes I am straining to find more points (was not good at it though).
>
You just want to understand? Are you sure? Your thread reads more like you just want to do things your way and are looking for support.
>
The team decided to place the 28 core tables in one schema A and the remaining 16 in another schema B within same database. (The reason for this is..since it is done in other projects lets do it here too).
Now comming to the code (stored procs, functions, packages etc). The teams wants to place most of the code in the schema B that has the 16 ref tables. (the reason again being the same).
>
My question to you is: what PROBLEM are you trying to solve? If the 'team' already uses this approach and there haven't been any substantive problems then why try to change things now? Why have you chosen to fight this battle?
Your 'team' has already decided and now, after that decision, you want to argue about it with them? The time to present arguments for/against a given plan is BEFORE the decisions are made, not after. Once a decision is made you need to be a team player and implement that decision to the best of your ability.
One thing I'm certain of. If you try to support your argument using things like that 'AskTom' link you posted any credibility you had will go out the window. That link, as you already hinted yourself, is not your use case at all. All it takes is for one of your 'team' members to point that out and everyone will pretty much stop listening to any other arguments you make.
People are generally not going to 'change their ways' unless you can show them:
a) there is something seriously wrong with the way they are now doing things or
b) a new way of doing things provides some substantial benefits
Choice 'a' above is where you need to start but you haven't provided ANY information in this post that you have identified any serious issues with the status quo.
The main task for Oracle is to be able to FIND the objects being referenced. So, in my opinion, that is what you should focus on when looking for PRO/CON arguments.
That is: What issues are there if an object being referenced is in a different schema than the session that needs to use the object?
1. objects may need to be prefixed with the schema name
2. public or private synonyms may need to be created/maintained to avoid having to deal with item #1 above
3. new grants may be needed to implement/maintain the proper security
4. new roles may need to be created to maintain proper security (see item #3 above)
5. additional work will be needed to maintain the new roles in item #4 above
6. PL/SQL code may not be able to reference the object or may reference the wrong object
7. Roles are disabled in PL/SQL (see item #6 above) - this means that the new grants (see item #3) may need to be granted directly to the schema users that need access instead of to roles. That can make it harder to create and maintain a role-base security schema.
If I were you I would spend my time on other more important thingsd. But if I chose to fight this particular battle then I would make a list of problems that occured in the past with the current method of doing things and also problems related to the above list of items and then show how many of those problems will 'disappear' if the new method is used.

Similar Messages

  • Accessing tables from different schema in CDS and AMDP

    Hi All,
    We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
    We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
    We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
    As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
    If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
    Can I also use different schema tables in CDS views.
    We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
    New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
    Thanks & Regards,
    Anil

    Hi Anil,
    I can only answer 1. and 2. (and would be interested into 3. as well):
    1.
    Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
    Examples:
        RESULT = SELECT
        FROM
              "SAP_ECC"."T441V" AS t,
              "_SYS_BIC"."tmp.package/AFPO" AS a.
        WHERE ...
    2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
    Best regards,
    Christoph

  • Staging area and base are in different schema/tablespace

    Please can someone give me some advantages and disadvantages to keep staging tables and base tables in same schema. For eg we have staging area where we daily truncate staging table, load in the stg table and do transformation process. Once done we will move the staging table data to base tables. Base tables sizes are huge volume like 6 to 8 million rows as there is no purging done.
    I want to suggest to my team that we should keep them in separate schemas as I understand it will be good from I/O point.
    Is there any other reason to keep staging and base tables in separate schema/tablespace.

    Hi,
    Definitely I agree with previous answers. You wrote that staging area, transformation etc.. So I think it's a datawarehouse. Staging and base tables should be stored in different data files also in different harddrives. During the ETL task there can be high load on the Disk subsystem. Storing them in different schemas is another subject which is not related with the disk performance.
    When it comes to blocksize of the datafile, there is a approach like this:
    If the database is used for OLTP systems, it would be good idea to setup smaller size blocks. But when we're talking about a datawarehouse, it's highly recommended to use larger block sizes like 16KB or 32KB. This setting has an advantage related to reading, accessing data blocks.
    Regards,
    Cuneyt

  • No Easy Way to Join on Tables from Different Schemas

    Hi,
    The company policy does not allow to join on tables from different schemas or use db links...
    I'm tasked to come up with a Perl script that does exactly that - allows for the SELECT statement to do several joins on 3 different schemas. In addition 1 of the schemas is on the different host altogether.
    Upping the privileges for my user and allowing db links is not an option...Can someone, please help me to understand on a conceptual level how would I use Perl and what logic would it have and what would it (perl) do?
    Thank you,

    Court in the wrong job... ;)
    It's like a librarian who is a hard rock artist maintaining the silence in the premises. ;)
    My dear friend, i don't think this is the right place for your requirement. This is the PL/SQL forum. If you have any problem related PL/SQL or SQL you can place that here.
    Regards.
    Satyaki De.

  • Performance with having tables in different schema's

    Hi all,
    We have a requirement to segregate tables into different schema's based on the sources. But everything is going to be on the same instance and database.
    Is there a performance hit (querying between tables) by having tables in different schema as apposed to having them in the same schema?
    Thanks
    Narasimha

    Most likely there is bit of performance impact if your application refers the tables from different schemas. You need to use database link to access the other schemas. Even you schemas may in instance but when you use database link the network also comes into picture. even queries on same instance will routed through network connect and get the data. Distributed transaction also have issues some time. So as far as possible the distribution of objects should be avoided into diffrent schemas.

  • Read tables from different schemas in oracle

    Hi, I'm trying to write a code to run a query to get data from an Oracle server, the problem is that the query refers to multiple tables in multiple schemas... the regular way to do it in oracle (SCHEMANAME.TABLENAME) does not work in excel vba query and
    I cant find a way to so, any help will be really appreciated, below a sample code with one table from WWPP schema.....
    Const DB As String = "Driver={Microsoft ODBC for Oracle};" & _
                         "CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=1526))(CONNECT_DATA=(SERVICE_NAME=MyName)));" & _
                         "Uid=MyID;Pwd=MyPwd*;"
    Sub test()
        Dim cnt As ADODB.Connection, rst As ADODB.Recordset
        Set cnt = New ADODB.Connection
        Set rst = New ADODB.Recordset
        cnt.Open DB
        (I also tried this but didn't work) -> cnt.Execute "ALTER SESSION SET CURRENT_SCHEMA=WWPP"
        rst.Open "SELECT * FROM WWPP.SO_LIFE_CYCLE_BACKLOG_RP", cnt, adOpenDynamic, 2
        If rst.EOF = False Then
            Sheet1.Cells(2, 2).Select
            Selection.CopyFromRecordset rst
        End If
        rst.Close
    End Sub
    Oscar Marquez

    1) Posting the error number (i.e. ORA-00942) in addition to the error message is often quite helpful since that's generally far easier to look up and far less likely to get confused in translation.
    2) Are you using an invoker's rights stored procedure? Or a definer's rights stored procedure? If you're not sure, the default is definer's rights.
    3) How has YFS been granted access to the Y_PS table? My hunch is that it was granted access via a role, not via a direct grant. Privileges granted through a role would be available for ad hoc SQL queries, but those privileges are not available to a definer's rights stored procedure. A definer's rights stored procedure only has access to the privileges granted directly to the owner.
    If my hunch is correct, you'd either have to directly grant YFS access to the table(s) it needs to access in other schemas or you'd need to make the stored procedure use invoker's rights, which may have ripple effects down the line if users other than YFS are going to be running the procedure.
    Justin

  • Create a View from tables of different schemas

    hi all,
    can u pls give solution to create a View from tables of different schemas.
    i have to bring data from one DB Server A,
    which contains different schemas and tables in the schemas...
    i need to insert that data in another DBServer B.
    i made a procedure for this...
    but when the connection fails from A, then i could not get data...
    please suggest some solution..
    thanks,
    neelima

    I don't know what database system you use, but in the most I know it is done that way:
    SELECT
    A.COL1,A.COL2.....
    FROM
    SCHEMA_NAME.TABLENAME A,
    SCHEMA_NAME.TABLE_NAME B
    WHERE
    A.COL1 = B.COL2
    ...

  • Package Error!  join to tables in different schemas

    Hi
    I get an error whwn I want to put my query into package
    I have two tables in different schemas and I joined them and it works when I compile it
    but in the SP it doesn't works
    Is anbody help me? please
    Table1 in Schema1
    Table2 in Schema2
    TableID is the column which I join two tables (Table1.TableID=Table2.TableID)
    User1 has Select grant to both tables (it works when I run the query but in the sp which is in the package it doesn't work)
    Package1 in Schema1

    query is working
    but when I put that query in to package, Package is giving error like "table or view does not exist"
    Table1 in Schema1
    Table2 in Schema2
    TableID is the column which I join two tables (Table1.TableID=Table2.TableID)
    User1 has Select grant to both tables (it works when I run the query but in the sp which is in the package it doesn't work)
    Package1 in Schema1
    Select * from Schema1.Table1
    Inner join Schema2.Table2 on Table1.TableID=Table2.TableID
    is working in editor but
    CREATE OR REPLACE PACKAGE Schema1.PCKG_packagename AS
    PROCEDURE SP_procedurename
    Select * from Schema1.Table1
    Inner join Schema2.Table2 on Table1.TableID=Table2.TableID;
    END SP_procedurename;
    END PCKG_packagename ;
    is not working
    Must I give grant to Package?
    Edited by: 874779 on 25.Tem.2011 03:37
    Edited by: 874779 on 25.Tem.2011 03:51

  • FBL5N t code and BSEG table is showing wrong contract number

    Hi,
    The proces flow is contract number>sales order>DMR-->Invoice
    Now when I am checking the VBFA table it's showing correct contract number against invoices but FBL5N t code and BSEG table are showing wrong contract numbers.
    Why FBL5N and BSEG table is showing wrong contract number?
    Currently we are using one enhancement and user exit is used to incorporate one customized field as identifier for bill type.
    1. During the billing document release to accounting VFX3, The user exit triggering and it is update the customized fields and Net settlement indicator.
    2. Using the Invoice number, get the fields VGBEL(Document number of the reference document) and VGPOS (Item number of the reference item) from VBRP and read table VBAP with VBELN and POSNR, to get DMR number (Sales Document) that created for the Invoice.
    3. Use fields VGBEL and VGPOS on table VBAP to get the sale order number.
    4. By using the Sales order number, get the Distribution channel to update Net indicator field
    In accounting table BSEG-UZAWE = JF must be updated on the customer line.
    5. Retrieve the sale order number and item level to get customized field from table VBAP
    Any pointers.
    Thanks
    Ashu

    Hi Reazuddin,
    Thanks for your reply,
    I am concercerned about BSEG table and using user exit EXIT_SAPLV60B_008 to post the document in FI.
    Now in we have enhanced this user exit  for contracts and included in this way.
      SELECT SINGLE ZZ_CONTRACT FROM VBAK INTO (LC_CONTRACT) WHERE VBELN EQ cvbrp-vgbel.
    Endloop.
    *Moving the values to final accounting table
    loop at xaccit.
    xaccit-vertn = lc_contract.
    xaccit-VBEL2 = xaccit-AUBEL.
    xaccit-xref3 = lc_vbel2.
    MODIFY xaccit .
    ENDLOOP.
    Clear: lc_contract,lc_vgbel,lc_vgpos,lc_vbel2.
    But I am getting correct data when checked other clients( development and quality), this problem I am getting in production.
    Do I need to ask the ABAP'er to debug this enhancement in production?
    Thanks
    Ashutosh

  • How to show master and detail tables in different pages?

    Hi,
    Can somebody expalin me how to include or bind the master and detail tables to different pages which are included at runtime.
    thnaks,
    Naresh.

    Hello!
    you have ti create a Master/Detail data structure.
    In the first page drag the master table, on the second drag a detail table.
    It should work out of the box. Selecting a record on the master table selects
    the details on the detail table automatically!
    regards,
    Mario Udina

  • How to get emp and dept tables of scott schema if they acdientally deleted

    Hii I accedentally modifiled emp and dept tables in scott schema.... Can you please tell how to recreate fresh emp and dept tables ? is there any way to get emp and dept tables? please help regarding this

    If you are on Oracle 10g version...
    The demo tableds under scott schema can be created using oracle supplied script.
    http://www.oracle.com/technology/sample_code/tech/sql_plus/htdocs/demobld.html
    Alternatively, this script exists in $ORACLE_HOME/sqlplus/demo directory.
    vr,
    Sudhakar B.

  • Materialized view with tables in different schemas

    Hello,
    I want to create a materialized view with a table from a different schema in the SELECT statement. For materialized view I would like to apply the "REFRESH COMPLETE ON COMMIT" option.
    Here the code:
    CREATE MATERIALIZED VIEW S1.MV_EXAMPLE
    TABLESPACE TS1
    PCTFREE 0
    BUILD IMMEDIATE
    REFRESH COMPLETE ON COMMIT
    AS
    SELECT T.COLUMN1 COLUMN
    FROM S2.TABLE1 T
    I can't execute this SQL because I get an "insufficient privileges" error to this table:
    FROM S2.TABLE1 T
    FEHLER in Zeile 9:
    ORA-01031: Insufficient privileges
    User S1 has the following privileges:
    CREATE SESSION
    CREATE SNAPSHOT
    CREATE TABLE
    CREATE QUERY REWRITE
    SELECT ANY TABLE
    User S2 has the following privileges:
    CREATE SESSION
    CREATE SNAPSHOT
    CREATE TABLE
    CREATE QUERY REWRITE
    ALTER ANY SNAPSHOT
    Which privileges are missing?
    Thanks, Mathias

    Thanks Kamal for your answer!
    S1 has the grant select directly. But I solveld the problem. The system privilege "ON COMMIT REFRESH" was missing for S1. This has to be set if any of the tables are outside the owner's schema of the materialized view (ORACLE documentation - Data Warehouse Guide).
    But one thing is not clear to me yet and the ORACLE documentation doesn't give me an answer. I can set the refresh-attribute ON COMMIT on a materialized view containing only joins when a group by clause is set. If the group by clause is missing I can't! Why?
    Regards, Mathias

  • Replication of tables in different schemas

    Hello,
    I have 2 schemas and would like to have tables (same structure), in the 2 different schemas, to be in sync.
    For eg:
    sample1.table_one
    sample2.table_one
    desc sample1.table_one is exactly the same as sample2.table_one
    I want both sample1.table_one and sample2.table_one to be in sync, when any changes are made to any one of them.
    Does Oracle 9i provide any mechanism for this or is the only obvious solution with PL/SQL and/or triggers.

    Zaid,
    If you have two identical identical tables, that contain the same data, you should just give grants to different applications based on the type of web applications and your business logic.
    Trying to replicate them and keeping in them in Sync is a tedious ( and wrong approach)
    which will will need a change (to the packages used to keep them in sync) everytime any of those table definition changes among many other problems..
    >
    With views the problem or limitation for me is that there are 2 web applications using each of the tables respectively. They have the ability to update the tables.
    This is why replication...
    >
    If you have Schema1.table1 and schema2.table1, is it not possible to change your web application code to just use one of these two schemas ? You can always write scripts to migrate the existing data from schema2 to schema 1.

  • How do I write into multiple target tables in DIFFERENT schemas?

    It is easy to have a mapping that writes into 2 or more tables it's results. I now need that all these tables are in different schemas!
    When I create a 2nd warehouse target with a 2nd location and configure this location to be a different schema on the database, validation tells me, that everything is okay.
    When I generate it, there are several warnings, when I execute it, it doesn't work :( It complains that it cannot find <something>.
    I'm sorry, I don't have the error-message at hand :(
    I've you got an idea, how I could have different schemas for my tables, please let me know!

    Art,
    Could it be that the target schema into which you install the runtime components does not have privileges on the tables in the other schemas? You have to have at least the right privileges (INSERT, UPDATE, DELETE) on the target tables in the other schemas in order for this to work. However, then there should be no reason, assuming your tables are in different modules related to different locations.
    Thanks,
    Mark.

  • Analytic View with tables from different schema

    Hi,
    I'm curious if I make something wrong or if this is not possible:
    I want to use two tables each in a different schema. I can drop them into the DataFoundation, can connect them, assign them some measure. But activation fails due to insufficient privileges. When I use the tables from the same schema activation works well. With the insufficient privileges I would guess HANA cannot create a View (failed with the statement CREATE COLUMN_VIEW "_SYS_BIC"."USER/ANALYTIC_VIEW_NAME"....).
    Since I tried the same assignment with the System-User and failed I wonder what kind of permissions are required. Or is this generally not allowed (resp. prohibited)?
    If not allowed, could somebody give me a hint, why its not possible?
    If it is possible, what kind of rights are required to get it working?
    roland

    Hm', I have allowed SYS_REPO the rights to the table and was able to activate the view. But now I have the problem, that the DataPreview is not working (again insufficient privileges). What user has to have additional permissions for the JDBC-query?
    Do I have to take care more on the privileges for other things?

Maybe you are looking for

  • Making calls on my iPhone/ LockScreen and Message freezing

    Hi, ive had my iphone for about six months now, im still under warranty and ive just recently been having few problems that are quiet annoying. My first problem , while making calls i can barely hear what the person is saying to me and they can barel

  • Bubble Chart with legend changes axis dimensions according to labels length

    I have a Bubble Chart with legend on the right. Data are by series and  the series are set  dynamically with a  drop down combo which replace the content of each series from time to time.  Every time the series changes, also the name of the series ch

  • How do you change the amp value of a battery

    I am trying to make a voltage regulator for my car. My car puts out 14v and 500 amp battery. I can not tell Multisim that I want a 500 amp battery. How do I change the value? This is important because I have to make sure I have at least 15amps output

  • OpenGL Photoshop CS5 and memory management by OSX 10.6

    I was able to find out quite a bit about the secrets around this issue - see my post on "NVIDIA Geforce 9400M and Adobe Photoshop/CS5 question". What I still do not understand is the following Apple-remark (in this case on the 17" PowerBook) NVIDIA G

  • Is Photoshop Elements compatible with Mac OS X v10.8?

    Is Photoshop Elements 10 compatible with Mac OS X v10.8? Thinking of purchasing it but in system requirements it only mentions up to Mac OS X v10.7.