To get list of materialized views/views using a column of a table

Hi,
    I am removing sal column from table tab_emp;
i want to check whether any materialized view or view using this column by  querying using data dictionary :-
if i use like condition against query column of all_mviews it is throwing error sicne it is long data type.
is there a way to search it without creating any function and use it in a query
Thanks,
Ajoy

start with select * from dictionary where table_name like '%VIEW%'
to identify appropriate dictionary views.
Then read: Ask Tom "Converting Longs to LOBS" and Ask Tom "Long to Varchar2 conversion.... "
to be able to search LONG descriptions for column names.
For example:
create table check_table as
select owner,view_name,text_length,to_lob(text) text_lob from all_views
Column Name
Data Type
Nullable
Default
Primary Key
OWNER
VARCHAR2(30)
No
VIEW_NAME
VARCHAR2(30)
No
TEXT_LENGTH
NUMBER
Yes
TEXT_LOB
CLOB
Yes
select * from check_table where instr(upper(text_lob),'SAL') > 0
OWNER
VIEW_NAME
TEXT_LENGTH
TEXT_LOB
SYS
USER_ENCRYPTED_COLUMNS
147
select TABLE_NAME, COLUMN_NAME, ENCRYPTION_ALG,SALT, INTEGRITY_ALG from DBA_ENCRYPTED_COLUMNS where OWNER = SYS_CONTEXT('USERENV','CURRENT_USER')
Regards
Etbin

Similar Messages

  • Materialized View cannot use filter columns ORA-12033

    Hello Forum members,
    I am creating the following MV with Can you please advise me??
    Thanks
    SQL> create materialized view log on his_swi with rowid including new values;
    Materialized view log created.
    SQL>
    SQL> CREATE MATERIALIZED VIEW His_Swi_mv
    2 refresh fast with rowid
    3 AS
    4 select quarter,sum(sw_po),sum(sw_po_fre),
    5 sum(sw_por_sta+sw_porunt_swi+sw_por_hb+sw_po_free) as proj from
    6 history_switch group by quarter;
    his_swi group by quarter
    ERROR at line 6:
    ORA-12033: cannot use filter columns from materialized view log on
    "EM"."HIS_SWI"

    Hello Forum members,
    Please ignore the above post.
    got solution from : http://www.jusungyang.com/DWfolder/MaterializedViews/MVlogFilterColumns.txt
    Thanks

  • How to get Materialized View to ignore unused columns in source table

    When updating a column in a source table, records are generated in the corresponding materialized view log table. This happens even if the column being updated is not used in any MV that references the source table. That could be OK, so long as those updates are ignored. However they are not ignored, so when the MV is fast refreshed, I find it can take over a minute, even though no changes are required or made. Is there some way of configuring the materialized view log such that the materialized view refresh ignores these updates ?
    So for examle if I have table TEST:
    CREATE table test (
    d_id NUMBER(10) PRIMARY KEY,
    d_name VARCHAR2(100),
    d_desc VARCHAR2(256)
    This has an MV log MLOG$_TEST:
    CREATE MATERIALIZED VIEW LOG ON TEST with rowid, sequence, primary key;
    CREATE MATERIALIZED VIEW test_mv
    refresh fast on demand
    as
    select d_id, d_name
    from test;
    INSERT 200,000 records
    exec dbms_mview.refresh('TEST_MV','f');
    update test set d_desc = upper(d_desc) ;
    exec dbms_mview.refresh('TEST_MV','f'); -- This takes 37 seconds, yet no changes are required.
    Oracle 10g/11g

    I would love to hear a positive answer to this question - I have the exact same issue :-)
    In the "old" days (version 8 I think it was) populating the materialized view logs was done by Oracle auto-creating triggers on the base table. A "trick" could then make that trigger become "FOR UPDATE OF <used_column_list>". Now-a-days it has been internalized so such "triggers" are not visible and modifiable by us mere mortals.
    I have not found a way to explicitly tell Oracle "only populate MV log for updates of these columns." I think the underlying reason is that the MV log potentially could be used for several different materialized views at possibly several different target databases. So to be safe that the MV log can be used for any MV created in the future - Oracle always populates MV log at any update (I think.)
    One way around the problem is to migrate to STREAMS replication rather than materialized views - but it seems to me like swatting a fly with a bowling ball...
    One thing to be aware of: Once the MV log has been "bloated" with a lot of unneccessary logging, you may perhaps see that all your FAST REFRESHes afterwards becomes slow - even after the one that checked all the 200000 unneccessary updates. We have seen that it can happen that Oracle decides on full table scanning the MV log when it does a fast refresh - which usually makes sense. But after a "bloat" has happened, the high water mark of the MV log is now unnaturally high, which can make the full table scan slow by scanning a lot of empty blocks.
    We have a nightly job that checks each MV log if it is empty. If it is empty, it locks the MV log and locks the base table, checks for emptiness again, and truncates the MV log if it is still empty, before finally unlocking the tables. That way if an update during the day has happened to bloat the MV log, all the empty space in the MV log will be reclaimed at night.
    But I hope someone can answer both you and me with a better solution ;-)

  • How do I get list of client IP Addresses using new Airport Utility v6.3?

    I have purchased and Airport Time Capsule 3TB (newest model).  Previous models were still compatible with Airport Utility 5.6 and I could use "manual" mode to get a list of client IP addresses attached to the device.  The new Airport Time Capsule is only compatible with Airport Utility 6.3 and I cannot figure out how to get a list of client IP addresses with this new model. Does anyone know how to do this?

    Try a ping broadcast - for example if your network were 192.168.1.xxx (netmask of 255.255.255.0) try this from a Termnal.app window (located in /Applications/Utilities):
         ping 192.168.1.255
    If you have a different type netmask, you need to put 255's where the 0's are in your netmask.
    Everyone on the local network (the 192.168.1.xxx network) should reply that is up and running unless you have them setup to not respond to pings (the WAN port on your TC should not reply cause it's in a different network) and you have your list of clients on the network. If you setup the TC to dedicate a range of addresses for WiFi clients you can even identify which of them are wired and which are wireless.
    good luck.

  • How to give view access to a column in a table

    I have a view with 100 columns. I want certain users to have access only to 10 columns. I was able to do this without any issues, but when they connect and expand the view they could still see all the column names.
    I was wondering whether there is away to restrict access to that too. So that the user will see only the columns that they have access to.
    Prsently, they see all the columns and when they do a select * , sql gives the error "Permission denied"
    Could they enter select * and see only their column names too?
    donsls

    It is not clear to me when you said "but when they connect and expand the view they could still see all the column names".
    I tried to expand this view in SSMS but could not able to see the other columns.
    Could you please again and let us know more about this. I treid to expand this view in SSMS I am not able to see other columns.
    USE [TestDB]
    GO
    CREATE TABLE [dbo].[onetest](
    [id] [int] NULL,
    [name] [char](100) NULL,
    [test] [char](100) NULL,
    [count] [int] NULL
    GO
    Create view [dbo].[vs] as select ID,name from onetest
    GO
    SELECT * FROM VS
    GO
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • How to get accurate values for select statement using single column

    Hi All,
    Below is my query which runs fine
    Select Distinct Top 4
    FiscalYearId,
    FiscalMonthOfYearId
    From ODS.Common.tODS_Date
    Inner Join
    UTL.Utility.tUTL_ProcessDate
    On tODS_Date.DateShort < tUTL_ProcessDate.ProcessDate
    And tUTL_ProcessDate.DatabaseName = 'ODS'
    Order By
    FiscalYearId Desc,
    FiscalMonthOfYearId Desc
    Below is the generate output
    FiscalYearId FiscalMonthOfYearId
    2014 2
    2014 1
    2013 12
    2013 11
    But i want to use this query in one of my where clause condition as its being used in the where clause it can only return 1 row.So, i tried something like this
    Select Distinct Top 4
    FiscalMonthOfYearId
    From ODS.Common.tODS_Date
    Inner Join
    UTL.Utility.tUTL_ProcessDate
    On tODS_Date.DateShort < tUTL_ProcessDate.ProcessDate
    And tUTL_ProcessDate.DatabaseName = 'ODS'
    Order By
    FiscalMonthOfYearId Desc
    And the result set of this one gives me the output like
    FiscalMonthOfYearId
    12
    11
    10
    9
    Which is not correct,( if you see the result set above). 
    Can someone please help me with any ides on this.

    If you want to use this query in the WHERE clause, then use it with EXISTS option which allows to return more than 1 column. 
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Getting a list of all months between 2 DATE columns for a table

    Current set:
    IF OBJECT_ID('tempdb..#TEST') IS NOT NULL
    DROP TABLE #TEST
    CREATE TABLE #TEST
    ID INT,
    DOB DATE,
    EffectiveDate DATE,
    TerminationDate DATE,
    GCode CHAR(1)
    INSERT INTO #TEST
    VALUES
    (1043,'1/1/1970','1/1/2014','4/1/2014','S'), -- Active in month Jan,Feb,March,April
    (1051,'1/1/1989','3/1/2014','5/1/2014','P'), -- Active in month March,April,May
    (1070,'1/1/2010','5/1/2014','8/1/2014','G') -- Active in month May,June,July,August
    SELECT * FROM #TEST
    Expected result set:
    ID          Month         GCode
    1043      January      S
    1043      February    S
    1043      March         S
    1043      April           S
    1051      March        P
    1051      April          P
    1051      May          P
    ---- Similarly for ID 1070
    This is needed for the reporting and each ID will have points associated to it, that will be a separate column that I'll be adding. The reason that I want this result set is because, the user might say, how many points did the ID have for a particular month.
    The points are not going to change for an ID. Please let me know how to get the expected result set

    Try
    -- code #1
    set LANGUAGE English;
    set dateformat MDY;
    declare @Month table (N int, T varchar(20));
    declare @I int, @D date;
    set @I= 1;
    set @D= '1/1/2014';
    while @I <= 12
    begin
    INSERT into @Month values (@I, DateName(month, @D));
    set @I+= 1;
    set @D= DateAdd(month, +1, @D);
    end;
    SELECT ID, T, GCode
    from @Month as M inner join
    #TEST as T on M.N between Month(EffectiveDate) and Month(TerminationDate)
    order by ID, N;
    José Diz     Belo Horizonte, MG - Brasil

  • Multiple indexes using same columns on one table - is this doable?

    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    So my question are:
    1. is this is possible? if so, what is the correct syntax.
    2. assuming it is possible, has anyone used this sort of construct before? it appears to be conflicting and inconsistent to me.
    Many thanks, and kind regards,
    Naran

    Naran H wrote:
    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    You can't have the unique and non-unique indexes in place at the same time, but you can have the non-unique index supporting the unique (PK) constraint.
    I guess your problem is that you don't want to have an interval of time where you have dropped the existing unique index while you create the replacement.
    The only current way I can think of for getting from:
    unique index(a,b)
    to
    non-unique index(a,b) with PK constraint (a,b)
    without having a point in time where bad data can appear, and with minimal locking is:
    create unique index (b,a) online;
    drop index (a,b);
    create non-unique index(a,b) online;
    add primary key using index (a,b) enabled, novalidate
    validate primary key
    drop index (b,a)Regards
    Jonathan Lewis

  • How to use selection column in a table control

    I have given the name of the selection column to be 'DEF_SEL',now i want to select rows in the table control using the 'selection column attribute' and maniupulate it programmatically so that i would transport the rows selected using selection coulmn to a different table control.How would i do this?

    Hi raja,
      Once you have the table cobtrol built using the extra field in the internal table, all the selected rows will have DEF_SEL = 'X'.
    Now you can loop your internal table and filter the records which were selected.
    in pai modules:
    loop at itab where DEF_SEL = 'X'.
    Move itab information inrto another internal table.
    append itab_new.
    endloop.
    have another table control which shows the data in the itab_new.
    regards,
    Ravi

  • Sort functionality using MULTIPLE columns in a table control

    Hi all,
    I have a custom screen with table control.Now i need to provide SORT functinality in this screen for the columns in the table control.
    My questins:
    1.Is it possible to seelct MULTIPLE columns in a table control for SORTING?If yes,what explicit settings do i need to do while creatng the TABEL CONTROL in the screen?DO I need to select "Column selection " as MULTIPLE??
    2.How do I write the code for SORT functinonality for multiple columns?
    I know how to write the code for SORTING on basis of single column .
    Thanks!

    Hi Rob,
    Thanks for the reply.
    However I was thinking to apply the same logic as for single columns as follows:
    types : begin of ty_fields,
                c_fieldname(20),
               end of ty_fields.
    data  : t_fields type table of ty_fields,
               wa_fields like line of t_fields.
    WHEN 'SORTUP'.(Ascending)
          loop at TABLE tc01-cols INTO wa_tc01  where  selected = 'X'.
          SPLIT wa_tc01-screen-name AT '-' INTO g_help g_fieldname.
          wa_fields-c_fieldname = g_fieldname.
          append wa_fields to t_fields.
          endloop.
          describe table t_fields lines l_index.
          c_count = 1.
          if c_count  <= l_index.
          read table t_fields into wa_fields index c_count.
          case c_count.
          when '1'.
          l_field1 = wa_fields-c_fieldname.
          when '2'.
         l_field2 = wa_fields-c_fieldname.
        and so on depending on the no of columns in the table control...
          endcase.
          endif.
          SORT t_tvbdpl_scr BY  l_fields1 l_fields 2......l_fieldn.
    Let me know if the above method will work!Also for the above method to work will the type of fields(columns on whihc sort function will be applied) matter???
    Thanks again for your time.

  • Func/BAPY to get list of objects from Material class

    Hi guys,
    I am looking for BAPI/FUNC to get list of material/objects if I know Class and Class type. In MM02 I am doing following: In selection of input I choose Materilas of Class there I write Class and Class type, and then there is icon FIND IN INITIAL CLASS after clicking that icon I get list of materials for entered class.
    Can you advise me which BAPI/Func do that or in which tables I can find this DATA.
    Thanks very much for any help.
    Zbynek

    Zbynek,
    Try using this BAPI....<b>BAPI_CLASS_SELECT_OBJECTS</b>
    Actually you can do this by directly going to tables....
    First using the class type and class number, go to KLAH tables... get the Int class no. (KLAH-CLINT). Using this go to KSSK table and use the KLAH-CLINT value in KSSK-CLINT and adda another condition like KSSK-MAFID = 'O'.
    Hope this helps...
    Please provide reward points if you find this reply helpful.
    Balaji

  • Get list of User Mailboxes in Exchange server 2013 by using EWS managed API

    Hi all,
    I need list of Users exists in my Exchange server 2013 , i.e Mail Box Users log in name.
    i know the command in Powershell  to get list, but i need this using code[ ews managed API].
    How can i achieve this ?
    Please share your ideas

    Hi Glen,
    i follow your suggested links i wrote below code ,
    here i am getting error  
    The term 'Get-Users' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    SecureString password = new SecureString();
    string str_password = "EIS2014!@#";
    string username = "[email protected]";
    foreach (char x in str_password) { password.AppendChar(x); }
    PSCredential credential = new PSCredential(username, password);
    WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://ExchangeServer.admin.com/powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", credential);
    //connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;
    Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
    PowerShell powershell = PowerShell.Create();
    PSCommand command = new PSCommand();
    command.AddCommand("Get-Users");
    command.AddParameter("ResultSize", 50);
    powershell.Commands = command;
    runspace.Open();
    powershell.Runspace = runspace;
    var aa = powershell.Invoke();
    Please help me.

  • How to get list of Reports used in iBots?

    Hi,
    What is the process to get list of all those reports used in iBots/Alerts.
    Is there any NQ table, which contains this information.
    Thanks,
    Sunil Jena

    Do you have usage tracking configured / enabled?
    From memory have a look in there - I am fairly sure you can see the difference between a 'normal' user use of a report and the i-Bot equivalent.
    And yes, you are correct there is also a table that holds the i-Bot data, in 10g it used to be nq_scheduler or something similar - not sure what it is now.
    regards,
    Robert.

  • Getting list of operations for a service Order

    I have to List the operation activities which are Planned and Confirmed in a service order.
    I'm unable to link the operation in service order for some ZREPORTING purpose as it links through structures only.
    Kindly suggest how we can obtain operation details while reporting a service order.
    Also let me know if there is any FUNCTION MODULE for the same.
    Reply Eagerly Awaited.
    Thanks in Advance.
    Deepak

    hi deepak KM
    order operations are stored in VIAUF_AFVC table .... and have a look at iw49 for getting list of operations and can use status inclusive and status exclusive for selection based on statuses.. of operations ...
    regards
    pushpa

  • How to get the Next Material Document Number

    Hi,
    Please let me know How to get the next Material Document Number using Functional Module,
    Material Document number are  in MSEG table.
    Regards,
    Ganesh

    Hi Ganesh,
    if you want the next matrial number then first of all you have to define it as a number range in transaction snro.After creating the number range you have to define the interval.
    now you can use your number range by calling the function module
    CALL FUNCTION 'NUMBER_GET_NEXT'
          EXPORTING
            nr_range_nr             = '01' " here you have to give the number range number which you have defined in number range
            object                  = 'ZPRODLOG' " Number Range
          IMPORTING
            number                  = wa_prod_error_log-seqnr " sequence number generated,in your case material number field
          EXCEPTIONS
            interval_not_found      = 1
            number_range_not_intern = 2
            object_not_found        = 3
            quantity_is_0           = 4
            quantity_is_not_1       = 5
            interval_overflow       = 6
            buffer_overflow         = 7
            OTHERS                  = 8.
    each and every time next number will get generated .
    i hope this will help you.
    Thanks,
    Tanmaya

Maybe you are looking for

  • Start/Field Routine in Transformations (ABAP)

    Hi Experts Please update me on how to proceed and ABAP Code required. DSOFULL->CUBE DSO Active Table: /BIC/AEMPPED00 Data In DSO Emp_ID--Emp_SDATE--Emp_TDate 1-----01.01.2008 1---01.01.2008--01.06.2008 1-----01.01.2008 Data Expected in CUBE Emp_ID--E

  • What is 'Spotlight' in iPhone 4?

    What does it does Spotlight do, what is it for and how can I get best usage out of it, etc.? Thanks! Anna

  • PROBLEM..PLEASE HELP..my ipod mini has frozen...

    My ipod mini has completely frozen or hung...the cursors not moving..its not even showing connectivity of hardware on the computer...basically it has become totally non-responsive...even the backlight is on...could someone please help me and let me k

  • Cant uninstall Itunes to reinstall it missing file itunes64.msi

    iTunes stopped working one day, so i tryed to uninstall it and it says missing itunes64.msi file. The installer wants me to find the file but i cant find it at all. i have downloaded itunes again and when i go to intstall it it goes half way through

  • Available software for old iBook & G4tower?

    I inherited a 14 inch iBook from my mother running 10.4.11 & I also have an old G4 tower running 10.4.11 & OS 9. Is there any newer OS system I can install that would be compatible with either of these, and where would I get such a thing? What are th