Too many results

I am writing a script to get all virtual machines in a set of clusters and data warehouses that they are on the amount of the freespace datastore. For some reason, it's getting ALL the VMs on data warehouses.

$ServerName = "servername."
$report = @)
$cl_filter_pattern = "* PCI.
$digits = 2
SE connect-VIServer $ServerName
foreach ($cluster Get-cluster | where {$_ .name - like $cl_filter_pattern}) {}
Get-VMHost-location $cluster | Get-Datastore. %{
$vms = $cluster | Get - VM
{foreach ($vm to $vms)
$info = "" | Select the center of data, Cluster, data store, VM, capacity, put in service, available, PercFree
$info. Datacenter = $_. Data Center
$info. Cluster = $cluster. Name
$info. Data store = $_. Name
$info. VM = $vm. Name
$info. Capacity = [math]: Round($_.capacityMB/1024,2)
$info. Put into service = [math]: Round (($_.)) ExtensionData.Summary.Capacity - $_. ExtensionData.Summary.FreeSpace + $_. ExtensionData.Summary.Uncommitted)/1GB,2)
$info. Available = [math]: round ($info. Capacity - $info. Put into service, 2)
$info. PercFree = [math]: round (100 * $_.) FreeSpaceMB / $_. CapacityMB, $digits)
$report += $info
}
}
}
$report | Export-Csv "C:\datastore-vms.csv" - NoTypeInformation - UseCulture
Disconnect-VIServer $ServerName - confirm: $false

Where I'm going wrong?

I have rearranged the curls a bit, and I use a hash table as a list of choices for data warehouses.

That avoids making several cmdets of Get_View for the same data store.

I use the list of datastoreId for each virtual computer.

Let me know if it produces a better result?

$ServerName = "servername" $report = @()
$cl_filter_pattern = "**PCI" $digits = 2

Connect-VIServer $ServerName foreach($cluster in Get-Cluster | where {$_.name -like $cl_filter_pattern}){
  $dsTab = @{}
  Get-VMHost -Location $cluster | Get-Datastore |

  where {$_.ExtensionData.Summary.MultipleHostAccess} | %{
    $dsTab.Add($_.Id,$_)
  }
  foreach ($vm in Get-VM -Location $cluster){
    $vm.DatastoreIdList | %{
      $ds = $dsTab[$_]
      $info = "" | select DataCenter, Cluster, Datastore, VM, Capacity, Provisioned, Available, PercFree      $info.Datacenter = $ds.Datacenter.Name      $info.Cluster = $cluster.Name      $info.Datastore = $ds.Name      $info.VM = $vm.Name      $info.Capacity = [math]::Round($ds.capacityMB/1024,$digits)
      $info.Provisioned = [math]::Round(($ds.ExtensionData.Summary.Capacity - $ds.ExtensionData.Summary.FreeSpace + $ds.ExtensionData.Summary.Uncommitted)/1GB,$digits)
      $info.Available = [math]::Round($info.Capacity - $info.Provisioned,$digits)
      $info.PercFree = [math]::Round(100 * $ds.FreeSpaceMB/$ds.CapacityMB,$digits)
      $report += $info    }
  }
}
$report | Export-Csv "C:\datastore-vms.csv" -NoTypeInformation -UseCulture Disconnect-VIServer $ServerName -Confirm:$false

Tags: VMware

Similar Questions

  • HP laptop: enter the model number and get a "game too many results.

    My HP laptop dies after 6 weeks. When I contact support, he asks the model number. I enter: say "15-ay041wm" is what the box and laptop. I get a reply that says.

    "Sorry, too many results match your search for 15-1y041wm.

    "So I try HP Notebook, I get the same mesaage above, except with the HP laptop ' instead of '15-ay041wm.

    Because no matter where I'm going, he wants the model number and I give, I can't help. No cat, no nothing.

    So someone can tell me how to get support?

    If HP is unable to handle the number of model of it's own computers, so I'm not very confident.

    Here are the free support number to call in the USA/Canada... 1 800-474-6836.

    Now here's another question, you can report to HP on if you want...

    You must stay online and listen to the automated assistant trying to talk to you to talk to a representative... visit the HP website... go to this support forum (which has no official presence in HP), etc.

    After a minute or two, the Assistant to say, if you can't get online, will stay on the line to speak to a customer services representative.

    This is when you will have the opportunity to speak with a support person and report the problem to open a pension case.

  • Add contact based on the username: too many results!

    Someone gave me their exact Skype username. Now, I want to add this contact.

    When I go to add contact and enter the user name, I get a long list of search results. The results do not show user names, but rather their real names. How can I know who is the person with the username? Is there a way to check the user name?

    If you are looking for using the exact name of Skype, then as a general rule, the first result displayed should match this user. However, you can always check it out by clicking on the display of the results and see the selection profile. You are looking for which is shown as the Skype name.

  • Join provided they produce too many results

    Hello

    I am making a simple inner join on the two tables, and the result set is hugh! I don't understand why the number of results is so great.

    Table 1 contains lines of 2932 (table is called to load)

    Table 2 of the 271 lines (table is called element)

    The code I use to join the table is:
    select 
            count(*)
    from
          load
    inner join
          item
          on 
                item.item_id= substr(old_system_id, instr(old_system_id,'-',1,3)+1, 1);
    The result set has 200040 lines! I understand that this is a kind of Cartesian join, but shouldn't the join condition, reduce the number of lines.

    If you join a single digit, there is no way those columns may be unique within your two tables so of course that you're going to get a vector product, if it is not not a full product cartersian.

    SQL> select * from t1;
    
                      C1 C
    -------------------- -
                       1 a
                       1 b
                       1 c
                       2 d
    
    SQL> select * from t2;
    
                      C1 C
    -------------------- -
                       2 w
                       1 x
                       1 y
                       1 z
    
    SQL> select *
      2  from   t1
      3  join   t2 on (t1.c1 = t2.c1);
    
                      C1 C                   C1 C
    -------------------- - -------------------- -
                       2 d                    2 w
                       1 c                    1 x
                       1 b                    1 x
                       1 a                    1 x
                       1 c                    1 y
                       1 b                    1 y
                       1 a                    1 y
                       1 c                    1 z
                       1 b                    1 z
                       1 a                    1 z
    
    10 rows selected.
    

    Note that the join for '2' has worked correctly, but '1' gives a great product. know exactly what it is supposed to do.

  • 10.1.3.4.2 - Multi Select guest - research shows too many results

    Hello

    Someone sees a situation...

    When you use a multiple selection of dash prompt, the prompt has the following clause to return only the code with the status of N = select ID from table where status in (' ' n ') and it works fine

    but in the guest even if we use the code names of search for example Contains "XXX", it will return all codes regardless of status, though even she must return only status = N codes,.

    any ideas...

    Thank you

    Hello

    I assume you are using the available inside the Multi selection prompt search filter?

    If this is the case, then this is how OBIEE multi select work. When you apply the search condition in mutiselect, it generates a new query with the condition provided in exculdes and the search filter no matter what external sql filter.

    If you want to keep the filter at the prompt, use condition you be the guest (fx). It will be useful.

    See you soon

    HN

  • query returns too many results

    I have this query that returns records 118 900 when I try to add

    or oth_tchname_ssn like '% % 123456789 '.

    at the end of the query.

    When I take off the or oth_tchname_ssn like '% % 123456789' returned 32 records, which seems all right.

    Any ideas as to where my cfquery statement is false?

    Thank you
    Emmanuel

    This was solved by the addition of parent tags.

  • Ulimit/too many open files

    Hey guys,.

    Just had a server go down as a result, too many files open. We could tweak the ulimit to fix. I was wondering if Foglight watches it? If yes what is the metric. If this is not the case, how can I me Dell to add it?

    Hi Daniel.

    I'm sure that you need an agent script for this. The command 'lsof' under Linux should

    helping you get the information.

    I hope this helps.

    Robert

  • Error message "too many redirects."

    I am running Windows 7, using the Chrome browser and have My Yahoo set as my homepage on my desk.  I can't access my Yahoo I get the error page "Web page a redirect loop" with message void "too many redirects."  I followed the instructions and deleted cookies, third-party cookies accepted and tried different browsers.  I can't access my Yahoo on other devices.

    Hello Janet,.

    Thanks for posting your query in Microsoft Community.

    Let me ask you;

    • The issue is specific to Google Chrome browser?
    • Are you facing any issues with Internet Explorer?

    If the problem is specific to Google Chrome, I recommend posting your query in the support forum of Google Chrome for the best possible response to your query.

    If you are having problems with Internet Explorer as well, please come back with answers to the following questions;

    • What is the version of Internet Explorer do you use?
    • What security software is installed on the computer?
    • When was the last time it was working fine?
    • Remember to no particular change in the computer before the show?

    If you are faced with questions as well using Internet Explorer, you can try the following methods and let us know the result.

    Method 1: I recommend that you clear your browser cache and temporary internet files to ensure that they are not causing your problem. Please delete your browser cookies by following the instructions.

    1. Open Internet Explorer, click the Start button. In the search box, and then type Internet Explorerin the list of results, click on Internet Explorer.

    1. Select Tools (via the gear icon) > Security > delete history....
    1. Be sure to uncheck the favorite preserve Web site data and check the Temporary Internet files and Cookies , and then click Remove.

    2. Once it has cleared your cache and cookies successfully, you will receive a confirmation at the bottom of the window.

    If the problem persists, try Method 2.

    Method 2: I suggest that you follow the steps in the article given below and check.

    Can't access some Web sites in Internet Explorer

    Note: The steps described in the article for Internet Explorer 10 for Windows 7 also applies to IE 11 for Windows 7.

    Important: Reset the Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.

    Hope the helps of information. Let us know if you need help with Windows related issues. We will be happy to help you.

    Hope this information is useful. Please feel free to answer in the case where you are facing in the future other problems with Windows.

  • Too many?

    Hello, in my application I am multiplying extremely large numbers. The product of these numbers when converted to a string and displayed to the user are in one of these formats:

    #1

    201.16800 * 0.00000000000668458134 = 1.34472385900512e - 9

    #2

    999999999999999999 * 0,0254 * 0.00000000000668458134 =-0.0002524105470876466

    Either as #1, the product is in scientific notation, which is what I want, either as #2, she has a negative value. Why #2 have a negative value? I also use the Number type to store these numbers. Y at - it a type more best suited for more - since I know that a regular 32-bit integer would not be able to manage these figures. There must be a solution to this problem. At one point, the number would have too many digits to display to the user correctly which is why I want display in scientific notation as in the #1 example.

    Thanks in advance,

    Noah NAKED

    The number in Actionscript class uses the format double-precision 64-bit that is used to store the values of numbers between-9, 007, 199, 254, 740, 992 (-2 ^ 53) to 9,007,199,254,740,992 (2 ^ 53). Your first number # 2 is just to great to store in the number class, so that you get a positive overflow resulting in a negative endresult.

    Unfortunately, there is no datatype in ActionScript with a larger area I know.

    If all this sounds like gibberish to you, I suggest you read up on top of floating points. The use of these small and large numbers together is boobytrapped by several errors of calculation.

  • Too many activations on CS3 Web Premium Suite

    Hello

    I have a serial number for CS3 Web Premium as a result won in a contest some time ago. But when I try to activate my installation, I get a "too many activations" error. How can I solve this problem and continue to use my product?

    Thank you for your time.

    Hi Liviucmg,

    Adobe allows two simultaneous activations of CS3, so if the software has been installed and enabled on both computers before, you will need to disable one or both of them to perform a new installation. On the old computer, start a CS3 application. From the Help menu choose Help > Deactivate > permanently disable: Learn how to enable or disable Adobe applications.

    If you do not have access to old computers to disable, you will need to contact customer service via chat and ask them to reset your activations. Cat representatives are unable to technical troubleshooting for older products like CS3, but they can help with licensing and activation. FYI, Adobe have reset your activations will delete the information about the licenses of all your computers, so you'll need to reactivate the computers currently in use.

    For more information, please visit: "Activation limit reached" or "connection error impossible ' with Adobe applications. Let us know if you have any additional questions.

    Best,

    Del

  • Too many problems with the latest version of Lightroom

    Hi all

    I have too many problems with the latest version of Lightroom (CC 2015.2.1 1046594)

    In fact, the latest version of 3 or 4 were bad: instead of doing better, I always had more problems.

    So I would like to go back to a previous version of lightroom

    Adobe customar care, in Italy, is unnecessary:

    they can just to:

    -looking for answer on this forum

    -saying "you solve your problems just with the de-insall and re-install it.

    stop, no more...

    in this way they create me a lot fo iusses...

    I use the English version of the PS and LR, but they made me reinstall the Italian version of CC because it has been blocked

    the result was that CC does not recognize software, due to a different language version

    so, I contacted again Adobe Customer Care... they said "no problem, uninstall LR, delete these files and install this...

    I did and I let go 2 years to develop the parameters on the correction of the colors for my clients because they told me to remove a folder, I need!

    so, I ask you now if there is a way to return to a previous version of lightroom, any previous version...

    I never found better performance in more recent versions...

    I've always found, performance slower, more problems...

    personal idea: I do not understand why adobe are boicotting itself, but I think he do!

    Thanks to you all

    Hi ramontillo,

    6.3/CC 2015.3 Lightroom is now available - try to update to this version which includes the previous import feature, bug fixes and new support for photo/target device profile: Lightroom CC 2015.3 / 6.3 now available

    Concerning

    Pete

  • Too many objects correspond to the primary key

    I read a lot of posts on this topic, but they are all related to the addition of new records.  My situation is a little different.

    I have a SelectOneChoice with AutoSubmit set to True.

    I have 2 tables that are related to the value of the SelectOneChoice with partial triggers defined on the SelectOneChoice.

    When I make a selection of the SelectOneChoice, I get the error "too many objects match the [primary key n] oracle.jbo.Key" where n is the primary key of the selection in the SelectOneChoice.

    Nothing is to be added/created.

    The end result should be that the tables get updated with correct lines that match the selection of SelectOneChoice.

    Any ideas on where to find questions, please let me know.

    JDEV 11.1.1.6

    Thank you

    Ray

    Why is - what drag you only the attribute ID of OrgRefView to your page? Why don't you drag the whole view of the page object?

    I think that is what is happening:

    The SelectOneChoice shows the ID attribute of the first line of OrgRefView. When you select a different value in the SelectOneChoice, you change the value of the ID of this line. And that's why the error message shows. You change the value of the ID of this line to the value of the ID of another line. And you can't have the same ID value for both lines.

    Try to drag the OrgRefView in the table on the page. Then, you can select a line and will display the appropriate details.

    Kind regards

    Linda

  • Scalability problems - too many Active Sessions?

    Hello

    I'm having a problem with an app that I built for one of the College campus, that I work. The application is a queue system where there are stations for students to access your room, admin stations where staff can see these students and "call", and displays outside every office employee that shows the student who was called. There are about 20 of the latter type of billboards. I have the following code in my footer to query the DB for most recent students called for a specific room:
    <script type="text/javascript">
    <!--
    var refresh_region = function( workstation_in, div_in ) {
        $.get(
            'wwv_flow.show', 
            {"p_request"      : 'APPLICATION_PROCESS=F_NEXT_STUDENT',
             "p_flow_id"      : $v('pFlowId'),      //app id
             "p_flow_step_id" : $v('pFlowStepId'),  //page id
             "p_instance"     : $v('pInstance'),    //session id
             "x01"            : workstation_in
            },
            function(data) {
                $(div_in).html(data);
            }
        );
        setTimeout(function() { refresh_region( workstation_in, div_in ) }, 5000);
    }
    
    refresh_region( '&P7_WORKSTATION_IN.', '#next_student_div' );
    //-->
    </script>
    The process of OnDemand, F_NEXT_STUDENT executes the query and returns the result:
    select a.FIRST_NAME || ' ' || a.LAST_NAME
    into   full_name
    from   ONESTOP_QUEUE a
    where  a.WORKSTATION_ID_CALLED = in_workstation_id
    and    a.STATUS = 'CALLED'
    and    a.QUEUE_ID = (
       select min( c.QUEUE_ID )
       from   ONESTOP_QUEUE c
       where  c.WORKSTATION_ID_CALLED = in_workstation_id
     and    c.STATUS = 'CALLED');
    However, when all these display panels is turned on (and I use the code as follows in the other pages for similar purposes) the application become slow and eventually unresponsive. As a first step, we have the application running a box with Oracle XE. Finally, we have migrated to a full blown installation 11g with APEX listener and GlassFish. My DBA said everything looks ok on the side of the DB, so I tried to dig into other areas to see where the bottleneck can be. After inspecting the report of Active Sessions in the APEX, I noticed that there are a ton of connections being generated (> 30 000). This is not a good thing for me and I try to understand what I am doing wrong.

    At first I used $. post() instead of $. get (). I was also using setInterval() instead of a setTimeout() loop. However, none of these changes really seem to help the situation. I am at a loss to know how else to improve the performance of this application. Any suggestions on what I can try?

    Most of the features of the app is on apex.oracle.com
    WORKSPACE: SCCC_TEST
    USER/PASS: TEST/test
    Direct URL to the page (I spend worksation ID): http://apex.oracle.com/pls/apex/f?p=65890:7:0:P7_WORKSTATION_IN:ADMISSIONS_1

    Thanks in advance for any help.

    Hello

    are you sure that each AJAX request generates a new APEX session? Because it is based on your downloaded app all right. You can check that by running the following query. It will also show you how long it took APEX to meet your demand for AJAX (elapsed_time). I think that the elapsed time will be the key to find out why your application becomes unresponsive if too many customers are returning. The goal should be that the AJAX request ends as soon as possible. For example 1 sec would be for many, because if you have 20 parallel AJAX requests at the same time, this could have an impact on your DB. You can share your average time?

    select apex_session_id, to_char(view_date, 'DD.MM.YYYY HH24:MI:SS') as view_date, elapsed_time, application_info
      from apex_workspace_activity_log
     where application_id = 65890
       and page_id = 7
       and view_date >= sysdate - 0.1
     order by 1, 2, 3
    

    I don't know how much data is stored in the ONESTOP_QUEUE table, but it may be useful to adjust your statement used in F_NEXT_STUDENT. On apex.oracle.com, the plan of the explain output shows at least he uses twice a scan interval on index ONESTOP_QUEUE_IDX. For inside MIN instruction it is well, but the external SQL should just do a search PK using QUEUE_ID. This is why I would like to delete

    a.WORKSTATION_ID_CALLED = in_workstation_id and a.STATUS = 'CALLED'
    

    to force the index seek PK using QUEUE_iD.

    I also suggest that you make your JavaScript code on the page 5 and 7 more transparent. He is currently hiding in the region or footer HTML. I would say to move JS code in the attributes of the page 'Function and Global Variable declaration' and ' run when Page Loads. BTW, there is no need to use $(document) .ready in "Run when the Page loads", because internally, we already use $(document) .ready.

    Or instead of using your own JavaScript code you can download the plugin http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html#dynamic "Timer" and use rather dynamic actions. On page 5 you can use the action "Refresh" to update your classic report and on page 7 you can use an action to "Set the value" to run your query. I think it would make your page easy to read for others.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • A function in a subquery is call too many times.

    Hi all

    I am struggling to understand why a function in a subquery is called too many times.
    Let me explain with an example:
    create or replace function all_emp (v_deptno in number) 
    return varchar2
    as
    
    v_all_emp varchar2(2000);
    
    begin
    
        dbms_output.put_line ('function called');
    
        for i in (select * from emp where deptno = v_deptno) loop
    
            v_all_emp := v_all_emp || i.ename || '; ';
        
        end loop;
    
    return v_all_emp;
        
    end;
    /
    
    -- running just the subquery, calls the function all_emp only 4 times (once for each row in table dept)
    select 
        d.deptno,
        d.dname,
        all_emp(d.deptno) f_all_emp
        from dept d;
    
    -- running the whole query, using regexp to split the value of f_all_emp into separate fields, causes that function all_emp is called 28 times, thus 6 times for each row!!
    select tmp.*,
    regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
    regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
    regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
    regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
    regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
    regexp_substr(f_all_emp,'[^;]*',1,11) emp6
    from
        (select 
        d.deptno,
        d.dname,
        all_emp(d.deptno) f_all_emp
        from dept d) tmp
    ;
    I do not understand why Oracle calls my 28 times function in this example, 4 times should be sufficient.

    Is there a way to force that the subquery is materialized first?

    A reminder of the facts:
    Above function / request is of course a simple example.
    In fact, I have a rather complex function, integrating in a subquery.
    The subquery is already slow (2 min) to run, but when I want to share the result of the function in several areas (about 20) it's over an hour due to above described behavior.

    Optimizer merges online view and the query results in:

    select  d.deptno,
            d.dname,
            all_emp(d.deptno) f_all_emp
            regexp_substr(all_emp(d.deptno),'[^;]*',1,1) emp1,
            regexp_substr(all_emp(d.deptno),'[^;]*',1,3) emp2,
            regexp_substr(all_emp(d.deptno),'[^;]*',1,5) emp3,
            regexp_substr(all_emp(d.deptno),'[^;]*',1,7) emp4,
            regexp_substr(all_emp(d.deptno),'[^;]*',1,9) emp5,
            regexp_substr(all_emp(d.deptno),'[^;]*',1,11) emp6
      from  dept d
    /
    

    That's why function is called 28 times. Seen go explain plan:

    SQL> explain plan for
      2  select tmp.*,
      3          regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
      4          regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
      5          regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
      6          regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
      7          regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
      8          regexp_substr(f_all_emp,'[^;]*',1,11) emp6
      9    from  (
     10           select  d.deptno,
     11                   d.dname,
     12                   all_emp(d.deptno) f_all_emp
     13             from  dept d
     14          ) tmp
     15  /
    
    Explained.
    
    SQL> @?\rdbms\admin\utlxpls
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------
    Plan hash value: 3383998547
    
    --------------------------------------------------------------------------
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |      |     4 |    52 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| DEPT |     4 |    52 |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------
    
    8 rows selected.
    
    SQL>  
    

    If we use the NO_MERGE indicator:

    SQL> select  /*+ NO_MERGE(tmp) */
      2          tmp.*,
      3          regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
      4          regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
      5          regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
      6          regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
      7          regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
      8          regexp_substr(f_all_emp,'[^;]*',1,11) emp6
      9    from  (
     10           select  d.deptno,
     11                   d.dname,
     12                   all_emp(d.deptno) f_all_emp
     13             from  dept d
     14          ) tmp
     15  /
    
        DEPTNO DNAME          F_ALL_EMP  EMP1       EMP2       EMP3       EMP4       EMP5       EMP6
    ---------- -------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
            10 ACCOUNTING     CLARK; KIN CLARK       KING       MILLER
                              G; MILLER;
    
            20 RESEARCH       SMITH; JON SMITH       JONES      SCOTT      ADAMS      FORD
                              ES; SCOTT;
                               ADAMS; FO
                              RD;
    
            30 SALES          ALLEN; WAR ALLEN       WARD       MARTIN     BLAKE      TURNER     JAMES
                              D; MARTIN;
    
        DEPTNO DNAME          F_ALL_EMP  EMP1       EMP2       EMP3       EMP4       EMP5       EMP6
    ---------- -------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
                               BLAKE; TU
                              RNER; JAME
                              S;
    
            40 OPERATIONS
    
    function called
    function called
    function called
    function called
    function called
    function called
    SQL> explain plan for
      2  select  /*+ NO_MERGE(tmp) */
      3          tmp.*,
      4          regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
      5          regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
      6          regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
      7          regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
      8          regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
      9          regexp_substr(f_all_emp,'[^;]*',1,11) emp6
     10    from  (
     11           select  d.deptno,
     12                   d.dname,
     13                   all_emp(d.deptno) f_all_emp
     14             from  dept d
     15          ) tmp
     16  /
    
    Explained.
    
    SQL> @?\rdbms\admin\utlxpls
    
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------
    Plan hash value: 2317111044
    
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |     4 |  8096 |     3   (0)| 00:00:01 |
    |   1 |  VIEW              |      |     4 |  8096 |     3   (0)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| DEPT |     4 |    52 |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    
    9 rows selected.
    
    SQL> 
    

    Not sure why the function is executed once 6 and not 4. What we really want, is to materialize reviews online:

    SQL> with tmp as (
      2               select  /*+ materialize */
      3                       d.deptno,
      4                       d.dname,
      5                       all_emp(d.deptno) f_all_emp
      6                 from  dept d
      7              )
      8  select  tmp.*,
      9          regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
     10          regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
     11          regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
     12          regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
     13          regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
     14          regexp_substr(f_all_emp,'[^;]*',1,11) emp6
     15    from  tmp
     16  /
    
        DEPTNO DNAME          F_ALL_EMP  EMP1       EMP2       EMP3       EMP4       EMP5       EMP6
    ---------- -------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
            10 ACCOUNTING     CLARK; KIN CLARK       KING       MILLER
                              G; MILLER;
    
            20 RESEARCH       SMITH; JON SMITH       JONES      SCOTT      ADAMS      FORD
                              ES; SCOTT;
                               ADAMS; FO
                              RD;
    
            30 SALES          ALLEN; WAR ALLEN       WARD       MARTIN     BLAKE      TURNER     JAMES
                              D; MARTIN;
    
        DEPTNO DNAME          F_ALL_EMP  EMP1       EMP2       EMP3       EMP4       EMP5       EMP6
    ---------- -------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
                               BLAKE; TU
                              RNER; JAME
                              S;
    
            40 OPERATIONS
    
    function called
    function called
    function called
    function called
    SQL> explain plan for
      2  with tmp as (
      3               select  /*+ materialize */
      4                       d.deptno,
      5                       d.dname,
      6                       all_emp(d.deptno) f_all_emp
      7                 from  dept d
      8              )
      9  select  tmp.*,
     10          regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
     11          regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
     12          regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
     13          regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
     14          regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
     15          regexp_substr(f_all_emp,'[^;]*',1,11) emp6
     16    from  tmp
     17  /
    
    Explained.
    
    SQL> @?\rdbms\admin\utlxpls
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------------------------------------
    Plan hash value: 634594723
    
    ---------------------------------------------------------------------------------------------------------
    | Id  | Operation                  | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT           |                            |     4 |  8096 |     5   (0)| 00:00:01 |
    |   1 |  TEMP TABLE TRANSFORMATION |                            |       |       |            |          |
    |   2 |   LOAD AS SELECT           |                            |       |       |            |          |
    |   3 |    TABLE ACCESS FULL       | DEPT                       |     4 |    52 |     3   (0)| 00:00:01 |
    |   4 |   VIEW                     |                            |     4 |  8096 |     2   (0)| 00:00:01 |
    |   5 |    TABLE ACCESS FULL       | SYS_TEMP_0FD9D6603_20255AE |     4 |    52 |     2   (0)| 00:00:01 |
    
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------------------------------------
    ---------------------------------------------------------------------------------------------------------
    
    12 rows selected.
    
    SQL> 
    

    However, suspicion of MATERIALIZATION is a hint of undocumented.

    SY.

  • 3D SDO_GEOMETRY too many arguments problem

    Hello world

    I have a problem when creating a sdo_geometry with many surfaces and encountered the problem that: ORA-00939: too many arguments for function 00939. 00000 - "too many arguments for the function.

    To be more precise, in our work, we will generate some points to form a solid or a multi-surface as a form of query to run SDO_ANYINTERACTION. However, there are a lot of affected areas. I used the following function, where the number of surface is 20, it works fine. When I use 30 or 60 with matching sdo_elem_info_array and sdo_ordinate_array surfaces, it would not work with the above error.

    CB.NAME SELECT the name OF CB DEMO_3D where SDO_ANYINTERACT (CB. GEOM, SDO_GEOMETRY (3007, 2157, NULL, SDO_ELEM_INFO_ARRAY (1 100 620, 1, 1003, 1.37, 1003, 1.73, 1003, 1 109, 1003, 1 145, 1003, 1 181, 1003, 1 217, 1003, 1 253, 1003, 1 289, 1003, 1 325, 1003, 1 361, 1003, 1 397, 1003, 1 433, 1003, 1 469, 1003, 1 505, 1003, 1 541, 1003, 1 577, 1003)) (((, 1 613, 1003, 1 649, 1003, 1 685, 1003, 1 721, 1003, 1 757, 1003, 1 793, 1003, 1 829, 1003, 1 865, 1003 1 901, 1003, 1 937, 1003, 1 973, 1003, 1,1009, 1003, 1,1045, 1003, 1,1081, 1003, 1,1117, 1003, 1,1153, 1003, 1,1189, 1003, 1,1225, 1003, 1,1261, 1003, 1,1297, 1003, 1,1333, 1003, 1,1369, 1003, 1,1405, 1003, 1), SDO_ORDINATE_ARRAY (...))) = "TRUE";

    Right now, we use the Oracle 11 g release 1
    Anyone know if there is any restriction specifying surfaces how we can have in the SDO_ELEM_INFO_ARRAY, or something else. Thanks in advance.

    --------------------------------------update----------------------------------
    I just tested, the total number allowed is 27 surfaces in the SDO_ELEM_INFO_ARRAY and the SDO_ORDINATES. Thank you

    Best regards
    Junjun

    Published by: sandrine on October 21, 2010 14:57

    Hi, -.
    Links see the link for an insert for example.
    Your case will be similar to the following:

    SQL> set serveroutput on
    SQL>  declare
      2  ords sdo_ordinate_array;
      3   result varchar2(20);
      4  begin
      5  ords:= sdo_ordinate_array(1,2,10);
      6   execute immediate 'select  sdo_geom.relate(sdo_geometry (3001, 2157, null, sdo_elem_info_array(1,1,1), sdo_ordinate_array(1,2,11)), ''anyinteract'', sdo_geometry(3001,2157, null,sdo_elem_info_array(1,1,1)'||
      7   ' , :ords), 0.0005)  from dual' into result using ords;
      8   dbms_output.put_line('result is: '|| result);
      9  end;
     10  /
    result is: FALSE
    
    PL/SQL procedure successfully completed.
    

    In your case, please replace #5 with your details (in parentheses) line.
    Your immediate statement execution online #6 & #7 will be something like:

    execute immediate 'SELECT CB.NAME name FROM DEMO_3D CB where SDO_ANYINTERACT(CB.GEOM, SDO_GEOMETRY(3007, 2157, NULL, SDO_ELEM_INFO_ARRAY(1,1006,20, 1, 1003, 1,37, 1003, 1,73, 1003, 1,109, 1003, 1,145, 1003, 1,181, 1003, 1,217, 1003, 1,253, 1003, 1,289, 1003, 1,325, 1003, 1,361, 1003, 1,397, 1003, 1,433, 1003, 1,469, 1003, 1,505, 1003, 1,541, 1003, 1,577, 1003, 1,613, 1003, 1,649, 1003, 1,685, 1003, 1,721, 1003, 1,757, 1003, 1,793, 1003, 1,829, 1003, 1,865, 1003, 1,901, 1003, 1,937, 1003, 1,973, 1003, 1,1009, 1003, 1,1045, 1003, 1,1081, 1003, 1,1117, 1003, 1,1153, 1003, 1,1189, 1003, 1,1225, 1003, 1,1261, 1003, 1,1297, 1003, 1,1333, 1003, 1,1369, 1003, 1,1405, 1003, 1) ' ||
    ', : ords)) =''TRUE'' ' into result using ords;
    

    Note that "is not double quotes.
    I hope this helps.
    Thank you

Maybe you are looking for