Need to alter maxvalue for one Partition table
Hi Guru's,
We have a table xyz with monthly partitions but tablespaces are in yearly basis.
we created the required partitions using exchange partition. Now the Partition for Dec 2007 is having range of MAXVALUE.
But our requirement is to add partition for 2008 now.
So we want to create 12 monthly partitions for 2008 and with a tablespace for that.
but how to change the MAXVALUE to 2008010100 for the partition DEC2007.
Appreciate any quick help !!
You can split the last partition to change the partition boundaries.
SQL> r
1 create table t(a date)
2 partition by range(a)(
3 partition p1 values less than (to_date('01.12.2007','dd.mm.yyyy')),
4* partition p2 values less than (maxvalue))
Table created.
SQL> alter table t split partition p2 at (to_date('01.01.2008','dd.mm.yyyy'))
2 into (partition p2,partition p3);
Table altered.
SQL> set lines 200
SQL> r
1 select PARTITION_NAME,HIGH_VALUE from user_tab_partitions
2* where table_name='T'
PARTITION_NAME HIGH_VALUE
P1 TO_DATE(' 2007-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
P2 TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
P3 MAXVALUE
Similar Messages
-
Help needed in EXPLAIN PLAN for a partitioned table
Oracle Version 9i
(Paste execution plan in a spreadsheet to make sense out of it)
I am trying to tune this query -
select * from comm c ,dates d
where
d.active_period = 'Y'
and c.period = d.period;
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 5 M 278887
HASH JOIN 5 M 5G 278887
TABLE ACCESS FULL SCHEMA.DATES 24 1 K 8
PARTITION LIST ALL 1 8
TABLE ACCESS FULL SCHEMA.COMM 6 M 5G 277624 1 8
However, I know that the dates table will return only one record. So, if I add another condition to the above query, I get this execution plan. The comm table is huge but it is partitioned on period.
select * from comm c ,dates d
where
d.active_period = 'Y'
and c.period = qd.period
and c.period = 'OCT-07'
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 1 8
MERGE JOIN CARTESIAN 1 9 K 8
TABLE ACCESS FULL SCHEMA.DATES 1 69 8
BUFFER SORT 1 9 K
TABLE ACCESS BY LOCAL INDEX ROWID SCHEMA.COMM 1 9 K 7 7
INDEX RANGE SCAN SCHEMA.COMM_NP9 1 7 7
How can I make the query such that the comm table does not have to traverse all of its partitions? The partitioning is based on quarters so it will get its data in one partition only (in the above example - partition no. 7)
Thanks in advance for writing in your replies :)You need to specify period = 'OCT-07', otherwise there is no way the optimizer can know it needs to access only one partition.
Alternatively, partition the DATES table in exactly the same way on "period", and partition-wise joins should kick in, and effectively accessing only the active partition. -
HOW to enable oracle advance compression for EXIST partitioned table
Hi All,
I have to enable oracle advance compression for existing table which PARTITION BY RANGE then SUBPARTITION BY HASH.
ORacle version: 11.2.0.2.0
Please provide me any relevant doc or any exp.
Thanks in advance.could not see any text for how to enable oracle advance compression for EXIST partitioned table.RTFM.
From the resource above:
How do I compress an existing table?
There are multiple options available to compress existing tables. For offline compression, one could use ALTER TABLE Table_Name MOVE COMPRESS statement. A compressed copy of an existing table can be created by using CREATE TABLE Table_Name COMPRESS FOR ALL OPERATIONS AS SELECT *. For online compression, Oracle’s online redefinition utility can be used. More details for online redefinition are available here.
" -
One laptop issue and one partition table request.
Title says is all.
I'd like one partition table. I want to install Windows Vista (HomeBasic - HP's OEM) with ArchLinux (dualboot). My hard disk has only 160GBs.
I surely want a partition for my data files.
Then, I want to learn a way, for my laptop fan, to get the fuck. It is veeeeeeeeeeeery loud all the time.
... and to get lower cpu temp.
That's it, could you help me please?This is issue with TAB
Try to include this code and & check
DATA:BEGIN OF tab_temp OCCURS 0,
CDOCT LIKE ZDNTINF-CDOCT,
DDTEXT LIKE DD07T-DDTEXT,
END OF tab_temp.
SELECT a~CDOCT b~DDTEXT FROM ZDNTDEPDOC as a
INNER JOIN DD07T as b
on a~CDOCT = b~DOMVALUE_L
INTO TABLE TAB_TEMP
WHERE b~DOMNAME = 'ZCDCT'.
loop at TAB_TEMP.
tab = TAB_TEMP-CDOCT. append tab.
tab = TAB_TEMP-DDTEXT append tab.
endloop.
a® -
Creating 2 table maintainance views for one custom table
Hello All,
I want to create 2 table maintainace views for one custom table.
I know how to create table maintainace but I want to know whether we can create only one maintainance view or we cal also create 2 maintainace views for a single custom table.
Regards
MaheshHello,
You can create as many maintenance views one one table as you want.
Kind regards,
Bart -
Hello Friends,
The background is I am working as conversion manager and we move the data from oracle to SQL Server using SSMA and then we will apply the conversion logic and then move the data to system test ,UAT and Production.
Scenario:
Moving the 80 Million records from Conversion database to System Test database (Just for one transaction table) taking too long. Both the databases are in the same server.
Questions are…
What is best option?
IF we use the SSIS it’s very slow and taking 17 hours (some time it use to stuck and won’t allow us to do any process).
I am using my own script (Stored procedure) and it’s taking only 1 hour 40 Min. I would like know is there any better process to speed up and why the SSIS is taking too long.
When we move the data using SSIS do they commit inside after particular count? (or) is the Microsoft is committing all the records together after writing into Transaction Log
Thanks
Karthikeyan Jothihttp://www.dfarber.com/computer-consulting-blog.aspx?filterby=Copy%20hundreds%20of%20millions%20records%20in%20ms%20sql
Processing
hundreds of millions records can be done in less than an hour.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Required alter script for adding partition and subpartition
Hi Folks,
Please help me to write ALTER STATEMENT for adding new partition P1 and SUBPARTITION P1_201001 and P1_201002.
Thank you
TABLE
=======
CREATE TABLE TEST
"REPORT_ID" NUMBER,
"MONTH_ID" NUMBER,
"GROUP_ID" NUMBER,
"AGE_GROUP_ID" NUMBER,
"GENDER_CD" CHAR(1 BYTE),
PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 COMPRESS BASIC NOLOGGING STORAGE
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
TABLESPACE "USER_WORK" PARTITION BY RANGE
"REPORT_ID"
SUBPARTITION BY LIST
"MONTH_ID"
SUBPARTITION TEMPLATE
SUBPARTITION "M201212" VALUES
201212
TABLESPACE "USER_WORK"
(PARTITION "P3" VALUES LESS THAN (4) PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USER_WORK" COMPRESS BASIC NOLOGGING ( SUBPARTITION "P3_M201212" VALUES
201212
TABLESPACE "USER_WORK" COMPRESS BASIC, SUBPARTITION "P3_M201301" VALUES
201301
TABLESPACE "USER_WORK" COMPRESS BASIC )
);First modify the subpartition template
ALTER TABLE TEST set
SUBPARTITION TEMPLATE
SUBPARTITION "M201212" VALUES
201212
SUBPARTITION P1_201001 VALUES (201001),
SUBPARTITION P1_201002 VALUES (201002)
)Then if the new partition is HIGHER than ALL existing ranges you can just add it
alter table test add
PARTITION "P1" VALUES LESS THAN (5) If the new partition is LOWER than one onf the existing ranges you will need to SPLIT the existing partition.
alter table test SPLIT PARTITION "P3" AT (2)
INTO (PARTITION P1, PARTITION P3)See the sections in the VLDB and Partitioning Guide
Modifying a Subpartition Template
http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1007904
Splitting a Partition of a Range-Partitioned Table
http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028 -
Issue in data replication for one particular table
Hi,
We have implemented streams in out test environment and testing the business functionalities. We have an issue in data replication for only one custom table all other tables data replications are proper no issue. When we do 100 rows update data replication is not happening for that particular table.
Issue to simulate
Update one row -- Replication successful.
100 rows update -- After 3-4 hrs nothing happened.
Please let me know did any of you have come across similar issue.
Thanks,
AnandExtreme slowness on apply site are usually due to lock, library cache locks or too big segments in streams technical tables left after a failure during heavy insert. these tables are scanned with full table scan and scanning hundreds of time empty millions of empty blocks result in a very big loss of performance, but not in the extend your are describing. In your case it sound more like a form of lock.
We need more info on this table : Lob segments? tablespace in ASSM?
If the table is partitioned and do you have a job that perform drop partitions? most interesting is what are the system waits nd above all the apply server sessions waits. given the time frame, I would more looks after a lock or an library cache lock due to a drop partitions or concurrent updates. When you are performing the update, you may query 'DBA_DDL_LOCKS', 'DBA_KGLLOCK' and 'DBA_LOCK_INTERNAL' to check that you are not taken in a library cache lock. -
Dropping tablespace for a partitionned table
Hi all,
I have a table partitionned and I want to drop the tablespace for a specific partition. So what happen in the table if I drop one tablespace with a commande drop tablespace tbs including contents and datafiles;
Does the index unusable in this table?
RegardsNo, you can not drop a tablespace which contains tables whose partitions are not completely contained in this tablespace.
db9i :SQL> create tablespace users2 datafile '/u02/oradata/db9i/users201.dbf' size 10M;
Tablespace created.
db9i :SQL> CREATE TABLE sales_by_region (item# INTEGER, qty INTEGER,
2 store_name VARCHAR(30), state_code VARCHAR(2),
3 sale_date DATE)
4 STORAGE(INITIAL 10K NEXT 20K) TABLESPACE test
5 PARTITION BY LIST (state_code)
6 (
7 PARTITION region_east
8 VALUES ('MA','NY','CT','NH','ME','MD','VA','PA','NJ')
9 STORAGE (INITIAL 20K NEXT 40K PCTINCREASE 50)
TABLESPACE users,
10 11 PARTITION region_west
12 VALUES ('CA','AZ','NM','OR','WA','UT','NV','CO')
13 PCTFREE 25
14 TABLESPACE users2,
15 PARTITION region_unknown
16 VALUES (DEFAULT)
17 TABLESPACE test
18 );
Table created.
db9i :SQL> insert into sales_by_region values (1, 100, 'store 1','NY',sysdate);
1 row created.
db9i :SQL> insert into sales_by_region values (2, 200, 'store 2','UT',sysdate);
1 row created.
db9i :SQL> insert into sales_by_region values (3, 300, 'store 3','ZZ',sysdate);
1 row created.
db9i :SQL> commit;
Commit complete.
db9i :SQL> select count(*) from sales_by_region
2 /
COUNT(*)
3
--insure all data went to the right partition
db9i :SQL> alter table sales_by_region truncate PARTITION region_east;
Table truncated.
db9i :SQL> select count(*) from sales_by_region
2 /
COUNT(*)
2
db9i :SQL> alter table sales_by_region truncate PARTITION region_west;
Table truncated.
db9i :SQL> select count(*) from sales_by_region
2 /
COUNT(*)
1
db9i :SQL> alter table sales_by_region truncate PARTITION region_unknown;
Table truncated.
db9i :SQL> select count(*) from sales_by_region
2 /
COUNT(*)
0
db9i :SQL> insert into sales_by_region values (1, 100, 'store 1','NY',sysdate);
insert into sales_by_region values (2, 200, 'store 2','UT',sysdate);
insert into sales_by_region values (3, 300, 'store 3','ZZ',sysdate);
1 row created.
db9i :SQL>
1 row created.
db9i :SQL>
1 row created.
db9i :SQL>
db9i :SQL>
db9i :SQL> commit;
Commit complete.
db9i :SQL> select count(*) from sales_by_region
2 /
COUNT(*)
3
--now drop one tablespace
db9i :SQL> drop tablespace users2 including contents and datafiles
2 /
drop tablespace users2 including contents and datafiles
ERROR at line 1:
ORA-14404: partitioned table contains partitions in a different tablespace
db9i :SQL> !oerr ora 14404
14404, 00000, "partitioned table contains partitions in a different tablespace"
// *Cause: An attempt was made to drop a tablespace which contains tables
// whose partitions are not completely contained in this tablespace
// *Action: find tables with partitions which span the tablespace being
// dropped and some other tablespace(s). Drop these tables or move
// partitions to a different tablespace
--move table partition from users2 to users
db9i :SQL> alter table sales_by_region move partition region_west
tablespace users; 2
Table altered.
--drop tablespace again
db9i :SQL> drop tablespace users2 including contents and datafiles
2 /
Tablespace dropped. -
Skip gather stats for a partition | table from the gather_stats_job in 10g
Hi all,
Can we skip gather statistics for a table or a partition in a partitioned-table from the GATHER_STATS_JOB in Oracle 10g ?
(cause that partition store in an offline-datafile, so GATHER_STATS_JOB had errors when running in sheduled).
Thanks.
Edited by: user8710247 on Nov 26, 2011 6:41 PMGATHER_TABLE_STATS will default to GRANULARITY 'AUTO' which will include Global and Partition Statistics. Global Statistics have to be across all the Partitions -- so Oracle will attempt to read all the partitions for this !
You need to run GATHER_TABLE_STATS with GRANULARITY 'PARTITION' and naming the other Partitions --- i.e. run it for each of the online partitions.
See :
SQL> create table XYZ (col_1 number, col_2 varchar2(5))
2 partition by range (col_1)
3 (partition P1 values less than (10) tablespace HEMANT,
4 partition P2 values less than (100) tablespace USERS)
5 /
Table created.
SQL> insert into XYZ values (5,'Five');
1 row created.
SQL> insert into XYZ values (50,'Fifty');
1 row created.
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,granularity=>'ALL');
PL/SQL procedure successfully completed.
SQL> select partition_name, tablespace_name , num_rows, sample_size from user_tab_partitions
2 where table_name = 'XYZ'
3 /
PARTITION_NAME TABLESPACE_NAME NUM_ROWS
SAMPLE_SIZE
P1 HEMANT 1
1
P2 USERS 1
1
SQL>
SQL> exec dbms_stats.lock_table_stats('','XYZ');
PL/SQL procedure successfully completed.
SQL> alter tablespace HEMANT offline;
Tablespace altered.
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,granularity=>'ALL');
BEGIN dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,granularity=>'ALL'); END;
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 13159
ORA-06512: at "SYS.DBMS_STATS", line 13179
ORA-06512: at line 1
SQL>
SQL> exec dbms_stats.unlock_table_stats('','XYZ');
PL/SQL procedure successfully completed.
SQL> exec dbms_stats.lock_partition_stats('','XYZ','P1');
PL/SQL procedure successfully completed.
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,granularity=>'ALL');
BEGIN dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,granularity=>'ALL'); END;
ERROR at line 1:
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2:
'/usr/oracle/oradata/MONDB/datafile/o1_mf_hemant_7d6m8zkx_.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 13159
ORA-06512: at "SYS.DBMS_STATS", line 13179
ORA-06512: at line 1
SQL>
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,partname=>'P2');
BEGIN dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,partname=>'P2'); END;
ERROR at line 1:
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2:
'/usr/oracle/oradata/MONDB/datafile/o1_mf_hemant_7d6m8zkx_.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 13159
ORA-06512: at "SYS.DBMS_STATS", line 13179
ORA-06512: at line 1
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,partname=>'P2',granularity=>'GLOBAL AND PARTITION');
BEGIN dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,partname=>'P2',granularity=>'GLOBAL AND PARTITION'); END;
ERROR at line 1:
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2:
'/usr/oracle/oradata/MONDB/datafile/o1_mf_hemant_7d6m8zkx_.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 13159
ORA-06512: at "SYS.DBMS_STATS", line 13179
ORA-06512: at line 1
SQL>
SQL> exec dbms_stats.gather_table_stats('','XYZ',estimate_percent=>100,partname=>'P2',granularity=>'PARTITION');
PL/SQL procedure successfully completed.
SQL>Hemant K Chitale -
I have installed a new drive on my mac book and more ram but the snow leopard install asks which to install the system on but then does not show the drive.
do I have to partition it and name it first. -- if so just one partition?Do this:
Drive Preparation
1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu.
2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID then click on the OK button. Click on the Partition button and wait until the process has completed.
4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
When formatting has completed quit DU and return to the installer. Complete the OS X installation. -
Best practice for replicating Partitioned table
Hi SQL Gurus,
Requesting your help on the design consideration for replicating a partitioned table.
1. 4 Partitioned tables (1 master table with foreign key constraints to 3 tables) partitioned based on monthly YYYYMM
2. 1 table has a XML column in it
3. Monthly switch partition to remove old data, since it is having foreign key constraint; disable until the switch is complete
4. 1 month partitioned data is 60 GB
having said the above, wanted to create a copy of the same tables to a different servers.
I can think of
1. Transactional replication, but then worried about the XML column,snapshot size and the alter switch will make the same thing
on the subscriber or row by row delete.
2. Logshipping with standby with every 15 minutes, but then it will be for the entire database; because I have other partitioned monthly table which is of 250 GB worth.
3. Thinking about replicating the Partitioned table as Non Partitioned, in that case how the alter switch will work. Is it possible to ignore delete when setting up the replication.
3. SSIS or Stored procedure method of moving data on a daily basis.
4. Backup and restore on a daily basis, but this will not work when the source partition is removed.
GaneshPlz refer to
http://msdn.microsoft.com/en-us/library/cc280940.aspx -
Need help with importing data in partition table
Hi,
DB:8.1.7
OS: win 2003 server
I have a table which is 4.5GB in size. I created a new partition table,with local indexes. I exported the original table with all indexes,triggers and procedures.
After creating the empty partitioned table,i imported the dump file. The data isn't loaded. My questions are:
1) Will the indexes be overwritten?
2) Will the data go automatically in allocated partitions?
3) Do i need to export only table data ignoring indexes,triggers etc?
Best Regards,ateeqrahman wrote:
1) Will the indexes be overwritten?Not if they already exist with the same name, or with the same logical definition (ie. same columns are already indexed)
2) Will the data go automatically in allocated partitions?Yes
3) Do i need to export only table data ignoring indexes,triggers etc?Do you need the triggers? do you need indexes that you haven't created manually? What about grants? -
Need of the datasource for the CRM Table CRMD_MKTATTR_SET
Hi Experts,
I have a field name in CRM but I couldn't able to find out the datasource in which that field exists
CRM Field Name CRM Table Name
ATTRIBUTE_SET CRMD_MKTATTR_SET
Now I need the Datasource(DS) for the above mentioned field, so that I can do the extraction from CRM to BW.
And can anyone provide me the information fo how to find out the relavant Datasource in CRM for a particular field in CRM
Could anyone please help me in the above issues.
Thanking you in Advance.
ARUNHi Arun,
Duno whether this is what you need:
CAMP_TYPE CRM Marketing Planning - Campaign Type CRM_MKTPL_ATTR CAMP_TYPE:
http://help.sap.com/saphelp_nw70/helpdata/en/a0/e98d3b24e50656e10000000a114084/frameset.htm
Alice -
Default partition name for Interval partitioned tables
Hi ,
Can we change the default partition names which are generated by Oracle.
For Example :
CREATE TABLE part_interval (
id NUMBER,
created_date DATE
PARTITION BY RANGE (created_date)
INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
PARTITION part_01 values LESS THAN (TO_DATE('01-NOV-2007','DD-MON-YYYY'))
Now if I insert values which doesn't fall in the 01-NOV-2007 date, a new partition is created like SYS_P43. Can I change this default partition name in the SQL statement itself . Not through procedures or functions.
Regards,
Raghunathan A
Edited by: 869187 on Jun 29, 2011 6:08 AM869187 wrote:
Hi ,
Can we change the default partition names which are generated by Oracle. post SQL & results that show you can change partition names generated by YOU.
Maybe you are looking for
-
Dear experts, Is there a way for the following SELECT query to be improved? The problem that I'm seeing here is that the same table (l_item_tab) is being queried twice in the SELECT query (due to the "table joins", a and b). How can I improve the dat
-
Hi all, I m getting this error in idoc.. Entry in outbound table not found. I doc number is generated.. also giving Program code ..check and tell me whr can i do change.. Following is program for idoc... REPORT ZNA_IDOC . *TABLES: CRMD_ORDERADM_
-
Accessing Dynamic Internal table fields
Hello All, I have one internal table ep_tabx having 138 columns whose data is getting displayed by using function module reuse_alv_grid_display. Now my query is, i have created one custom button on the appl toolbar to download ep_tabx data. IF the us
-
X Value for a correcting CMAx of Y channel
Hi There, I am tryinig to read in the Cmax of a Y channel. This is fine, I have no issues. But would like o get the corresponding time value(X -channel) when CMax occurs. For this I check each value of the channel using CHDX and get the X value, henc
-
Printer suddenty wont print Excel or Quickbooks but will print Word docs
Help! My HP 6500 just decided to stop printing Excel, Quickbooks and Efax but WILL print Word documents and other files. When I hit "okay" ont he print menu the printer head goes back and forth but no ink comes out. Again, the weird thing is that Wor