Running scripts in different schema

Assume you have a workspace user DEMO and parsing schema TEST and PROD.
I create from Workshop/utilities/DDL you select schema PROD for getting DDL for tables, Triggers...
Now you want to run this script against schema PROD (to create the Objects from PROD at TEST). But at Workshop/scripts you see the scripts owned by TEST, but you can't select a schema fur running the script.
As workaround I edited the script: create table TEST.x instead of create table x, but I got: ORA-01031: insufficient privileges.
If I go to Workshop/SQL_Commands select the schema TEST and put in the content of the script (create table TEST.x) it works.
I confused as I create a DDL for y selecting TEST as schema and want run it as "create table PROD.y" - IT WORKS.
In which context is a script executed ?
The difference between schema TEST and PROD is that PROD was created with the workspace and TEST was added later (as new created schema).
It looks like a bug?

thank you scott, I understand. I assumed/found the "primary" schema (b) as the way as it worked. The default schema (a) I now tested - it works.
That means per user there is only 1 schema assigned for running scripts (default or the first schema sssigned to workspace.
But If I have a workspaced with assigned many schemata and some users, having there own default schema but accessing different schemata, there is no way to run a script at a specific schema.
A workaround could by if a developer can change his default schema, but he can't
( I believe thats okay!).
A developer sometimes has to create, upload,execute scripts ...
For my example with schemata DEMO, PROD,TEST I hade to create 3 developers and relogin for executing scripts in the 3 different schemata.
I think there is an enhancement request for having
a) connect command in a script OR
b) selecting schema as in object browser
Thanks - hope you had merry christmas

Similar Messages

  • ORA -04062 when running forms aginst a different schema

    Hello,
    I am getting this error (ORA -04062 signature of 'procedure' has been changed)when I try to run my form aginst my test- schema (different from my development schema). I get rid of the error if I compile the form against the test schema. In the production environment I have to run this form against multiple schemas, so recompilation is not a possible solution.
    Has anybody else come across this problem.
    null

    Thanks John for your reply !
    I think my problem is close to the second thing you mention as a possible cause. I found out that I had used a parameter of type table%ROWTYPE in call to a pacakged procedure. When I defined a "TYPE MyRec IS RECORD" record type in my pacakge specification and used that as the type for the parameter my form seems to work against my test schema without recompilation. Unfortunately the table is pretty large so my package specification does not look so neat anymore. And I lost the dynamics associated with the %ROWTYPE attribute.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Alexander ([email protected]):
    That's a well-known bug. Its worse with a v7 database, but still can occur with 8/8i.
    A couple of things to look for:
    1) REMOTE_DEPENDENCIES_MODE is SIGNATURE instead of TIMESTAMP in init.ora.
    2) Forms that call stored procedures with a large parameter list (about 55 or more) can get a run-time error ORA-4062 if running on a different schema than where it was compiled.
    3) You can also hit a snag if you are calling a dbms_XX package within the form. Instead, call it within a db procedure, which you can call from the form.
    John Alexander
    St. Petersburg, FL www.SummitSoftwareDesign.com <HR></BLOCKQUOTE>
    null

  • Script for Compare same table 'TAB1' structures in different schemas

    Hello, i am having three schema and in all schema i have same table for example TAB1 and i want to Compare TAB1 table structures in all three schema but i don't know the script. the different should content at least  DATA_TYPE,DATA_LENGTH,DECODE(DATA_PRECISION,NULL,NULL,DATA_PRECISION||','||DATA_SCALE) columns in query. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi Thanks..

    If you want a generic script use below function to get the difference.. Run the below script and let me know in case of any issues
    CREATE OR REPLACE TYPE nt_username IS TABLE OF VARCHAR2(50);
    CREATE OR REPLACE TYPE obj_struc IS OBJECT (user_name1     VARCHAR2(30),
                                               user_name2      VARCHAR2(30),
                                               column_name1    VARCHAR2(30),
                                               column_name2    VARCHAR2(30),
                                               data_type1      VARCHAR2(106),
                                               data_type2      VARCHAR2(106),
                                               data_length1    NUMBER(10),
                                               data_length2    NUMBER(10),
                                               data_precision1 VARCHAR2(50),
                                               data_precision2 VARCHAR2(50),
                                               column_id1      NUMBER(10),
                                               column_id2      NUMBER(10)
    CREATE OR REPLACE TYPE nt_struc IS TABLE OF obj_struc;
    CREATE OR REPLACE FUNCTION tabstruc_script (p_tabnm   VARCHAR2,
                                                p_usernm  nt_username
    RETURN nt_struc
    AS
    v_nt_struc nt_struc := nt_struc();
    v_ntusrnm nt_username := p_usernm;
    TYPE rec_stru IS RECORD (column_name    all_tab_columns.column_name%TYPE,
                             data_type      all_tab_columns.data_type%TYPE,
                             data_length    all_tab_columns.data_length%TYPE,
                             data_precision all_tab_columns.data_precision%TYPE,
                             data_scale     all_tab_columns.data_scale%TYPE,
                             column_id      all_tab_columns.column_id%TYPE
    TYPE nt_stru IS TABLE OF rec_stru;
    v_ntstru nt_stru  := nt_stru();
    v_columnname all_tab_columns.column_name%TYPE;
    v_reccnt NUMBER;
    v_cnt NUMBER;
    v_precision1 VARCHAR2(50);
    v_precision2 VARCHAR2(50);                    
    BEGIN
    FOR i IN 1..v_ntusrnm.COUNT
      LOOP
         SELECT COUNT(*) INTO v_reccnt
         FROM all_tables
         WHERE owner = v_ntusrnm(i)
         AND table_name = p_tabnm;
          IF v_reccnt >= 1 THEN
             SELECT column_name,  
                    data_type,    
                    data_length, 
                    data_precision,
                    data_scale,
                    column_id
             BULK COLLECT INTO v_ntstru
             FROM all_tab_columns
             WHERE owner = v_ntusrnm(i)
             AND table_name = p_tabnm;
              FOR j IN i+1..v_ntusrnm.COUNT
                LOOP
                     FOR k IN 1..v_ntstru.COUNT
                       LOOP
                          SELECT COUNT(*) INTO v_cnt
                          FROM all_tab_columns
                          WHERE owner = v_ntusrnm(j)
                          AND table_name = p_tabnm
                          AND column_name = v_ntstru(k).column_name;
                           IF v_cnt >= 1 THEN
                             FOR l IN (SELECT column_name,  
                                              data_type,    
                                              data_length, 
                                              data_precision,
                                              data_scale,
                                              column_id
                                       FROM all_tab_columns
                                       WHERE owner = v_ntusrnm(j)
                                       AND table_name = p_tabnm
                                       AND column_name = v_ntstru(k).column_name)
                                LOOP
                                  IF ((v_ntstru(k).column_id <> l.column_id)
                                      OR (v_ntstru(k).data_type <> l.data_type)
                                      OR (NVL(v_ntstru(k).data_length,0) <> NVL(l.data_length,0))
                                      OR (NVL(v_ntstru(k).data_precision,0) <> NVL(l.data_precision,0))
                                      OR (NVL(v_ntstru(k).data_scale,0) <> NVL(l.data_scale,0))) THEN
                                     v_nt_struc.EXTEND;
                                     SELECT DECODE(v_ntstru(k).data_precision,NULL,NULL,v_ntstru(k).data_precision||','||v_ntstru(k).data_scale),
                                            DECODE(l.data_precision,NULL,NULL,l.data_precision||','||l.data_scale)
                                     INTO v_precision1,
                                          v_precision2
                                     FROM DUAL;
                                     v_nt_struc(v_nt_struc.COUNT) := obj_struc(v_ntusrnm(i),
                                                                               v_ntusrnm(j),
                                                                               v_ntstru(k).column_name,
                                                                               l.column_name,
                                                                               v_ntstru(k).data_type,
                                                                               l.data_type,
                                                                               v_ntstru(k).data_length,
                                                                               l.data_length,
                                                                               v_precision1,
                                                                               v_precision2,
                                                                               v_ntstru(k).column_id,
                                                                               l.column_id);
                                  END IF;
                                END LOOP;
                           END IF;
                       END LOOP;
                      FOR m IN(SELECT column_name,  
                                      data_type,    
                                      data_length, 
                                      data_precision,
                                      data_scale,
                                      column_id
                               FROM all_tab_columns
                               WHERE owner = v_ntusrnm(i)
                               AND table_name = p_tabnm
                               AND column_name NOT IN(SELECT column_name
                                                      FROM all_tab_columns
                                                      WHERE owner = v_ntusrnm(j)
                                                      AND table_name = p_tabnm))
                          LOOP                                         
                            v_nt_struc.EXTEND;
                            SELECT DECODE(m.data_precision,NULL,NULL,m.data_precision||','||m.data_scale)
                            INTO v_precision1
                            FROM DUAL;
                            v_nt_struc(v_nt_struc.COUNT) := obj_struc(v_ntusrnm(i),
                                                                      v_ntusrnm(j),
                                                                      m.column_name,
                                                                      NULL,
                                                                      m.data_type,
                                                                      NULL,
                                                                      m.data_length,
                                                                      NULL,
                                                                      v_precision1,
                                                                      NULL,
                                                                      m.column_id,
                                                                      NULL);
                          END LOOP;
                         FOR n IN(SELECT column_name,  
                                          data_type,    
                                          data_length, 
                                          data_precision,
                                          data_scale,
                                          column_id
                                   FROM all_tab_columns
                                   WHERE owner = v_ntusrnm(j)
                                   AND table_name = p_tabnm
                                   AND column_name NOT IN(SELECT column_name
                                                          FROM all_tab_columns
                                                          WHERE owner = v_ntusrnm(i)
                                                          AND table_name = p_tabnm))
                           LOOP
                            v_nt_struc.EXTEND;
                            SELECT DECODE(n.data_precision,NULL,NULL,n.data_precision||','||n.data_scale)
                            INTO v_precision2
                            FROM DUAL;
                            v_nt_struc(v_nt_struc.COUNT) := obj_struc(v_ntusrnm(j),
                                                                      v_ntusrnm(i),
                                                                      n.column_name,
                                                                      NULL,
                                                                      n.data_type,
                                                                      NULL,
                                                                      n.data_length,
                                                                      NULL,
                                                                      v_precision2,
                                                                      NULL,
                                                                      n.column_id,
                                                                      NULL);
                           END LOOP;
                        END LOOP;
            END IF;
      END LOOP;
    RETURN v_nt_struc;
    EXCEPTION
    WHEN OTHERS THEN
      RAISE;
    END tabstruc_script;
    SELECT * FROM TABLE(tabstruc_script(:tabnm,nt_username(:user1,:user2,:user3)));
    You need to pass tablename and username to calling this function. Username is a nested table here so you can pass like nt_username(:user1,:user2,:user3)

  • Running  sql scripts from different directory

    Hi
    I have sql scripts in different directories as follows:
    D:\myapp\sql
    - load.sql
    - init.sql
    D:\myapp\sql\schema
    -users.sql
    -structure.sql
    D:\myapp\sql\populate\
    - data1.sql
    - data2/sql
    load.sql call all the other scripts as below:
    @init.sql
    @schema\users.sql
    @schema\structure.sql
    @populate\data1.sql
    @populate\data2.sql
    All my scripts run correctly when I run load.sql from D:\myapp\sql on comand prompt.
    I need a way to run this script from a different directory say D:\ or C:\
    I am writing a installer which will execute from a different directory.
    Right now I get a file not found error for scripts within schema an populate folder.
    Please let me know how can I make this work from a different directory.
    Thanks
    kelvin

    Hi peter. i think you cannot run files spread across different locations.
    --the method which u specified always looks to the defined path                                                                                                                                                                                                                                                                                       

  • Unix Perl Script To verify a Up and Running Database on Different Server

    Unix Perl Script To verify a Up and Running Database on Different Server
    Hi
    can any one please tell me a solution to verify a Up and Running Database on Different Server other than the one where we run the unix perl script? The perl script should check if the database is running else it must exit.
    Thanks much
    Kiran

    The other best solution would be Enterprise Manager, load the EM on the other machine and install oracle intelligent agent on all the boxes where oracle is running and problem solved.
    FTP is only a File Transfer Protocol, you can upload/download the files but cant execute them.
    Apart from EM the best way is load oracle client and make connection to all the databases.
    AND There are some free oracle monitoring software available I dont know much about them but one is NAGIO (if I am not wrong), try that if you want.
    BTW whats the problem in monitoring the boxes from the same physical box, means just schedule a script using cron on the same physical box where oracle is to either make connection using SQLPLUS or check the processes using "ps" command and if there is anything wrong then send alert from that box only. In this way there is no need to maintain a central monitoring server.
    Daljit Singh

  • DB Links in different schemas

    Hi,
    I'd like to change DB links in different schemas with SYS user.
    I've tried to create a script to change all DB links (database it should connect to and password)
    ALTER DATABASE LINK "database_link"
    CONNECT TO database IDENTIFIED BY password;
    ORA-02024: database link not found
    Is there no way to do this as SYS? Do I need to logon to everey schema in the database and alter the DB link?
    Regards
    933746
    Edited by: 933746 on Sep 14, 2012 12:09 PM

    Richard-1 wrote:
    I've hijacked the users password / login as the user / create the db link / reset the users password.
    That is ok for a one off.
    To do more a better solution would be to try a procedure call.
    Here is a link to a couple versions that do what you want:
    http://oraganism.wordpress.com/2009/12/02/how-to-create-a-database-link-in-another-users-schema/
    http://oradbatips.blogspot.com/2010/01/tip-84-create-private-db-link-for-user.html
    Hi and thanks.
    The thing is that I know all the passwords but I'd like to only run one script as system or sys and connect to all schemas with private database links and drop them and then create them with new information. Is this at all possible without writing PL/SQL?

  • DB2 to Oracle conversion using SQL Developer Migration Wizard - different schemas

    I am performing a conversion between DB2  to Oracle 11 XE, using the SQL Developer Migration Wizard. Specifically I am trying to migrate the DB2User schema over to Oracle.
    Using the migration wizard, when I pick the Oracle target connection to be the same schema ( DB2User schema ) the migration is successful and all data is converted.
    However if I pick a different Oracle target connection ( say OracleUser ) , I run into issues.
    Firstly , the table schema is not created. When I check the project output directory, the .out file has the following errors:
       CREATE USER DB2User IDENTIFIED BY DB2User DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
            SQL Error: ORA-01031: insufficient privileges
            01031. 00000 -  "insufficient privileges"
        connect DB2User/DB2User
        Error report:
        Connection Failed
        Commit
        Connection created by CONNECT script command disconnected
    I worked around this by manually executing the .sql in the project output directory using the OracleUser id  in the new DB.
    Then I continue with the migration wizard and perform the Move Data step.
    Now - the message appears as succuessful, however, when I review the Migrationlog.xml file, i see errors as follows:
    <level>SEVERE</level>
      <class>oracle.dbtools.migration.workbench.core.logging.MigrationLogUtil</class>
      <message>Failed to disable constraints: Data Move</message>
      <key>DataMove.DISABLE_CONSTRAINTS_FAILED</key>
      <catalog>&lt;null&gt;</catalog>
      <param>Data Move</param>
      <param>oracle.dbtools.migration.workbench.core.logging.LogInfo@753f827a</param>
      <exception>
        <message>java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist</message>
      <level>WARNING</level>
      <class>oracle.dbtools.migration.datamove.online.TriggerHandler</class>
      <message>ORA-01031: insufficient privileges
    </message>
    I think what is happening is that the wizard is attempting to perform the 'move data' process using the DB2User id.
    How do I tell the wizard that the target schema is different than my source schema.
    My requirement is that I need to be able to migrate the DB2User schema to different schemas in the same Oracle database
    ( since we will have multiple test environments under the same database ) .
    Thanks in advance .
    K.

    Perhaps the following from the SQL Developer documentation is helpful for you:
    Command-Line Interface for Migration
    As an alternative to using the SQL Developer graphical interface for migration operations, you can use the migration batch file (Windows) or shell script (Linux) on the operating system command line. These files are located in the sqldeveloper\sqldeveloper\bin folder or sqldeveloper/sqldeveloper/bin directory under the location where you installed SQL Developer.
    migration.bat or migration.sh accepts these commands: capture, convert, datamove, delcaptured, delconn, delconverted, driver, generate, guide, help, idmap, info, init, lscaptured, lsconn, lsconverted, mkconn, qm, runsql, and scan. For information about the syntax and options, start by running migration without any parameters at the system command prompt. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration
    You can use the -help option for information about one or more actions. For the most detailed information, including some examples, use the -help=guide option. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration -help=guide
    Regards
    Wolfgang

  • Dbms_sql  in a different schema from query table-error  ** ORA-00942

    Oracle Experts,
    I think I am having problems with using DBMS_SQL in which the function was created in one schema and the query table was created in a different schema.
    We have 2 schemas: S1, S2
    We have 2 tables:
    T1 in Schema S1
    T2 in Schema S2
    We have a function F1 created by DBA in schema S1 that uses the dbms_sql as:
    CREATE OR REPLACE FUNCTION S1.F1(v1 in VARCHAR2) return NUMBER IS
    cursor1 INTEGER;
    BEGIN
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, v1, dbms_sql.NATIVE);
    dbms_sql.close_cursor(cursor1);
    return (0);
    EXCEPTION
    when others then
    dbms_sql.close_cursor(cursor1);
    return (1) ;
    END;
    I am using jdeveloper 11G. We have an Oracle DB 11g.
    We have a java program which uses jdbc to talk to our Oracle DB.
    Basically, in my java program, I call function F1 to check if the query is valid.
    If it is, it returns 0. Otherwise, returns 1:
    oracle.jdbc.OracleCallableStatement cstmt = (oracle.jdbc.OracleCallableStatement) connection.prepareCall ("begin ? := S1.F1 (?); end;");
    cstmt.registerOutParameter (1, java.sql.Types.INTEGER);
    cstmt.setString(2, "Select * from S2.T2");
    cstmt.execute ();
    Since the table that I run the query is T2, created in different schema than F1 was created in, I have the error:
    ** ORA-00942: table or view does not exist
    So my questions are these:
    - I am using Oracle DB 11g, if I run the query on a table that created in a different schema from the one that the function (which uses dbms_sql) was created in, I would get the error ORA-00942?
    - If I runs the query on table T1 in the same schema as the function F1, would I have the same problem(The reason I ask is I cannot create any table in schema S1 because the DBA has to do it; I am not a DBA)
    - This is not a problem, but a security feature because of SQL injection?
    - How to resolve this issue other than creating the table in the same schema as the function that utilizes DBMS_SQL?
    Regards,
    Binh

    Definer rights (default) stored objects run under owner's security domain and ignore role based privileges. So regardless what user you are logged in as, function S1.F1 always executes as user S1 and ignores user S1 roles. Therefore exeuting statement within S1.F1:
    Select * from S2.T2requires user S1 to have SELECT privilege on S2.T2 granted to S1 directly, not via role.
    SY.

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

  • Altering index unuseable from a different schema.

    I'm sure I'm overlooking something.
    I was recently tasked with taking an existing ETL process that was in several different schemas and centralize it so the controlling procedures and functions are all in one schema, and the tables that are being loaded are in various schemas.
    We're using a dirrect load, with insert (/* append*/) which is much fast than any other method we've found to load the tables. The trouble I'm having is in disabling the indexes. It's used to be that the procedure that altered the indexes was owned by the same schema that owned the indexes. That was working fine.
    So,
    Schema 'A' owns the table and indexes.
    Schema 'B' owns the procedure that will alter the indexes to set them to unuseable.
    Schema B has been granted GRANT ALTER, INSERT, SELECT, UPDATE, DELETE to all tables in Schema 'A'
    I am logged in a Schema 'B' and I run the following command...
    ALTER INDEX A.PROC_DETAILS_ENC_ID_IDX UNUSABLE
    I get ....
    Index altered.
    However if I run the same thing in a function, I get ...
    ORA-01418: specified index does not exist
    That seems odd to me that I can run it from toad, but not in a function?

    user12221955 wrote:
    That seems odd to me that I can run it from toad, but not in a function?Check role-based vs direct grant privileges. PL/SQL does not like role-based privileges and tends to ignore them while running. Directly granted privileges are not so affected. Directly grant the privileges you want to the PL/SQL procedure owner.

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

  • 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

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

  • 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

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

Maybe you are looking for

  • HT204074 ccount Information screen, click Manage Devices...that step is missing on my page view

    Account Information screen, click Manage Devices...that step is missing on my page view in other words i dont see manage Devices when logged into my account on the itunes store through itunes

  • Css pop up issues

    Hello if you go to http://www.enhancedwireless.net/Company/TEST.shtml and rollover "(ODMA)" you should get a disjointed rollover of a 301 x 167 gif image. However, while this works in latest mac FF and Netscape, it doesn't work in Safari 1.3.2 or lat

  • Using IPMI to Start,Stop Oracle VM server via OVMM fails

    I have tried to manually start and stop an OVM server by using the ipmitool cmd from the environment of OVMM and it worked fine To start: ipmitool -U username -I lanplus -H xxx.xxx.xxx.xxx power off And to stop: ipmitool -U username -I lanplus -H xxx

  • 042Complete Album sub=less then Actual Property Purchase Goto Tower Records

    I love my shuffle, I'm a new iTunes subscriber. I really like the iTunes program and the visualizer looks awesome on my 23" apple cinema. I recently completed 2 albums for the $9 sale iTunes offer, (Mushroom Head - savior sorrow & Seether). i thought

  • Weblogic shutting down abnormally

    hi my weblogic server is shutting down abnormally.when i checked the weblogic.log file i could trace the following error i dont know whether this error is related to the abnormal shutdown of weblogic i am copying the error message for your reference