Create synonym of tables & views in one go!

Hi,
My oracle database is 11gR1 and Linux is the platform. I have more then 1500 tables and views. I need to create synonym of all views and tables. Is it possible to do it with some routine? Name of synonym is to be same as table name or view name. Kindly help me if it is possible.
Thanks, Imran

You can certainly write a small PL/SQL block to generate the synonyms, i.e.
BEGIN
  FOR t IN (SELECT owner, table_name FROM dba_tables WHERE owner = <<schema name>>)
  LOOP
    EXECUTE IMMEDIATE 'CREATE PUBLIC SYNONYM ' || t.table_name || ' FOR ' || t.owner || '.' || t.table_name;
  END LOOP;
  FOR v IN (SELECT owner, view_name FROM dba_views WHERE owner = <<schema name>>)
  LOOP
    EXECUTE IMMEDIATE 'CREATE PUBLIC SYNONYM ' || v.view_name|| ' FOR ' || v.owner || '.' || v.view_name;
  END LOOP;
END;(This assumes that you want to create public synonyms. If you are creating private synonyms, change the DDL appropriately).
Justin

Similar Messages

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • At max how many columns is advisable to create in a table/view

    Hi All,
    I have two transaction table from which i want to create a simple view or materialized view. But the number of columns is about 200. So i want to know at max how many columns is advisable from the performance point of view.
    Even though i will create 200 columns in a view , for a perticular client installation i may not use all the columns.
    one more thing i will never use 200 columns in the select statement . At a time i will use only 4/5 columns.
    It may happen from this four column one column will be the 1st and 2nd column will be the 200th one.
    I want to know how it affects the performance and in which scenario . Please help if any body knows or already faced this kind of scenario.
    I am using oracle 10g .

    Annapurna Nayak wrote:
    thanks for ur reply .
    We are going to use this view in a report , so if i will create it as simple view it will affect report performance. because the view script is too long ...so every time quring to a view will decrease the performance.
    Are you asking me if it will? I think it probably won't but of course you have the means to test it to be sure, right?
    As u said MV should be done with minimum possible column . what can be the maximum column in MV ..??It would be defined by the limits on:
    * The maximum number of columns that a table can contain
    * The size of the query needed to define the select statement
    * Limitations on queries needed to maintain the data
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/limits003.htm#i288032

  • Creating a pivot table view with two levels of headers

    Hi,
    I have a requirement in which i need to have a common heading for two or more columns.
    For Example, I have two columns like total number of loans and Total loan amount. As per my requirement, i need to give a common header 'Total loan' as the main header and amount and Count as two subheaders under the main heading in the pivot table.
    In table view, i would be able to make it using the display column and table header property. But, i need to get the same in pivot table as we have to use pivot table view instead of table view.
    Please Help me on this issue.
    Thanks in Advance
    Deepak

    Hello,
    create one column in criteria and change it's fx to case when 1=0 then Products."Prod Name" else 'Tota Loanl' end
    Now go to pivot and drag this column to Columns block of pivot. But keep this column up of Measure Labels and Now, go to column Format values.
    Mention cell horizontal alignment to Center
    see the following screenshot, Header is the column i created with the above functionality.
    !http://i852.photobucket.com/albums/ab83/kishorg86/Header.jpg!

  • Unable to create visual composer table view from the Bex Query

    Hi
    I am trying to create the visual composer lay out from a Bex query. The Bex query contains a set of Key figures and a structure.
    These key figure and structure combination is forming a table in the query output. Key figure parameters are coming as rows and Structure parameters are coming as columns.
    example query out put:
    Total, HPC, FDS excel ICe etc are as Structure elements and coming as columns in query out put and
    Invoice value, Gross sale value, Efficient operations etc are as Key figure elements in query and coming as rows in query out put.
    But if I map this query to visual composer table view all these are coming as columns as given below.
    Total Invoice value ,             Total Gross sale value,    Total Efficient operations,      HPC Invoice vale,.........
    And if execute the query will giving the out put in single row.
    Can anybody help me out to map this in the row column format?
    Is it really possible to do in VC?
    I am using CE 7.2. The VC model I need to be embedding in BPM.
    Please help me to solve this issue. I completely stuck up this issue.
    Regards
    Sajith P
    Edited by: Sajith P on Aug 17, 2010 3:07 PM
    Edited by: Sajith P on Aug 17, 2010 3:15 PM

    Hi,
    Try to use some function module which will convert query data into flat tables. (eg., RS_VC_GET_QUERY_VIEW_DATA_FLAT).
    Hope this solves your issue.
    Regards,
    Vinay

  • How to create links in table view

    Hi
    I am working in IC WebClient.
    Can any body guide me how to create link on particular column of the table view and How can we navigate to another page by clicking on this link ?
    I am filling the internal table (for table view) by z tables. I do not have context node for that.
    Points will be rewarded.

    use Iterators. In the itarator you can create any BSP Object you wish to.
    in the method RENDER_CELL_START of the interface IF_HTMLB_TABLEVIEW_ITERATOR
    METHOD if_htmlb_tableview_iterator~render_cell_start.
      DATA: lo_text     TYPE REF TO cl_htmlb_textview,
            lo_link TYPE REF TO cl_htmlb_link,
            lv_link_click TYPE string,
            lv_link  TYPE string,
            lv_dim   TYPE string,
            lv_pernr TYPE string.
      FIELD-SYMBOLS: <dat> TYPE ANY.
      lv_link  = 'info.htm?pernr='.
      lv_dim   = 'left=300,top=220,width=620,height=200,menubar=0,scrollbars=yes,resizable=no'.
      row_ref = p_row_data_ref.
      CASE p_column_key.
        WHEN 'PERNR'.
          CREATE OBJECT lo_link.
          lo_link->id            = p_cell_id.
          lo_link->text          = get_column_value( p_column_key ).
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = lo_link->text
            IMPORTING
              output = lv_pernr.
          CONCATENATE `window.open('` lv_link lv_pernr `' , '` lo_link->text `', '` lv_dim `');` INTO lv_link_click.
          lo_link->text = lv_pernr.
          lo_link->onclientclick = lv_link_click.
          p_replacement_bee      = lo_link.
        WHEN OTHERS.
          CREATE OBJECT lo_text.
          lo_text->id       = p_cell_id.
          lo_text->wrapping = 'FALSE'.
          lo_text->text     = get_column_value( p_column_key ).
          lo_text->design   =  'STANDARD'.
          p_replacement_bee = lo_text.
      ENDCASE.
    ENDMETHOD.
    How to use Iterators.
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    Hope this helps.
    Cheers
    Amandeep
    <i><b>Reward points for each helpful answer.</b></i>

  • Object Modelling Question: How do I create multiple nested table columns in one table

    Hi there,
    I have a XML doc which is as follows:
    <PERSON>
    <ADDRESSLIST>
    <ADDRESS>111, Hamilton Ave </ADDRESS>
    <ADDRESS>222, Cambell Ave </ADDRESS>
    </ADDRESSLIST>
    <PHONELIST>
    <PHONENO>4085551212 </PHONENO>
    <PHONENO>6505551212</PHONENO>
    </PHONELIST>
    </PERSON>
    I need a table that looks as follows:
    Create table person
    (addresslist address_table,
    phonelist phone_table
    I would like to create a table called person with columns addresslist and phonelist. Each defined as object type table of address and table of phones.
    Can anybody please tell me how can I do this.
    I have seen that there can only be one nested table per table. If so, how do we do this.
    Thanks so much
    Pramod

    pelle.k wrote:
    peets wrote:Hehe because it's less typing!
    Good one!
    Also, it's by far the more dynamic method.
    If you want to get pedantic, it's also far less efficient in terms of execution time: each iteration of the loop forks a new process, whereas using a single mkdir command forks only once.  The "best" way is the curly-braces method demonstrated above by chimeric.

  • Create/Drop/Compile Table, Views, Triggers, Sequences, etc.

    Is there a way to create, drop, and compile objects on an Oracle database with the ADF library? If so, any good examples?
    Can the results be captured as well?

    Frank,
    Maybe I wasn't clear enough. The only example I saw that involved the blob column was number 85 which did not contain info for database maintance.
    I have a JClient application that reads database structures like triggers, tables, and views. I would like the user to be able to push a button and the trigger be compiled in the database. While SQL Dev probably has more features and does a better job I have added a bunch of internal stuff that would have to be manually added in SQL Dev each time a new trigger was created.
    Is there a way, when working with the current transaction(or new transaction), to issue a statement like you would in SQL*Plus "DROP TABLE EMPLOYEES;" with the results being "TABLE DROPPED"?
    thanks.

  • Trying to create a fact table,error:unable to extend temp segement

    Using Oracle 10.2g
    SQL>
    create materialized view facts_table
    (     s_id
    ,     g_id
    ,     sb_id
    ,     sc_id
    ,     y_id)
    refresh with rowid
    as      select s.s_id
    ,     g.g_id
    ,     sb.sb_id
    ,     sc.sc_id
    ,     y.academicyear
    from      student s
    ,     grade g
    ,     subject sb
    ,     school sc
    ,     comqdhb.teachinggroup y;
    ERROR at line 3:
    ORA-01652: unable to extend temp segment by 1024 in tablespace POSTGRADSI am creating the fact table as materialized view because its specified for us.
    I am trying to create a fact table from the dimension tables and its giving this error
    what is the mistake kindly help.
    Also when creating the fact table do all the columns need to be foreign keys compulsorily.
    Edited by: Trooper on Jan 10, 2009 5:25 AM
    Edited by: Trooper on Jan 10, 2009 6:37 AM

    Well basically what your saying is absolutely right
    I realized what i am doing right now is stupendous blunder.
    Basically my aim is there are 5 dimensional tables that are created
    Student->s_id primary key,upn(unique pupil no),name
    Grade->g_id primary key,grade,exam_level,values
    Subject->sb_id primary key,subjectid,subname
    School->sc_id primary key,schoolno,school_name
    year->y_id primary key,year(like 2008)
    s_id,g_id,sb_id,sc_id,y_id are sequences
    select * from student;
    S_ID UPN FNAME COMMONNAME GENDER DOB
    ==============================
    9062 1027 MELISSA ANNE       f  13-OCT-81
    9000 rows selected
    select * from grade;
          G_ID GRADE      E_LEVEL         VALUE
            73 A          a                 120
            74 B          a                 100
            75 C          a                  80
            76 D          a                  60
            77 E          a                  40
            78 F          a                  20
            79 U          a                   0
            80 X          a                   0
    18 rows selectedThese are basically the dimensional views
    Now according to the specification given, need to create a fact table as facts_table which contains all the dim tables primary keys as foreign keys in it.
    The problem is when i say,I am going to consider a smaller example than the actual no of dimension tables 5 lets say there are 2 dim tables student,grade with s_id,g_id as p key.
    create materialized view facts_table(s_id,g_id)
    as
    select  s.s_id,g.g_id
    from   (select distinct s_id from student)s
    ,         (select distinct g_id from grade)gThis results in massive duplication as there is no join between the two tables.But basically there are no common things between the two tables to join,how to solve it?
    Consider it when i do it for 5 tables the amount of duplication being involved, thats why there is not enough tablespace.
    I was hoping if there is no other way then create a fact table with just one column initially
    create materialized view facts_table(s_id)
    as
    select s_id
    from student;then
    alter materialized view facts_table add column g_id number;Then populate this g_id column by fetching all the g_id values from the grade table using some sort of loop even though we should not use pl/sql i dont know if this works?
    Any suggestions.
    Edited by: Trooper on Jan 10, 2009 6:38 AM

  • Help on Table View

    Hi Experts,
    This requirements seems to be a bit different but the user needs it this way.
    I have transaction data in a table format which crosses 10000 records.
    I have created a simple request and have called this request in dashboards.
    As the data is more the user looses the track of what column is he looking when he /she scrolls down.
    User wants to display the column headings at the end also.
    IS there anyway where i can display only the column headings and not the data.
    So that i can create such request and call this in dashboard also.
    Let me know if i need to be more clear.
    Appreciate your immediate response.
    Please treat this as an immediate requirement.
    Regards,

    Don't know if this will satisfy your needs... and you can always play with it to improve the final outlook, but take a look at this:
    You say you have a Table View and want the headers at the bottom of your report as well.
    1) Create a Duplicate Table View.
    2) In the Properties of Table:2 view, change the Rows per page to 1. (I tried 0, but it didn't work for obvious reasons.)
    3) Click on the Background Color and change the color to the color of the values (most likely black). This will black out the one row of data that unfortunately I couldn't find a way to get around.
    4) Click on Additional Formatting Options and enter 100% for the width. Do the same for the original Table View. This step will help the columns line up properly.
    5) Go to Compound Layout View and add the Table:2 View at after the original Table View.
    Voila, you have the headers at the end of the report. Not the most elegant solution, but if it works for you, great.

  • Image table views

    Hi all,
    I have a basic question about tableviews with user generated photos. I want to create a scrollable table view feed where each cell (the entire cell) is of an image that is uploaded by users, with a editable text box over the image in the tableview (much like the VEVO app tableview on the iphone).
    Would I have to create a custom class for this UItableview, or is there already a template for this?

    Where should i store the images
    Store the image inside the project as 'Resources'.
    And how should I place in the table
    One method is to add the image by first drawing a CGRect and then placing the image inside...like this:
    CGRect myImageRect = CGRectMake(18.0f, 13.0f, 172.0f, 42.0f);
    UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
    [myImage setImage:[UIImage imageNamed:@"allrnd.png"]];
    myImage.opaque = YES; // explicitly opaque for performance
    self.view addSubview:myImage];
    [myImage release];
    If you have multiple images, repeat the code block and change the name if myImage to something unique and change the f values shown for placement as required.
    Try to get the image as close as possible to the rect they will fill to avoid unnecessarily bloating the project/app size overall. In the example above, the image sits at 18 pixels from the left, 13 pixels down from the top and is 172 wide and 42 tall.
    See this doc from Apple for details:
    http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Referenc e/CGGeometry/Reference/reference.html

  • How to make a single row as editable in a table view?

    Hello Friends,
    As per the requirement,i have created a new table view with table row level actions. But I am able to achieve the delete functionality. But for edit action, if i lock the corresponding entity also it is not becoming as edit.
    Let me know any ideas to achieve this??
    Thanks in Advance.
    Regards,
    Ravi

    Hi Raviteja,
    In your row level buttons if you want to edit a row you have to fallow this steps..
    1) get the selected record by using index.
    2) get the action mean which action you want to perform ( edit or delete like).
    3) lock the current entity.
    4) get the custom or comp controller instance based on get the current record.
    5) edit the row..
    sample code for this..
    DATA:
         lv_index          TYPE int4,
         lr_current        TYPE REF TO if_bol_bo_property_access,
         lr_entity         TYPE REF TO cl_crm_bol_entity,
         lv_event          TYPE string,
         lv_dummy          TYPE string,
         lr_core           TYPE REF TO cl_crm_bol_core,
         lv_one_click_lock TYPE sysubrc,
         lr_col            TYPE REF TO if_bol_bo_col,
         lr_coco           TYPE REF TO component ctrl class name (impl class),
         lr_cuco           TYPE REF TO custom cntrl class name ( impl.)
       CALL METHOD cl_thtmlb_util=>get_event_info
         EXPORTING
           iv_event = htmlb_event_ex
         IMPORTING
           ev_index = lv_index.
       CHECK lv_index IS NOT INITIAL.
    * Get the current entity
       lr_entity ?= me->typed_context->urcnode->collection_wrapper->find( iv_index = lv_index ).
       CHECK lr_entity IS BOUND.
    * Get the action clicked on
       SPLIT htmlb_event_ex->event_defined AT '.' INTO lv_event lv_dummy.
    * Try to lock the current entity
       lv_one_click_lock = cl_crm_uiu_bt_tools=>set_one_click_lock( me->typed_context->cnode->collection_wrapper ).
       CASE lv_event.
    *   Edit the current Partner
         WHEN 'EDIT'.
           IF lv_one_click_lock <> 2 AND lr_entity->is_send_active( ) = abap_true.
             lr_coco ?= me->comp_controller.
             CHECK lr_coco IS BOUND.
             lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
    *       if entity is not yet there: add it to component controller collection
             IF lr_current IS NOT BOUND .
               lr_coco->typed_context->cnode->collection_wrapper->add( lr_entity ).
               lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
             ENDIF.
             CHECK lr_current IS BOUND.
             lr_cuco ?= me->get_custom_controller( 'compname/cnameCuCo' ). "#EC NOTEXT
             lr_cuco->typed_context->cnode->on_new_focus( lr_current ).
             me->set_editable( ).
           ENDIF.
    if this is not work then go through this link..
    OCA edit button problem
    Thanks & Regards,
    Srinivask

  • How to identify whether any data source is created for a table?

    hi all,
    How to identify whether any extractions is been carried out for a particular table, view or function module(generic extraction)? from r/3.
    bcos i need to create an extraction for a table, view and function module. But  iam not sure whether any extractions is already been created for those tables, view, function modules??
    thanxs
    haritha

    Hi,
    By passing the following values as selection to table  ROOSOURCE we can find whether any data source has been created or not .
    EXMETHOD = V
    EXTRACTOR = Table name
    hope it helps..
    regards,
    raju

  • Excluding a column causes non-repeating values in 2nd table view

    I have an analysis (11.1.1.5) that has these columns: Month, Country, State, City, Sales, Country Sales, Share of Country. Country Sales is a level-based measure that returns sales at the Country level. Country, State, and City are a hierarchy as you might expect.
    When I display the initial Table view for this analysis, the Country Sales column shows a value on every row.
    When I create a 2nd Table view and exclude the City column from that view, the Country Sales column now only shows a value for the first State within each Country. In other words, each value of Country Sales is shown only once, and is NOT repeated on each subsequent row for that country.
    Any ideas if this is a bug, or if it was intentionally designed this way for some reason? Is there a way to force the values to repeat? (Green Bar / Repeat doesn't do it.)

    Thank you for the responses, guys. Still no luck.
    I moved the Country Sales column as Deepak suggested, both in the criteria and in the view. That didn't change the results. I also started fresh with a new analysis, and placed the columns in the suggested positions from the start. Still no change.
    New information: I tried excluding State and leaving City in the table view. Got the same goofy results - Country Sales did not repeat.
    More new information: I added a Brand Revenue measure to the Sample Sales subject area. Brand Revenue is defined as '1 - Revenue' at the Product Brand level. Created a similar view, and it worked fine.
    I'll investigate what the differences might be between Sample Sales and my repository. Hard to imagine what it might be. My repository is very simple and straightforward.

  • Table View Navigation

    I've a table view with one column being an image (clickable). I have 40 rows of records (say for example) and I display 15 at a time in my table view.
    When I navigate to page 3 of my tableview (for example) and click on row to edit (lineedit mode) my view page stays put on page 3 of table view (that's the way it should be). However, after row selection, when I click on my image (which generates a server event and I do my stuff) it goes back to the 1st page of the tableview. The point to note that it does keep the rowselection (on the 3rd page) and changes the icon image as it suppose to but somehow it navigates to the 1st page every time.
    Is there a way to control the navigation?
    Thanks,
    Partho

    I've added
    runtime->keep_context = 1. in my do_handle_event
    and also added
    keepSelectedRow       = "TRUE" in my htmlb:tableview
    but still it navigates to the 1st page.
    It is this section in the render cell iterator
        IF p_edit_mode IS INITIAL.
        ELSE.
           img->onclick = 'image_click'.
        ENDIF.
    which fires the server event and always goes back to the 1st page.
    Please help.
    Thanks,
    Partho

Maybe you are looking for

  • ITunes sharing between accounts on same Mac

    Hello, Is there a way to share iTunes content (music, movies, etc.) between different user accounts on the same Mac? We have a "family" iMac with different login accounts (me, my spouse and our kids). When my spouse or kids are logged on as themselve

  • How to split up an audio file?

    What is the most straightforward way to split .aiff and mp3 files, without losing quality, using aural and visual (waveform) cues and then save the split-up files? The idea is to split a long file with multiple tracks into individual songs.

  • Does "quickQuery" have "resultComponentID" like "query"

    Hi, According to document, af:quickQuery component is a simplified version of af:query component. the result of query component can by set with resultComponent attribute. but seems quickQuery component does not have such attribute. what should I do t

  • BAPI supporting f-30 - transfer with clearing

    I need to use f-30 ' transfer with clearing' to clear over 1000 documents at a time. Do you know of a BAPI in 4.7 that implements this functionality? Thank you Chris

  • Can't open mail after Mavericks upgrade on macbook air

    I cannot open mail after upgrading to mavericks. The mail icon appears to recognise it is open as it has the mark under it while in the taskbar alone the bottom. But that is as far as it goes, the mail window does not open to view emails. The email i