Partition problem

i was wondering how could i get the following error when my partition strategy is
partition by range (service_dt)
partition call_minvalue
values less than (to_date('2007-07-09','YYYY-MM-DD'))
tablespace data1,
partition call_part_20070719
values less than (to_date('2007-07-10','YYYY-MM-DD'))
tablespace data1,
partition call_maxvalue
values less than (MAXVALUE)
tablespace data1
It seems anything should be able to going into maxvalue
ORA-14400: inserted partition key does not map to any partition
version 10g

service_dt is a date, and i passing in date fields.
Also i checked the web example above but the question is shouldnt i be able to insert any date as i have "values less than (MAXVALUE)" specified?
also first part of ddl to show that service date is a date
create table call
CALL_ID     Number not null
,CALL_SOURCE_TYP     Varchar2(2) not null
,UCDR_ID     Number not null
,SERVICE_DT     Date not null

Similar Messages

  • After creating partition, problems start

    I use Boot Camp Asst. and create a 32 GB partition. at the end of the process, I'm told to "hit the Restart key or hold the power key for a few seconds." Since i have no restart key on my MacBook, I hold down the power key. Then the system turns off. I turn it on again, and reboot. I get an error - osx shut down unexpectedly, do i want to report to apple. whatever. the space i allocated on the partition is gone from my free space, but if I go into BCA, it doesn't seem to know that i've already created a partition. things are screwy and i have to reboot from the Leopard disk and use Disk Utility to repair the disk.
    So, how do I get around this? I really want to use boot camp.

    I have it all fixed (except that the Windows XP system won't completely shut down or restart into any startup volume...I have to hold down the power button until shutdown, then start by pressing the start button).
    AppleCare tech, on two different calls, spoke of a bug in OS X (10.5.2) that is causing the partition problem described by me and others in this thread.
    The solution (assuming that you don't have a Windows partition yet) is to install OS X (10.5.1). Don't do any software updates to 10.5.1 until you've completed the Windows install using Boot Camp Assistant.
    Remember to have backups.
    I didn't exactly follow the solution directly. I reinstalled Tiger 10.4.11. Then I installed 10.5.1 as an upgrade. The reason for this is that I was not warned by AppleCare tech that a 10.5.2 install using "erase and install" would delete the entire iLife '06 suite. I lost iLife '06. That's why I reverted to Tiger before attempting the Leopard and Boot Camp installations.

  • IMAP Alternate partition problem

    IMAP partition problem
    IMAP is set so all boxes are on a separate partition ..
    and until recently, worked fine.
    one day (shortly after 10.4.9 upgrade)
    after "rebuilding" an IMAP inbox from Mail.app
    everything went down.. and came up again with all IMAP boxes other than INBOX appearing gone
    but what happened is that all the accounts suddenly reverted (?) to existing on the default partition (var/spool/imap)
    and although the alternate partition still exists and all settings reflect such..
    I can't get the accounts back to seeing that partition.
    cyradmn does not 'see' boxes on the alt partition.
    thus, I cant retrieve some huge folders of stored mail.
    in addition, the accounts are unable to create any folders on the current (default) partition and only "inbox" exists (no Sent or Drafts, etc..).
    (the error returned : System I/O error)
    mail works, can send and receive, .. but how to restore accounts to the alternate partition ??
    Ive tried shutting off the account and deleting the user mailbox (on default partition) and turning back on the user.. still creates on the default partition
    the accounts still show (in SA and NetInfo record) set to alternate partition..
    and imapd.conf still has the partition entry ..
    what's up ??

    Thanks for the responses ..
    yes, actually, I have tried reconstruct from mailbfr (options -o and -m) as well as via cyradm.. and SA
    either option succeeds at reconstructing all the boxes fine, and permissions appear to be fine as well..
    drwxr-xr-x 4 cyrusima mail - 136B Jun 3 2006 mailstore
    mailbfr reports both partitions being operated on ..
    my config also appears OK, its the same as has been working flawlessly for over a year :
    admins: cyrusimap localadmin
    configdirectory: /var/imap
    partition-default: /var/spool/imap
    unixhierarchysep: yes
    altnamespace: yes
    servername: mail.mydomain.com
    sievedir: /usr/sieve
    sendmail: /usr/sbin/sendmail
    lmtpdowncasercpt: 1
    tlscertfile: /etc/certificates/mail.mydomain.com.crt
    logrollingdays: 0
    logrolling_daysenabled: false
    tlskeyfile: /etc/certificates/mail.mydomain.com.key
    imapauth_crammd5: yes
    imapauthgssapi: yes
    popauthclear: no
    enable_pop: no
    tlscommonname: mail.mydomain.com
    tlsserveroptions: use
    imapauthlogin: yes
    partition-mailstore: /Volumes/path/to/alt-partition
    I did notice an odd thing though..
    although the boxes are being read from /var/spool/imap
    and accounts show "default" partition (in SA)
    when I try to create a box (via Mail.app) in IMAP acct..
    it fails .. can't so it ..
    and the IMAP log shows
    imaps[22176]: IOERROR: creating directory /Volumes/path/to/alt-partition: Permission denied
    so it appears to want to write to the right place and can't ..
    but still reads from the wrong place.
    something is amiss !!
    where to look next ?

  • Bootcamp and windows 8(partition problem)

    I am trying to install windows 8 and until now with no sucess. The instalation by the bootcamp runs smoothly, but when I boot from the USB, start the instalation process on windows and it asks me what partition I want to install the windows, I try to choose the Partition 4: BOOTCAMP and it doesn't work. It says it's a problem because the partition is EFI and for installing windows it can't be or something like that
    And if I don't press the Alt button, when the bootcamp finishes the instalation and reboot the mac, it goes to a black screen where said that I don't have any boot devices connected and to connect one and press a key.

    I believe you are supposed to format the partition labeled BOOTCAMP to NTFS from the installer. It is stated in the BootCamp suport guide.

  • Hard Drive Partition Problems

    I recently installed a new HD in my iMac DV SE. I thought I'd be clever and make three partions, 2 8GB OS drives (one is blank - I was thinking about Linux, but too lazy to do it and don't need to right now) and one ~100GB for my music, files, etc. that I can share without too much worry.
    The problem I'm having is that Tiger uses a lot of virtual memory and if my computer is on for awhile, or I'm doing multiple things, my OSX drive fills up with VM (I think) and I get the "Your HD is almost full" (the error that originally drove me to buy a new HD)
    Of course quitting out of programs and restarting fixes the problem, but sometimes my computer slows down so much I find myself using that magic little button on the side and restarting it (how bad is this really?)
    What I want to do is take the extra OS partition and combine it with the other OS partition so that the OS can use as much VM as it pleases. Can I do this without wiping the whole drive?
    Also, if I have to wipe the whole drive, what is the best way to store my data so that I can put it back how it was, maybe an image file (never done this before)? Maybe a link to a site that explains it or something?
    I know that buying more memory would also solve this problem, and I plan on doing this in the future, but I'm a poor college student, so that isn't an option for awhile
    Thanks,
    Eric

    Choose Go to Folder from the Finder's Go menu and then type or paste in /private/etc/ as the folder's location. Make two copies of the file rc inside that folder, and put one copy on the desktop, and the other in the Documents folder of your home folder. Open the copy in the Documents folder with a text editor and locate the text swapdir inside. After the =, replace /private/var/vm/ with /Volumes/volumename/vm/ . Replace volumename with the name of the the partition; this requires that the partition's name doesn't contain spaces or other special characters. Once done, replace the existing file and restart the machine to change the location of the VM swap files.
    If you encounter any problems after doing this, you can restore the original rc file by restarting your machine from the Mac OS X install disk and opening the Terminal application. Enter the following: "mv /Users/yourname/Desktop/rc /Volumes/diskname/private/etc/rc" without the quotes, and after replacing yourname with the short name of your user account and diskname with the name of your normal partition. If either contains spaces, you will need to enclose the whole path in quote marks.
    (8904)

  • Boot camp / partition problems, hard drive damaged?

    I was in the middle of using boot camp to allocate 13gb to windows when my macbook pro crashed (the crash screen with the turn off and restart text came up), then when i restarted and ran boot camp it said that my harddrive couldn't be partitioned and to repair it using disk utility. I ran that, but the repair disk is greyed out, the repair permissions doesn't have any effect and when i clicked verify disk it says;
    "Disk utility stopped verifying macintosh hd because the following error was encountered filesystem verify or repair failed"
    and the log is
    Verifying volume “Macintosh HD”
    Performing live verification.
    Checking Journaled HFS Plus volume.
    Checking Extents Overflow file.
    Checking Catalog file.
    Checking multi-linked files.
    Checking Catalog hierarchy.
    Checking Extended Attributes file.
    Checking volume bitmap.
    Checking volume information.
    Invalid volume free block count
    (It should be 15200369 instead of 11898629)
    The volume Macintosh HD needs to be repaired.
    Error: Filesystem verify or repair failed.
    Can you help me out? It's essential i get a number of windows products running.

    Ok, that seemed to work for part of the problem.
    It repaired the disk but whenever I run boot camp it keeps throwing up that crash screen and i have to go through the process of repairing the disk again.
    I've ran boot camp with no other programs running in the background or open and without disturbing it while it's allocating the partition and it still crashes.
    Any ideas how to get it working?
    Heres the crash report
    Fri May 30 00:22:56 2008
    panic(cpu 1 caller 0x0031D1B3): "hfs_lock: locking against myself!"@/SourceCache/xnu/xnu-1228.3.13/bsd/hfs/hfs_cnode.c:986
    Backtrace, Format - Frame : Return Address (4 potential args on stack)
    0x3d2476d8 : 0x12b0e1 (0x457024 0x3d24770c 0x13321a 0x0)
    0x3d247728 : 0x31d1b3 (0x483cc0 0x0 0x3d247758 0x1f0d72)
    0x3d247758 : 0x31db5b (0x5399ae0 0x3 0x0 0x4384804)
    0x3d247848 : 0x1f2e30 (0x3d247860 0x0 0x3d247888 0x1f4d49)
    0x3d247888 : 0x1da8f0 (0xa1f25a0 0x4a09ca4 0x38ed58 0x0)
    0x3d2478a8 : 0x1da95d (0xa1f25a0 0x0 0x246 0x49e1500)
    0x3d2478c8 : 0x3346c6 (0xa1f25a0 0x68000 0x57bbee0 0x49e1500)
    0x3d247bc8 : 0x334a22 (0x4a09ca4 0x17f7fff 0x3e616c 0x0)
    0x3d247c58 : 0x32bc00 (0x4384804 0xf8000000 0x17 0x4a09ca4)
    0x3d247cd8 : 0x1f5039 (0x3d247d08 0x0 0x3d247cf8 0x0)
    0x3d247d38 : 0x1e7e0c (0x4381c70 0x80006802 0x3d247ee0 0x0)
    0x3d247f78 : 0x3dbe77 (0x49e1500 0x4a09ba0 0x4a09be4 0xb0080d78)
    0x3d247fc8 : 0x19f084 (0x46543a0 0x0 0x1a20b5 0x46543a0)
    No mapping exists for frame pointer
    Backtrace terminated-invalid frame pointer 0xb0080d88
    BSD process name corresponding to current thread: DiskManagementTo
    Mac OS version:
    9C31
    Kernel version:
    Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386
    System model name: MacBookPro3,1 (Mac-F4238BC8)

  • Recovery and Tools partition problem

    Hi;
    My Elitebook 8460p recover and tool partition deleted I want to recover my hard drive factory default but i can't find any rescue DVD.
    Please help me..

    Welcome to the HP Forum!
    mgs_mgs wrote:
    Hi;
    My Elitebook 8460p recover and tool partition deleted I want to recover my hard drive factory default but i can't find any rescue DVD.
    Please help me..
    That is indeed unfortunate. You will need to order a recovery disk set from HP or an HP Partnet. Here is how to order a recovery disk set.
    Kind regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • NTFS format partition problem - install Windows 8.1

    I cannot install Windows 8.1 from USB via bootcamp, on Mavericks late 2013 rMPB 15"
    When I get towards the end of the Windows Setup screen the Bootcamp partition is showing as not NTFS format
    There is no 'advanced options' to click, under the 4 partition options.
    I have pressed Option and tried installing through either the 'Windows' partition and the 'EFI' partition - both have the NTFS format problem.

    Just hit the 'format' button - looks like it might be working now

  • Partition problem with Win 7 and Lion

    I have a 2011 Mac Mini with two hard drives - the original 500GB drive and a SSD.   The SSD is laid out as follows:
    $ diskutil list
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *60.0 GB    disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS OSX Lion SSD            19.0 GB    disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4:       Microsoft Basic Data BOOTCAMP W7             40.2 GB    disk0s4
    It has my two bootable operating systems and works fine (for now) so I am happy to leave it alone.
    The problem is with the second drive.  It has:
    1) EFI partition 200M
    2) Original Lion install 40G HFS+
    3) Original recovery partition 650M
    4) Space set aside for OSX HFS+ 160G (has some big files in it)
    5) Space set aside for Windows NTFS 300G (no files in it yet)
    I think there is a problem with MBR vs GPT and Disk Utility vs Disk Management.
    Disk Utility or fdisk calls it
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *500.1 GB   disk1
       1:                        EFI                         209.7 MB   disk1s1
       2:       Microsoft Basic Data                         37.6 GB    disk1s2 (these entries are wrong)
       3:       Microsoft Basic Data                         650.0 MB   disk1s3
       4:       Microsoft Basic Data                         161.5 GB   disk1s4
       5:       Microsoft Basic Data NTFS stuff              300.1 GB   disk1s5 (this entry seems right)
    and I cannot access the partitions in Lion.
    Gdisk calls it:
    GPT fdisk (gdisk) version 0.8.1
    Partition table scan:
      MBR: hybrid
      BSD: not present
      APM: not present
      GPT: present
    Found valid GPT with hybrid MBR; using GPT.
    Disk /dev/disk1: 976773168 sectors, 465.8 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 0000303E-4D40-0000-1B4C-0000F9090000
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 976773134
    Partitions will be aligned on 8-sector boundaries
    Total free space is 2061 sectors (1.0 MiB)
    Number  Start (sector)    End (sector)  Size       Code  Name
       1              40          409639   200.0 MiB   EF00  EFI system partition
       2          409640        73900919   35.0 GiB    0700  Customer (name is wrong)
       3        73900920        75170455   619.9 MiB   0700  Recovery HD
       4        75170456       390588423   150.4 GiB   0700  stuff
       5       390590464       976773119   279.5 GiB   0700  Basic data partition (name is wrong)
    Windows Disk Management is happy to see inside the HFS partitions, so I know all my files are at least still there.  I had a 5th NTFS partition formatted, but upon going into Lion and back, it disappeared.
    I think ideally what I would like to have is a spare Lion + recovery partition on this drive in case my SSD barfs, then a big NTFS partition to hold my Windows files.  I guess merging the 40G OSX and 160G HFS+ partitions will be ok.  Could the problem be related to MBR having a limit of 4 partitions?  There isn't any data on this drive that isn't backed up, but I would rather do this partition fixing shuffle without having to restore big files.  Any suggestions on how to proceed?

    I managed to fix the problem.  First I used Disk Utility to delete the NTFS partition.  It hung during the process, so I quit it, and the partition was deleted anyway.  Next, I used gdisk to change the partition type from 0700 to AF00 and AB00 for the Lion and Recovery partitions respectively.  It worked and I can access the partitions under OSX again.  Thanks, everybody, you've been super helpful.

  • Can't install Windows 8 - Partition problems

    Hi all,
    Ive recently installed a SSD (Samsung 830) into my iMac 2011. It already had a 1 TB HDD in it but I want to install Mountain Lion and Windows 8 on the SSD.
    Installing Mountain Lion was a piece of cake but now im getting problems installing the bootcamp partition with Windows 8. See below
    diskutil list:
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS Untitled                999.9 GB   disk0s2
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *256.1 GB   disk1
       1:                        EFI                         209.7 MB   disk1s1
       2:                  Apple_HFS Macintosh SSD           255.2 GB   disk1s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk1s4
    /dev/disk2
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *16.1 GB    disk2
       1:                 DOS_FAT_32 WININSTALL              16.1 GB    disk2s1
    Ive tried to creating the bootcamp partition with the DISK UTILITY and the Bootcamp assistant, but neither of these methods work. Is it because of the 1TB HDD thats causing these problems or is it something else?
    Regards,
    Nick

    Well I also tried this option: http://huguesval.com/blog/2012/02/installing-windows-7-on-a-mac-without-superdri ve-with-virtualbox/
    But no luck, getting a Save MBR failed, exit code 255 when trying to clone the VM Hard drive onto BC.
    Think im going to swap the SSD to the HDD bay and put the Superdrive back in

  • Partition Problem with Boocamp

    Hello all,
    I have a mid-2009 Macbook Pro. I had just recently formatted my hard drive and installed Snow Leopard on it. There is only one hard drive and only one partition. My intention is to install Windows 7 on this new installation.
    My problem occurs right when I want to configure bootcamp. I select the amount of space for the windows partition (only 20GB for the future OS X partition remain) and it begins the partition process. Then I get this error message that says:
    "The disk cannot be partitioned because some files cannot be moved. Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."
    Considering that I just formatted my hard drive prior to installing this new copy of Snow Leopard on it, I am very confused as to why I have to back up and restore my volume again. I have tried to install Windows 7 about two years ago on this machine and it was successful....I don't know what the problem is this time around. I haven't done any updates to this version of Snow Leopard...am I at fault there? Do I need to upgrade to Lion or Mavericks and then attempt to install Windows 7?
    Any advice would be greatly appreciated!
    Thanks in advance,
    Rados

    Thanks for responding promtply turbostar.
    I have done what you suggested but it did not help. I realized I had an OS X Lion .dmg so I reinstalled that instead of Snow Leopard. I was able to partition and install Windows 7.

  • Windows Partition Problem.....

    As I am sure you all have seen this many times before....I've tried looking at other discussion threads to help solve my problem but they either didnt have the exact same problem or I couldnt fully understand the answers.  Myself, Im rather inexperienced with Mac and its OS so Layman's terms usually work best with me.  Im running Leopard right now, whatever the latest version is; 10.6.8 I believe.  I'm trying to run a parallel now since something is apparently wrong with the sound on my XP disk when I installed it, twice.  This has been a long and drawn out process for me please bare with me, for I may ask some stupid questions....
    Ok.
    So I've deleted the Windows partition in Boot Camp Assisstant successfully, however, a version on Windows (named: Untitled) is still showing up in my finder and when I hold down the Option key on the start up.  I tried erasing it with Disk Utility, it looked like it started to do something, but all it did was remount it.  Now, when I try to go through BCA its gives me the message: "The startup disk must be formatted as a single Mac OS Extended (Journaled) volume or already partitioned by Boot Camp Assistant for installing Windows." No clue as to what in THEE **** its talking about.  Of course I've tried ejecting it but it doesnt get rid of it nor does it gives me my 99GB of Mac OS back.
    Be honest, did I **** up or did I **** up bad somewhere down the line while installing windows? And what (if anything) can I do?
    Again, thanks for your time and help in advance.

    Sounds like something went wrong when you sued the BootCamp Assistant to remove the Windows partition since usually that also reassigns the used diskpace back to OSX.
    1) boot your Mac from your OSX install DVD
    2) choose your language and then 'ignore' (cancel) the installation
    3) from the Top Menu (Utilities) start Disk Utility (DU)
    4) in DU click on your harddisk (not any partition) in the left pane (the first item listed)
    5) in the right pane use the 'Partition'-Tab
    6) click to highlight on the ex-Windows partition you want to delete
    7) click on the small '-' Button at the bottom
    That should delete your former Windows partition
    After that's done successfully
    8) Drag the partition separator line until it encompasses the entire drive and then select apply.
    9) Quit Disk Utility
    10) reboot your Mac from your harddisk.
    Since you are 'fumbling' with your OSX partition you should consider having/making a backup of it before trying the a.m. procedure. Just in case.
    Stefan

  • Partitioning Problems

    I partitioned my hard drive a while back to run Ubuntu and decided I didn't feel like doing that after all. I tried to go back into Boot Camp to remove the partition but I get a notice saying "The Startup Disk cannot be partitioned or restored to a single partition." So, I figured the Disk Utility would help me out after reading some steps to solve my problem by that. So, I open disk utility and I find that I have 5 partitions labeled BOOTCAMP, DISK0S4, Linux Swap, DISK0S6, and Linux Swap. I click on BOOTCAMP and press the - button and it says "Preparing to remove volume." It remains on here indefinitely and I have to quite the application to do anything within Disk Utility. This happens on any of the partitions I try to remove. Does anyone have an idea of how to remove the partitions in place?

    I went to the Apple Store and it seems the only way to completely fix my hard drive is to copy my current HD onto an external HD and reinstall it after wiping my computer clean. Not very easy, but it would work.

  • Sliding Window Table Partitioning Problems with RANGE RIGHT, SPLIT, MERGE using Multiple File Groups

    There is misleading information in two system views (sys.data_spaces & sys.destination_data_spaces) about the physical location of data after a partitioning MERGE and before an INDEX REBUILD operation on a partitioned table. In SQL Server 2012 SP1 CU6,
    the script below (SQLCMD mode, set DataDrive  & LogDrive variables  for the runtime environment) will create a test database with file groups and files to support a partitioned table. The partition function and scheme spread the test data across
    4 files groups, an empty partition, file group and file are maintained at the start and end of the range. A problem occurs after the SWITCH and MERGE RANGE operations, the views sys.data_spaces & sys.destination_data_spaces show the logical, not the physical,
    location of data.
    --=================================================================================
    -- PartitionLabSetup_RangeRight.sql
    -- 001. Create test database
    -- 002. Add file groups and files
    -- 003. Create partition function and schema
    -- 004. Create and populate a test table
    --=================================================================================
    USE [master]
    GO
    -- 001 - Create Test Database
    :SETVAR DataDrive "D:\SQL\Data\"
    :SETVAR LogDrive "D:\SQL\Logs\"
    :SETVAR DatabaseName "workspace"
    :SETVAR TableName "TestTable"
    -- Drop if exists and create Database
    IF DATABASEPROPERTYEX(N'$(databasename)','Status') IS NOT NULL
    BEGIN
    ALTER DATABASE $(DatabaseName) SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DROP DATABASE $(DatabaseName)
    END
    CREATE DATABASE $(DatabaseName)
    ON
    ( NAME = $(DatabaseName)_data,
    FILENAME = N'$(DataDrive)$(DatabaseName)_data.mdf',
    SIZE = 10,
    MAXSIZE = 500,
    FILEGROWTH = 5 )
    LOG ON
    ( NAME = $(DatabaseName)_log,
    FILENAME = N'$(LogDrive)$(DatabaseName).ldf',
    SIZE = 5MB,
    MAXSIZE = 5000MB,
    FILEGROWTH = 5MB ) ;
    GO
    -- 002. Add file groups and files
    --:SETVAR DatabaseName "workspace"
    --:SETVAR TableName "TestTable"
    --:SETVAR DataDrive "D:\SQL\Data\"
    --:SETVAR LogDrive "D:\SQL\Logs\"
    DECLARE @nSQL NVARCHAR(2000) ;
    DECLARE @x INT = 1;
    WHILE @x <= 6
    BEGIN
    SELECT @nSQL =
    'ALTER DATABASE $(DatabaseName)
    ADD FILEGROUP $(TableName)_fg' + RTRIM(CAST(@x AS CHAR(5))) + ';
    ALTER DATABASE $(DatabaseName)
    ADD FILE
    NAME= ''$(TableName)_f' + CAST(@x AS CHAR(5)) + ''',
    FILENAME = ''$(DataDrive)\$(TableName)_f' + RTRIM(CAST(@x AS CHAR(5))) + '.ndf''
    TO FILEGROUP $(TableName)_fg' + RTRIM(CAST(@x AS CHAR(5))) + ';'
    EXEC sp_executeSQL @nSQL;
    SET @x = @x + 1;
    END
    -- 003. Create partition function and schema
    --:SETVAR TableName "TestTable"
    --:SETVAR DatabaseName "workspace"
    USE $(DatabaseName);
    CREATE PARTITION FUNCTION $(TableName)_func (int)
    AS RANGE RIGHT FOR VALUES
    0,
    15,
    30,
    45,
    60
    CREATE PARTITION SCHEME $(TableName)_scheme
    AS
    PARTITION $(TableName)_func
    TO
    $(TableName)_fg1,
    $(TableName)_fg2,
    $(TableName)_fg3,
    $(TableName)_fg4,
    $(TableName)_fg5,
    $(TableName)_fg6
    -- Create TestTable
    --:SETVAR TableName "TestTable"
    --:SETVAR BackupDrive "D:\SQL\Backups\"
    --:SETVAR DatabaseName "workspace"
    CREATE TABLE [dbo].$(TableName)(
    [Partition_PK] [int] NOT NULL,
    [GUID_PK] [uniqueidentifier] NOT NULL,
    [CreateDate] [datetime] NULL,
    [CreateServer] [nvarchar](50) NULL,
    [RandomNbr] [int] NULL,
    CONSTRAINT [PK_$(TableName)] PRIMARY KEY CLUSTERED
    [Partition_PK] ASC,
    [GUID_PK] ASC
    ) ON $(TableName)_scheme(Partition_PK)
    ) ON $(TableName)_scheme(Partition_PK)
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_GUID_PK] DEFAULT (newid()) FOR [GUID_PK]
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_CreateDate] DEFAULT (getdate()) FOR [CreateDate]
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_CreateServer] DEFAULT (@@servername) FOR [CreateServer]
    -- 004. Create and populate a test table
    -- Load TestTable Data - Seconds 0-59 are used as the Partitoning Key
    --:SETVAR TableName "TestTable"
    SET NOCOUNT ON;
    DECLARE @Now DATETIME = GETDATE()
    WHILE @Now > DATEADD(minute,-1,GETDATE())
    BEGIN
    INSERT INTO [dbo].$(TableName)
    ([Partition_PK]
    ,[RandomNbr])
    VALUES
    DATEPART(second,GETDATE())
    ,ROUND((RAND() * 100),0)
    END
    -- Confirm table partitioning - http://lextonr.wordpress.com/tag/sys-destination_data_spaces/
    SELECT
    N'DatabaseName' = DB_NAME()
    , N'SchemaName' = s.name
    , N'TableName' = o.name
    , N'IndexName' = i.name
    , N'IndexType' = i.type_desc
    , N'PartitionScheme' = ps.name
    , N'DataSpaceName' = ds.name
    , N'DataSpaceType' = ds.type_desc
    , N'PartitionFunction' = pf.name
    , N'PartitionNumber' = dds.destination_id
    , N'BoundaryValue' = prv.value
    , N'RightBoundary' = pf.boundary_value_on_right
    , N'PartitionFileGroup' = ds2.name
    , N'RowsOfData' = p.[rows]
    FROM
    sys.objects AS o
    INNER JOIN sys.schemas AS s
    ON o.[schema_id] = s.[schema_id]
    INNER JOIN sys.partitions AS p
    ON o.[object_id] = p.[object_id]
    INNER JOIN sys.indexes AS i
    ON p.[object_id] = i.[object_id]
    AND p.index_id = i.index_id
    INNER JOIN sys.data_spaces AS ds
    ON i.data_space_id = ds.data_space_id
    INNER JOIN sys.partition_schemes AS ps
    ON ds.data_space_id = ps.data_space_id
    INNER JOIN sys.partition_functions AS pf
    ON ps.function_id = pf.function_id
    LEFT OUTER JOIN sys.partition_range_values AS prv
    ON pf.function_id = prv.function_id
    AND p.partition_number = prv.boundary_id
    LEFT OUTER JOIN sys.destination_data_spaces AS dds
    ON ps.data_space_id = dds.partition_scheme_id
    AND p.partition_number = dds.destination_id
    LEFT OUTER JOIN sys.data_spaces AS ds2
    ON dds.data_space_id = ds2.data_space_id
    ORDER BY
    DatabaseName
    ,SchemaName
    ,TableName
    ,IndexName
    ,PartitionNumber
    --=================================================================================
    -- SECTION 2 - SWITCH OUT
    -- 001 - Create TestTableOut
    -- 002 - Switch out partition in range 0-14
    -- 003 - Merge range 0 -29
    -- 001. TestTableOut
    :SETVAR TableName "TestTable"
    IF OBJECT_ID('dbo.$(TableName)Out') IS NOT NULL
    DROP TABLE [dbo].[$(TableName)Out]
    CREATE TABLE [dbo].[$(TableName)Out](
    [Partition_PK] [int] NOT NULL,
    [GUID_PK] [uniqueidentifier] NOT NULL,
    [CreateDate] [datetime] NULL,
    [CreateServer] [nvarchar](50) NULL,
    [RandomNbr] [int] NULL,
    CONSTRAINT [PK_$(TableName)Out] PRIMARY KEY CLUSTERED
    [Partition_PK] ASC,
    [GUID_PK] ASC
    ) ON $(TableName)_fg2;
    GO
    -- 002 - Switch out partition in range 0-14
    --:SETVAR TableName "TestTable"
    ALTER TABLE dbo.$(TableName)
    SWITCH PARTITION 2 TO dbo.$(TableName)Out;
    -- 003 - Merge range 0 - 29
    --:SETVAR TableName "TestTable"
    ALTER PARTITION FUNCTION $(TableName)_func()
    MERGE RANGE (15);
    -- Confirm table partitioning
    -- Original source of this query - http://lextonr.wordpress.com/tag/sys-destination_data_spaces/
    SELECT
    N'DatabaseName' = DB_NAME()
    , N'SchemaName' = s.name
    , N'TableName' = o.name
    , N'IndexName' = i.name
    , N'IndexType' = i.type_desc
    , N'PartitionScheme' = ps.name
    , N'DataSpaceName' = ds.name
    , N'DataSpaceType' = ds.type_desc
    , N'PartitionFunction' = pf.name
    , N'PartitionNumber' = dds.destination_id
    , N'BoundaryValue' = prv.value
    , N'RightBoundary' = pf.boundary_value_on_right
    , N'PartitionFileGroup' = ds2.name
    , N'RowsOfData' = p.[rows]
    FROM
    sys.objects AS o
    INNER JOIN sys.schemas AS s
    ON o.[schema_id] = s.[schema_id]
    INNER JOIN sys.partitions AS p
    ON o.[object_id] = p.[object_id]
    INNER JOIN sys.indexes AS i
    ON p.[object_id] = i.[object_id]
    AND p.index_id = i.index_id
    INNER JOIN sys.data_spaces AS ds
    ON i.data_space_id = ds.data_space_id
    INNER JOIN sys.partition_schemes AS ps
    ON ds.data_space_id = ps.data_space_id
    INNER JOIN sys.partition_functions AS pf
    ON ps.function_id = pf.function_id
    LEFT OUTER JOIN sys.partition_range_values AS prv
    ON pf.function_id = prv.function_id
    AND p.partition_number = prv.boundary_id
    LEFT OUTER JOIN sys.destination_data_spaces AS dds
    ON ps.data_space_id = dds.partition_scheme_id
    AND p.partition_number = dds.destination_id
    LEFT OUTER JOIN sys.data_spaces AS ds2
    ON dds.data_space_id = ds2.data_space_id
    ORDER BY
    DatabaseName
    ,SchemaName
    ,TableName
    ,IndexName
    ,PartitionNumber  
    The table below shows the results of the ‘Confirm Table Partitioning’ query, before and after the MERGE.
    The T-SQL code below illustrates the problem.
    -- PartitionLab_RangeRight
    USE workspace;
    DROP TABLE dbo.TestTableOut;
    USE master;
    ALTER DATABASE workspace
    REMOVE FILE TestTable_f3 ;
    -- ERROR
    --Msg 5042, Level 16, State 1, Line 1
    --The file 'TestTable_f3 ' cannot be removed because it is not empty.
    ALTER DATABASE workspace
    REMOVE FILE TestTable_f2 ;
    -- Works surprisingly!!
    use workspace;
    ALTER INDEX [PK_TestTable] ON [dbo].[TestTable] REBUILD PARTITION = 2;
    --Msg 622, Level 16, State 3, Line 2
    --The filegroup "TestTable_fg2" has no files assigned to it. Tables, indexes, text columns, ntext columns, and image columns cannot be populated on this filegroup until a file is added.
    --The statement has been terminated.
    If you run ALTER INDEX REBUILD before trying to remove files from File Group 3, it works. Rerun the database setup script then the code below.
    -- RANGE RIGHT
    -- Rerun PartitionLabSetup_RangeRight.sql before the code below
    USE workspace;
    DROP TABLE dbo.TestTableOut;
    ALTER INDEX [PK_TestTable] ON [dbo].[TestTable] REBUILD PARTITION = 2;
    USE master;
    ALTER DATABASE workspace
    REMOVE FILE TestTable_f3;
    -- Works as expected!!
    The file in File Group 2 appears to contain data but it can be dropped. Although the system views are reporting the data in File Group 2, it still physically resides in File Group 3 and isn’t moved until the index is rebuilt. The RANGE RIGHT function means
    the left file group (File Group 2) is retained when splitting ranges.
    RANGE LEFT would have retained the data in File Group 3 where it already resided, no INDEX REBUILD is necessary to effectively complete the MERGE operation. The script below implements the same partitioning strategy (data distribution between partitions)
    on the test table but uses different boundary definitions and RANGE LEFT.
    --=================================================================================
    -- PartitionLabSetup_RangeLeft.sql
    -- 001. Create test database
    -- 002. Add file groups and files
    -- 003. Create partition function and schema
    -- 004. Create and populate a test table
    --=================================================================================
    USE [master]
    GO
    -- 001 - Create Test Database
    :SETVAR DataDrive "D:\SQL\Data\"
    :SETVAR LogDrive "D:\SQL\Logs\"
    :SETVAR DatabaseName "workspace"
    :SETVAR TableName "TestTable"
    -- Drop if exists and create Database
    IF DATABASEPROPERTYEX(N'$(databasename)','Status') IS NOT NULL
    BEGIN
    ALTER DATABASE $(DatabaseName) SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    DROP DATABASE $(DatabaseName)
    END
    CREATE DATABASE $(DatabaseName)
    ON
    ( NAME = $(DatabaseName)_data,
    FILENAME = N'$(DataDrive)$(DatabaseName)_data.mdf',
    SIZE = 10,
    MAXSIZE = 500,
    FILEGROWTH = 5 )
    LOG ON
    ( NAME = $(DatabaseName)_log,
    FILENAME = N'$(LogDrive)$(DatabaseName).ldf',
    SIZE = 5MB,
    MAXSIZE = 5000MB,
    FILEGROWTH = 5MB ) ;
    GO
    -- 002. Add file groups and files
    --:SETVAR DatabaseName "workspace"
    --:SETVAR TableName "TestTable"
    --:SETVAR DataDrive "D:\SQL\Data\"
    --:SETVAR LogDrive "D:\SQL\Logs\"
    DECLARE @nSQL NVARCHAR(2000) ;
    DECLARE @x INT = 1;
    WHILE @x <= 6
    BEGIN
    SELECT @nSQL =
    'ALTER DATABASE $(DatabaseName)
    ADD FILEGROUP $(TableName)_fg' + RTRIM(CAST(@x AS CHAR(5))) + ';
    ALTER DATABASE $(DatabaseName)
    ADD FILE
    NAME= ''$(TableName)_f' + CAST(@x AS CHAR(5)) + ''',
    FILENAME = ''$(DataDrive)\$(TableName)_f' + RTRIM(CAST(@x AS CHAR(5))) + '.ndf''
    TO FILEGROUP $(TableName)_fg' + RTRIM(CAST(@x AS CHAR(5))) + ';'
    EXEC sp_executeSQL @nSQL;
    SET @x = @x + 1;
    END
    -- 003. Create partition function and schema
    --:SETVAR TableName "TestTable"
    --:SETVAR DatabaseName "workspace"
    USE $(DatabaseName);
    CREATE PARTITION FUNCTION $(TableName)_func (int)
    AS RANGE LEFT FOR VALUES
    -1,
    14,
    29,
    44,
    59
    CREATE PARTITION SCHEME $(TableName)_scheme
    AS
    PARTITION $(TableName)_func
    TO
    $(TableName)_fg1,
    $(TableName)_fg2,
    $(TableName)_fg3,
    $(TableName)_fg4,
    $(TableName)_fg5,
    $(TableName)_fg6
    -- Create TestTable
    --:SETVAR TableName "TestTable"
    --:SETVAR BackupDrive "D:\SQL\Backups\"
    --:SETVAR DatabaseName "workspace"
    CREATE TABLE [dbo].$(TableName)(
    [Partition_PK] [int] NOT NULL,
    [GUID_PK] [uniqueidentifier] NOT NULL,
    [CreateDate] [datetime] NULL,
    [CreateServer] [nvarchar](50) NULL,
    [RandomNbr] [int] NULL,
    CONSTRAINT [PK_$(TableName)] PRIMARY KEY CLUSTERED
    [Partition_PK] ASC,
    [GUID_PK] ASC
    ) ON $(TableName)_scheme(Partition_PK)
    ) ON $(TableName)_scheme(Partition_PK)
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_GUID_PK] DEFAULT (newid()) FOR [GUID_PK]
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_CreateDate] DEFAULT (getdate()) FOR [CreateDate]
    ALTER TABLE [dbo].$(TableName) ADD CONSTRAINT [DF_$(TableName)_CreateServer] DEFAULT (@@servername) FOR [CreateServer]
    -- 004. Create and populate a test table
    -- Load TestTable Data - Seconds 0-59 are used as the Partitoning Key
    --:SETVAR TableName "TestTable"
    SET NOCOUNT ON;
    DECLARE @Now DATETIME = GETDATE()
    WHILE @Now > DATEADD(minute,-1,GETDATE())
    BEGIN
    INSERT INTO [dbo].$(TableName)
    ([Partition_PK]
    ,[RandomNbr])
    VALUES
    DATEPART(second,GETDATE())
    ,ROUND((RAND() * 100),0)
    END
    -- Confirm table partitioning - http://lextonr.wordpress.com/tag/sys-destination_data_spaces/
    SELECT
    N'DatabaseName' = DB_NAME()
    , N'SchemaName' = s.name
    , N'TableName' = o.name
    , N'IndexName' = i.name
    , N'IndexType' = i.type_desc
    , N'PartitionScheme' = ps.name
    , N'DataSpaceName' = ds.name
    , N'DataSpaceType' = ds.type_desc
    , N'PartitionFunction' = pf.name
    , N'PartitionNumber' = dds.destination_id
    , N'BoundaryValue' = prv.value
    , N'RightBoundary' = pf.boundary_value_on_right
    , N'PartitionFileGroup' = ds2.name
    , N'RowsOfData' = p.[rows]
    FROM
    sys.objects AS o
    INNER JOIN sys.schemas AS s
    ON o.[schema_id] = s.[schema_id]
    INNER JOIN sys.partitions AS p
    ON o.[object_id] = p.[object_id]
    INNER JOIN sys.indexes AS i
    ON p.[object_id] = i.[object_id]
    AND p.index_id = i.index_id
    INNER JOIN sys.data_spaces AS ds
    ON i.data_space_id = ds.data_space_id
    INNER JOIN sys.partition_schemes AS ps
    ON ds.data_space_id = ps.data_space_id
    INNER JOIN sys.partition_functions AS pf
    ON ps.function_id = pf.function_id
    LEFT OUTER JOIN sys.partition_range_values AS prv
    ON pf.function_id = prv.function_id
    AND p.partition_number = prv.boundary_id
    LEFT OUTER JOIN sys.destination_data_spaces AS dds
    ON ps.data_space_id = dds.partition_scheme_id
    AND p.partition_number = dds.destination_id
    LEFT OUTER JOIN sys.data_spaces AS ds2
    ON dds.data_space_id = ds2.data_space_id
    ORDER BY
    DatabaseName
    ,SchemaName
    ,TableName
    ,IndexName
    ,PartitionNumber
    --=================================================================================
    -- SECTION 2 - SWITCH OUT
    -- 001 - Create TestTableOut
    -- 002 - Switch out partition in range 0-14
    -- 003 - Merge range 0 -29
    -- 001. TestTableOut
    :SETVAR TableName "TestTable"
    IF OBJECT_ID('dbo.$(TableName)Out') IS NOT NULL
    DROP TABLE [dbo].[$(TableName)Out]
    CREATE TABLE [dbo].[$(TableName)Out](
    [Partition_PK] [int] NOT NULL,
    [GUID_PK] [uniqueidentifier] NOT NULL,
    [CreateDate] [datetime] NULL,
    [CreateServer] [nvarchar](50) NULL,
    [RandomNbr] [int] NULL,
    CONSTRAINT [PK_$(TableName)Out] PRIMARY KEY CLUSTERED
    [Partition_PK] ASC,
    [GUID_PK] ASC
    ) ON $(TableName)_fg2;
    GO
    -- 002 - Switch out partition in range 0-14
    --:SETVAR TableName "TestTable"
    ALTER TABLE dbo.$(TableName)
    SWITCH PARTITION 2 TO dbo.$(TableName)Out;
    -- 003 - Merge range 0 - 29
    :SETVAR TableName "TestTable"
    ALTER PARTITION FUNCTION $(TableName)_func()
    MERGE RANGE (14);
    -- Confirm table partitioning
    -- Original source of this query - http://lextonr.wordpress.com/tag/sys-destination_data_spaces/
    SELECT
    N'DatabaseName' = DB_NAME()
    , N'SchemaName' = s.name
    , N'TableName' = o.name
    , N'IndexName' = i.name
    , N'IndexType' = i.type_desc
    , N'PartitionScheme' = ps.name
    , N'DataSpaceName' = ds.name
    , N'DataSpaceType' = ds.type_desc
    , N'PartitionFunction' = pf.name
    , N'PartitionNumber' = dds.destination_id
    , N'BoundaryValue' = prv.value
    , N'RightBoundary' = pf.boundary_value_on_right
    , N'PartitionFileGroup' = ds2.name
    , N'RowsOfData' = p.[rows]
    FROM
    sys.objects AS o
    INNER JOIN sys.schemas AS s
    ON o.[schema_id] = s.[schema_id]
    INNER JOIN sys.partitions AS p
    ON o.[object_id] = p.[object_id]
    INNER JOIN sys.indexes AS i
    ON p.[object_id] = i.[object_id]
    AND p.index_id = i.index_id
    INNER JOIN sys.data_spaces AS ds
    ON i.data_space_id = ds.data_space_id
    INNER JOIN sys.partition_schemes AS ps
    ON ds.data_space_id = ps.data_space_id
    INNER JOIN sys.partition_functions AS pf
    ON ps.function_id = pf.function_id
    LEFT OUTER JOIN sys.partition_range_values AS prv
    ON pf.function_id = prv.function_id
    AND p.partition_number = prv.boundary_id
    LEFT OUTER JOIN sys.destination_data_spaces AS dds
    ON ps.data_space_id = dds.partition_scheme_id
    AND p.partition_number = dds.destination_id
    LEFT OUTER JOIN sys.data_spaces AS ds2
    ON dds.data_space_id = ds2.data_space_id
    ORDER BY
    DatabaseName
    ,SchemaName
    ,TableName
    ,IndexName
    ,PartitionNumber
    The table below shows the results of the ‘Confirm Table Partitioning’ query, before and after the MERGE.
    The data in the File and File Group to be dropped (File Group 2) has already been switched out; File Group 3 contains the data so no index rebuild is needed to move data and complete the MERGE.
    RANGE RIGHT would not be a problem in a ‘Sliding Window’ if the same file group is used for all partitions, when they are created and dropped it introduces a dependency on full index rebuilds. Larger tables are typically partitioned and a full index rebuild
    might be an expensive operation. I’m not sure how a RANGE RIGHT partitioning strategy could be implemented, with an ascending partitioning key, using multiple file groups without having to move data. Using a single file group (multiple files) for all partitions
    within a table would avoid physically moving data between file groups; no index rebuild would be necessary to complete a MERGE and system views would accurately reflect the physical location of data. 
    If a RANGE RIGHT partition function is used, the data is physically in the wrong file group after the MERGE assuming a typical ascending partitioning key, and the 'Data Spaces' system views might be misleading. Thanks to Manuj and Chris for a lot of help
    investigating this.
    NOTE 10/03/2014 - The solution
    The solution is so easy it's embarrassing, I was using the wrong boundary points for the MERGE (both RANGE LEFT & RANGE RIGHT) to get rid of historic data.
    -- Wrong Boundary Point Range Right
    --ALTER PARTITION FUNCTION $(TableName)_func()
    --MERGE RANGE (15);
    -- Wrong Boundary Point Range Left
    --ALTER PARTITION FUNCTION $(TableName)_func()
    --MERGE RANGE (14);
    -- Correct Boundary Pounts for MERGE
    ALTER PARTITION FUNCTION $(TableName)_func()
    MERGE RANGE (0); -- or -1 for RANGE LEFT
    The empty, switched out partition (on File Group 2) is then MERGED with the empty partition maintained at the start of the range and no data movement is necessary. I retract the suggestion that a problem exists with RANGE RIGHT Sliding Windows using multiple
    file groups and apologize :-)

    Hi Paul Brewer,
    Thanks for your post and glad to hear that the issue is resolved. It is kind of you post a reply to share your solution. That way, other community members could benefit from your sharing.
    Regards.
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Partition  Problem :(Srce trgt Disappear )

    Hi All
    I created partition , It is some times showing and some times disappearing ,if i did any modification sequantly im getting this , right now its not showing any thing under paririon either source database , targt database both r disappearing , I retarted the server also wat may be the problem , I think after loading the data into cube we cant do modification , if we want to do we have to clear th data and do the modification ,dim buld etc...
    so wat can i do to show srce and trgt databases under the parition
    this is really headache,,, for all the trgt cubes happening like this , experts plz help on his;...........
    Thanks

    Is it disappearing in EAS? I had a lot of issues with seeing partitions in EAS in v7.

  • Range Partition Problem

    I have a table on a Oracle 10g R2 Database that has id numbers, the table was divided on two tablespaces. Four partitions were made on the first tablespace, e.g. id numbers 10000, 20000, 30000, 40000 while the other tablespace has three partitions 50000, 60000, 70000. There is no space left in this tablespace to create another partition of 80000. The problem is that when users insert into this table, they get the following error, ORA-14400 inserted partition key does not map to any partition. While on em console I can see the following message, 'This Table Contains Columns That Are In Partially Dropped State. No Operations Are Premitted Until The Drop Operations Completes'. So do I need to assign another tablespace or increase the size of that tablespace? If yes, then which is better in terms of preformance and why?
    Thank you
    Adith

    Do you have a maxvalue partition? For example is there a partition that says 70000->maxvalue? If there isn't and because you don't have space then you need to split the 70000 partition and have a maxvalue partition, but if you don't have space then how are you going to insert the data? If you split the partition then you will need to rebuild global indexes if any or create new local ones. On the other hand why don't you just make the tablespace bigger and add a 70000->80000 partition? Whether you want to create a new tablespace is up to you and a question of why were the two tablespaces created in the first place. Don't know what the 2nd error is from apart from it sounds like a column was dropped on the table.It is dangerous to do operations like that (table DDL) while transactions are still occurring. The other one to watch for is changing or adding a column with a default value which causes every row to be updated in the table and takes out an exclusive lock.

Maybe you are looking for