Creating a view of mast bearing the same name with the name of the table

Hello world

After having dropped the name of view mast QQ. "" TRDLN_DIM_MV ", I try to recreate by having the same name as the table, but I got an error message stating that"the name is already used by an existing object. How to create a matte view to resemble the object possessed by schema 'GQ', with a name identical to the name of the table, drop the table?

OWNER_O CREATED LAST_DDL_ TIMESTAMP STATUS OBJECT_NAME OBJECT_TYPE
===
GQ MATERIALIZED VIEW 5 NOVEMBER 08 2008 13 DECEMBER 08-11 - 05:06:31:46 TRDLN_DIM_MV VALID
GQ TABLE 5 NOVEMBER 08 2008 15 DECEMBER 08-11 - 05:06:31:00 TRDLN_DIM_MV VALID
QQ TABLE 17 AUGUST 07 16 MARCH 09 2007-08 - 17:17:05:21 TRDLN_DIM_MV VALID

SQL & gt; CREATE THE QQ MATERIALIZED VIEW. TRDLN_DIM_MV
2 TABLESPACE FPLC01S
3 NOCACHE
4 NOLOGGING
5 PACK
6 PARALLEL (DEGREE 1 2 INSTANCES)
7 BUILD IMMEDIATE
8 REFRESH FORCE ON REQUEST
9 WITH PRIMARY KEY
10 AS
11 Select / * + NO_REWRITE * / trdln_id,.
trdln_skid 12,
trdln_end_date 13,
FIRST_VALUE (trdln_end_date) 14 over (partition by order of trdln_id trdln_end_date DESC) as MaxDate
15 QQ.trdln_dim;
of QQ.trdln_dim
*
ERROR on line 15:
ORA-00955: name is already used by an existing object

I appreciate your help. Thanks in advance!

Kind regards
Radic

You must rename the table (using ALTER TABLE TableName RENAME to othername ;) before creating the MV.
You cannot have both existing with the same name in the same schema.

What you see in the scheme of GQ, is that the 'picture' is the underlying table for the materialized view.
When you do a MY_MV CREATE MATERIALIZED VIEW AS...
Oracle creates two objects with the same name, we the MY_MV materialized view, and the other being the MY_MV table, which is the physical storage. {Don't forget that a materialized view is a way to get a physical representation of views.}

In the schema QQ is what you
a. a real Table
or
b. a MV incorrectly deleted, resulting in the underlying Table always presents.

Tags: Database

Similar Questions

  • Dreamweaver CS5, MySQL, PHP: Why the views are listed under the tables in connection

    Using Dreamweaver C5 on a remote server with MySQL and PHP, I notifce the opinion that I defined in the database are the list under tables in the login window, not under views. Probably does not really matter, but I was wondering if there is a way to influence this - keeping views listed separately in the tables.

    Hello

    This has to do with how MySQL stores the view in the database, (a similar problem occurs with procedures) that they are stored as part of the entire database.

    View on there own are not natively supported in dreamweaver.

    PZ

  • Define a view that refers to the tables of 50?

    Hello

    I have a problem at hand, and I'm not sure what I can adopt the right solution.

    There is a demand which has just hit the DB (v11.2) to access a single view "XVIEW. This view has a simple sql & join that is based on two tables XTABLE1 and XTABLE2.

    Now, the new version of the schema that has been released has split XTABLE2 into 50 paintings different each with the same structure. For the correction of the question, there are two solutions I could think:

    1. create 50 views above 50 paintings and difficulty of enforcement to designate these 50 new views. Note: the app has hundreds of references and it has an important work involved.

    2 rewrite XVIEW refer to 50 paintings. You can avoid so modify the application, however I do not know if this is feasible and will have a decent performance.

    I would go for solution 2, because it requires a lot less effort, but do not know how to set the view, only the 50 table structure is the same that I can just union of them?

    Thanks for the help.

    Hello

    Hozy says:
    Frank, thank you for help out me.

    What you are proposing is that I should recreate the XVIEW view what union did all (as the lines will be unique) 50 paintings, however performance will be a problem unless I can create a materialized views.

    I know of materialized views, what it is used for static pre-calculated data type.

    A materialized view is pre calculated; This is what makes it faster. The time and effort spent, in doing so, the UNION is moved from the moment you make queries at the same time when you refresh the materialized view. If it's more or less total time depends on how many times you query the view and how often you refresh. In any case, the performance when you perform them queries will be as good as possible.
    Views materialized ar often used in data wharehouses, where then can only change once a month, but they are also often used in situations like yours, when data changes on a daily basis, or even more frequently.

    In my case, the little 50 tables data can change once every 24 hours and all this comes at some point. Queries that hit XVIEW should obtain the most recent data. Is there a way I can define a materialized view that will pick up the new data in the base tables 50?

    I see it; you have some job that turns to, say, 02:00 every morning and changes some, or perhaps all, 50 tables. You can refresh the materialized view to, say, 04:00 daily, or at some point, when you are sure that the changes made to the tables of the Basic are completed. Any query that uses the view materialized between 02:00 and 04:00 will get outdated data.
    Otherwise, you could do the materilaized view Refresh whenever one of these base tables changes, but it uses more resources, including your time and effort to set up.

  • How to add and implement business logic in components created by ADF companies consisting of the table Wizard

    I understand that after you have created a new Fusion Middleware Web Application, you will get Fusion Web Quick Start checklist containing the steps to follow. On the stage Build Business Services, when you click on create objects entities and Associations, you will before the Business components create the magician of the Tables. My question is how I will present something as a component to perform logic and more the CRUD that was created by the wizard.

    Your help will be appreciated. Thank you.

    Once check this document by Chris Muir-Oracle  ADF Code Guidelines

    Normally any code that deals with the model model or the update must be written in the template itself

    You can do that in AMImpl (implementation of Application Module class), for any specific code viewObject you can use VOImpl (ViewObject implementation class)

    For any specific operation, create, update, or delete, you can make use of EOImpl class

    and any validation level of page, for access to the UI component, the use of any script on the client side as a listener client or server listener, using iterator, listbindngs, bindings, call business services through link etc. layer you can make use of bean managed

    Ashish

  • How can I create a custom button to format the table borders?

    I often paste to Excel in a message e and would like a button or a context menu for the PROPERTIES of TABLE FORMAT it takes 2-3 clicks each time to access. Is there such a thing? I searched the Add-ons nothing helps. There may be a change in config I can do which would have the table to stick with borders already in place (I have to change the thickness of the border on '1' each and every time that she missed to '0' - maybe there is a place to have it by default on '1'?)

    I have attached a picture of the menu on that I wonder.

    I don't know of a setting for this...

    It would be easier to click on, but based on underscores bit indicating the keys Accelerator, the keyboard sequence would be:

    • ALT + o b o
    • ALT o b o
  • View previous transactions in the table citywise

    Hi all

    I have about 2 million transactions in the table of MEASURES. There are thousands of transactions of the cities. I want to return 40 first operations (datewise orderded I mean first transactions when a city was presented in the table) of each city, there are close to 100 cities in the table. Can all help modify the SQL code following it please?
    select citycode,cityname, actiondate, performedaction
    from ACTIONS
    where performedaction=6 and citycode in (select citycode from cities where description is not null)
    order by 2,3 asc
    I would appreciate your help in this regard.

    Thank you

    Try this

    SELECT citycode
          ,cityname
          ,actiondate
          ,performedaction
      FROM (SELECT a.*
                  ,ROW_NUMBER () OVER (PARTITION BY cityname ORDER BY actiondate) row_num
              FROM actions             a
                  ,cities              c
             WHERE performedaction     = 6
               AND a.citycode          = c.citycode
               AND c.description       IS NOT NULL
           )
     WHERE row_num <= 40
     ORDER BY 2,3 ASC
    

    Concerning
    Arun

  • Anyway to create a SCAN REPORT of just the table you have scanned?

    I need to create a report of just the scanned... table and I hope that the records affected that need to be cleaned up/edited.

    I tried to export the analysis report after I did the scan and he wanted to export the entire database analysis report, which I did not need.
    I need to be as granular as possible.

    Thank you

    You can open the analysis report, and then select the filter "scanned".

  • Hi, I want to drag and drop a file in the form (in a grid view of data in the table of attachments in database-type access is incidental)

    I am using visual basic 2010. A shape has a datagridview named in an attachment that is connected to a binding source (access database) named attachments. The columns are attached and description. The attachment is not of type text, this is the type of attachment. How to download files in the access database by using my VB form.

    Can anyone suggest me how do. I'm new to VB. It'll be good if you can provide the code.

    Hello

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the MSDN Developer audience. Please ask your question in the following forum.

    VB general forum:
    http://social.msdn.Microsoft.com/forums/en-us/vbgeneral/threads

    Concerning

  • Elapsed time for the materialized view vs Master table query

    Hello all;

    Small confusion about time up for the vs Master materialized view table query

    SQL > select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:30.54
    SQL > create materialized view mv1
    2 activate the rewrite of the query as
    3. select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    Materialized view created.
    Elapsed time: 00:00:01.45
    SQL > select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:00.01

    Please see the three cases "Elapsed Time"...

    When comparing other cases.
    1. my query takes long time (30.54), extraction of data from the sale
    2. create a materialized view takes less time (01:45) why?

    Source: http://uhesse.com/2009/07/08/brief-introduction-into-materialized-views/

    >
    Small confusion about elapsed time for the materialized view vs Master table query

    SQL > select count (*), sum (quan_sold), sum (amt_sold) from the sale.

    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:30.54

    SQL > create materialized view mv1
    2 activate the rewrite of the query as
    3. select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    Materialized view created.
    Elapsed time: 00:00:01.45

    SQL > select count (*), sum (quan_sold), sum (amt_sold) from the sale.

    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:00.01

    Please see the three cases "Elapsed Time"...

    When comparing other cases.
    1. my query takes long time (30.54), extraction of data from the sale
    2. create a materialized view takes less time (01:45) why?
    >
    Many queries take less time the second time you run them. After the first performance, there may be many, if not all, lines in the buffer cache. Then the second round will not make any or all e/s physical but will obtain data from the buffer cache.

    Also, you haven't checked that the MV was even used for the second run.

    Drop the MV and make the query several times and means of the time. Then create the MV and do the same thing.

  • You can create a view that filters (ESX host) Linux machines on the view of the Infrastructure?

    Hello

    We have recently implemented Foglight and VMware plugin. As part of the VMware plugin, Foglight pulls in all the Linux VM machines including the ESX host. Our team of Linux only manages the running redhat Linux hosts. They fail the ESX VM guest. That said, is there a way to create a view that shows only the hosts running redhat Linux?

    For example the view of rail infrastructure below contains 88 Linux machines, but nearly half of them are ESX hosts for our Linux team would not see all these. Is it possible to filter these?

    Any help is appreciated.

    Thank you

    Tony

    The easiest way would be to create a personalized, pair it with Infrastructure and then create a dynamic management component.  This will help create you a rule for "All hosts" where you can find just the hosts that are not of the ESX host and run Linux.

    The query would be:

    detail.topologyTypeName! = "VMWESXServer" & os.longName like «% Linux»

  • creating a view and use the view in a model

    Hi all

    I'm new to OBIEE, and I have a requirement that I have two fields to be added to a domain. Because we cannot add queries directly to a model, I have to create a view and then put the request in it, and then use the view in this model.
    I did not understand this well, if someone could help me, explaining in detail the view and adding a query in it?

    Thank you
    Gohan

    Hello

    (a) If you want to use your existing DB view please tick box import meta option data - RPD--> file menu
    (b) If you want to create the new view in RPD itself just right click anyof a physical table--> properties--> click the genral--> change the type of array as "Select" then you create/update your sql query, and then click ok that's all
    Once created, you can deploy advice on the database (right mouse button) or you can leave the view cancelled (worst performance).

    Ref steps more to create views
    http://gerardnico.com/wiki/dat/OBIEE/opaque_view
    http://allaboutobiee.blogspot.com/2012/05/OBIEE-11g-deployundeploy-view-in.html

    Thank you
    Deva

  • Run a view after validation of the database

    Hi all

    I am a beginner with ADF 11 g.

    I have a database view that makes some calculation based on the tables in the db. I have let down on the top of my template. Using this model, I create other pages with tables, and now I want to rerun this view after the transaction to commit on any table in my application. How can I do?

    Any help will be appreciated.

    Kind regards
    Wojtek.

    Hello

    a way to handle this use case would be to define a managed bean and create a JSF component binding (using the table binding property) for the table. To do this, you go to the table in the model, select the binding of the table property, then click the right arrow. Choose Edit from the context menu, and then create a managed bean (for example you named the managed bean "templateBean" and the bean class name is "TemplateBean") and a name for the set/get methods that are created and referenced by EL (say that you named the 'templateTable1' table property). This creates a bean managed in the config.xml file by default adfc, this bean is in the scope of the request.

    Create a method in the same managed bean

    public void refreshTemplateTable(){
    
      RichTable table = this.getTemplateTable1();
      CollectionModel model = (CollectionModel) table.getValue();
      JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding) table.getWrappedData();
      //re-execute the View Object (iterator) displaying in the table in the template
      DCIteratorBinding iter = adfTableBinding.getDCIteratorBinding();
      iter.execute();
      //PPR the table in the UI
      AdfFacesContext.getCurrentInstance().addPartialTarget(table);
    
    }
    

    Now, whenever you need to update the table in the model - for example when a user validates data - you dial the following code

          FacesContext fctx = FacesContext.getCurrentInstance();
          ELContext elctx = fctx.getELContext();
          ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
          //get access to the managed bean that is referenced by the table in the template
          ValueExpression ve = efactory.createValueExpression(elctx, "#{templateBean}", Object.class);
          TemplateBean templateBean = (TemplateBean) ve.getValue(elctx);
          //re-execute the query for the table in the template
          templateBean.refreshTemplateTable();
    

    This solution gives you explicit control when the iterator must be refreshed (which can also be useful in other cases of use)

    Note: If the template is used on stubborn workflows, so make sure that you explicitly create the definition of bean managed in the configuration of the workflow of the stubborn workflow

    Frank

  • for relaxation: where is the table created by the Wizzard users create in the APEX?

    Hello everyone and Tony in particular since it was followed and mentoring my progress on this.

    Well,.

    Here we have 2 things:



    (1) when the wizzard of Administration > database > manage users creates a user. Where is the table it creates? What name does have? Why is it not visible in the object browser? I need the name of this table to put it on my trigger (I called users_table)



    (2) how to do that whenever a user connects, his formerly generated by the trigger sequence is used by a State to extract personal data (it's sort of VPD) in this case would be, how do you know what surrogate key, we need to call. To do this, I think, the thing would be to request the: = APP_USER (that was created in step 1) and each APP_USER will surrogate that are associated with this key.



    I set up a simple trigger, but just the substring of the concatenation of the given username, the system randomly generated pwd up to 12 characters.



    CREATE OR REPLACE
    GENERATE_SEQUENCE RELAXATION
    AFTER INSERT ON USERS_TABLE
    FOR EACH LINE
    BEGIN
    insert into users_table (surrogate_key)
    values (SUBSTR (¦¦ username password), 1.12);
    END;


    but as I said, this users_table must be the table where the wizzard to create users stores its data,... .but where is this table?


    Thank you very much

    Alvaro

    Published by: Alvaroe on February 6, 2010 09:13

    Published by: Alvaroe on February 6, 2010 10:00

    Hello

    (1) create a table and then start filling in

    I think you need to have a custom table of your patients (and users), say,

    CREATE TABLE patients
      (
        "USER_ID"   NUMBER,
        "USER_NAME" VARCHAR2(100 BYTE),
        "FIRST_NAME" VARCHAR2(100 BYTE),
        "LAST_NAME" VARCHAR2(100 BYTE),
        "PASSWORD"  VARCHAR2(4000 BYTE),
        "CREATED_ON" DATE
        CONSTRAINT patients_PK PRIMARY KEY ("USER_ID")
      );
    

    you need to build customized in your appl authentication and do not use the Apex or Db authentication.
    To do this, you must do this table in the schema that is used in the analysis of your application's schema.
    And you need create the function custom_hash like this:

    create or replace
    function custom_hash (p_username in varchar2, p_password in varchar2)
    return varchar2
    is
      l_password varchar2(4000);
      l_salt varchar2(4000) := '55PSP4P78JLDQ2AMBXQ60DW9OW7G9Z';
    begin
    
    l_password := utl_raw.cast_to_raw(dbms_obfuscation_toolkit.md5
      (input_string => p_password || substr(l_salt,10,13) || p_username ||
        substr(l_salt, 4,10)));
    return l_password;
    end;
    

    (2) then build the trigger when it detects that I completed a line
    It generates this sequence AND inserts it into another table (as you say, I could not put it in the same table)

    users must register themselves?
    Or register?
    Then you must create the free registration form or a form where you fill in your table above users.

    I think that your user_name must be unique. Put a Unique about this strain.

    When creating the patient button is pressed, then the above table is filled (you must and name, user in the form fill password)
    You must calculate USER_ID, user_name, password and created_on, this can be done in the trigger

    create or replace
    TRIGGER patients_trg_bi
      before insert on patients
      for each row
    begin
    if :NEW.USER_ID is null then
        select patients_seq.nextval into :NEW.USER_ID from dual;
    end if;
    
    if :NEW.CREATED_ON is null then
        :NEW.CREATED_ON := SYSDATE;
    end if;
    
    if :NEW.USER_NAME  is null then
        :NEW.USER_NAME  := :NEW.LAST_NAME || :NEW.USER_ID;
    end if;
    
       :NEW.PASSWORD := custom_hash(:NEW.USER_NAME, :NEW.PASSWORD);
    
    end;   
    

    you create the sequence of patients_seq

    In this case the surrogate key be hashed password.
    And you can use it by selecting table using patients: APP_USER
    that is when the user is connected to his USER_NAME, variable APP_USER is filled

    (3) then, the SQL query would recover this surrogate_key and show as connected individual data.

    Yes, when the user logs on, the key is populated by users based on table: APP_USER
    using

    select password
    from patients
    where user_name = :APP_USER;
    

    You must understand how EVP can be implemented at the Apex.

    You can use any application for this SURROGATE_KEY say

    which is calculated by Application of calculation on the new Instance

    4) but in order to know what to ask, surrogate key should be a key with the substitution APP_USER connection

    is that correct?

    Yes. You have the info from the users table

    Do you have examples of Applications Apex somewhere.
    If you use Apex 2.1, you can install it from the repository and if you have 3 Apex, they are normally automatically installed if you create the new workspace.

    You can use it a lot to manage users.

    Concerning
    Oleg

    BTW,

    Alvaro,
    Yo have your appl?
    If you sent your Db and tables all the Pl/SQl, as well as application Apex, you have for me by email, I can check and make/suggest improvements
    (For free, of course)
    I need to check what you did there, otherwise it seems to be a very long subject.
    Well, I have the time to discuss

    Yes, you can make the trigger like this

    CREATE OR REPLACE
    GENERATE_SEQUENCE RELAXATION
    AFTER INSERT ON USERS_TABLE
    FOR EACH LINE
    BEGIN
    insert into GENERATED_SEQUENCES_TABLE (lastinserted_name, surrogate_key)
    values (SELECT name from USER OF USERS_TABLE WHERE USERID..., SUBSTR (lastinsertedname¦¦ password), 1.12);
    END;

    but where the values are made here
    SUBSTR (lastinsertedname¦¦ password), 1.12

    Published by: oleg.lihvoinen on February 6, 2010 14:55

  • Strange behavior of the cursor to the row in the table

    Hello.

    I use JD Studio Edition Version 11.1.1.5.0 on Weblogic 11.1.1.5

    I have page JSPX in taskflow bounded to view history records in the table.

    DB table is simply with a single primary key and number of columns.

    On the page, I show only little of them (Date, user, Rec.Number and State).

    When I open this dialog box with records that hold these documents

    ID Date user RecNumber State

    67

    02.01.07User111

    68

    02.01.07User122

    69

    02.01.07User131

    70

    02.01.07User142

    71

    02.01.07User151
    7202.01.07User162

    I see highlighted records with status = 1. Click on any record highlighting disappears and when I try to move the cursor down through the cursor of the keyboard (arrow keys) Stoops (pressing "down") until that record 3rd then skip (press 'down' key) 2nd record and repeat this. When I try to move the top slider to 5th/4th then folder and back loop.

    When I leave the body of the table and click outside the table then highlighting appears again.

    If I show only records State = 1 then all records are highlighted and the cursor jumps between 2nd and 5th record.

    ADF table is created simply by dragging and dropping of DataControl with RowSelection simple =, rowBandingInterval = 0, filterVisible = "true".

    I can find no reason for this kind of behavior.

    Please help me understand what can be the reason of this madness.

    Thanks in advance

    I check the original Version and compare it with the last good version.

    I found at the end

    This section is missing from the right version

    I add

    and everything is fine now.

    The same problem was in an another PK VO. missing base table.

  • Questions about the reorganization of the rows in the table by drag-and - drop feature

    I am referring to the demo: 106. Drag-and-drop the reorganization of the rows of the table in aCorner of Code DF to implement my case.

    I am facing some problems:

    1. the view object (bound to the table) is read only and it is created directly by very complex SQL queries, without entity objects. When it is run the code: dragRow.removeAndRetain () in the method: DnDAction processDrop (DropEvent dropEvent), it throws the error so that a guest view object is read-only. I want to know if there is another way to delete the moved collection line?

     public DnDAction processDrop(DropEvent dropEvent) {
    ...       
           CollectionModel collectionModel = (CollectionModel) table.getValue();        
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding departmentsIterator = treeBinding.getDCIteratorBinding();               
            RowSetIterator rsi = departmentsIterator.getRowSetIterator(); 
    
            int indexOfDropRow= rsi.getRangeIndexOf(dropRow);
           //get access to the oracle.jbo.Row instance represneting this table row
           Row dragRow = (ViewRowImpl)table.getRowData(draggedRowKey);
           //remove dragged row from collection so it can be added back
           dragRow.removeAndRetain();
           rsi.insertRowAtRangeIndex(indexOfDropRow, dragRow);
          ...
    }
    

    2. When you click on a button, I need to save the command results in the database using the command update # of each rank. Here it is the handler method for the event of the action (in MB) button.

    I want to use RowSetIterator table for encode it from all ranks and update the value # order of each rank.   I call a data control method to run sql update. is it ok? any suggestion?

        public void processSaveOrder(ActionEvent actionEvent) {
            CollectionModel collectionModel = (CollectionModel) mytable.getValue();        
            JUCtrlHierBinding treeBinding = (JUCtrlHierBinding) collectionModel.getWrappedData();
            
            //get access to the ADF iterator binding used by the table and the underlying RowSetIterator.
            //The RowSetIterator allows us to remove and re-instert the dragged row
            DCIteratorBinding iterator = treeBinding.getDCIteratorBinding();               
            RowSetIterator rsi = iterator.getRowSetIterator();
            Row row =rsi.first();
            System.out.println(0+"="+ row);
            int i = 1;
            while(rsi.hasNext()){
                row = rsi.next();
                System.out.println(i+"="+ row.getKey());
                i++;
            }
    
        }
    

    A workaround solution was found:

    In ADF 12 c, it can be solved by changing Updatable "Always" in the details tab of each attributes to read-only view object without entity object.

Maybe you are looking for