Create trigger on view belong to different schema of same db

Hi Guru's,
I have two different schema in the same DB.
Example : schema1 and schema2
I have one view on schema1 and i have grant select to schema2 and create synonym for that view.
Now i need to create trigger on synonym which created from view in schema1 and insert the data into different table from trigger when insert happen on view.
first of all , is it possible?
if its possible then do i need to give create any trigger on view to schema2.
Or is there any other we can get this done..
Many thanks.

Hi,
user590978 wrote:
Hi Guru's,
I have two different schema in the same DB.
Example : schema1 and schema2
I have one view on schema1 and i have grant select to schema2 and create synonym for that view.
Now i need to create trigger on synonym I'm not sure I understand you.
Triggers operate on tables and views (but I'll just say "table" from now on). It doesn't matter if the statement that caused the trigger to fire used the actual table name or a synonym.
which created from view in schema1 and insert the data into different table from trigger when insert happen on view.
first of all , is it possible?I'm not sure I understand you here, either.
It is possible to have a trigger on a view in schema1, which INSERTs data into a table. That table can be in any schema, just so long as the trigger owner has privilges on INSERT into it.
if its possible then do i need to give create any trigger on view to schema2.It's very dangerous, and usually a terrible idea, to grant the CREATE ANY privileges to users.
Schema2 needs the CREATE ANY TRIGGER system privilege only to create a trigger in another schema, such as schema1. There's probably no reason to do that. Let schmea1 create the objects in its own schema.
Post a test script that shows what you want to do. Include CREATE TABLE, CREATE VIEW, CREATE TRIGGER, CONNECT and INSERT statements, and the results you want (the contents of tables where the trigger INSERTed data). If you don't know how to code something, post the closest thing you can, and explain what you really want to do in that place.

Similar Messages

  • Associating BI Publisher rerport to a View belonging to different bus Obj.

    Hi All,
    Is it possible to associate a BI Publisher report to a view that is based on a different BO?? Should the Report's IO and the Associated View's Business Object be the same?? If they can be different,. how is it possible to add them?? Appreciate your thoughts.
    Thanks
    SriV

    You can schedule the report once..
    And then re-Publish the same query data for different template :)
    1. schedule the report
    2. add as many template you want to the report.
    3. go to scheduled history of the report
    4. click on the report and re-publish

  • Sinlge select query in different schemas for same table(Indentical Structu)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.

    Thanks for the reply
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

  • JDBC Lookup - Import table data from a different schema in same DB

    Hi XI Experts,
    We are facing an issue while importing a Database table into the external definition in PI 7.1.
    The details are as below:
    I have configured user 'A' in PI communication channel to access the database. But the table that I want to access is present in schema "B". Due to this, I am unable to view the table that I have to import in the list available.
    In other words, I am trying to access a table present in a different schema in the same database. Please note that my user has been given all the required permissions to access different schema. Even then, I am unable to access the table in different schema.
    Kindly provide your valuable suggestions as to how I can import table which is present in another schema but in the same Database.
    Regards,
    Subbu

    If you are using PI 7.1, then you can do JDBC Lookup to import JDBC meta data (table structures from DB). Configure a jdbc receiver communication channel where you specify username and password which has permission to access schema A and Schema B of database. Specify database name in the connection string. Then you might have access to import both schema.
    Please refer these links
    SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups
    How to use JDBC Lookup in PI 7.1 ?

  • View objects from different Schema from Web Object Browser

    I am logged in as dba and try to view the tables of another schema.
    However in the object browser I can only select my own schema.
    This happens with whatever user I use.
    From sqlplus I can access or create tables for another schema without any problems.
    Is this not supported or am I doing something wrong?
    Thanks for the help.

    Can you assign multiple schemas to a workspace in the XE version of HTML DB?
    I haven't found where to do it.
    Is it not possible because there aren't really workspaces in this version?

  • Different schema on same database

    i have 2 schemas in the same database, i create a table in one schema and can access the same table from the other schema without grant option. For eg, i create one table 'emp' in one schema 'schema1' like:
    create table emp(no number);
    Now, from the other schema, schema2, i can access this table data using the following select statement :
    select * from schema1.emp;
    without first giving the grant on the table from 'schema1' like this:
    grant select on emp to schema2.
    Please help in solving my doubt as i need it resolved urgently.

    Have you (perhaps mistakenly) granted a user the SELECT ANY TABLE privilege?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Lightroom – Library view – Why 2 different displays of same hard drive

    Background - PC/WinXP32/LR2.6 – I use a “working catalogue” for this months shots – on my C drive, and an “archive catalogue” on a large external network storage (Raid) drive (“Ark”).  This is because – when I just used the external drive, if I exported to CS3 to finish off an image, then saved it back into LR, it would take 20 – 30 secs, whereas if I worked from a Catalogue on my C drive it would save it in 2-4 seconds. (who knows why?).
    When I have finished working on that months images, I then “import from catalogue” into my “archive cat” (without copying the original raw image files), then I copy across the image files via explorer, then re-link them in LR (I don’t copy the image files across with the cat because I have found that it renames them all differently to my naming scheme!).
    The problem – this has worked well for 6 months or so until now.  When I re-link the folders, it is putting them (on LHS of Library module – see screen shot at http://chrishowe.zenfolio.com/p773837375/e1b184507
    ) into another file system under a second “copy” of “Ark”. Even worse, I use annual & quarterly parent folders (see screenshot at http://chrishowe.zenfolio.com/p773837375/ebe93e9c
    for folder/file structure) – my annual folder “Lightroom 2010”, after I put a dummy image into it, so it will import, has been placed in the first version of “Ark” on LHS of Library module, but the individual folders (such as “2010-01-07-snow”) have been put in the second version of “Ark” on LHS of Library module – and furthermore do not have the parent folder showing.
    If I right click a folder on LHS and choose “update folder location” etc – it tells me there is already a folder of that name in that location (which I already know).
    I could solve this by re-importing all the images ( I tried it with one folder, and it puts it in the right place), but I lose all my adjustments in the develop module – as it just comes up as “import” on LHS.
    Has anyone any ideas about this?

    I saved them as "complete". The pages I'm saving have the text and images confined within a gray field that is narrower than my monitor screen, with solid black filling in along the sides. The pages I've saved have lost the gray backgrounds and black edges, and spread the remaining text and images across the entire width of the screen. The background for all of it becomes solid white. The two attached images show what I'm talking about.
    Thanks for your help!

  • PO for Plants belonging to different Country under same Company Code

    Hi,
    We have created a Company      1000 (Country u2013 India)
    We have created two Plants 1001 (Location - Delhi, India), 1002 (Location - United Kingdom).
    We have created a pricing Procedure      ZDOMES & ZIMPOR for Domestic & Imports Procurement.
    We have created a Tax Code V0, Country IN.
    We have tested the Procurement Cycle for Plant 1001 (Location - Delhi, India) and it is working fine.
    For Plant 1002 (Location - United Kingdom) what extra configuration do I need to do? Can we use the same pricing Procedure, Tax Code?
    Please advice.
    Regards,

    Thanks for the reply.
    Here in our scenario, we have created only one Company Code and one of our Branch is in UK.
    we need to create only One Company Code & Branches (Plants) in Delhi & UK
    Please suggest .
    Regards,

  • Creating a Materialized View in Oracle 8i

    Hello -
    What are the steps and privileges required to create a materialized view in Oracle 8i?
    Thanks

    To create a materialized view in your own schema:
    You must have been granted the CREATE MATERIALIZED VIEW system privilege and either the CREATE TABLE or CREATE ANY TABLE system privilege.
    You must also have access to any master tables of the materialized view that you do not own, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    To create a materialized view in another user's schema:
    You must have the CREATE ANY MATERIALIZED VIEW system privilege.
    The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database), and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    Thanks
    Manish

  • Loading the data in different schemas in different environments

    Hi all,
    My source technology is File and Target is Oracle.
    In Development environment developed the code and successively loaded in target  Oracle DB with schema A.
    In UAT environment i have to load the different schema with same oracle DB with schema B.
    Imported the code to UAT from development and trying to load the data in the schema B.
    I created the physical connection and pointed the same Loagical name which i used in schema A.
    I'm getting the error.
    could you please any one help on this. and also correct me if i'm doing wrong.
    Thanks in advance 

    Hi,
    can you please paste the error here.
    Thanks

  • Accessing a Cube under different schema

    Guys,
    Is it possible for a user to access OLAP cube residing in a different schema under same oracle database and SID ? If yes, how it can be done (permissions etc.)
    Thanks,
    Mav

    Hi,
    Yes this is possible. The other user needs to have the olap_user role, and if you are going to use discoverer it also needs the d4opub role.
    In addition to that you also need to grant rights on the AW$ table to the user you want to give access to.
    The AW$ table is where actually the AW is stored and should be in the schema where you have created the AW. The name of it s AW$<AW_NAME> so in order for you to grant select on it to other users, all you need to do is the following:
    grant select on aw$<aw_name> to <user>
    Ragnar

  • Same index name for different tables in different schema

    Just a quick query
    Can two tables present in different schema of same database has same index name ?
    Will there be any problem?
    Thanks

    And just a quick answer:
    859486 wrote:
    Just a quick query
    Can two tables present in different schema of same database has same index name ?Yes.
    >
    Will there be any problem?No.
    >
    Thanks

  • 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
    ...

  • Sdo_filter fail when query against a spatial view in different schema

    We have a table with X,Y coordinates and would like to run spatial query against it. We do not want to change the table structure, so we opt to use a function based index. USER_SDO_GEOM_METADATA is updated and index is built. Then we created a view with spatial column from the table. Everything works fine with the user who owns the table and view.
    When we try to run a spatial query against the view from a different user, it failed with error. However, if we substitute the select from my_view* with the actual SQL statement that created the view, it works. So it looks like Oracle refuse to acknowledge the spatial index if accessed via view. Here is some simplified scripts:
    --- connect as USER1.
    --update meta data
    INSERT INTO USER_SDO_GEOM_METADATA ( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID ) VALUES
    ('LOCATIONS', 'MDSYS.SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)',
    SDO_DIM_ARRAY( SDO_DIM_ELEMENT('X', 1300000, 1600000, 1), SDO_DIM_ELEMENT('Y', 400000, 700000, 1) ), 2264 );
    --created index
    CREATE INDEX LOCA_XYGEOM_IDX ON LOCATIONS
    ( SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)
    ) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    --create view
    CREATE VIEW USER1.MY_VIEW AS SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0;
    -- run spatial query from view, works fine by user1 by failed on user2.
    SELECT SHAPE FROM (
    SELECT * FROM USER1.MY_VIEW
    ) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
    -- run spatial query from table directly, simply replace the view with actual statements that created the view. works fine by user1 AND user2.
    SELECT SHAPE FROM (
    SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0
    ) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
    When run against the view by user2, the error is:
    ORA-13226: interface not supported without a spatial index
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 8
    ORA-06512: at "MDSYS.SDO_3GL", line 1173
    13226. 00000 - "interface not supported without a spatial index"
    *Cause:    The geometry table does not have a spatial index.
    *Action:   Verify that the geometry table referenced in the spatial operator
    has a spatial index on it.
    Note, the SELECT SHAPE FROM (****) A WHERE SDO_FILTER(....) syntax is a third party application, all we have control is the part inside "(select ...)".
    So it appears Oracle is treating view differently. Have attempted fake the view name into USER_SDO_GEOM_METADATA, did not work. Also, granted select on the index table to user2, did not work.
    if we re-created the view in user2 schema, it worked for user2 but not user1, so it's not something we can do for every user.
    Searched the forum, no good match found. A few posts talked about "union all" in view caused the problem but I do not have the union.
    We are only use Oracle 10g Locator, not full spatial edition.
    Any ideas?
    Thanks!
    Edited by: liu.284 on Oct 4, 2011 12:08 PM

    It seems a bug, where a function-based spatial index is not correctly handled in a view query transformation.
    Not sure if the following works for you or not.
    add a new column "shape" (mdsys.sdo_geometry) in table locations, use a trigger and x_coord/y_coord
    to set values for this new column, and just create a normal spatial index on this new column. (drop the
    function-based spatial index). And create a view like:
    CREATE VIEW USER1.MY_VIEW2 AS SELECT ID , X_COORD, Y_COORD, SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0;

  • 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

Maybe you are looking for