BLOB column in own tablespace, in partition, in table, tablespace to be moved

Hi All,
First off I am using Oracle Database 11.2.0.2 on AIX 5.3.
We have a table that is partitioned monthly.
In this table there is a partition (LOWER), this lower partition is 1.5TB in size due to a BLOB column called (ATTACHMENT).
The rest of the table is not that big, about 30GB, its the BLOB column that is using up all the space.
The lower partition is in its own default tablespace (DefaultTablespace), the BLOB column in the lower partition is also in its own tablespace(TABLESPACE_LOB) - 1.5TB
I've been asked to free up some space by moving the TABELSPACE_LOB(from the lower partition) to an archive database, confirming the data is there and then removing the lower partition from production.
I don't have enough free space (or time) to do an expdp, I don't think its doable with so much data.
CREATE TABLE tablename
  xx                          VARCHAR2(14 BYTE),         
  xx                          NUMBER(8),   
  xx         NUMBER,
  ATTACHMENT   BLOB,
  xx             DATE,
  xx             VARCHAR2(100 BYTE),
  xx                     INTEGER,
LOB (ATTACHMENT) STORE AS (
  TABLESPACE  DefaultTablespace
  ENABLE      STORAGE IN ROW
NOCOMPRESS
TABLESPACE DefaultTablespace
RESULT_CACHE (MODE DEFAULT)
PARTITION BY RANGE (xx)
  PARTITION LOWER VALUES LESS THAN ('xx')
    LOGGING
    COMPRESS BASIC
    TABLESPACE DefaultTablespace
    LOB (ATTACHMENT) STORE AS (
      TABLESPACE  TABLESPACE_LOB
      ENABLE      STORAGE IN ROW
...>>
My idea was to take an datapump export of the table excluding the column ATTACHMENT, using external tables.
Then to create the table on the archive database "with" the column ATTACHMENT.
Import the data only, from what I understand if you use a dump file that has too many columns Oracle will handle it, i'm hoping it will work the other way round.
Then on production make the TABLESPACE_LOB read only and move it to the new file system.
This is a bit more complicated than a normal tablespace move due to how the table is split up.
Any advice would be very much appreciated.

JohnWatson wrote:
If disc space is the problem, would a network mode export/import work for you? I have never tried it with that much data, but theoretically it should work. You could do just a few G at a time.
I see what you are saying, if we use a network link then no redo would be generate on the export, but it would for the import right.  But like you said, we could do 100GB per day for the next ten days and that would be very doable I think, it would just take a long time. On the archive database we backup archivelogs every morning so anything generate on the import would be backed up to tape the following morning.
mtefft wrote:
          Does it contain only that partition? Or are there other partitions in there as well? If there are other partitions, what % of the space is used by the partition you are trying to move?
Yep, tablespace_lob only contains the LOWER partition, no other partitions.  Just the LOWER partition is taking up 1.5TB.

Similar Messages

  • BLOB column in separate tablespace in 9i?

    Should a BLOB column go in a separate tablespace in Oracle 9i? And if so, then how to do it?

    Should a BLOB column go in a separate tablespacein Oracle 9i?
    from documentation
    (http://download.oracle.com/docs/cd/B10501_01/appdev.9
    20/a96591/adl07mds.htm#117432):
    TABLESPACE and LOB Index
    Best performance for LOBs can be achieved by
    specifying storage for LOBs in a tablespace different
    from the one used for the table that contains the
    LOB. If many different LOBs will be accessed
    frequently, it may also be useful to specify a
    separate tablespace for each LOB column or attribute
    in order to reduce device contention.
    The LOB index is an internal structure that is
    strongly associated with LOB storage. This implies
    that a user may not drop the LOB index and rebuild
    it.
    Note:
    The LOB index cannot be altered.
    And if so, then how to do it? You can specify tablespace during table creation:
    create test_table (id number not null,
    content blob)
    tablespace  data
    lob (content) store as (tablespace lobs);
    /pre]
    For existing table:
    [pre]
    alter table test_table move lob (content) store as
    (tablespace lobs);
    Thanks for the post and the link!! Do you know if Oracle creates the LOB index on its own? From reading the link, that was the impression I had as if that was handled by Oracle.

  • Error while importing a table with BLOB column

    Hi,
    I am having a table with BLOB column. When I export such a table it gets exported correctly, but when I import the same in different schema having different tablespace it throws error
    IMP-00017: following statement failed with ORACLE error 959:
    "CREATE TABLE "CMM_PARTY_DOC" ("PDOC_DOC_ID" VARCHAR2(10), "PDOC_PTY_ID" VAR"
    "CHAR2(10), "PDOC_DOCDTL_ID" VARCHAR2(10), "PDOC_DOC_DESC" VARCHAR2(100), "P"
    "DOC_DOC_DTL_DESC" VARCHAR2(100), "PDOC_RCVD_YN" VARCHAR2(1), "PDOC_UPLOAD_D"
    "ATA" BLOB, "PDOC_UPD_USER" VARCHAR2(10), "PDOC_UPD_DATE" DATE, "PDOC_CRE_US"
    "ER" VARCHAR2(10) NOT NULL ENABLE, "PDOC_CRE_DATE" DATE NOT NULL ENABLE) PC"
    "TFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS"
    " 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TS_AGIMSAPPOLOLIVE030"
    "4" LOGGING NOCOMPRESS LOB ("PDOC_UPLOAD_DATA") STORE AS (TABLESPACE "TS_AG"
    "IMSAPPOLOLIVE0304" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE L"
    "OGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEF"
    "AULT))"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'TS_AGIMSAPPOLOLIVE0304' does not exist
    I used the import command as follows :
    imp <user/pwd@conn> file=<dmpfile.dmp> fromuser=<fromuser> touser=<touser> log=<logfile.log>
    What can I do so that this table gets imported correctly?
    Also tell me "whether the BLOB is stored in different tablespace than the default tablespace of the user?"
    Thanks in advance.

    Hello,
    U can either
    1) create a tablespace with the same name in destination where you are trying to import.
    2) get the ddl of the table, modify the tablespace name to reflect the existing tablespace name in destination and run the ddl in the destination database, and run your import command with option ignore=y--> which will ignore all the create errors.
    Regards,
    Vinay

  • Problem with blob column index created using Oracle Text.

    Hi,
    I'm running Oracle Database 10g 10.2.0.1.0 standard edition one, on windows server 2003 R2 x64.
    I have a table with a blob column which contains pdf document.
    Then, I create an index using the following script so that I can do fulltext search using Oracle Text.
    CREATE INDEX DMCS.T_DMCS_FILE_DF_FILE_IDX ON DMCS.T_DMCS_FILE
    (DF_FILE)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('DATASTORE CTXSYS.DEFAULT_DATASTORE');
    However, the index is not searchable and I check the following tables created by database for my index and found them to be empty as well !!
    DR$T_DMCS_FILE_DF_FILE_IDX$I
    DR$T_DMCS_FILE_DF_FILE_IDX$K
    DR$T_DMCS_FILE_DF_FILE_IDX$N
    DR$T_DMCS_FILE_DF_FILE_IDX$R
    I wonder what's wrong with it.
    My user has been granted the ctx_app role and I have other tables that store plain text which I use Oracle Text are fine. I even output the blob column and save as pdf file and they are fine.
    However the database seems like not indexing my blob column although the index can be created without error.
    Please advise.
    Really appreciate anyone who can help.
    Thank you.

    The situation is I have already loaded a few pdf document into the table's blob column.
    After I create the Oracle text index on this blob column, I find the system generated index tables listed in my earlier posting are empty, except for the 4th table.
    Normally we'll see words inside the table where those are the words indexed by oracle text on my document.
    As a result, no matter how i search for the index using select statement with contains operator, it will not give me any result.
    I feel weird why the blob is not indexed. The content of the blob are actually valid because I tested this by export the content back to pdf and I can still view and search within the pdf.
    Regards,
    Jap.

  • Can i move blob column one tablespace to another tablespace

    When I ruining the following script
    ALTER TABLE T_Transaction_Image
    MOVE LOB(RCSCOMPRESSED_IMAGE,CAMERA_PHOTO_1,CAMERA_PHOTO_2,NUMBER_PLATE)
    STORE AS TABLESPACE IMAGE
    I found error
    ORA-22853: invalid LOB storage option specification
    Here we have more than one column having BLOB data type .
    Question
    I want to know can i move multiple column in single alter table ?
    and how can i move blob column one tablespace to another tablespace
    Thanks in advance
    Edited by: abdul moyed on Feb 3, 2011 6:33 PM

    http://decipherinfosys.wordpress.com/2007/11/21/moving-lob-column-to-a-different-tablespace/
    Regards
    Asif Kabir

  • Table with BLOB  column re-partitioning

    Currently I have a table with a blob column Z partitioned on Column X I want to re-partition the table on Column Y is there a quick way of doing this.
    INSERT INTO SELECT * has limitations on the blob size I guess.
    Can someone explain this?
    Edited by: user10229350 on Mar 1, 2010 7:36 AM

    I am using hash partitioning looks like split partition doesn't apply for hash partition:
    "The SPLIT PARTITION clause of the ALTER TABLE or ALTER INDEX statement is used to redistribute the contents of a partition into two new partitions. Consider doing this when a partition becomes too large and causes backup, recovery, or maintenance operations to take a long time to complete. You can also use the SPLIT PARTITION clause to redistribute the I/O load.
    This clause cannot be used for hash partitions or subpartitions."

  • I can't import a table contains BLOB column  from one user to another user.

    1) I create two user both have connect role,and each has its own tablespace, DDL:
    create user d2zd identified by d2zd default tablespace d2zd quota unlimited on d2zd account unlock;
    grant connect to d2zd;
    create user d3zd identified by d3zd default tablespace d3zd quota unlimited on d3zd account unlock;
    grant connect to d3zd;
    2)Then enter oracle as d2zd and create a table contains BLOB column and insert data to the table.
    3) export d2zd as follow:
    exp d2zd/d2zd file=d2zd.dmp
    4) import to d3zd as follow:
    imp d3zd/d3zd fromuser=d2zd touser=d3zd file=d2zd.dmp
    the question is the table with BOLB colum can't be import,
    it says:have no privilege on tablespace d2zd.
    How can I import a table contains BLOB column from one user to another user?

    Hi - the reason for as our friend already told ist that a blob can be stored outside of the table segment, in another Tablespace, This is for performance reason.
    Sou you would need to have Quota on two tablespaces.
    the one which holds the table segment the other which holds the blob(segment).
    Regards
    Carl
    Message was edited by:
    kreitsch

  • How to view PDF files strored in a BLOB column

    Hi all,
    I want to display a PDF file, stored in a BLOB column, in a form or through a JavaBean.
    But the problem is more complicated then that. I do not want to retrieve the PDF file in the application server that show it through a browser.
    Actually, I do not want users to get the entire file, I just want them to see it or print it.
    I want, in fact, to display a "stream" of bytes through Oracle Forms. Not a file.
    This one, sounded to be a good solution, but actually not. When the file was too big (multiple pages), the application was blocked until the entire file was loaded. And when you try to print it, it wasn't printed right. The advantage of this solution is that it is open-source so we can add methods to connect to the DB, retrieve the content of the BLOB column and displays it without downloading the file.
    Here is a good solution. Really good, files are loaded quickly, the rendering is really good and the file is printed perfectly (as it was printed from Adobe Acrobat). The disadvantage of this solution is that it is not open-source and is really expansive.
    As you can see, both solutions uses PJC.
    So any help, any idea to solve my problem will be highly appreciated.
    Thanks to all of you,
    Amine
    PS : I am using F&R 11gR2

    Not entirely. At least we came to the conclusion it doesn't make (much) sense to block the save option of PDFs if you want to allow printing them
    Anyway; there is of course another possibilty: you could always write your own java bean PDF reader; there are plenty of java PDF libraries available:
    Open Source PDF Libraries in Java
    The easiest way would be to choose one which can open a PDF from a URL and render it; I would retrieve the image via mod_plsql using WPG_DOCLOAD and simply use the PDF library to render the PDF. No tempfiles anyway, and if you don't implement it there is also no save button.
    cheers

  • Migrating a table with BLOB column from one db to another

    Hello everybody,
    I have two databases D1 and D2. Each database contains table T1 (same structure in both databases). T has a BLOB column and is populated in D1. I have to move all the data from T database D1 into T database D2.
    D1 and D2 are located on different machines. T in D1 is a huge table (milions of records). What is the best solution to migrate the T data between the 2 databases?
    Any help will be appreciated.
    Thank you in advance.
    daniela

    Depending on the version of the database you have, you could use transportable tablespaces.
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#9370

  • ORA-00600 error when inserting NULL in BLOB column

    Hi,
    I want to insert NULL value into a BLOB column w/o using empty_blob(), but I am getting the following error upon submission (both through program and upon directly executing it from TOAD/SQL*):
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kxtotolc_lobopt], [], [], [], [], [], [], []
    The query is as follows:
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Html, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size) values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, null, '1', '30670908')
    In the table r.Html, r.Original_Text are blob and clob columns respectively.
    If I remove the column r.Html (blob) and its corresponding value the following query executes fine :
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size)
    values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, '1', '30670908')
    I know I can also insert the query using the string empty_blob(), but I dont want to do it without using empty_blob() since it will involve changing my generic DB classes.
    The strange thing is that I created another table involving blob and clob columns through TOAD.
    In this table I can insert NULL values in the blob column without any error.
    Is there anything that can be done to insert a NULL into my blob column? Am I missing anything?
    Is there a setting in the database that will allow me to do this? cuz one table accepts null and the other doesn't. Its strange.
    I am using Oracle8i Enterprise Edition Release 8.1.7.0.0
    The query doen't execute through toad or sql* plus or through program (I am using thin oracle drivers: the usual classes12.zip file)
    thanks in advance
    - Nilesh

    From metalink
    Oracle 9i Message~~~~~~~~~~~~~~~~~
    Error:     ORA-14400 (ORA-14400)
    Text:     inserted partition key does not map to any partition
    Cause:     An attempt was made to insert a record into, a Range or Composite
         Range object, with a concatenated partition key that is beyond the
         concatenated partition bound list of the last partition -OR- An
         attempt was made to insert a record into a List object with a
         partition key that did not match the literal values specified for
         any of the partitions.
    Action:     Do not insert the key. Or, add a partition capable of accepting
         the key, Or add values matching the key to a partition
         specification
    >
    So check the date .
    What is your insert statement.
    Anand
    Edited by: Anand... on Mar 4, 2009 5:42 PM

  • BLOB column says undefined

    Hi .
    when i create a BLOB column in the table and describe the structure it says undefined. how do i fix that. also if someone can let me know how to update a RTF content from a VB to the BLOB column in the oracle table?? Tons of thanks in advance

    You can write a BLOB- VB to Oracle database using ADO function in VB. Search in MSDN for help on BLOB function. They have a ready eg.
    Just in case you don't find it.
    Here it is:
    Just copy paste this in a form with text boxes for all ODBC parameters.
    I think you cannot read directly from a BLOB column. Don't forget to initiate a BLOB column like:
    /*LOB table for storing files*/
    Drop table FileColumn;
    Create table FileColumn
    ( REPQUE_ID NUMBER(10) NOT NULL ,
    RepText_blob BLOB default empty_blob()
    Storage (initial 50K next 50K pctincrease 0)
    tablespace TEST31ORA
    lob(RepText_blob) store as
    (tablespace ACCOUNT4
    Storage (initial 100k next 100k pctincrease 0)
    chunk 16k pctversion 10 nocache logging);
    /*initialize LOB locator by making it not null, use empty lob, this will
    insert the locator value in that column
    I did this initialize in create table script, so that I can do the bulk insert
    One can do bulk inserts if there are no rows before
    insert into FileColumn
    values(1, empty_blob()); */
    Option Explicit
    Const BlockSize = 32768
    ' FUNCTION: ReadBLOB()
    ' PURPOSE:
    ' Reads a BLOB from a disk file and stores the contents in the
    ' specified table and field.
    ' PREREQUISITES:
    ' The specified table with the OLE object field to contain the
    ' binary data must be opened in Visual Basic code (Access Basic
    ' code in Microsoft Access 2.0 and earlier) and the correct record
    ' navigated to prior to calling the ReadBLOB() function.
    ' ARGUMENTS:
    ' Source - The path and filename of the binary information
    ' to be read and stored.
    ' T - The table object to store the data in.
    ' Field - The OLE object field in table T to store the data in.
    ' RETURN:
    ' The number of bytes read from the Source file.
    Function ReadBLOB(Source As String, T As Recordset, _
    sField As String)
    Dim NumBlocks As Integer, SourceFile As Integer, i As Integer
    Dim FileLength As Long, LeftOver As Long
    Dim FileData As String
    Dim RetVal As Variant
    On Error GoTo Err_ReadBLOB
    ' Open the source file.
    SourceFile = FreeFile
    Source = "c:\blob_file_folder\G63JR557.doc"
    T = mwebRepOutput
    sField = RepOut_Content
    Open Source For Binary Access Read As SourceFile
    ' Get the length of the file.
    FileLength = LOF(SourceFile)
    If FileLength = 0 Then
    ReadBLOB = 0
    Exit Function
    End If
    ' Calculate the number of blocks to read and leftover bytes.
    NumBlocks = FileLength \ BlockSize
    LeftOver = FileLength Mod BlockSize
    ' SysCmd is used to manipulate status bar meter.
    RetVal = SysCmd(acSysCmdInitMeter, "Reading BLOB", _
    FileLength \ 1000)
    ' Put first record in edit mode.
    T.MoveFirst
    T.Edit
    ' Read the leftover data, writing it to the table.
    FileData = String$(LeftOver, 32)
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, LeftOver / 1000)
    ' Read the remaining blocks of data, writing them to the table.
    FileData = String$(BlockSize, 32)
    For i = 1 To NumBlocks
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, BlockSize * i / 1000)
    Next i
    ' Update the record and terminate function.
    T.Update
    RetVal = SysCmd(acSysCmdRemoveMeter)
    Close SourceFile
    ReadBLOB = FileLength
    Exit Function
    Err_ReadBLOB:
    ReadBLOB = -Err
    Exit Function
    End Function
    null

  • Problem inserting large files into a Blob-Column

    hi all,
    i am using a oracle 10g database.
    i defined a table including one blob column as follows:
    create table contact(
    id     number(22) primary key not null,
    lastupdated date not null,
    lastwriter_id number(22) not null,
    contacttype_id number(22) not null,
    notice varchar2(2000),
    attachment blob,
    attachmentname varchar2(255))
    tablespace users
    storage (initial 2M pctincrease 0)
    lob (attachment) store AS (
    tablespace users
    storage (initial 10M)
    enable storage in row
              pctversion 5
              chunk 1
    index lob_attachment_idx (tablespace users storage (initial 1M)));
    now i fill this table from a java application using hibernate.
    small files (for example 2700 chars) are ok, the pass into the attachment column.
    larger files dont go there. i receive no errormessage.
    whats going wronr?
    ist my create table statement wrong?
    thnax for help dieter

    Quick and dirty testcase:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table t;
    Table dropped.
    test@ORA10G> create table t (x blob);
    Table created.
    test@ORA10G>
    test@ORA10G> insert into t (x)
      2  select utl_raw.cast_to_raw(rpad('a',1000,'x')) from dual;
    1 row created.
    test@ORA10G>
    test@ORA10G> commit;
    Commit complete.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> select dbms_lob.getlength(x) as len, dbms_lob.substr(x,10,1) as chunk from t;
           LEN CHUNK
          1000 61787878787878787878
    test@ORA10G>
    test@ORA10G>pratz

  • How to display binary file saved in BLOB column in Discoverer PLUS /VIEWER

    HI, Friends,
    I tried to display the binary file saved in the database in BLOB column with the *.doc or *.xls fomats, but it seemed not work at all. I can display them in discoverer DESKTOP, but not the web version PLUS or VIEWER. MY Discoverer PLUS/VIEWER version is 9.0.4.45.02 and the database is 9.2.0.4. Are there any special setting/configuration in somewhere (Discoverer administration/Applicaiton server/PLUS/VIEWER?)
    Any help /information will be greatly appreciated.
    Thanks a lot.

    Hi,
    Sorry but this feature is not available in the web version of 9.0.4.45. You will have to write your own mod_plsql function to download the file.
    Rod West

  • Partitioning A table on a data column

    Hi,
    My requirement is to partition a table using a column with DATE datatype.
    Example:
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    Now i want to RANGE partition the above table on the "UPDTIME" column, so that it will look like:
    Partition Value from Value till
    P1 01-Jan 31-Mar
    P2 01-Apr 30-Jun
    P3 01-Jul 30-Sep
    P4 MAXVALUE
    I tried using the below syntax, but failed with error.
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    LOGGING
    PARTITION BY RANGE (UPDTIME)
    PARTITION P1 VALUES LESS THAN (to_date('04','MM')) LOGGING COMPRESS TABLESPACE part_tbs_P1,
    PARTITION P2 VALUES LESS THAN (to_date('07','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P2,
    PARTITION P3 VALUES LESS THAN (to_date('10','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P3,
    PARTITION P4 VALUES LESS THAN (MAXVALUE) LOGGING COMPRESS TABLESPACE part_tbs_P4
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 2 INSTANCES Default )
    ROWDEPENDENCIES
    NOMONITORING
    ENABLE ROW MOVEMENT;
    Please suggest.
    Thanks in advance for the suggestions.

    what is the error message and your Oracle version? this sample may assist I guess -
    CREATE TABLE range_part (
    prof_history_id NUMBER(10),
    person_id       NUMBER(10) NOT NULL,
    organization_id NUMBER(10) NOT NULL,
    record_date     DATE NOT NULL,
    ph_comments     VARCHAR2(200))
    PARTITION BY RANGE (record_date) (
    PARTITION yr0 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
    TABLESPACE part1,
    PARTITION yr1 VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY'))
    TABLESPACE part2,
    PARTITION yr2 VALUES LESS THAN (TO_DATE('01-JAN-2002','DD-MON-YYYY'))
    TABLESPACE part3,
    PARTITION yr9 VALUES LESS THAN (MAXVALUE) TABLESPACE part4);for more examples you may visit - http://psoug.org/reference/partitions.html

  • Move large tables and indexes into own tablespace

    I currently manage a 100Gb 10.2.0.4 SE database on Windows.
    There is one data tablespace and one indexes.
    I have one table xxxHistory that is periodically cleared out, however, six months of data must be retained.
    The table is currently 17Gb and has 95 million rows, the corresponding nine or so indexes take another 47Gb.
    I am having a small problem with I/O waits on this table so, I want to move this table and the indexes to their own tablespaces, which I will create (xxxHistory_D and xxxHistory_I).
    I know the two methods, exp/imp (difficult due to foreign keys) and the prefered method of :
    alter table tbl move tablespace tblsp and
    alter index ind rebuild tablespace tblsp.
    I have no problems with the syntax etc, having used this method many times.
    My question is, does anyone have a better idea of how to approach this to minimise downtime?
    The system cannot be used if this table is not available.
    I am also going to migrate to 11.2x when available but can't find anything in the new features to help.
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Thanks,

    BigPhil wrote:
    Note, this is SE, so partitioning is not an option and once I have sorted this table out, I will unchain the rows of any other and reorganise the space.
    Disk space is not an issue.
    Strategically this sounds as if you really do need partitioning; since you're on SE, you could consider the v7 "partition view" concept.
    Create one table per month, and index each table separately.
    Add a constraint to each table of the form: "movement date between to_date('...') and to_date('...')"
    Create a union all view of the tables.
    Getting rid of a single month means redefining the view.
    In theory any queries you do should be able to filter predicate pushdown and thus eliminate redundant partitions, and also handle pushing joins down into the union all view. But that's something you would have to test carefully.
    You could even create the tables as index organized tables - which may be the solution to your I/O wait problems - if your queries are about stock movement then all the movements for a given stock will be thinly scattered across the table, leading to one block I/O per row required. IOTs would give you an overhead on inserts, but eliminate waits on queries.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • IPod Classic Screen still black after restoring it

    After dropping my iPod classic, the screen went black and I could no longer get it to work.  I was able to restore it however the screen is still black. I can hear it clicking when I spin the will and it connects to iTunes but the screen is still bla

  • Missing characters in german keyboard layout

    I'm using Gnome 3 on a PC with a german keyboard with a physical layout like this one. The german layout is configured in the settings and mostly works as intended, but one key is mapped wrongly. The key next to the left shift key in the second row f

  • How do I clean cache

    how do you manage apps, clean caches, close apps running in background?

  • MD04 problem

    Gurus i have scenario were in i have a production Order and associated with it is purchase requisition . Now the Porduction Order is  Arcived but the MDO4 stikll shows the Purchase Requisition that is associated with this Porduction Order , do SAP ha

  • New-MailUser Command for O365

    Hi I'm trying to get the command New-MailUser to work and then in bulk. But I can not get it to work on user at a time yet My Invocation is as follows PS C:\powershell> $password = Read-Host "Pass:" -AsSecureString Pass:: ********** PS C:\powershell>