Using tables in another schema as source tables

Let's say I have a schema called, say, FRED and FRED owns a table called CUSTOMERS.
Now say for security reasons I cannot log in as FRED but I do have access to a user called READ_ONLY. READ_ONLY is granted SELECT privileges on CUSTOMERS (directly rather than through a role). So now I can log in as READ_ONLY and do a SELECT * FROM FRED.CUSTOMERS and it works. If I create a synonym then I can just do SELECT * FROM CUSTOMERS.
My question is can OWB see this table if it is connecting as READ_ONLY? The table does not appear in the shuttle list of objects to capture under the Import Metadata wizard as it is not owned by READ_ONLY. Neither the select privs nor the synonym seem to enable me to get at the table definition. Is there any other way of getting at it? I can fudge it by creating a view but if I can get at the table itself then that would be the best answer as it removes a dependency for me.

On the import wizard did you select the check box for using a synonym to look up objects? This should do what you want. Also you can use READ_ONLY as the authentication user and FRED as the schema as an alternative.
Cheers
David

Similar Messages

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How to share data in "User_*" tables with another schema

    I would like to share the data in the USER_SEGMENTS table with another schema. If I create a view and grant select on the view, when the other schema queries the view the data is identical to themselves querying the SYS.user_segments table directly.
    create view sys_user_segments as select * from sys.user_segments;
    grant select on sys_user_segments to A;My guess is that the SYS.user_segments table is a view based on the current user.
    Is there a way to share this data without creating a copy of the table?
    Oracle: 10g
    Thanks

    Hi,
    All the data dictionary "tables" whose names start with user_ (or all_ or dba_) are actually views, and what results they bring back depend on what schema you logged in to. I don't think there's any way to allow user A to directly see what's in user B's version of user_segments.
    Why do you need this? Can you use the all_ views instead, by giving A some privileges on B's objects?
    Failing that, you can replicate the data into a regular table. Inside a AUTHID DEFINER stored procedure, the data dictionary views (such as user_segments) are the versions of the procedure owner, so B can write a stored procedure (let's call it populate_my_segments) that populates a regular table (let's call it my_segements), and then grant EXECUTE privilges on populat_my_segments and SELECT privileges on my_segements to user A. A can then refresh the table and look at it whenever he wants to.
    If A only needs to see a little information, e.g. the total number of bytes, from B's user_segments, then B can write a function just to return that information.

  • Create user who can update another schema table

    Hi,
    We have a prod system under which we need to update  the application schema by running different update statement and  create/execute function,procedure,package body. This is very easy if you use the owner schema. But i need to run those activities from another user due to some restriction. How can i do that??
    May u suggested to give update any table privilege..but this would give all the dictionary table access also.
    Is there any privilege that would allow any other user to update another schema table without using the schema name infront of the table name??
    Plss suggest

    John,
    Can we use public synonym for it ?  I don't know the security risk for it though :
    SQL> connect hr/hr
    Connected.
    SQL> select * from scott.emp;
    select * from scott.emp
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> connect scott/tiger
    Connected.
    SQL> create public synonym scotemp for scott.emp;
    Synonym created.
    SQL> connect hr/hr;
    Connected.
    SQL> select * from scotemp;
    select * from scotemp
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> connect scott/tiger
    Connected.
    SQL> grant select on emp to hr;
    Grant succeeded.
    SQL> connect hr/hr
    Connected.
    SQL> select * from scotemp;
    14 rows selected.
    SQL> show user;
    USER is "hr"
    SQL> update scotemp set ename='SMITHX' where empno=7369;
    update scotemp set ename='SMITHX' where empno=7369
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> connect scott/tiger
    Connected.
    SQL> grant update on emp to hr;
    Grant succeeded.
    SQL> connect hr/hr
    Connected.
    SQL> update scotemp set ename='SMITHX' where empno=7369;
    1 row updated.
    SQL> rollback;
    Rollback complete.
    SQL>
    Regards
    Girish Sharma

  • Connect role allows user to update/delete row of a table of another schema

    I am using oracle 9i r2, I created a user and only give him CONNECT role. Then I opened the sqlplus and found that he could query table of another schema which doesn't belong to the new user, but the thing which scares me most is that when I tried to update/delete a row from a table of another schema, it succeeded. Also, I created a new role with system priviledges CREATE_SESSION and SELECT_ANY_TABLE then granted to new user and revoked the CONNECT role but the same thing happened like before. What I am doing wrong? By the way, I am trying to create a read only user. Any help is greatly appreciated.

    Thanks guys for the tips. I have forgotten to mention that this situation happened only in a new created schema which has only a table and the table was exported from another oracle db( I pre-created the user with connect role and assign the tablespace etc), the import worked fine. Then I used a read only user(in different schema) to update/delete row to the imported table.The read only user can't update/delete other schemas besides from the new one. Is that I missed something when importing the table or pre-create user, tablespace, etc? Thanks in advance.

  • How to work with tables located into another schema ?

    Hi
    I have created an application named OBSERVATOIRE and a schema named "OBSERVATOIRE" for it into my db. I created into this schema a few tables like "AGENT" for example.
    Now I am designing another application named TELEGESTION located in another schema named "SIVOA" and I need to display and to use tables located into the schema OBSERVATOIRE.
    I added the schema OBSERVATOIRE into my application TELEGESTION.
    In my new application TELEGESTION, when I try to create a report with a simple request like this
    select * from observatoire.agents
    I get this error :
    Query cannot be parsed, please check the syntax of your query. (ORA-00942: Table ou vue inexistante)
    What should I do in order to work with tables in another schema ?
    Thank you very much
    Christian

    Vajrad and Dan,
    Thank you very much for your suggestions.
    At this point I am wondering if It would be better for me to change the way I began work.
    These two applications will be used by the same users into an intranet (a private network of our company). I wonder if the better would be to import the tables and my application OBSERVATOIRE into the schema SIVOA and get rid of these problems of access.
    Historically, the schema SIVOA contains a lot of tables already used by a previous network.As i was beginner with APEX I created a schema "OBSERVATOIRE" to be "safe". But this schema contains a small amounbt of tables, i can easily tranfers them into the schema "SIVOA"
    But now as I see that that having two schemas is complexifying the developpement and also I am thinking to the login page, I do'nt want to force the user to login each times a switch from one application to the other, etc... I want some kind of "single sign on".
    Whad would be you advise ?
    Thank you for your time.
    Christian

  • Using tables from another app

    Hi
    I have little experience developing multi-app systems.
    In this specific case, I have a table that has a FK for a table in another app.
    My first question is: if I export the referencing app, and import it in another repository that hasn't the referenced app, what happens? The import fails? Should I import the referenced app first?
    My 2nd question: since the two apps will correspond to different database schemas, how am I supposed to generate the DB? Specifically how to generate that FK that points to a table in another schema...
    Thanks
    Luis Cabral

    I meant when I go to the app store through an app like Flipboard.

  • Using table comparison can we use multiple tables as source?

    Using table comparison can we use multiple tables as source?
    Thank you very much for the helpful info.

    Table Comparison
    1) Input Data coming in
    2) Comparison table (table to which the data is compared)
    3) Output (input rows with respective opcodes based on the comparison result of input dataset with the comparison table)
    If your question is whether table comparison can accept union/join of multiple table sources, you can achieve by using merge/query transforms and then feeding to table comparison. Here, you have to be careful about choosing the primary keys inside table comparison

  • Create Index on another schema table stored in my table

    Hi,
    I want to create index on a table column which is in another schema from my schema and the index to be stored in my schema.
    ex: current user 'hr'
    sql>create index idx1 on scott.emp(eno);
    Does the above query works??
    thanks,
    Sri

    Why cant you give a try?
    Are you getting any error message?
    See below..
    SQL> show user
    USER is "SCOTT"
    SQL> grant select on emp to hr;
    Grant succeeded.
    SQL> conn
    Enter user-name: hr@***
    Enter password:
    Connected.
    SQL> show user
    USER is "HR"
    SQL> create index ndx on scott.emp(sal);
    create index ndx on scott.emp(sal)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> conn
    Enter user-name: system@*******
    Enter password:
    Connected.
    SQL> create index ndx on scott.emp(sal);
    Index created.
    SQL> drop index ndx;
    Index dropped.
    SQL> grant create any index to hr;
    Grant succeeded.
    SQL> conn
    Enter user-name: hr@*******
    Enter password:
    Connected.
    SQL> create index ndx on scott.emp(sal);
    Index created.Edited by: jeneesh on Oct 8, 2012 3:53 PM

  • Accesing the tables of one schema in another schema

    Hi
    I have doubt .. suppose i have a user called DEMO and it has tables . now i have a another user called DEMO1
    my doubt is . how can i get the tables of DEMO user into DEMO1. If update the table in DEMO1 that should reflect
    in DEMO user. help me.........

    Before going further, you should clarify your requirements and make sure you have a good understanding of:
    - Synonyms
    - Views
    - Replication such as materialized views
    - Basic security including object grants
    Assuming this is all in the same database...
    If you just need to have one user access data in another schema, you need grants.
    If you need to make it 'look like' the data in that other schema is in your schema, you should be looking at synonyms or views.
    If you need to capture the data periodically from the other schema, you should be looking at materialized views.
    If you are straddling multiple databases then the choices may be less clear-cut but you should still be looking at these capabilities to assemble a solution
    From what you have said so far, triggers should not even be on your radar.

  • Loading data into another schema table

    Hi,
    i have a table 'abc' in schema 'sch_123'
    i also havea a table 'xyz' in another schema 'sch_789'
    i have abt 25,000 rows of dat in table abc of schema 'sch_123'
    i want load the data in table 'abc to another table 'xyz' which is in the schema 'sch_789'

    connect to schema 'sch_789'
    then execute
    grant select on xyz to sch_123then connect to sch_123
    and execute
    insert into abc select *  from sch_789.xyzBut there the structure should be same of both the tables...
    Cheers
    Nawneet
    Edited by: Nawneet on Oct 29, 2009 2:20 AM

  • How to find the list of un used table names in a schema?

    Hi,
    I have a doubt in Oracle. The doubt is that If we are using any tables in Function Or Proc.... Then...We can list all those used table names from USER_DEPENDENCIES system table. Right...
    But, If the table is used with Execute Immediate Statement, then, those table names are not coming out with USER_DEPENDENCIES system table. Because they are identified at run time and not compile time.
    It is fine. And I agree.. But, If I want to list out those tables also...then...How to do? Any idea?
    I think ‘USER_SOURCE’ system table may not be the right one. If there is any other system table avails for this purpose...then..it would be very grateful to extract right...
    So I am wanting that exact system table.
    Please let me know about this, if you have any idea or check with your friends if they have any idea.
    Regards,
    Subramanian G

    Hi Guys,
    Thanks for all your answers.
    Yes....You are all right. We can list out the used tables upto certain extent. Anyhow, I have done some R&D to derive the SQL's which is given below:
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    UNION
    SELECT UT.TABLE_NAME FROM
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    AND REFERENCED_OWNER=(SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual)
    ) UT,
    ( SELECT * FROM USER_SOURCE
    WHERE NAME IN
    ( SELECT DISTINCT NAME FROM USER_SOURCE
    WHERE TYPE NOT IN ('TYPE')
    AND
    UPPER(TEXT) LIKE '%EXECUTE IMMEDIATE%'
    ) US
    WHERE
    UPPER(US.TEXT) LIKE '%'||UPPER(UT.TABLE_NAME)||'%'
    AND
    (UPPER(US.TEXT) NOT LIKE '%--%')
    The above SQL Query can list out unused tables by checking the Dynamic SQL Statement also upto some level only.
    Once we extracted the list of unused tables, having a manual check would be also greater to verify as it is should not impact the business applications.
    Regards,
    Subramanian G

  • Problems using table (cast as)

    Hi
    I have some code like this:
    declare
    TYPE t_forall_bags IS TABLE OF misbag.bags%ROWTYPE;
    l_forall_bags t_forall_bags := t_forall_bags ();
    begin
    open c2;
    FETCH c2 BULK COLLECT INTO l_forall_bags LIMIT v_array_size;
    if l_forall_bags.COUNT > 0 then
    begin
    merge into misbag.bags dest
    using (select col1,
    col2,
    colx
    from TABLE( cast( l_forall_bags as t_forall_bags ) ) ) src
    on (dest.bag_id = src.bag_id )
    when matched then
    --do update stuff
    when not matched then
    --do insert stuff;
    end;
    end if;
    end;
    on compilation I am getting an ora-00902 invalid datatype seemingly on the t_forall_bags in side the cast (as highlighted in bold)
    I thought I had the syntax correct, but maybe not.
    rgds
    Tony

    BluShadow wrote:Why are you querying data from the database into a collection (in expensive PGA memory) to then pass that back down to the SQL engine to be treated as a table (and incidently one without any indexes or the other benefits of a database table).Well that is a very good question.
    The task is to take a generally smaller number of very recent rows from one table and apply them to a similar table in another schema. This task will run very frequently (ie every second or two) so generally will have a smallish number fo rows (ie 100-200) each time it runs. Some rows are updates and some rows are inserts.
    If there is a delay on running the task, we don't necessarily want to process all of the outstanding rows in one go, but to take them in chunks until is catches up.
    One way to do this would be to perform multiple queries on the original data to check how many rows where outstanding, then to select which ones were to be merged, then go ahead and do the merge (with both main tables as you propose). This alternate idea (that I was looking at here) was to bulk collect the first n rows from the table into the array (up to the defined limit) and then to merge this list of rows into the destination table. The goal was to perform fewer data accesses and make the process least expensive in I/O. By bulk selecting up to N rows into the array, it was felt that there was less I/O on the source table, and probably the same amount of I/O on the destination table.
    The very first method of writing was to bulk select the first N rows into an array, delete any that already existed in the dest table then to "forall" insert the array contents into the destination table. This seemed to work quite well, we wanted to compare the merge version and see how it compared in speed and I/O usage.
    Tony
    rgds
    Tony

  • Using Table.Join formula takes extremly long time to get results.(Why Query Folding doesn't work?)

    Hi,
    I built a query with 4 tables inside (load from Oracle DB and two of them are quite big, more than millions of rows). After filtering, I tried to build relationships between tables using Table.Join formula. However, the process took extremly long time to
    bring out results (I ended the process after 15 mins' processing). There's a status bar kept updating while the query was processing, which is showed as  . I suppose
    this is because the query folding didn't working, so PQ had to load all the data to local memory first then do the opertion, instead of doing all the work on the source system side. Am I right? If yes, is there any ways to solve this issue?
    Thanks.
    Regards,
    Qilong 

    Hi Curt,
    Here's the query that I'm refering,
    let
        Source = Oracle.Database("reporting"),
        AOLOT_HISTS = Source{[Schema="GEN",Item="MVIEW$_AOLOT_HISTS"]}[Data],
        WORK_WEEK = Source{[Schema="GEN",Item="WORK_WEEK"]}[Data],
        DEVICES = Source{[Schema="GEN",Item="MVIEW$_DEVICES"]}[Data],
        AO_LOTS = Source{[Schema="GEN",Item="MVIEW$_AO_LOTS"]}[Data],
        Filter_WorkWeek = Table.SelectRows(WORK_WEEK, each ([WRWK_YEAR] = 2015) and (([WORK_WEEK] = 1) or ([WORK_WEEK] = 2) or ([WORK_WEEK] = 3))), 
        Filter_AlotHists = Table.SelectRows(AOLOT_HISTS, each ([STEP_NAME] = "BAKE" or [STEP_NAME] = "COLD TEST-IFLEX" or [STEP_NAME] = "COLD TEST-MFLEX") and ([OUT_QUANTITY] <> 0)),
        #"Added Custom" = Table.AddColumn(Filter_AlotHists, "Custom", each Table.SelectRows(Filter_WorkWeek, (table2Row) => [PROCESS_END_TIME] >= table2Row[WRWK_START_DATE] and [PROCESS_END_TIME] <= table2Row[WRWK_END_DATE])),
        #"Expand Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"WRWK_YEAR", "WORK_WEEK", "WRWK_START_DATE", "WRWK_END_DATE"}, {"WRWK_YEAR", "WORK_WEEK",
    "WRWK_START_DATE", "WRWK_END_DATE"}),
        Filter_AolotHists_byWeek = Table.SelectRows(#"Expand Custom", each ([WORK_WEEK] <> null)),
        SelectColumns_AolotHists = Table.SelectColumns(Filter_AolotHists_byWeek,{"ALOT_NUMBER", "STEP_NAME", "PROCESS_START_TIME", "PROCESS_END_TIME", "START_QUANTITY", "OUT_QUANTITY", "REJECT_QUANTITY",
    "WRWK_FISCAL_YEAR", "WRWK_WORK_WEEK_NO"}),
        Filter_Devices= Table.SelectRows(DEVICES, each ([DEPARTMENT] = "TEST1")),
        SelectColumns_Devices = Table.SelectColumns(Filter_Devices,{"DEVC_NUMBER", "PCKG_CODE"}),
        Filter_AoLots = Table.SelectRows(AO_LOTS, each Text.Contains([DEVC_NUMBER], "MC09XS3400AFK") or Text.Contains([DEVC_NUMBER], "MC09XS3400AFKR2") or Text.Contains([DEVC_NUMBER], "MC10XS3412CHFK") or Text.Contains([DEVC_NUMBER],
    "MC10XS3412CHFKR2")),
        SelectColumns_AoLots = Table.SelectColumns(Filter_AoLots,{"ALOT_NUMBER", "DEVC_NUMBER", "TRACECODE", "WAFERLOTNUMBER"}),
        TableJoin = Table.Join(SelectColumns_AolotHists, "ALOT_NUMBER", Table.PrefixColumns(SelectColumns_AoLots, "AoLots"), "AoLots.ALOT_NUMBER"),
        TableJoin1 = Table.Join(TableJoin, "AoLots.DEVC_NUMBER", Table.PrefixColumns(SelectColumns_Devices, "Devices"), "Devices.DEVC_NUMBER")
    in
        TableJoin1
    Could you please give me some hints why it needs so long to process?
    Thanks.

Maybe you are looking for