Accessing different schema

Hi
I have created user with username "ABC/ABC@oracle" which is having DBA priviliges.
Now I want to connect another user of same database e.g. "DEF/DEF@oracle" ,I have to drop and create table in "DEF" schema thru procedure/package created in my schema i.e. "ABC".
I have given execute procedure privileges on my procedure to "DEF" schema.
I can drop & create table in "DEF" schema thru anonymous block.But I am unable to drop & create table in "DEF" schema thru procedure created in "ABC/ABC@oracle".
Please tell me where I m going wrong or do i have to give any privileges to my procedure/package to move further.

user8443223 wrote:
Hi
I have created user with username "ABC/ABC@oracle" which is having DBA priviliges.
Now I want to connect another user of same database e.g. "DEF/DEF@oracle" ,I have to drop and create table in "DEF" schema thru procedure/package created in my schema i.e. "ABC".
I have given execute procedure privileges on my procedure to "DEF" schema.
I can drop & create table in "DEF" schema thru anonymous block.But I am unable to drop & create table in "DEF" schema thru procedure created in "ABC/ABC@oracle".
Please tell me where I m going wrong or do i have to give any privileges to my procedure/package to move further.You have the answer to your question ... privs for a proc are not inherited by a role, but let me pic a nit on another issue:
I have created user with username "ABC/ABC@oracle" ...No, you haven't. You have created a user with username ABC. You have created user ABC with a password of ABC. You have created user ABC in the database that is referenced by the tnsnames entry "oracle".

Similar Messages

  • Can Oracle reports access different schemas?

    I have a query that accesses 2 schemas: It gives me an error ORA-00904 when I try to run the report.
    Any ideas?

    Yes it helps. I had 3 queries... and the first was accessing the other schema but not the second or third query when they should have. However, when I ran the report, it kept giving me an error as if the first one was the problem.
    Misleading error diagnostics made doubt it.

  • Users accessing different schemas

    Hi,
    I may be missing some fundamental concept here, but here is my issue:
    I have a Java application, that accesses an Oracle database. We provide the Oracle scripts to the end user to create their database and they can change the user/schema name.
    So in my code, I would access the database with commands like:
    select * from employee
    and not
    select * from mySchema.employee
    The JDBC connection that will just use the default schema for that user.
    Now my end user wants to create a different Oracle user to use for DB access in the application with more restricted privileges, but somehow I need to change what the default schema for this new user would be. How can I do this? It would be great if their were a JDBC property that I could set which would set the schema to use - but I didn't think there is one.
    I've come across suggestions of
    "ALTER SESSION SET CURRENT SCHEMA = schema;"
    but would I have to run that statement in program on every JDBC connection I get? I would then have to allow the user some place to configure the schema name they were using.
    TIA
    Ian

    Thanks for that - sounds like what I want.
    So I've created a trigger like this
    create or replace trigger INIT_APPLICATION
    after logon on MYAPP_NO_PRIV.SCHEMA
    begin
    execute immediate 'ALTER SESSION SET CURRENT SCHEMA = MYAPP';
    end;
    which I hope will change the schema as the user logs on.
    Problem is when I try to log on now, I get the error
    "ORA-00604: error occurred at recursive SQL level"
    Any ideas?

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

  • 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

  • How to access different Agent from differnt schema in ODI?

    Hi,
    I am new in ODI and doing some practical assignment related to ODI agent.
    here on one system i.e. 198.168.100.22 my colleague install ODI and  another system 198.168.100.21 I also have installed ODI this is my system with different schema of each.
    We also have created standalone agent of each system and Test successfully. We run so many session with this standalone agent.
    Now we have to configure his agent in my system and vice-a-verse, he also configure my agent to his system.
    we try tried it but for my agent , the Test is SUCCESSFUL but when I created another agent with the same name & his hostname the Test is fail.
    Please anybody suggest us how would I access his agent in my system & test successfully(Work Successfully).
    Thanks

    ODI-1424: Agent host or port cannot be reached using http://192.168.100.29:20910/oraclediagent.
    Here, the IP(100.29) in URL looks different than 2 IPs' that you have specified above. 
    Also, In topology, the ODI agent should be configured with hostname where ODI Standalone Agent is installed.
    will create only one Master Repository and under that will create the 2 work repository
      Yes, this sounds good.
    Regards,
    Santy

  • 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

  • MapViewer metadata problem - accessing spatial data in a different schema.

    I have a MapViewer application that uses data from three different schemas.
    1. Dynamic Themes come from schema A.
    2. Static Themes come from schema B.
    3. A newly added static theme in B whose data comes from schema C.
    The mapviewer datasource points to schema B where the static themes, data and metadata are defined while the dynamic themes have their own datasource specified as part of addJDBCTheme(...).
    To get the newly added map to work I've had to add a view in schema B that points to C instead of referencing directly the table and I've had to add the metadata twice, once for schema B and once for schema C.
    If I put the metadata in just one of the two schemas I get the following errors.
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] cannot find entry in ALL_SDO_GEOM_METADATA table for theme: AMBITOS_REST
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] java.sql.SQLException: Invalid column index
    OR
    08/11/21 13:53:39 ERROR [oracle.sdovis.theme.pgtp] java.sql.SQLException: ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    It's not a big deal but I'd like to know if anyone else has has similar problems.
    Saludos,
    Lew.
    Edited by: Lew2 on Nov 21, 2008 6:42 AM

    Hi Lew,
    if you are using a recent version (10.1.3.1 or later) there is no need to use a view and to create the metadata in both schemas.
    You need to grant selection on tables between the schemas.
    You can try the following. Assume you have the MVDEMO schema (from MapViewer kit) and SCOTT schema.
    1) grant select on MVDEMO Counties table to SCOTT
    SQL> grant select on counties to scott;
    2) Now you are ready to create a predefined theme in schema SCOTT using the MVDEMO Counties table.
    - Open MapBuilder and loads the SCOTT schema.
    - On the Data navigator (bottom left tree), go to Geometry tables and you should see the MVDEMO node and the COUNTIES node inside it.
    - Start a wizard to create a geometry theme based on this Counties table.
    - At the end you should see that the base table name is MVDEMO.COUNTIES. Therefore MapViewer will use the metadata in MVDEMO schema and there is no need to replicate it in SCOTT schema.
    Joao

  • How can i import tables from a different schema into the existing relational model... to add these tables in the existing model? plss help

    how can i import tables from a different schema into the existing relational model... to add these tables in the existing relational/logical model? plss help
    note; I already have the relational/logical model ready from one schema... and I need to add few more tables to this relational/logical model
    can I import the same way as I did previously??
    but even if I do the same how can I add it in the model?? as the logical model has already been engineered..
    please help ...
    thanks

    Hi,
    Before you start, you should probably take a backup copy of your design (the .dmd file and associated folder), in case the update does not work out as you had hoped.
    You need to use Import > Data Dictionary again, to start the Data Dictionary Import Wizard.
    In step 1 use a suitable database connection that can access the relevant table definitions.
    In step 2 select the schema (or schemas) to import.  The "Import to" field in the lower left part of the main panel allows you to select which existing Relational Model to import into (or to specify that a new Relational Model is to be created).
    In step 3 select the tables to import.  (Note that if there are an Foreign Key constraints between the new tables and any tables you had previously imported, you should also include the previous tables, otherwise the Foreign Key constraints will not be imported.)
    After the import itself has completed, the "Compare Models" dialog is displayed.  This shows the differences between the model being imported and the previous state of the model, and allows you to select which changes are to be applied.
    Just selecting the Merge button should apply all the additions and changes in the new import.
    Having updated your Relational Model, you can then update your Logical Model.  To do this you repeat the "Engineer to Logical Model".  This displays the "Engineer to Logical Model" dialog, which shows the changes which will be applied to the Logical Model, and allows you to select which changes are to be applied.
    Just selecting the Engineer button should apply all the additions and changes.
    I hope this helps you achieve what you want.
    David

  • Import of BaseView to a different schema in database

    Hi All,
    We have developed some bam reports. Now the base view, meta view are referring to a schema name (say SchemaName1) in database.
    In the plans we are using "SQL query" to get data from database. So we have queries like "Select SchemaName1.table1.column1 ... from ......".
    Now we have taken a export of the base view, meta view ,plans and all other components of BAM.
    All is fine till now... But now i need to import all these stuff in a different database. My problem is that in the new database instance i cannot use the same schema name (i.e. SchemaName1 ). I have a different schema name(say SchemaName2) there and i need to use that......There is no way i can use SchemaName1.
    Will the import of Base view/Meta view/plans work or we need to do some configuration changes during import??
    Do we have to create Base view for the new schema names from scratch or the imported code can be used??
    The plans have sql queries referring to SchemaName1 but we need it to refer to the Other schema(SchemaName2 )...What is the possible way of referring to the new schema without developing the plan again??
    Waiting for your valuable feedback...

    ***Backup your repository database***
    ***Please review all steps before attempting***
    Sarputil Export
    1.     Start | Run, type “sarputil”
    2.     Do a partial export. (Note down directory that will contain files to be exported.).
    3.     Select your Baseview, Metaview, Security:Login Profile, and Plan. (Note, the check boxes are in front of each object name and might appear very light on some clients.)
    4.     On the XML dialog and with the question on what you would like to do – select Execute Now.
    5.     Finish the wizard and from the directory noted above, verify .csv files were created. (Typically C:\OracleBAM\EnterpriseLink\Data\rp\export).
    6.     Copy all .csv files and paste to different temporary folder on 2nd server.
    Sarputil Import
    1.     Start | Run, type “sarputil” on the 2nd server where you’ll import into.
    2.     Partial import
    3.     Under Repository Information dialog, set the Data Source information on the right and remember to change the directory now containing your .csv files.
    4.     Like before, select “Execute now” and Finish the wizard.
    Oracle BAM Admin
    Modify connect string (host string or tns name) if you need to:
    1.     Connect in Oracle BAM Admin
    2.     Expand Baseviews and select the imported Baseview
    3.     Check under “Server” on the left if the connect string is correct.
    4.     If not, click Modify button and change.
    Modify Baseview Login if you need to:
    1.     With your Baseview still selected on the left side, click on “Baseview Logins” tab
    2.     Logins on the left correspond to actual database user id’s and password. Add a new Login with a database User ID and Password to access the new schema.
    3.     Associate or Set the new Login (right) to the BAM User on the left.
    Sarpbv Modification
    Use sarpbv utility to change references of the old schema name to a new schema name.
    General syntax for Oracle:
    sarpbv /R"username:pwd:Oracle:TNS Name::DB UserID:DBUser pwd” /B"BaseView name" /O"NewSchema"
    **Use Capital letters for New Schema name!
    **Notice 2 colons (::) after TNS Name (because you do not have a database name in Oracle).
    1.     Open DOS
    2.     Type your sarpbv command. Below is an example where I changed a Baseview called “scott” to use a new schema name called Jack.
    sarpbv /R"sa::ORACLE:baminst::sagent:sagent" /B"scott" /O"JACK"
    3.     Open Design Studio, locate the plan and check the SQL Query now reflects the new schema.
    4.     Test the plan to ensure it’s pulling data correctly from the new schema.

  • 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

  • Different schemas in the same Oracle database

    Both my source and target tables are in the same physical Oracle database (different schemas).
    I can use the LKM Oracle to Oracle (DBLINK) knowledge module to load data but this requires setting up a dblink between the two schemas. Given that I can set this up so that the target schema has select etc permissions on the source schema, I can't help feeling that there is a simpler (more efficient?) way of doing this.
    One of the steps in the LKM is 'Create Synonym on Target' which does the following
    create synonym     <%=snpRef.getTable("L", "COLL_NAME", "W")%>
    for           <%=snpRef.getTable("R", "COLL_NAME", "W")%>
    This creates an Oracle synonym that includes a dblink (e.g create synonym s1 for s2@dblink). I can't help feeling that if I could change this so that it doesn't include the '@dblink' part then I could solve the problem and just create a synonym in the target schema that points directly to the source (e.g create synonymn s1 for source.s2). This should then mean that all the rest of the load etc process could run just the same.
    I'm sure that there must be a way of doing this, but I can't figure out how to do it using the substitution methods API.
    Any ideas how I do this?
    Thanks,
    Chris

    Chris,
    for sure when you define a Data Server you have to specify user which have appropriate access to both source and target schemas.
    Then you can create 2 schemas in one Data Server and ODI will use queries like
    insert into target_schema.tab_name
    select ... from source_schema.tab1 ...
    Loading KM will not be used in that case at all therefore data flow will work MUCH faster.
    Oleg

  • Connecting to a different schema within a stored procedure

    Hi Peopl,
    I have a Stored proce "TestProc" which is a part of schema "test1"... Now within this proc i need to connect to a different schema "test2", fetch some data from its tables and disconnect from the same, but not from the original schema "test1". Both the schemas are located on the same database server so i guess no different network connection. I hope u guys got my question... if not tell me... How shud i approach this requirement....

    This would all be handled within the same session, so there is no extra connect or disconnect involved here.
    The user 'test2' needs to grant the appropriate privileges directly to 'test1'. These grants must be direct and not through a role. If the procedure is just selecting data from test2, then test2 needs to:
    test2>grant select on tablea to test1;where tablea represents a table in the test2 schema. There would be a separate grant for each table in test2 accessed by test1.
    The code in test1 can refer to the table in test2 as test2.tablea, or you can create a private synonym in test1:
    test1>create synonym tablea for test2.tablea;so every reference to tablea does not need to be qualified with the 'test2.' prefix.

  • Stored Procedure executes on two different schemas in Oracle 8i

    Can I Create a Stored Procedure that access table from two different schemas?
    For Example I have created this Stored Procedure on SCHEMA_ONE
    CREATE OR REPLACE PROCEDURE SP_DEMO IS
    BEGIN
    INSERT INTO SCHEMA_ONE.COUNTRY_ONE(COUNTRY_NAME)
    SELECT COUNTRY_NAME
    FROM SCHEMA_TWO.COUNTRY_TWO
    END SP_DEMO;
    and when I execute it I am getting error message as :
    Error: PLS-00201: identifier 'SCHEMA_TWO.COUNTRY_TWO' must be declared
    is that possible? If yes then what I need to do for that?
    Please assist me.

    hi john
    How are you?
    please have a view there and correct me if m wrong.
    insufficient privileges
    Khurram Siddiqui
    [email protected]                                                                                                                                                                                                                                                                                                                                                                                                                   

  • SQL Query Template to a different schema

    Hi all
    I am on MII 12.2, connecting to Oracle through a data source which references user/schema "Foo"
    I would like to perform queries involving tables from schema "Bar" .
    As a consequence, when I need to access Bar tables I must reference them like "Foo.<TableName>"
    If I use an SQL query with mode Command I can freely write the prefix but no return is allowed
    If I use mode = FixedQuery(With Output) I can't prefix "Foo." because the editor prevents me from freely entering SQL code
    How can I do this? Thanks regards
    Vincenzo

    Thanks for your reply!
    Actually there is a primary key, but Streams seems to ignore it. I've also tried the SET_KEY_COLUMNS way plus supplementary logging on the source DB, but this didn't help at all. I think this is happenening because the tables are not in the TEST_HQ schema, there are only synonyms to the real tables contained in TEST_CO.
    Is there any other easy way to get Streams working between two different schemas?
    Thanks again for your help!!
    Max

Maybe you are looking for