When to use Filestream partitions?

We have a Web site where we do a lot of document management. We currently have a table with 370,000 records in it. When uploading a new file we check it's size and if it is below 2Gig we store it in a VarChar blob column. We currently want to alter that
table and add a Filestream column and transfer the data as shown below. As you see we are only creating one file folder and the query will probably run for six hours or so. 
We are also thinking about adding up to 5 million audio files stored in a different area. We could conceivably end up with several terabytes of file data. Should we partition and if so how many files should we store in each partition? We are using SQL Server
2012 and Windows Server 2012 R2.
--Create a ROWGUID column
USE CUR
ALTER Table documents
Add DocGUID uniqueidentifier not null ROWGUIDCOL unique default newid()
GO
--Turn on FILESTREAM
USE CUR
ALTER Table documents
SET (filestream_on=FileStreamGroup1)
GO
--Add FILESTREAM column to the table
USE CUR
ALTER Table documents
Add DocContent2 varbinary(max) FILESTREAM null
GO
-- Move data into the new column
UPDATE documents
SET DocContent2=DocContent
where doccontent is not null and  doccontent2 is null  
GO
--Drop the old column
ALTER Table documents
DROP column DocContent
GO
--Rename the new FILESTREAM column to the old column name
Use CUR
GO
 sp_rename 'documents.DocContent2', 'DocContent','Column'
GO

Hi tomheaser,
Quote: Should we partition and if so how many files should we store in each partition?
Yes, if our database contains very large tables, we may benefit from partitioning those tables onto separate filegroups. In this case, SQL Server can access all the drives of each partition at the same time, this may reduce a lot time to load data.
If you only want to reduce the query time by increasing the number of the filegroups, then the limit on the maximum number of partitions is 15,000 in SQL Server. But in order to maintain a balance between performance and number of partitions, we need to consider
more things such as memory, partitioned index operations, DBCC commands, and queries. So please consider all those things first, then choose a reasonable number of partitions. For more information about Performance Guidelines of Table Partition, please refer
to the following article:
http://msdn.microsoft.com/en-us/library/ms190787(v=sql.110).aspx
If you have any question, please feel free to let know.
Regards,
Jerry Li

Similar Messages

  • I have a macbook retina with a partition of windows 7 and Yosemite. When I use time machine in Yosemite it wont recognise the macintosh HD, but it recognises the windows hd ( bootcamp). Does anybody know why ?

    I have a macbook retina with a partition of windows 7 and Yosemite. When I use time machine in Yosemite it wont recognise the macintosh HD, but it recognises the windows hd (bootcamp ). Does anybody know why ?

    Please provide a bit more detail on what 'recognize' means. A screen shot is always very helpful.

  • Index issue with or and between when we set one partition index to unusable

    Need to understand why optimizer unable to use index in case of "OR" whenn we set one partition index to unusable, the same query with between uses index.
    “OR” condition fetch less data comparing to “BETWEEN” still oracle optimizer unable to use indexes in case of “OR”
    1. Created local index on partitioned table
    2. ndex partition t_dec_2009 set to unusable
    -- Partitioned local Index behavior with “OR” and with “BETWEEN”
    SQL> CREATE TABLE t (
      2    id NUMBER NOT NULL,
      3    d DATE NOT NULL,
      4    n NUMBER NOT NULL,
      5    pad VARCHAR2(4000) NOT NULL
      6  )
      7  PARTITION BY RANGE (d) (
      8    PARTITION t_jan_2009 VALUES LESS THAN (to_date('2009-02-01','yyyy-mm-dd')),
      9    PARTITION t_feb_2009 VALUES LESS THAN (to_date('2009-03-01','yyyy-mm-dd')),
    10    PARTITION t_mar_2009 VALUES LESS THAN (to_date('2009-04-01','yyyy-mm-dd')),
    11    PARTITION t_apr_2009 VALUES LESS THAN (to_date('2009-05-01','yyyy-mm-dd')),
    12    PARTITION t_may_2009 VALUES LESS THAN (to_date('2009-06-01','yyyy-mm-dd')),
    13    PARTITION t_jun_2009 VALUES LESS THAN (to_date('2009-07-01','yyyy-mm-dd')),
    14    PARTITION t_jul_2009 VALUES LESS THAN (to_date('2009-08-01','yyyy-mm-dd')),
    15    PARTITION t_aug_2009 VALUES LESS THAN (to_date('2009-09-01','yyyy-mm-dd')),
    16    PARTITION t_sep_2009 VALUES LESS THAN (to_date('2009-10-01','yyyy-mm-dd')),
    17    PARTITION t_oct_2009 VALUES LESS THAN (to_date('2009-11-01','yyyy-mm-dd')),
    18    PARTITION t_nov_2009 VALUES LESS THAN (to_date('2009-12-01','yyyy-mm-dd')),
    19    PARTITION t_dec_2009 VALUES LESS THAN (to_date('2010-01-01','yyyy-mm-dd'))
    20  );
    SQL> INSERT INTO t
      2  SELECT rownum, to_date('2009-01-01','yyyy-mm-dd')+rownum/274, mod(rownum,11), rpad('*',100,'*')
      3  FROM dual
      4  CONNECT BY level <= 100000;
    SQL> CREATE INDEX i ON t (d) LOCAL;
    SQL> execute dbms_stats.gather_table_stats(user,'T')
    -- Mark partition t_dec_2009 to unusable:
    SQL> ALTER INDEX i MODIFY PARTITION t_dec_2009 UNUSABLE;
    --- Let’s check whether the usable index partition can be used to apply a restriction: BETWEEN
    SQL> SELECT count(d)
        FROM t
        WHERE d BETWEEN to_date('2009-01-01 23:00:00','yyyy-mm-dd hh24:mi:ss')
                    AND to_date('2009-02-02 01:00:00','yyyy-mm-dd hh24:mi:ss');
    SQL> SELECT * FROM table(dbms_xplan.display_cursor(format=>'basic +partition'));
    | Id  | Operation               | Name | Pstart| Pstop |
    |   0 | SELECT STATEMENT        |      |       |       |
    |   1 |  SORT AGGREGATE         |      |       |       |
    |   2 |   PARTITION RANGE SINGLE|      |    12 |    12 |
    |   3 |    INDEX RANGE SCAN     | I    |    12 |    12 |
    --- Let’s check whether the usable index partition can be used to apply a restriction: OR
    SQL> SELECT count(d)
        FROM t
        WHERE
        (d >= to_date('2009-01-01 23:00:00','yyyy-mm-dd hh24:mi:ss') and d <= to_date('2009-01-01 23:59:59','yyyy-mm-dd hh24:mi:ss'))
        or
        (d >= to_date('2009-02-02 01:00:00','yyyy-mm-dd hh24:mi:ss') and d <= to_date('2009-02-02 02:00:00','yyyy-mm-dd hh24:mi:ss'))
    SQL> SELECT * FROM table(dbms_xplan.display_cursor(format=>'basic +partition'));
    | Id  | Operation           | Name | Pstart| Pstop |
    |   0 | SELECT STATEMENT    |      |       |       |
    |   1 |  SORT AGGREGATE     |      |       |       |
    |   2 |   PARTITION RANGE OR|      |KEY(OR)|KEY(OR)|
    |   3 |    TABLE ACCESS FULL| T    |KEY(OR)|KEY(OR)|
    ----------------------------------------------------“OR” condition fetch less data comparing to “BETWEEN” still oracle optimizer unable to use indexes in case of “OR”
    Regards,
    Sachin B.

    Hi,
    What is your database version????
    I ran the same test and optimizer was able to pick the index for both the queries.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    SQL> set autotrace traceonly exp
    SQL>
    SQL>
    SQL>  SELECT count(d)
      2  FROM t
      3  WHERE d BETWEEN to_date('2009-01-01 23:00:00','yyyy-mm-dd hh24:mi:ss')
      4              AND to_date('2009-02-02 01:00:00','yyyy-mm-dd hh24:mi:ss');
    Execution Plan
    Plan hash value: 2381380216
    | Id  | Operation                 | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |      |     1 |     8 |    25   (0)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |      |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|      |  8520 | 68160 |    25   (0)| 00:00:01 |     1 |     2 |
    |*  3 |    INDEX RANGE SCAN       | I    |  8520 | 68160 |    25   (0)| 00:00:01 |     1 |     2 |
    Predicate Information (identified by operation id):
       3 - access("D">=TO_DATE(' 2009-01-01 23:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "D"<=TO_DATE(' 2009-02-02 01:00:00', 'syyyy-mm-dd hh24:mi:ss'))
    SQL>  SELECT count(d)
      2  FROM t
      3  WHERE
      4  (
      5  (d >= to_date('2009-01-01 23:00:00','yyyy-mm-dd hh24:mi:ss') and d <= to_date('2009-01-01 23:59:59','yyyy-mm-dd hh24:mi:ss'
      6  or
      7  (d >= to_date('2009-02-02 01:00:00','yyyy-mm-dd hh24:mi:ss') and d <= to_date('2009-02-02 02:00:00','yyyy-mm-dd hh24:mi:ss'
      8  );
    Execution Plan
    Plan hash value: 3795917108
    | Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT         |      |     1 |     8 |     4   (0)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE          |      |     1 |     8 |            |          |       |       |
    |   2 |   CONCATENATION          |      |       |       |            |          |       |       |
    |   3 |    PARTITION RANGE SINGLE|      |    13 |   104 |     2   (0)| 00:00:01 |     2 |     2 |
    |*  4 |     INDEX RANGE SCAN     | I    |    13 |   104 |     2   (0)| 00:00:01 |     2 |     2 |
    |   5 |    PARTITION RANGE SINGLE|      |    13 |   104 |     2   (0)| 00:00:01 |     1 |     1 |
    |*  6 |     INDEX RANGE SCAN     | I    |    13 |   104 |     2   (0)| 00:00:01 |     1 |     1 |
    Predicate Information (identified by operation id):
       4 - access("D">=TO_DATE(' 2009-02-02 01:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "D"<=TO_DATE(' 2009-02-02 02:00:00', 'syyyy-mm-dd hh24:mi:ss'))
       6 - access("D">=TO_DATE(' 2009-01-01 23:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "D"<=TO_DATE(' 2009-01-01 23:59:59', 'syyyy-mm-dd hh24:mi:ss'))
           filter(LNNVL("D"<=TO_DATE(' 2009-02-02 02:00:00', 'syyyy-mm-dd hh24:mi:ss')) OR
                  LNNVL("D">=TO_DATE(' 2009-02-02 01:00:00', 'syyyy-mm-dd hh24:mi:ss')))
    SQL> set autotrace off
    SQL>Asif Momen
    http://momendba.blogspot.com

  • Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verif

    Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verifying and repairing it but had no luck. I also tried mounting and unmounting it but still no solution. Anyone to help please?

    Looks bad. I would strongly advise backing up the stuff on the other two partitions as soon as possible in case the rest of the drive goes wrong.
    Beyond that, Disk Utility has limited abilities to repair disks, DiskWarrior uses a different approach and might, emphasis might be more successful. It has certainly done the job for me in the past when Disk Utility could not.
    See http://www.alsoft.com/diskwarrior/

  • When I use Merge duplicate Values

    Hi
    When I use MERGE for to INSERT It is duplicating values, I put condition in ON
    MERGE                         /*+  append nologging */ INTO sysadm.ps_loc_item_sn_zz2 t3
       USING (WITH tmp_ps_loc_item AS
                   (SELECT loc_cntr_id_sn, setid, companyid, effdt, setid_product, loc_product_sn,
                           ROW_NUMBER () OVER (PARTITION BY loc_cntr_id_sn, setid, companyid, effdt, setid_product, loc_product_sn ORDER BY linha)
                                                                                          seqno_item_sn,
                           loc_item_status, NULL ken_data_ativ_sn, NULL inactive_date_sn,
                           'LO' cntrct_origin_sn, SYSDATE row_added_dttm,
                           'CARGA PS 29052007' row_added_oprid, SYSDATE row_lastmant_dttm,
                           'CARGA PS 29052007' row_lastmant_oprid, 0 syncid, NULL syncdttm,
                           ken_component_sn
                      FROM (SELECT t1.*, ROWNUM linha
                              FROM sysadm.tmp_equip_crm t1,
                                   (SELECT     LEVEL l
                                          FROM DUAL
                                    CONNECT BY LEVEL <= 100)
                             WHERE l <= t1.qtd) )
              SELECT t2.loc_cntr_id_sn, t2.setid, companyid, effdt, setid_product, loc_product_sn,
                     t2.seqno_item_sn, loc_item_status, t5.ken_data_ativ_sn, inactive_date_sn,
                     cntrct_origin_sn, row_added_dttm, row_added_oprid, row_lastmant_dttm, syncid,
                     syncdttm, t2.ken_component_sn
                FROM tmp_ps_loc_item t2, sysadm.tmp_data_ativa t5
               WHERE t2.loc_cntr_id_sn = t5.loc_cntr_id_sn(+)
                 AND t2.ken_component_sn = t5.ken_component_sn(+)
                 AND t2.loc_item_status = t5.loc_item_status_sn(+)
                 AND t2.seqno_item_sn = t5.seqno_item_sn(+)) t4
       ON (    t3.loc_cntr_id_sn = t4.loc_cntr_id_sn
           AND t3.setid = t4.setid
           AND t3.companyid = t4.companyid
           AND t3.effdt = t4.effdt
           AND t3.setid_product = t4.setid_product
           AND t3.loc_product_sn = t4.loc_product_sn
           AND t3.seqno_item_sn = t4.seqno_item_sn)
       WHEN MATCHED THEN
          UPDATE
             SET t3.syncid = 0
       WHEN NOT MATCHED THEN
          INSERT (loc_cntr_id_sn, setid, companyid, effdt, setid_product, loc_product_sn, seqno_item_sn,
                  loc_item_status_sn, ken_data_ativ_sn, inactive_date_sn, cntrct_origin_sn,
                  row_added_dttm, row_added_oprid, row_lastmant_dttm, row_lastmant_oprid, syncid,
                  syncdttm)
          VALUES (t4.loc_cntr_id_sn, t4.setid, t4.companyid, t4.effdt, t4.setid_product,
                  t4.loc_product_sn, t4.seqno_item_sn, loc_item_status, t4.ken_data_ativ_sn,
                  t4.inactive_date_sn, t4.cntrct_origin_sn, t4.row_added_dttm, t4.row_added_oprid,
                  t4.row_lastmant_dttm, t4.ken_component_sn, t4.syncid, t4.syncdttm);

    I don't understand what you mean exactly?
    When an SQL statement encounters an error then all
    its work is rolled back ...
    So why do you expect that it worùs otherwise?simply
    WHEN MATCHED THEN      UPDATE         SET t3.syncid = 0Only

  • Not right data when row_number used in inner-view sql query...

    Hi ,
    I use the below sql statement which displays the right data
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over(partition by code_farmakou order by sum_posotita desc) from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS)The data are:
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA ROW_NUMBER()OVER(PARTITIONBYCO
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5                              1
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30                              1
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3                              1
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2                              1
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45                              1
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1                              3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6                              1
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2                              2
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                        21                              1
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                         2                              2However , when i use the below statement , in order not to display the row_number (so i use row_number function in inner-view) the data are different--in different order... why is that????
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over(partition by code_farmakou order by sum_posotita desc) from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS)
      )and its data are:
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA
    1000016655                               KABIVEN                                                                          BT                           50ΦΥΣ.Χ1,7ML                        21
    1000016655                               KABIVEN                                                                          BT                           50ΦΥΣ.Χ1,7ML                         2
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1NOTE :Sorry, I tried to pose some sample data using the "with" statement but i couldn't...the error ORA-32035 : unreferenced query name defined in WITH clause was displayed..
    Regards,
    Simon

    The optimizer has, well, optimized out the row_number because you never refer to its value in the outermost query.
    sql>select deptno, cnt, row_number() over (order by cnt desc) rn
      2    from (select deptno, count(*) cnt
      3            from emp
      4           group by deptno);
       DEPTNO       CNT        RN
           30         6         1
           20         5         2
           10         3         3
    3 rows selected.
    -- here because we include rn in the outermost query,
    -- the results are still ordered based on the analytical function result
    sql>select deptno, cnt, rn
      2    from (select deptno, cnt, row_number() over (order by cnt desc) rn
      3            from (select deptno, count(*) cnt
      4                    from emp
      5                   group by deptno));
       DEPTNO       CNT        RN
           30         6         1
           20         5         2
           10         3         3
    3 rows selected.
    -- but if we don't include rn in the outermost query,
    -- the optimizer leaves out the window sort and the results are in a different order
    sql>select deptno, cnt
      2    from (select deptno, cnt, row_number() over (order by cnt desc) rn
      3            from (select deptno, count(*) cnt
      4                    from emp
      5                   group by deptno));
       DEPTNO       CNT
           10         3
           20         5
           30         6
    3 rows selected.This just reinforces the point that if you want your results in a particular order, you need to provide an ORDER BY clause - don't rely on execution plans to do your sorting for you.

  • How to use recovery partition for installing OS

    hello,
             i tried a lot to recover my os with lenove own button for system restore but it did't work and finaly i install OS XP Professional and manualy install all drivers. i must wanna say to lenove mangment that their this way is absolut more complicated then simply provide lenove customer backup cd with laptop. even when i call lenove help line for backup system cd then they demanded money for the cd eigther it must b free for lenove customer as lenove system restore button and partition whole typoligy seems to be total failur. If some one here plz give me advise what should i do with that partition of my hard drive which having system backup from lenove. i make 3 partition of my hdd with i did't remove that partition... so now i want to know that can i still use that partition for system restore or i should remove that partition to make my hdd space free
    Thanx 4 reading
    Mehr

    I had the same problem. I hate Lenovo. I will not buy an another lenovo in my lifetime again. I paid for the OS, then when i call customer care, they ask me for money. Guys look at Dell. I had the system for 7 yrs, i had the OS that i purchased with my laptop. I am loving Dell. Lenovo , your process is wrong. 

  • Home Directories when installing on multiple partitions

    I have a macpro setup with two partitions.  Originally one partition assigned to Snow Leopard.  I log in using a network user (using OSX server) and that user has local Admin rights.  All is well.
    I setup a new instance of Snow Leopard on the secondary Partition and logged in using the network user.  This had the effect of using the partition 1 Home directory for this user and I can't get the secondary partition to use itself for storing the users home directory.
    The workaround I have is to log in to Partition 2 snow leopard with a local admin user then temporarily rename the Users folder on partition 1.  Next login to partition 2 as the network user, then everything gets created on partition 2 as expected.  Finally rename the Partition 1 Users folder back.  Now I can log in to either partitoin with the same user and have different local home setups.
    Anyone else had this or is there a better procedure for setting up multiple partitions ?  The same happens with LION.  I need to keep a snowleoapard partition with all the setup I currently have, but start a new LION partition.  I don't want any cross contamination, hence the requirement for separation.

    This was my point. I wanted total separation.  In order to create that separation (when trying to use a network user) I had to temporarily move the existing Snow Leopard Users folder (on Partition 1) so that the Partition 2 OS (either Snow leopard or LION) will create it's own User directory structure.  This is only needed for network users (i.e. ones that authenticate via OSX server).
    Once the process of temporarily moving the Users folder, letting the new instance create it's own directories, and renaming back, everything works.  i.e. when I startup Snowleopard all operations are within Partition 1 then if I start LION all operations are within Partition 2. 
    When installing new versions of an O/S I like to have control and manage the change so that I know I have a totally working system.  Been doing the same with Linux for years, but Mac OS/X tries to be a bit too clever!

  • An not import an export file when has cross-schema partition by reference

    I'm working on a complex system with about 200 tables stored in *5 schemas* on Oracle 11.2.0.2 (database is installed on a Redhat Linux).
    There are lots of partitioned tables, and some are partition by reference, and some of the partition by references are partitioned on cross-schema references (the referenced partitioned table and the table which is partitioned by reference are in 2 different schemas).
    When exporting these 5 partitions using data-pump everything goes fine, but I could not find a way to import it in another database without errors. And the problem is on creating tables which are partitioned by cross-schema references, and I get an Insufficient Privilege error.
    It seems that the impdp first creates all the tables, and then apply the grants (including references grant) and that causes the problem. If it applied grant statements of each table after creating that table there would be no problem.
    Is there any way I can overcome this problem?

    This is export script:
    declare
    h1 NUMBER;
    begin
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'EXPORT000185', version => 'COMPATIBLE');
    dbms_datapump.set_parallel(handle => h1, degree => 1);
    dbms_datapump.add_file(handle => h1, filename => '910202.LOG', directory => 'DATA_PUMP_DIR', filetype => 3);
    dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
    dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''PAYESH_ACCOUNTING'',''PAYESH_CORE'',''PAYESH_CRM'',''PAYESH_LIFE'',''PAYESH_SECURITY'')');
    dbms_datapump.add_file(handle => h1, filename => '910202_db4.DMP', directory => 'DATA_PUMP_DIR', filetype => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
    dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
    dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
    dbms_datapump.detach(handle => h1);
    end;
    and this is the import script:
    declare
    h1 NUMBER;
    begin
    h1 := dbms_datapump.open (operation => 'IMPORT', job_mode => 'SCHEMA', job_name => 'IMPORT000189', version => 'COMPATIBLE');
    dbms_datapump.set_parallel(handle => h1, degree => 1);
    dbms_datapump.add_file(handle => h1, filename => '910228.LOG', directory => 'DATA_PUMP_DIR', filetype => 3);
    dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
    dbms_datapump.add_file(handle => h1, filename => '910128.DMP', directory => 'DATA_PUMP_DIR', filetype => 1);
    dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''PAYESH_ACCOUNTING'',''PAYESH_CORE'',''PAYESH_CRM'',''PAYESH_LIFE'',''PAYESH_SECURITY'')');
    dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
    dbms_datapump.set_parameter(handle => h1, name => 'SKIP_UNUSABLE_INDEXES', value => 0);
    dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
    dbms_datapump.detach(handle => h1);
    end;

  • Use a partition on external drive for windows support software

    Hello
    I am trying to install Windows 7 on my MacBook AIR  13" 8GB.  I have an external drive that i created a partition for the Windows Support software but when I choose to proceed in Boot Camp Assistant to download the windows support software it says the entire drive has to be one partition formatted to MS DOS.
    Any way around this..I have the Windows disc and would like to avoid having to buy another 8 GB or greater size external disc drive
    Thanks

    I do not want to install Windows on the external drive.
    An external drive is needed to download the windows support software as stated in Boot Camp.  It seems I cannot use a partition on the external drive to download the support software.. Wondering if there is a work around this..

  • Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    OK, it's very bad computing to use a backup disk for anything but a backup. The reason being is if/when the HD crashes you will have lost not only all your backup but the data files. While I commend you for wanting redundant backup, you really need separate EHDs for doing so. Format each EHD using Disk Utility to Mac OS Extended (Journaled) using the GUID parttition. When you connect, OS X will ask if you want to use that drive as a Time Machine backup drive, select yes and then let it backup. On the second EHD format the same way however do not use TM as a backup, this time I'd suggest an app such as SuperDuper or Carbon Copy Cloner to make a clone of the internal HD. Leave both EHDs connected and TM will backup new or changed files automatically on a hourly basis. The clone you will need to set to backup on the schedule you want. For example I have my SuperDuper EHD set to backup only changed or updated files at 2AM every day.
    The advantage of a clone is that if the computers internal HD crashes you can boot from a clone and continue working, TM will not do that but it's great for keeping an archive of all files. So if you want a version of a file from many months ago, TM will help you locate and restore it.

  • Logical standby stopped when trying to create partitions on primary(Urgent

    RDBMS Version: 10.2.0.3
    Operating System and Version: Solaris 5.9
    Error Number (if applicable): ORA-1119
    Product (i.e. SQL*Loader, Import, etc.): Data Guard on RAC
    Product Version: 10.2.0.3
    logical standby stopped when trying to create partitions on primary(Urgent)
    Primary is a 2node RAC ON ASM, we implemented partitions on primar.
    Logical standby stopped appling logs.
    Below is the alert.log for logical stdby:
    Current log# 4 seq# 860 mem# 0: +RT06_DATA/rt06/onlinelog/group_4.477.635601281
    Current log# 4 seq# 860 mem# 1: +RECO/rt06/onlinelog/group_4.280.635601287
    Fri Oct 19 10:41:34 2007
    create tablespace INVACC200740 logging datafile '+OT06_DATA' size 10M AUTOEXTEND ON NEXT 5M MAXSIZE 1000M EXTENT MANAGEMENT LOCAL
    Fri Oct 19 10:41:34 2007
    ORA-1119 signalled during: create tablespace INVACC200740 logging datafile '+OT06_DATA' size 10M AUTOEXTEND ON NEXT 5M MAXSIZE 1000M EXTENT MANAGEMENT LOCAL...
    LOGSTDBY status: ORA-01119: error in creating database file '+OT06_DATA'
    ORA-17502: ksfdcre:4 Failed to create file +OT06_DATA
    ORA-15001: diskgroup "OT06_DATA" does not exist or is not mounted
    ORA-15001: diskgroup "OT06_DATA" does not exist or is not mounted
    LOGSTDBY Apply process P004 pid=49 OS id=16403 stopped
    Fri Oct 19 10:41:34 2007
    Errors in file /u01/app/oracle/admin/RT06/bdump/rt06_lsp0_16387.trc:
    ORA-12801: error signaled in parallel query server P004
    ORA-01119: error in creating database file '+OT06_DATA'
    ORA-17502: ksfdcre:4 Failed to create file +OT06_DATA
    ORA-15001: diskgroup "OT06_DATA" does not exist or is not mounted
    ORA-15001: diskgroup "OT06_DATA" does not exist or
    Here is the trace file info:
    /u01/app/oracle/admin/RT06/bdump/rt06_lsp0_16387.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    ORACLE_HOME = /u01/app/oracle/product/10.2.0
    System name: SunOS
    Node name: iscsv341.newbreed.com
    Release: 5.9
    Version: Generic_118558-28
    Machine: sun4u
    Instance name: RT06
    Redo thread mounted by this instance: 1
    Oracle process number: 16
    Unix process pid: 16387, image: [email protected] (LSP0)
    *** 2007-10-19 10:41:34.804
    *** SERVICE NAME:(SYS$BACKGROUND) 2007-10-19 10:41:34.802
    *** SESSION ID:(1614.205) 2007-10-19 10:41:34.802
    knahcapplymain: encountered error=12801
    *** 2007-10-19 10:41:34.804
    ksedmp: internal or fatal error
    ORA-12801: error signaled in parallel query server P004
    ORA-01119: error in creating database file '+OT06_DATA'
    ORA-17502: ksfdcre:4 Failed to create file +OT06_DATA
    ORA-15001: diskgroup "OT06_DATA" does not exist or is not mounted
    ORA-15001: diskgroup "OT06_DATA" does not exist or
    KNACDMP: *******************************************************
    KNACDMP: Dumping apply coordinator's context at 7fffd9e8
    KNACDMP: Apply Engine # 0
    KNACDMP: Apply Engine name
    KNACDMP: Coordinator's Watermarks ------------------------------
    KNACDMP: Apply High Watermark = 0x0000.0132b0bc
    Sorry our primary database file structure is different from stdby, we used db_file_name_convert in the init.ora, it look like this:
    *.db_file_multiblock_read_count=16
    *.db_file_name_convert='+OT06_DATA/OT06TSG001/','+RT06_DATA/RT06/','+RECO/OT06TSG001','+RECO/RT06'
    *.db_files=2000
    *.db_name='OT06'
    *.db_recovery_file_dest='+RECO'
    Is there any thing wrong in this parameter.
    I tried this parameter before for cloning using rman backup. This din't work.
    What exactly must be done? for db_file_name_convert to work.
    Even in this case i think this is the problem its not converting the location and the logical halts.
    help me out.....
    let me know if you have any questions.
    Thanks Regards
    Raghavendra rao Yella.

    Hi reega,
    Thanks for your reply, our logical stdby has '+RT06_DATA/RT06'
    and primary has '+OT06_DATA/OT06TSG001'
    so we are using db_file_name_convert init parameter but it doesn't work.
    Is there any thing particular steps hiding to use this parameter? as i tried this parameter for rman cloning it din't work, as a workaround i used rman set new name command for clonning.
    Let me know if you have any questions.
    Thanks in advance.

  • Checked and unchecked exceptions - when to use which ?

    Hi,
    Example:
    public void go(String[] args) {
       if(args.length==0)
          throw new //   <= what type of an exception should come here ?
    }Is there a good explanation when to use which one ? I know that generally
    unchecked exception are the exceptions associated with errors in the logic
    of your applications and checked are those which you can not determine
    (like files, networks problems ....).
    Thanks,
    Adrian

    There is no, "I think it is better to us a type-XXX exception here because of conditions 1, 2, and 3" scenario.
    Checked exceptions are of type java.lang.Exception and must be handled in one of two ways- try/catch constructs or having the method state it throws the checked exception.
    Unchecked exceptions are of type java.lang.Error or java.lang.RuntimeException. If the problem is an Error, something very bad has occurred like running out of memory. If it is a RuntimeError, then it probably came from a program bug. In both cases, there is no way for you to know when they will arise. Therefore the compiler does not force you to handle these unusual circumstances.
    If you think of piece of code may throw an error like an I/O operation, and you do not have code to handle that possibility, the compiler will let you know. After you have been programming long enough, you'll begin to know when you need try/catch constructs without Mr. Compiler yelling at you. ;-)
    Edited by: filestream on Sep 14, 2007 5:37 PM

  • Does it makes sense to create an index on a column used for partitioning

    I am new to using partitions along with index. Can someone help me with the situation below?
    I have a table defined like below
    CREATE TABLE FACT_MASTER
    PERIODCODE NUMBER(8) NOT NULL,
    PRODUCT_CD NUMBER(10) NOT NULL,
    DPT_CD NUMBER(3),
    FACT_VALUE1 NUMBER,
    FACT_VALUE2 NUMBER,
    FACT_VALUE3 NUMBER,
    FACT_VALUE50 NUMBER
    PARTITION BY RANGE (PERIODCODE)
    partition P1 values less than (2002),
    partition P2 values less than (2003),
    partition P3 values less than (2004),
    This table is partitioned by range on Period code.
    In a select query on this table, period code and product code are being used. I am planning to create an index to boost the performance. Does it make sense to include the period code column also in the index? I am planning to create index only for the product code column. I am thinking that the partition itself will act like an index for periodcode. Can someone tell me if this is correct? I am using 10g.
    Edited by: user6794035 on Jan 21, 2010 8:47 AM
    Edited by: user6794035 on Jan 21, 2010 8:50 AM

    In your scenario I think it's better not to create an index on PERIODCODE because this column probaly has a only few distinct values.
    In other scenarios, when in the same partition there are many distinct values of the partitioning key, creating an index can be an advantage for query performances..
    But it depends on the specific context...
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]

  • Y do i get clear lines on my video when i use a software

    when i use serato itch i get this clear lines on my video

    Assuming you already have it installed: Go to system preferences and chose 'start up disc' in the system menu. Then select the Windoze partition and restart it. - To get back to OSX, find the Boot Camp icon in the tool bar bottom right.

Maybe you are looking for

  • R/3 configurations (Idoc to File)

    Hi, while we create RFC Destination (SM59) in R/3 System, in logon security tab do we need to provide R/3 credentials or XI credentials??!! Note: Scenario-- Idoc to file Thanks., abhi

  • How to resume deleted process chain

    HI BW gurus, I have 1 process chain which loads data to ZFIGL_01 infocube.But by mistake the process chain got deleted from the meta chain as well as main chain. Is there any step to recreate the process chain.And will it affect my main process chain

  • Phantom Connected Users

    Hello We have a MacPro running Snow Leopard Server 10.6.8 with 5 client Macs connected running Snow Leopard. If I shut down all of the clients except my MacBook, select the server and click 'disconnect' and then screen share the server to restart it

  • Can't get PCI 6024E card recognized by LabView

    Window's Device Manager sees the card as an unknown PCI.  I have tried removing the card, rebooting, and then replacing the card.  I can't find any driver (.inf) files for the 6024.  Is NI-DAQ the driver?  NI-DAQ will just not see the card at all (ev

  • Database Copy Doesn't find tables for moving data

    I'm running SQL Dev 3.1.7 on a Win7-64 PC against Oracle 11g. Using the Database Copy function to move and update tables from one instance to another. The application seems to work fine, creating all of the tables, but in the script when it tries to