Schema name change

Hi,
Can you please let me know how to change a schema name?
Thanks
KSG

KSG wrote:
But.. Is there any other possibillity for changing Schama name?I told you the unique way to change the schema name. There is no one single command line to do that.
But then, who's worried about schema name ? It is just a name, nothing more, it could be whatever.
Nicolas.

Similar Messages

  • Dynamic prefix of schema name in PL/SQL objects

    I have a requirement where schema name would be passed as a parameter to the procedure and I am supposed to write some DML statements on some of the fixed tables. The table names are common among any schemas, but then only the schema names change.
    This weird requirment is because, here they do not maintain same names for schemas on DEV,QA,UAT and PROD databases, and I can not change that. My thoughts are that it can be acheived only using Dynamic SQL. I want to know whether any alternate ways exist since this is going to be the case on various packages and procedures. For example I have a package with around 80 procedures in it which have couple of DML statements in it. Now they want to pass the schema name to main procedure and want the 80 procedures to perform the DML on the schema name passed :)
    So, should I change all the 80 procedures and make all the DML in it to Dynamic SQL (I am afraid I might end up doing that)? Please not that I can not change all the environments to same schema names (Not in my hands)
    Please suggest.

    You can make use of this inside you programs. We do this.
    You can prefix the value before the object names.
    When the procedure can run from same user who has privs on other schemas.
    Just set the current_schema to HR , SCOTT or others.
    You will not need to Pass Parameters for each procedure.
    Current User can be same as the procedure run from or owner of the procedure.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    SCOTT
    SQL> alter session set current_schema=hr;
    Session altered.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    HR
    SQL> alter session set current_schema=scott
    Session altered.
    SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    SCOTTSS

  • How to make sure that schema name is not included with generated sqls

    How to make sure that schema name is not included with generated sqls with tableadapter wizard.
    What should I use? Oledb, ODT.NET, where can set that I want "pure" sqls, not schemas, not ", or anything like this
    I want
    "Select a,b from t1" ,not "select "a","b" from schema.t1"
    Also schema name is put in all parameters, all over the place... What if schema name changes. (b1test to b1prod)
    . I now manually edit XML files of dataset. It works but....
    thanks

    The full hardware :
    Processor Intel core due 3.00 MHz
    RAM:1.5GB
    psu:650 Watt (but i baught i cheap one so it may be actually about 400 watt)
    HD Disk:160 GB
    But about the power supply if it not able to run the VGA card ,Is it will not show any screen or it will not able to run the computer??

  • How to programatically change schema name for an application ? JDev10g

    I am using JDeveloper 10g 10.1.3.4
    What I am trying to do is: while connecting to the database instace with login/passwd credentials for a specific schema, being able to take in
    schema as a separate paramter and connect to that schema.
    Connecting to a database instace ORCL to the hr schema say with hr/hr
    supply a paramter schema_name: scott. and connect to the scott schema as the hr schema user.
    In SQL Plus* all you do is
    connect as hr/hr
    and then
    alter session set current_schema = scott.
    While developing an application that autheticates against database username/pwd credentials I was using the methodology
    as described on http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
    and http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.htmlexample 14.*[Dynamic JDBC Credentials for Model 1 and Model 2|http://otn.oracle.com/products/jdev/tips/muench/dynamiccredentials/DynamicCredentials1013.zip]* [10.1.3.3] 2006, Upd: 17-MAY-2007 by Steve Muench
    In the DynamicJDBCBindingFilter that in the doFilter() method, I was trying to find a way to be able to specify the schema name
    as in sessoion.setAttribute(Configuration.<SomeProperty>, schema);
    is there any property/parameter that can be set to change the schema within the context of the application?
    because in all the code that i see there are attributes of 'Configuration' that are being set.
    So I don't think there is way for me to just write straight up jdbc code to
    create a connection and run the statement "alter session set current_schema = scott"
    and be able to pass the login credentials
    and connect to the schema I want to.
    Any help would be appreciated.

    Hi,
    I am not sure if JDBC really supports this. I found
    JDBC alter session set ...
    but this never got a success/failure statement.
    If you want to use a singe connection but different schema for users then you may want to have a look at proxy user authentication, which is exatly doing what you want - use a single user to get into the database and then have him mapped to his own schema to work in
    Frank

  • Change Logical Schema name of an existing interface

    How do we change the logical schema name of an existing interface which is pointing to a different logical schema. Note: Both two different logical schema are pointing to the same database schema.
    Thanks in advance for your update.
    Kaustuv

    I'm not sure it's good to have two different logical schemas pointing to the same physical schema.
    Whatever, what do you want to change ?
    The logical schema of a source datastore ? Of a target datastore? Of a target temporary interface? Or the staging area ?

  • Change schema name without doing export and import

    Is there a way of changing the name of a database schema without having to create a new user and exportng objects from the old schema into the new schema?
    Are there any system tables that can be changed to modify schema name without creating a new schema?

    SQL> select user#,name from user$ where user#=55;
    USER# NAME
    55 HR
    SQL> desc hr.employees
    Name Null? Type
    ----------------------------------------- -------- ---------------------------- EMPLOYEE_ID NOT NULL NUMBER(6)
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(25)
    PHONE_NUMBER VARCHAR2(20)
    HIRE_DATE NOT NULL DATE
    JOB_ID NOT NULL VARCHAR2(10)
    SALARY NUMBER(8,2)
    COMMISSION_PCT NUMBER(2,2)
    MANAGER_ID NUMBER(6)
    DEPARTMENT_ID NUMBER(4)
    SQL> update user$ set name='RH' where user#=55;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select user#,name from user$ where user#=55;
    USER# NAME
    55 RH
    SQL> desc rh.employees
    ERROR:
    ORA-04043: object rh.employees does not exist
    SQL> desc hr.employees
    Name Null? Type
    ----------------------------------------- -------- ---------------------------- EMPLOYEE_ID NOT NULL NUMBER(6)
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(25)
    PHONE_NUMBER VARCHAR2(20)
    HIRE_DATE NOT NULL DATE
    JOB_ID NOT NULL VARCHAR2(10)
    SALARY NUMBER(8,2)
    COMMISSION_PCT NUMBER(2,2)
    MANAGER_ID NUMBER(6)
    DEPARTMENT_ID NUMBER(4)
    conclusion:
    changing the name in user$ does not change then schema name

  • Changing schema names

    Is there a way of changing the name of a schema?? I know in dba studio you can only change the password. Thanks.
    TP

    The only way to change the schema name is to export then import.
    Basically, the steps are
    1. Export old_user schema
    2. Drop old_user cascade
    3. Create new_user
    4. Import fromuser=old_user touser=new_user
    null

  • How to parameterize the schema name in APEX

    Hi,
    How to parameterize the schema name in APEX , in order to access different tables from the respective schema.
    For example:-
    select NAME display_value, CODE return_value
    from paramSchema.DESC_LIST WHERE SELECTION_FLG = 'Y'
    order by 1
    in the above code, paramSchema will be replaced with the actual schema name duing runtime. I tried doing so by some hidden fields on page, but it didn't worked out.
    I took the schema name from the respective server as per the IPof the server.
    stored in a hidden field named as schema.
    And replaced the same in place of schema name. But no luck.
    select NAME display_value, CODE return_value
    from :schema.DESC_LIST WHERE SELECTION_FLG = 'Y'
    order by 1
    Please help me in shorting it out.
    Thanks,
    Anuradha

    Hi
    In order to do that, you would need to use dynamic SQL by changing the report type to PL/SQL Function Body Returning SQL Query and have code along the lines of
    DECLARE
    l_sql VARCHAR2(32767);
    BEGIN
    l_sql := 'select NAME display_value, CODE return_value
    from '||:schema||'.DESC_LIST WHERE SELECTION_FLG = 'Y'
    order by 1';
    RETURN l_sql;
    END;However, by doing this, you lose alot of flexibility. The other options would be...
    To have seperate report regions that are conditional on the value of the variable.
    To use a WITH clause at the tope of the query like...
    WITH src_data AS
    (SELECT * FROM schema1.my_table
    WHERE :schema = 'schema1'
    UNION ALL
    SELECT * FROM schema2.my_table
    WHERE :schema = 'schema2')
    SELECT *
    FROM src_dataOther than that you could look at using synonyms and doing something similar.
    Hope this helps.
    Cheers
    Ben

  • Why does the PDFs' name change when i view them in the iBooks app?

    i have some past papers and marking schemes in my iTunes library....when i sync them to my iPad, they appear just fine....they are there just the way i named them and all...
    but when i open them, the name changes to some coded-ish name with lots of numbers and all that....
    is it possible for me to change some setting and save the name i want for those PDFs? Or am I going to have to live with this madness?
    please help!

    Hello, I wanted to follow up on this issue after reviewing some of the changes with the current update. [https://bugzilla.mozilla.org/show_bug.cgi?id=1049521] This bug addressed some Windows HKEYs that are changed when Firefox is updated/or installed.
    As an update, a patch has been made and changes are on the way for fresh installs of Firefox :-)

  • Need to know schema name and table name associated with a column-URGENT

    Hi folks,
    I need to know the schema name and the table name associated with a column. Though jdbc has the api to getTableName and getSchemaName, some database vendor like oracle does return empty upon call of mentioned methods. I found that oracle driver does not support that ……
    Can any one give me the solution? It is urgent. Or do you suggest any third pary jdbc driver which can provide those?
    Thanks
    Angelina

    Angelina,
    Your question has been discussed several times previously in this forum. Search this forum's archives for "getTableName". Oracle JDBC driver does not implement this (because "it is not feasible" -- according to Oracle).
    First of all, I would suggest that you could probably change your application's logic so that you would not need this functionality (but I guess that is not feasible either, right :-)
    Alternatively, you could try querying the Oracle database data dictionary.
    Good Luck,
    Avi.

  • Default schema names in multi-tier landscape

    Hi folks,
    We have an interesting problem due to having different named default schemas in each of our 3 hana systems.  For example lets say these are our default schemas in our development, staging, and production HANA systems;
    DEV_SCHEMA
    QA_SCHEMA
    PROD_SCHEMA
    Each of these replicating data from their corresponding SAP source systems.
    Now, we have a view that is developed on DEV hana box and uses DEV_SCHEMA.  When this view content is imported to QA or PROD we handle easily with schema mapping.  All is well and good although we are not really a fan of this different naming and us developers did not choose this naming (self defense plea here for us brilliant developers whom never make such mistakes... PS: HI LARS! - Go Germany!)
    Now we are setting up a connection from BW into HANA using system connection and inside this is a parameter called 'db user'.  Although it's called db user it's actually looking for a SCHEMA name.  If BW DEV is querying from HANA DEV this schema name would be DEV_SCHEMA.  However if BW_QA is querying from HANA_QA then the name would need to be QA_SCHEMA but in our BW landscape we are locked in QA and PROD and normally can not and/or do not want to edit objects in non-native systems.  Ideally what we need is our default schemas in HANA to have the same exact name throughout the HANA landscape.
    All this said, I can see that it would be great to re-name our entire HANA landscape however that would be a HUGE monumental undertaking as all systems would need to be re-replicated again (at least I think).
    Just curious if anybody else has named their schemas differently on each tier?  What are most people doing?  Naming the default schemas the same consistently or are you using schema mapping?
    Thanks,
    -Patrick

    Hi Luke,
    I am new to the project and there seems to be no original version.  At some point a bunch of the destination field names were changed on the admin console and errors resulted from it both due to mismatched joins and the use of two word field names.  I have documentation of the names for the set of tables in the function area but am having trouble with how everything matches up in the bottom half..  I'll keep working on it
    Z

  • Schema name in DB Adapter

    Hi,
    Schema name is hardcoded in the DB adpater even if I am not selecting the schema name while creation.
    <jca:operation
    SchemaName="APPS"
    PackageName="XX_PKG"
    ProcedureName="POPULATE_DATA"
    InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec" >
    How do I make it generic? Can I remove SchemaName parameter?
    My JNDI Url may change dynamically and the target database may have different schemas.
    Thanks,
    Rishi

    The adapter uses the schema name to qualify the stored procedure invocation (e.g. "APPS.XX_PKG.POPULATE_DATA"). Having the schema name means that you can invoke a stored procedure in a schema other than the one associated with your connection. If you remove the schema name then the qualified execution will be "XX_PKG.POPULATE_DATA" and the schema will be your connection schema. So be careful about removing the schema name because the stored procedure qualified by package name alone may not be enough to resolve it for execution. In other words, the package containing your stored procedure may not exist in the schema associated with your connection.

  • OWB 10.1 Deploy Mgr. - Registration - schema name is grayed out, sometimes

    Environment:
    Repository - OWB 10.1.0.2 on UNIX (AIX 5.2)
    Target - Oracle 9.2.0.4 on UNIX (AIX 5.2)
    Question: I have several locations that have been registered in the past. When I right click a location and click on 'Register' in some cases the schema name comes up grayed out and I am unable to change it and other times it is open.
    Why is that and how do I change the schema name of a location?
    I have installed the new schema as a target through the runtime assistant and there is a working runtime repository in that instance.
    Any help is greatly appreciated.
    P.S. Yes, we are making plans to upgrade to 10.2 soon but not soon enough ;-)>
    -gary

    Hi,
    In order to edit/delete a location you need to unregister the location from all the Control Centers. A location might be registered to more than one Control Centers.
    Having said that if you have registered location A to Schema B in Control Center C, you need to unregister the location A from Control Center C.
    In case you have accidentally dropped the Schema B without unregistering the location A, then even if you unregister the location A from Control Center C, you will still see the user name and password fields grayed out. In that case you need to re-create the schema B, register the location A and then again unregister the location and then you will be able to edit it. Seems to be a bug in OWB.
    Regards
    -AP

  • Prefixing sequence with schema name in generated sql on oracle

    Hi,
    We use kodo 3.4 with an oracle database in a J2EE environment.
    When we put on the kodo tracing during on of our testcases we see statements being generated like :
    select LOOPBAANPERIODESEQUENCE.NEXTVAL from DUAL
    When we check the rest of the statements we see :
    SELECT * FROM PC52290.EINDELOOPBAAN (EINDELOOPBAAN being a table)
    Is there any way to make kodo generate the following statement ?
    select PC52290.LOOPBAANPERIODESEQUENCE.NEXTVAL from DUAL
    Our kodo.properties we use :
    javax.jdo.PersistenceManagerFactoryClass=kodo.jdbc.runtime.JDBCPersistenceManagerFactory
    javax.jdo.option.Optimistic=true
    javax.jdo.option.RetainValues=true
    javax.jdo.option.NontransactionalRead=true
    kodo.jdbc.DBDictionary=kodo.jdbc.sql.OracleDictionary
    kodo.jdbc.ForeignKeyConstraints=true
    kodo.LicenseKey=<VALID_LICENSE_HERE>
    kodo.Log=DefaultLevel=WARN,SQL=TRACE,Runtime=WARN,Configuration=WARN
    kodo.jdbc.Schemas=PC52290
    kodo.PersistentClasses= ...
    An example of our mapping :
              <class name="LoopbaanPeriode">
                   <extension vendor-name="kodo" key="jdbc-sequence-factory" value="native"/>
                   <extension vendor-name="kodo" key="jdbc-sequence-name" value="LOOPBAANPERIODESEQUENCE"/>
    <extension vendor-name="kodo" key="jdbc-class-ind-value" value="1"/>
    <field name="beginDatum"           persistence-modifier="persistent" />
    <field name="statuut" persistence-modifier="persistent" />
    <field name="loopbaan"                     persistence-modifier="persistent"/>
    </class>
    regards,
    David De Schepper.

    Hi David,
    When faced with a similar problem, I wrote my own subclass of DBDictionary
    (in my case actually a subclass of OracleDictionary), and plugged it into
    kodo using the kodo.jdbc.DBDictionary property. My class overrode the
    following methods:
    public String getFullName(Table, boolean);
    public String getFullName(Index);
    Then at runtime, these methods stuffed in the correct Schema name for
    certain tables and indexes, based on values yoinked from some user
    properties.
    Not sure if this will help or not in your case.
    Cheers!
    .droo.
    On 4/9/06 2:48 PM, in article [email protected], "David De
    Schepper" <David De Schepper> wrote:
    yes that works but that is not an option for us.
    We have an oracle schema for each developer on our team and don't want to
    hardcode it in our mapping file (for obvious reasons)
    FYI : kodo 4.0.1 does it correctly (generates PC52290.LOOPBAANPERIODESEQUENCE)
    but since i have problems doing the upgrade to kodo 4.0 (with as few code
    changes as possible) i'm going to have to advice my company not to do the
    upgrade.
    (In case you are intersted or have some time :
    http://forums.bea.com/bea/thread.jspa?forumID=500000029&threadID=600017073&mes
    sageID=600041994#600041994)

  • Schema name as Parameter

    Hi,
    I have a requirement where i need to pass the schema names during run time for a cursor.
    Is there any way I can do it for an existing cursor?
    For example, the idea is to pass the schema name as a parameter as mentioned below.we have set of programs which are written already and the current requreiments is to change the schema name alone as a parameter.
    Please advice.
    Example:
    CREATE OR REPLACE PROCEDURE proc_TEST (SRC_SCH VARCHAR2)
    IS
    CURSOR c_Account(SRC_SCH VARCHAR2) IS
    SELECT *
    FROM &SRC_SCH.T2ACCOUNTS;
    fl_Success Boolean;
    BEGIN
    END proc_TEST;

    You need to use dynamic SQL.
    SQL> conn thomas2/thomas@ora9204
    Connected.
    SQL> create table test(id number);
    &nbsp
    Table created.
    &nbsp
    SQL> insert into test values(2);
    &nbsp
    1 row created.
    &nbsp
    SQL> grant select on test to scott;
    &nbsp
    Grant succeeded.
    &nbsp
    SQL> conn thomas1/thomas@ora9204
    Connected.
    SQL> create table test(id number);
    &nbsp
    Table created.
    &nbsp
    SQL> insert into test values(1);
    &nbsp
    1 row created.
    &nbsp
    SQL> grant select on test to scott;
    &nbsp
    Grant succeeded.
    &nbsp
    SQL> conn scott/tiger@ora9204
    Connected.
    SQL> create or replace procedure get_id(sch varchar2)
      2  is
      3   id number;
      4   cur sys_refcursor;
      5  begin
      6   open cur for 'select id from ' || sch || '.test';
      7   loop
      8    fetch cur into id;
      9    exit when cur%notfound;
    10    dbms_output.put_line(id);
    11   end loop;
    12   close cur;
    13  end;
    14  /
    &nbsp
    Procedure created.
    &nbsp
    SQL> set serveroutput on
    SQL> exec get_id('thomas1');
    1
    &nbsp
    PL/SQL procedure successfully completed.
    &nbsp
    SQL> exec get_id('thomas2');
    2
    &nbsp
    PL/SQL procedure successfully completed.
    &nbspRgds.

Maybe you are looking for