"Sliding window" with table partition

Hi,
I have a partitioned table with one partition containing history data and the other contains current (on-line) data. The table is range partitioned with date as the key and I have enabled row movements.
I would like to have the on-line partition to store data for the last 24 months. When data (inserted earlier) gets out of date, I would like the rows to be moved to the history partition.
My question is: what is the best implementation for such a "sliding window" technique?
Do I have to update the partition key (date) for all rows to trigger the row movements?
/johan

My suggestion would be to define a second column of type number on which the
partitioning is based, lets say 0 for actual and 1 for history data.
Then you can schedule a job running over night or every weekend doing the
update job
update tab set old_new_flag = 1 where old_new_flag = 0
and insert_ts < sysdate - 365 * 2.

Similar Messages

  • Problem with table partitioning

    Hi,
    I am facing an issue regarding table partitioning. I splitted a partition on a table and added a new one using below command:
    ALTER TABLE infx.ncr_item_input SPLIT PARTITION MCS AT ('MID')
    INTO (PARTITION MCS,PARTITION MID);
    Later I faced some issue and dropped the partiton using below command:
    alter table infx.ncr_item_input drop partition MID;
    Now when I am trying to add the partiton again using the first command, I am getting error: ORA-14080: partition cannot be split along the specified high bound.
    Although I had dropped the partiton and it is no more there in the table, it still exists somewhere in database and that I checked in the view dba_tab_partitions where I can see the values as:
    Partiton_name High_value
    MCS 'MID'
    How do I resolve this issue? Can someone help please. Appreciate quick response.
    Thanks,
    Sonam

    >
    Now when I am trying to add the partiton again using the first command, I am getting error: ORA-14080: partition cannot be split along the specified high bound.
    Although I had dropped the partiton and it is no more there in the table, it still exists somewhere in database and that I checked in the view dba_tab_partitions where I can see the values as:
    Partiton_name High_value
    MCS 'MID'
    How do I resolve this issue?
    >
    Not easily. You can recreate the table like I show below. Or you can rename the MCS partition and add a new MCS MAXVALUE partition.
    alter table split_test rename partition mcs to mcs1
    alter table split_test add partition MCS values less than (maxvalue)Then you need to merge the two partitions together.
    The problem you have is because you have to split partitions on a value that is IN the range of data for the partition.
    The value 'MID' is now the HIGH_VALUE for the partition MCS so you can't split on it because that value isn't part of the data.
    Try this samle code and you will see what is happening.
    CREATE TABLE split_test (
      id            NUMBER(10),
      created_date  DATE,
      lookup_id     NUMBER(10),
      data          VARCHAR2(50)
    PARTITION BY RANGE (data)
    (PARTITION mcs VALUES LESS THAN (MAXVALUE));
    select * from user_tab_partitions where table_name = 'SPLIT_TEST'The high value for MCS is now MAXVALUE so do the split
    ALTER TABLE SPLIT_TEST SPLIT PARTITION MCS AT ('MID')
    INTO (PARTITION MCS,PARTITION MID);
    select * from user_tab_partitions where table_name = 'SPLIT_TEST'The high value for MCS is now 'MID' and the high value for MID is now MAXVALUE.
    If you drop the MID partition the high value for MCS is still 'MID' so you cannot split it on 'MID' since that isn't in the range.
    Your SPLIT command should have put MID before MCS. That is, you should have used
    ALTER TABLE SPLIT_TEST SPLIT PARTITION MCS AT ('MID')
    INTO (PARTITION MID,PARTITION MCS);
    select * from user_tab_partitions where table_name = 'SPLIT_TEST'Now the high value for MCS is still MAXVALUE and the high value for MID is 'MID; the reverse of what you had before.
    Now you can drop MID and split MCS again if you needed to.
    See ALTER TABLE in the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_3001.htm#i2113516

  • Need help with table partitions

    Hi all,
    I'm new at partitions and tablespaces and I've been asked to create a partition for a table. First off, here's a sample table that I have.
    create table M_TRANS  (
       TRAN_ID NUMBER,
       MONTH_KEY INTEGER,
       ACCOUNT_KEY INTEGER,
       ACCOUNT_NUMBER CHAR(8),
       LINE_KEY VARCHAR2(40),
       SERVICE_TYPE VARCHAR2(10)
    )I need to create a range partition based on Month_Key and list sub-partition based on last char of Line_Key.
    MONTH_KEY has a data format of "YYYYMM" (200802).
    LINE_KEY's last char should be in 0-9 / A-Z. 1 partition for each number 0-9 and 1 partition for alphabet values.
    Upon reading articles, samples on this particular subject, I came up with this...
    create table M_TRANS  (
       TRAN_ID                    NUMBER,
       MONTH_KEY            INTEGER,
       ACCOUNT_KEY          INTEGER,
       ACCOUNT_NUMBER       CHAR(8),
       LINE_KEY             NUMBER,
       SERVICE_TYPE         VARCHAR2(10)
    PARTITION BY RANGE(MONTH_KEY)
    SUBPARTITION BY LIST (LINE_KEY)
    SUBPARTITION TEMPLATE(
    SUBPARTITION P_0 VALUES 1 TABLESPACE TS_0,
    SUBPARTITION P_1 VALUES 2 TABLESPACE TS_1,
    SUBPARTITION P_2 VALUES 3 TABLESPACE TS_2,
    SUBPARTITION P_3 VALUES 4 TABLESPACE TS_3,
    SUBPARTITION P_4 VALUES 5 TABLESPACE TS_4,
    SUBPARTITION P_5 VALUES 6 TABLESPACE TS_5,
    SUBPARTITION P_6 VALUES 7 TABLESPACE TS_6,
    SUBPARTITION P_7 VALUES 8 TABLESPACE TS_7,
    SUBPARTITION P_8 VALUES 9 TABLESPACE TS_8,
    SUBPARTITION P_9 VALUES 0 TABLESPACE TS_9,
    SUBPARTITION P_AZ VALUES ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') TABLESPACE TS_AZ
    PARTITION M_JAN VALUES 'JAN'
    PARTITION M_FEB VALUES 'FEB'
    PARTITION M_MAR VALUES 'MAR'
    PARTITION M_APR VALUES 'APR'
    PARTITION M_MAY VALUES 'MAY'
    PARTITION M_JUN VALUES 'JUN'
    PARTITION M_JUL VALUES 'JUL'
    PARTITION M_AUG VALUES 'AUG'
    PARTITION M_SEP VALUES 'SEP'
    PARTITION M_OCT VALUES 'OCT'
    PARTITION M_NOV VALUES 'NOV'
    PARTITION M_DEC VALUES 'DEC'
    );The only problem is that since the MONTH_KEY has a format of "YYYYMM", how do I compare just the last 2 numbers. Same goes with the LINE_KEY.
    Can some help me? Thanks.
    Regards,
    A.Sandiego

    In 10g and earlier, you need to create separate columns for the last 1-2 characters and use those columns as partitioning keys.
    In 11g, you can use virtual columns:
    CREATE TABLE M_TRANS (
       TRAN_ID NUMBER,
       MONTH_KEY INTEGER,
       LINE_KEY VARCHAR2(40),
       MONTH_ONLY as ((month_key/100-trunc(month_key/100))*100),
       LAST_CHAR as (upper(substr(line_key,length(line_key),1)))
    PARTITION BY RANGE(MONTH_ONLY)
    SUBPARTITION BY LIST (LAST_CHAR)
       SUBPARTITION TEMPLATE (
       SUBPARTITION P_0 VALUES ('1'),
       SUBPARTITION P_1 VALUES ('2'),
       SUBPARTITION P_2 VALUES ('3'),
       SUBPARTITION P_AZ VALUES ('A','B','C')
    PARTITION M_JAN VALUES LESS THAN (2),
    PARTITION M_FEB VALUES LESS THAN (3),
    PARTITION M_MAR VALUES LESS THAN (4)

  • How to  display a popup window with tables values to input

    hi experts,
    I need to display a popup  displaying values of table in UI.
    Is there any function module to dispaly a popup.

    Hi Ashwini,
    There is no function module to call the pop up in CRM UI.
    You need to follow following steps:
    1. Create an event handler for your click event on which you want to call this pop up.
    2. Create a Z component with a table view and in the table view, define the context nodes and attributes you want to use in the  pop up view.
    3. In the .htm coding of this view, define the layout and buttons you want on this pop up view.
    4. Go to Runtime Repositry, create a ViewSet, ViewArea and in this View Area add the table view you created just now.
    5. Create a MainWindow in the Runtime repositry and add the same table view you created.
    6. Now come back to the main Component and add Component Usage (e.g CUXYZ) .......
    7. While Creating the Component Usage, mention Component Name as your Z Component name and in the Interface View, choose MainWindow from the F4 help.
    8. Go to event handler method of your main Component/View and create separate methods for creating your pop up and handling the close event of the pop up as well.
    For seeing the coding, you cna refer to any standard pop up handling and do the coding in similar format.
    I hope this will helps you.
    Thanks
    Vishal

  • 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

  • Sliding window sanario in PTF vs Availability of recently loaded data in the staging table for reporting purpose

    Hello everybody, I am a SQL server DBA and I am planning to implement table partitioning on some of our large tables in our data warehouse. I
    am thinking to design it using the sliding window scenario. I do have one concern though; I think the staging tables we use for new data loading and for switching out the old partition are going to be non-partitioned, right?? Well, I don't have an issue with
    the second staging table that is used for switching out the old partition. My concern is on the first staging table that we use it for switch in purpose, since this table is non-partitioned and holding the new data, HOW ARE WE GOING TO USE/access THIS DATA
    FOR REPORTING PURPOSE before we switch in to our target partitioned table????? say, this staging table is holding a one month worth of data and we will be switching it at the end of the month. Correct me if I am wrong okay, one way I can think of accessing
    this non-portioned staging table is by creating views, which we don’t want to change our codes.
    Do you guys share us your thoughts, experiences???
    We really appreciate your help.

    Hi BG516,
    According to your description, you need to implement table partitioning on some of our large tables in our data warehouse, the problem is that you need the partition table only hold a month data, please correct me if I have anything misunderstanding.
    In this case, you can create non-partitioned table, import the records which age is more than one month into the new created table. Leave the records which age is less than one month on the table in your data warehouse Then you need to create job to
    copy the data from partition table into non-partitioned table at the last day of each month. In this case, the partition table only contain the data for current month. Please refer to the link below to see the details.
    http://blog.sqlauthority.com/2007/08/15/sql-server-insert-data-from-one-table-to-another-table-insert-into-select-select-into-table/
    https://msdn.microsoft.com/en-us/library/ms190268.aspx?f=255&MSPPError=-2147217396
    If this is not what you want, please provide us more information, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Table Partitions and Rolling Window: free space not reclaimed

    I have a couple of processes that involve the rolling window scenario where we drop an old partition and add a new partition monthly. We are seeing, however, that free space is not being reclaimed, and so I keep having to feed new datafiles into the tablespace (which is LMT). I was (mistakenly, it seems) under the impression that dropping a partition frees up that space for re-use.
    We're currently on Oracle 10gR2 (10.2.0.2), but these tablespaces were orginally created in 9i. I've read that one solution is to implement "table shrinking," however I also see that is only available on tables in an ASSM tablespace. I see that ASSM is the default for tablespaces in 10gR2, but since my tablespaces were created in 9i, I assume they are not ASSM.
    I'd like to see what other people think of this scenario. Surely a lot of people do the rolling window scenario and need space reclaimed.

    No, it is of concern because Sanadra was messing with the partitions. She could have inadvertantly caused something to happen, in this case the free-space issue, and it's imperative to get all of the details.
    My iMac 27' Late-2012 does not have a fusion drive, yet shows that the type is "internal" the original poster doesn't indicate that.

  • Issue with updating partitioned table

    Hi,
    Anyone seen this bug with updating partitioned tables.
    Its very esoteric - its occurs when we update a partitioned table using a join to a temp table (not non-temp table) when the join has multiple joins and you're updating the partitoned column that isn't the first column in the primary key and the table contains a bit field. We've tried changing just one of these features and the bug disappears.
    We've tested this on 15.5 and 15.7 SP122 and the error occurs in both of them.
    Here's the test case - it does the same operation of a partitioned table and a non-partitioned table, but the partitioned table shows and error of "Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'".
    I'd be interested if anyone has seen this and has a version of Sybase without the issue.
    Unfortunately when it happens on a replicated table - it takes down rep server.
    CREATE TABLE #table1
        (   PK          char(8) null,
            FileDate        date,
            changed         bit
    CREATE TABLE partitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    LOCK DATAROWS
      PARTITION BY RANGE (ValidTo)
      ( p2014 VALUES <= ('20141231') ON [default],
      p2015 VALUES <= ('20151231') ON [default],
      pMAX VALUES <= (MAX) ON [default]
    CREATE UNIQUE CLUSTERED INDEX pk
      ON partitioned(PK, ValidFrom, ValidTo)
      LOCAL INDEX
    CREATE TABLE unpartitioned  (
      PK         char(8) NOT NULL,
      ValidFrom     date DEFAULT current_date() NOT NULL,
      ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    LOCK DATAROWS
    CREATE UNIQUE CLUSTERED INDEX pk
      ON unpartitioned(PK, ValidFrom, ValidTo)
    insert partitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert unpartitioned
    select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    insert #table1
    select "ET00jPzh", "Jan 15 2015", 1
    union all
    select "ET00jPzh", "Jan 15 2015", 1
    go
    update partitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join partitioned p on (p.PK = t.PK)
    where  p.ValidTo = '99991231'
    and    t.changed = 1
    go
    update unpartitioned
    set    ValidTo = dateadd(dd,-1,FileDate)
    from   #table1 t
    inner  join unpartitioned u on (u.PK = t.PK)
    where  u.ValidTo = '99991231'
    and    t.changed = 1
    go
    drop table #table1
    go
    drop table partitioned
    drop table unpartitioned
    go

    wrt to replication - it is a bit unclear as not enough information has been stated to point out what happened.  I also am not sure that your DBA's are accurately telling you what happened - and may have made the problem worse by not knowing themselves what to do - e.g. 'losing' the log points to fact that someone doesn't know what they should.   You can *always* disable the replication secondary truncation point and resync a standby system, so claims about 'losing' the log are a bit strange to be making. 
    wrt to ASE versions, I suspect if there are any differences, it may have to do with endian-ness and not the version of ASE itself.   There may be other factors.....but I would suggest the best thing would be to open a separate message/case on it.
    Adaptive Server Enterprise/15.7/EBF 23010 SMP SP130 /P/X64/Windows Server/ase157sp13x/3819/64-bit/OPT/Fri Aug 22 22:28:21 2014:
    -- testing with tinyint
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed tinyint
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned
    -- duplicating with 'int'
    1> use demo_db
    1>
    2> CREATE TABLE #table1
    3>     (   PK          char(8) null,
    4>         FileDate        date,
    5> --        changed         bit
    6>  changed int
    7>     )
    8>
    9> CREATE TABLE partitioned  (
    10>   PK         char(8) NOT NULL,
    11>   ValidFrom     date DEFAULT current_date() NOT NULL,
    12>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL
    13>   )
    14>
    15> LOCK DATAROWS
    16>   PARTITION BY RANGE (ValidTo)
    17>   ( p2014 VALUES <= ('20141231') ON [default],
    18>   p2015 VALUES <= ('20151231') ON [default],
    19>   pMAX VALUES <= (MAX) ON [default]
    20>         )
    21>
    22> CREATE UNIQUE CLUSTERED INDEX pk
    23>   ON partitioned(PK, ValidFrom, ValidTo)
    24>   LOCAL INDEX
    25>
    26> CREATE TABLE unpartitioned  (
    27>   PK         char(8) NOT NULL,
    28>   ValidFrom     date DEFAULT current_date() NOT NULL,
    29>   ValidTo       date DEFAULT '31-Dec-9999' NOT NULL,
    30>   )
    31> LOCK DATAROWS
    32>
    33> CREATE UNIQUE CLUSTERED INDEX pk
    34>   ON unpartitioned(PK, ValidFrom, ValidTo)
    35>
    36> insert partitioned
    37> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    38>
    39> insert unpartitioned
    40> select "ET00jPzh", "Jan  7 2015", "Dec 31 9999"
    41>
    42> insert #table1
    43> select "ET00jPzh", "Jan 15 2015", 1
    44> union all
    45> select "ET00jPzh", "Jan 15 2015", 1
    (1 row affected)
    (1 row affected)
    (2 rows affected)
    1>
    2> update partitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join partitioned p on (p.PK = t.PK)
    6> where  p.ValidTo = '99991231'
    7> and    t.changed = 1
    Msg 2601, Level 14, State 6:
    Server 'PHILLY_ASE', Line 2:
    Attempt to insert duplicate key row in object 'partitioned' with unique index 'pk'
    Command has been aborted.
    (0 rows affected)
    1>
    2> update unpartitioned
    3> set    ValidTo = dateadd(dd,-1,FileDate)
    4> from   #table1 t
    5> inner  join unpartitioned u on (u.PK = t.PK)
    6> where  u.ValidTo = '99991231'
    7> and    t.changed = 1
    (1 row affected)
    1>
    2> drop table #table1
    1>
    2> drop table partitioned
    3> drop table unpartitioned

  • Sliding window for historical data purge in multiple related tables

    All,
    It is a well known question of how to efficiently BACKUP and PURGE historical data based on a sliding window.
    I have a group of tables, they all have to be backed up and purged based on a sliding time window. These tables have FKs related to each other and these FKs are not necessary the timestamp column. I am considering using partition based on the timestamp column for all these tables, so i can export those out of date partitions and then drop them. The price I have to pay by this design is that timestamp column is actually duplicated many times among parent table, child tables, grand-child tables although the value is the same, but I have to do the partition based on this column in all tables.
    It's very much alike the statspack tables, one stats$snapshot and many child tables to store actual statistic data. I am just wondering how statspack.purge does this, since using DELETE statement is very inefficient and time consuming. In statspack tables, snap_time is only stored in stats$snapshot table, not everywhere in it's child table, and they are not partitioned. I guess the procedure is using DELETE statement.
    Any thought on other good design options? Or how would you optimize statspack tables historical data backup and purge? Thanks!

    hey oracle gurus, any thoughts?

  • Accessing ext3 partitions from Windows with FS Driver

    Hi everyone,
    I have a slight probem. I'm dual-booting ArchLinux and Windows. Here is my partition scheme:
    /dev/sda1 (NTFS) Lenovo Recovery partition
    /dev/sda2 (NTFS) Windows
    /dev/sda3 (ext2) /boot
    /dev/sda5 (JFS) /
    /dev/sda6 (JFS) /home
    /dev/sda7 (ext3) [documents] partition mounted on /media/data
    /dev/sda8 (swap) swap
    Everything works fine on the Linux side (of course).
    The problem is that I use http://www.fs-driver.org/ to access my documents (/dev/sda7) from Windows.
    This worked fine (I was using Kubuntu) but now I had to format the disk in order to install ArchLinux and FS Driver would not recognize the "documents" partition.
    I think it might be because the partition is not PRIMARY but LOGICAL. Is there a way to fix this without reformatting everything (just formatting /dev/sda7 is fine with me) ?
    Thank you in advance
    Last edited by yms (2009-09-11 14:08:17)

    Hi, I just stumbled across this one and thought I'd throw in my two cents....
    Something I've found about windows is that it's -very- picky about partition sizes.
    For  instance, on a new system of mine, I did dual booting windows/Linux from partitions on the same hard drive.
    The windows partition was first.  After creating my Linux partitions, windows would no longer boot, said the partition table was corrupt.
    (All partitions were primary)
    The solution?  I created my Linux partitions using windows tools (which wasted around 10Gigs of hard drive space) and finished them off with linux tools.
    Everything worked fine then.
    Bottom line, Linux can use partition sizes that (some?) windows will refuse to use.
    You should be able to simply remove the last 2 partitions (sda7 and sda8).  Any partitioner should work (gparted, cfdisk, windows logical disk manager).  Don't forget to move your documents.  If you do this from your installed Linux system, don't forget to disable your swap space or you won't be able to remove that partition.
    ...might also need to unmount /dev/sda7 to use cfdisk... I think gparted does this automatically but don't quote me on that one...
    Then you can recreate the last two partitions using windows.  Then use Linux to set their types, format them, and restore your documents.
    Just to simplify things with the swap space, it's probably easier to use a live distro than your installed Linux.
    If your fstab uses UUID's, don't forget to update as formatting will assign new UUID's to the partitions.
    ... should solve at least half the problem.
    laters,
    b

  • How to open new window with required size when clicking on image in a table

    Hi,
    There is an image column in advanced table. i want to open new window with required parameters(size, toolbar, status bar,etc..) and with that transaction context.
    can any one help plzzzzzzzz?
    Thanks
    Raju

    You can also use OAF js function to open modal pop up:
    openWindow(self, '<url>','longTipWin', {width:900, height:400}, true); return false;
    --Mukul                                                                                                                                                                                                                                                                                                                                   

  • External Dvd Install Windows 7 With MBR Partition

    I have imac, macmini and macbook pro. My dvd rom on my imac has a failure and does not read most of the dvd/cd roms. Now i have bought macosx mountain lion and made a clean install. Now i want to install windows 7/windows 8 to my imac with bootcamp. When i try to install it from external dvd rom
    it shows windows and efi icon. But when i want to install it with windows selection it does not boot. Or does only show efi dvd icon.
    If i try to install it from usb stick it only shows efi install. And i want to install it normal mbr record but i cannot do it in imac.
    And when i try above tests in my mac mini server it does them all normally. It can install everything in normal mode windos 7 or 8 what ever it doesn't care. . Below picture is taken from mac mini server.  My dvd rom is broken and i understand imacs bios does only install normal mbr via internal dvd rom. But now how can i install without internal dvd rom with mbr partition ?
    Below picture is taken from mac mini server i want to install with windows selection ???  Any ideas?

    Please re-post on the Boot Camp forum, that is where the Boot Camp and MS Windows gurus hang out. 

  • No Booting of Windows 8.1 After GPT Partition Resizing with Easeus Partition Master 3.0

    Hi there,
    I have a Sony Notebook SVS13A3Z9ES with preinstalled Windows 8 which I updated to Windows 8.1. The notebook has a
    250GB SSD which had the following GPT partitions
    Partition 1: SONYSYS - 260MB (Sony Vaio tools, type OEM)
    Partition 2: Windows RE - 1,4 GB (Type OEM)
    Partition 3: EFI System Partition - 260 MB (type System)
    Partition 4: MSR 128 MB  (type reserved)
    Partition 5: About 240 GB - (incl. Windows, Type Prime)
    Partition 6: Windows Recovery 350 MB (type OEM)
    Partition 7: Recovery: 28 GB - OEM -> I created instead a Recovery USB stick and have now another prime partition
    I then shrinked the Windows partition to 101GB with the Easeus Partition Master 3.0 to create another partition dedicated for data only. I didn't use the Windows built-in partition tool because I still wanted to shift the part.6,
    being able to only extend part.7 for the final data partition. After I activated the shrinking via the Easeus I had to restart the notebook. I immediately came obviously to the Windows RE environment :
    - asking me for selecting language
    - afterwards I was brought to the Option Menue
    * Continue Booting -> led me back to the language selection
    * Turn-of PC and
    * Trouble Shooting -> 
    Proceeding with Troubleshooting
    * Recovery and Maintenance -> tried to start VAIO Care but couldn't access it -> back to Option Menu
    * Refresh PC -> led to the message
    “The drive where Windows is installed is locked. Unlock the drive and try again.” 
    It seems that the C: drive was locked after shrinkingthe partition with Easeus. 
    * Advanced Options -> 
    Proceeding with Advanced Options:
    * Automatic Repair -> couldn't be executed, log file on C:. With cmd the C:\>  drive can be initialized but Windows folder is not found (probably locked or hidden) 
    * Recovery Point Recovery -> no recovery points were detected -> back to Troubleshooting
    * System Image Recovery -> no image points were detected -> back to Troubleshooting
    * UEFI Firmware Settings -> led to the Vaio Care RescueMode screen which can be seen here
    http://community.sony.com/t5/VAIO-Upgrade-Backup-Recovery/How-can-I-enter-bios-on-my-vaio-I-want-to-boot-from-the-cd-drive/td-p/60063 
    e.g. starting Windows from there led to WinRE again
    * cmd window ->
    Finally we have the cmd Window. Here are several postings in the internet with potential solutions but no one helped me so far. Example postings:
    http://superuser.com/questions/460762/how-can-i-repair-the-windows-8-efi-bootloader
    http://www.qliktips.com/2012/11/fix-windows-8-boot-issue.html
    http://pcsupport.about.com/od/fixtheproblem/ht/rebuild-bcd-store-windows.htm
    http://www.winhelp.us/repair-your-computer-in-windows-8.html
    I tried so far:
    - chkdsk -> executed, no problems
    - Bootrec /fixmbr -> executed
    - Bootrec /fixboot -> executed
    - Bootrec /rebuildbcd, result:
    Successfully scanned Windows installations.
    Total identified Windows installations: 0
    The operation completed successfully.
    Restart brought me directly to language selection and Windows RE back again. 
    BCDBoot c:\Windows -> executed successfully but restart
    back to WinRE
    Then I assigned a letter to the EFI partition using diskpart v6.2.9200 and replaced bcd file with
    1. method: BCDBoot c:\Windows /s z: /f ALL   (z: letter of EFI partition) ->
    executed successfully but restart back to WinRE
    2. method: Bootrec /rebuildbcd -> executed successfully but restart back to WinRE
    I had the recovery USB stick inserted but it was never used so far. 
    Do you still have other solution ideas restore the booting or an approach how to unlock the GPT c: drive with Windows again ? I would appreciate that very much.

    Hi,
    According to your description,the system was damaged by the partition tool.
    Since you upgraded to Windows 8.1,you cannot use Windows 8 recovery media to repair the system.
    If you have some important data in the SSD,I suggest that you move the ssd to other computer,and backup the data.
    As you said,you had the recovery USB stick inserted but it was never used so far.
    For this issue,please change your BOIS setting for USB.
    I suggest you use your recovery USB stick to reinstall your system.
    Regards,
    Kelvin Xu
    TechNet Community Support

  • How do I restore data to a new mac with windows boot camp partition?

    Hi
    I have a new iMac and an old MBP, I'd like to copy all of the data of my old MBP to the iMac.Would doing that affect the windows boot camp partition?
    and how do I do it? 
    right now im backing everything up on my MBP using super duper
    both the MBP and the iMac are running on Lion

    I am assuming the Boot Camp partition is on the old MBP and that the SuperDuper clone is on an external drive and is bootable. The Super Duper clone does not include the Boot Camp Partition.
    To get the Mac Data moved you can use Migration Assistant and if you want to transfer the Boot Camp partition you would need Winclone to move/copy it to a newly created Boot Camp partition on the iMac. The SD Clone ( and a Winclone backup) is your insurance policy if some kind of difficulty arises.
    Links to more detailed info.
    http://support.apple.com/kb/HT6025
    http://support.apple.com/kb/PH11275
    http://pondini.org/OSX/MigrateLion.html
    http://twocanoes.com/support/winclone/migrating-a-bootcamp-partition-with-winclo ne
    http://twocanoes.com/support/winclone/using-sysprep-when-migrating-boot-camp

  • How do I create a Boot Camp partition with Windows & blank NTFS partitions?

    I'm trying to create this kind of setup:
    OS X partition
    Windows 7 partition
    blank NTFS partition (no OS)
    blank NTFS partition (no OS)
    This would be much easier if I created just the OS X partition and the Windows 7 partition with the Boot Camp Assistant tool (done this many times before successfully on other computers). The problem begins when I try to split the Boot Camp partition through the Windows 7 DVD partition manager during setup by deleting the Boot Camp partition, and recreating three partitions from the unallocated space. After installing Windows 7 on one of those new three partitions, I'm getting all kinds of startup errors when I try to install the Boot Camp drivers.
    What would the best way to achieve this setup?

    Yes, I researched many options for three partition dual boot set ups. After many trials and tribulations, there is a simple method that I have used on multiple MBPs.
    1. Run Boot Camp Assistant, as per the Boot Camp Installation and Setup Guide. Once you have Mac OS X and Windows 7 set up, check the partitions and back them up (with Time Machine, and Winclone).
    2. Get iPartition, and resize the Mac and Windows partitions to what you want, say 100GB each, and set up your other partitions to the size you want. I put mine "after" the Windows partition, at the end of the disk, and have had no problems. It takes a few minutes to create the bootable CD for iPartition, but you get everything you need to do so from Coriolis Systems. You will need your Mac OS X installl disc.
    3. Install Paragon's HFS+ for Windows and NTFS for Mac, and everybody can read and write everything.
    4. I have both Time Machine and Norton 360 back up the Data partitions, just in case -- to an external drive, of course.
    You can boot to either OS and access any partition.

Maybe you are looking for

  • Downloading email on E71 crashs the message applic...

    I am facing a problem since updating the firmware of E71 which is simply causing the message application to close (crash) after donwloading the emails. the crash cause the shortcut button of the email on the phone panel not to work and I have to open

  • Transport control program (tp) ended with return code 0200

    Hi Gurus, Please help, we have a fresh system copy of our prod. I already configure new domain controller with one virtual system. it was meant for 2 system lanscape. PRD -> VIR. The problem now is everytime we try to release a config it shows an err

  • Ipod is frozen on do not disconnect screen....

    i seriously don't know what to do with m ipod anymore. it's a 5 gen ipod video that i've had for less than a year. today i tried to sync it to my computer which is a sony vaio with windows xp and it got stuck on the do not disconnect screen. i plugge

  • Delivery based on salesorder

    Hi there. I've tried to create delivery notes based on sales orders via the DI, with no success. My code is as follows: for (int t = 0; t < salesordersLines->Count; t++){ salesordersLines->SetCurrentLine(t); deliveryLines->BaseEntry = salesordersDoc-

  • Resolving color management with Epson printer

    Using an Espon Stylus Photo RX600 InDesignCS 3.0.1 PhotoShop 8.0 I continually struggle with color when printing scanned images or images off of a camera card into PhotoShop and/or InDesign, and with the warning messages (upon opening) for tagged or