Possible To Compress Existing Table In Oracle Database
Nov 29, 2012it's possible to compress the existing table in oracle database directly.
View 1 Repliesit's possible to compress the existing table in oracle database directly.
View 1 RepliesIm having table which is of 45M rows table [Not partitioned], Now I want to compress the old data other than last 3Months data, I should not go for partition compress. Rarely some select queries will be fired on that Old data. Now how can I compress that table without affecting the Indexes , Dependencies proc, pkgs, Functions.
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionPL/SQL Release 11.2.0.3.0 - Production"CORE 11.2.0.3.0 Production"
Today I found myself in a situation where I needed to compress an already existing, partitioned index. First I issued an alter table to rebuild and compress the whole index:
SQL> ALTER INDEX MY_INDEX REBUILD COMPRESS;
ERROR at line 1:ORA-14086: a partitioned index may not be rebuilt as a wholeSo next I tried to rebuild compress one of the partitions:
SQL> ALTER INDEX MY_INDEX REBUILD PARTITION PART1 COMPRESS;
ERROR at line 1:ORA-28659: COMPRESS must be specified at object level first
Turns out that there is no way you can do a rebuild compress on partitioned indexes. I did not realize that until I stumbled across document 312843.1 on Metalink. It says the only way to compress a partitioned index is to drop it and recreate it (through 11.2).
My question is do we have any new feature in Oracle 11gR2 to rebuild partition indexes?
I have a lot of uncompressed backup. How can I compress it?
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
304 B 0 A DISK 01-OCT-12 1 1 NO BACKUP_DPCTRDB_000_100112093432
305 B 0 A DISK 01-OCT-12 1 1 NO BACKUP_DPCTRDB_000_100112093432
306 B 0 A DISK 01-OCT-12 1 1 NO BACKUP_DPCTRDB_000_100112093432
308 B 0 A DISK 01-OCT-12 1 1 NO BACKUP_DPCTRDB_000_100112093432
309 B 0 A DISK 01-OCT-12 1 1 NO BACKUP_DPCTRDB_000_100112093432
[Code]....
There is a huge table,i want to compress it,how can i do? alter table tb_my_table compress After executed the sql,the size of table have any change.
View 2 Replies View RelatedI am trying out the COMPRESS option along with CREATE TABLE. just wanted to understand if we need the "Advanced Compression" option enabled. Does this require extra license?
View 2 Replies View RelatedI am having many different files and i want to use pure plsql to get these files stored as blob from a table then compress them into 1 files and store that into another table. I did some search and its like possible but didnt get conclusive solution
View 4 Replies View Relatedcode to append data of 32k to exisitng CLOB field in an oracle table..
View 1 Replies View RelatedI tried to clone a 2 node rac database to single instance non rac database using existing backup. I have not used connectivity to target or catalog. rman duplicate finished with below messages:
rman auxiliary sys/******@dbracdup
RMAN> duplicate database to dbrac spfile backup location '/oracle/backup';
...
...
Finished recover at 25-JUL-12
Segmentation fault
And the database was in mount stage, and when i tried to open database it failed with below error:
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-19838: Cannot use this control file to open database .
I have the following four tables with the following structures Table A
ColA1 ColA2 ColA3 ColA4 ColA5 AA 100 CC DD EE
Table B
ColB1 ColB2 ColB3 ColB4 ColB5 AA 100 40452 A9 CDE
when these two tables were joined like the following:
Select colA1,ColA2, ColA3, ColA4, ColB3,ColB4, ColB5 from table A Left outer join (select ColB3, ColB4, ColB5 from table B where colB3 = (select max(colB3) from table B ) on (colA1 = colB1 and ColA2 = col B2)
Now i have to join the next table C with table B
Table C structure is
ColD1 ColD2 ColD3 Desc1 A9 Executive Desc1 A7 Engineer
I have the common column such as ColD2 and colB4 to get the Col D3
how do i join the existing query + join between table b and table c?
I would like to know about oracle 12c. In 12c, when i read documents,i understood that one container DB(CDB) can contain upto 253 pluggable DB and this pluggable DB(PDB) is similar to our traditional database(pre 12c).
1) whether my existing database (11.2.0.3) can be upgraded as pluggable DB and plugged it in CDB?
2)i read that we can move from local data center model to cloud in this version. Is that mean that once PDB is ready, whether we can plug it in CDB using private cloud or public also possible?
3)If public cloud is possible, are both CDB and PDB accessed through cloud client only?If so, whether our user data that is available under PDB also moved to external place?
During the database installation the two nodes after all the prerequisite check and copy of files i am getting the below error message
"Template4 General_Purpose.dbc does not exist. Please specify an existing template for database creation".
How can i overcome this error ? I am installing Oracle 11g R2 11.2.0 On Oracle Enterprise Linux (5.1.19) running on [Oracle Virtual Box 4.1.12 ]. Also what are the steps to uninstall the previously installed db_home1 which failed due to this error.
I am creating a table from another existing table in another schema. The existing table contains data. When I am using the query- create table m _voucher as select * from ipm.m_voucher,I am getting the whole data of m_voucher but I want empty m_voucher table, so what will be the query to get the empty m_voucher table?
View 4 Replies View RelatedI want to create temp table, for this i am using:
CODEcreate global temporary table help_temp
as
select * from help;
but this is creating only the table structure, not copying the table data.
What is the best way to convert an existing database table set with nls_legnth_semantic=BYTE to CHAR?
View 2 Replies View RelatedHow to add ROWDEPENDENCIES in an existing table. I mean How to Alter any table to add ROWDEPENDENCIES..
View 2 Replies View RelatedWe have a transaction table and has 30 million rows. The table is not partitioned till date. We need to create partition on this table. We had an idea of moving this data to a temporary table and create partition[range]on the original table and move the data back.
View 5 Replies View RelatedI want to either UPDATE or add a new column with ROWNUMBER() OVER an column on a table
the output will shows like below
empID DeptNo New_column Start_Date
11 7778 1 01-02-2010
11 3400 202-06-2010
25 4444 103-02-2010
25 7775 204-07-2011
25 7777 305-02-2012
30 2223 109-02-2012
the forth one column is in date format and I want to update table with respect to order by the column start_date
How to compress a index?
SQL> Create Table tb_compress_test
2 As
3 Select * From dba_objects;
Table created.
SQL> Create Index idx_object_id On tb_compress_test(object_id);
Index created.
SQL> Alter Index idx_object_id Move Compress;
Alter Index idx_object_id Move Compress
*
ERROR at line 1:
ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option
How to compress sub partition on exadata, using 'for query high' and pctfree 10 options? I used this statement, but I get only ORA-14160:this physical attribute may not be specified for a table subpartition.
alter table table_name move subpartition subpartition_name PCTFREE 10 compress for query high;
I need to get the timestamp for all the existing records in my table...I am having one user definition field, is this possible?
View 4 Replies View RelatedCan we modifying the existing constraint on table?I have table level UNIQUE constraint on 3 columns of table.I need to modify the UNIQUE constraint to 2 columns? Instead of dropping/recreating the constraint, is there any option to modify the existing constraint
Ex
CREATE TABLE TEST_CONST(NUM1 NUMBER , NUM2 NUMBER , NUM3 NUMBER , UNIQUE (NUM1 ,NUM2,NUM3)); ;
SELECT * FROM USER_CONS_COLUMNS UCC WHERE UCC.TABLE_NAME LIKE 'TEST_CONST';
ALTER TABLE TEST_CONST MODIFY CONSTRAINT SYS_C0025132 UNIQUE(NUM1,NUM2);
ORA-00933: SQL command not properly ended
Third statement is not executing fine .
I am abolute new in PL SQL and I am working on following topic:
I have to check if an entry exists in a table.
- if it exists ...... do something
- if not ...... simply go on
I tried the following:
select Count(*)from products p
where p.productNbr = temp_Nbr
Group By t.produkt;
I fetched the result into a variable entries
if entries > 0 .....
MY problem is the following:
If there are entries (entries>0) --> it works
If there are no entries, entries is not 0 but 'no data found' --> crash
I cannot work with Exceptions because this all happens in a Loop which must go on in both cases!
I have table property and flat , in both of these tables I have cvp_id common colomn .Now I want to add cluster on this colomn so how can I add cluster to table which is already exists.
View 3 Replies View RelatedI need to create partition on the non partition table without dropping a table.
Range partition on stage tables and hash partition on fact tables.
I have 2 tables that doesn't have primary keys. These 2 tables have same number of rows. I want to create a new table from getting some columns from table1 and some columns from table 2. I want to combine first row from table1 and first row from table2.
Below is example
TABLE1
ACOL1 ACOL2 ACOL3
A1 A2 A3
B1 B2 B3
C1 C2 C3
TABLE2
BCOL1 BCOL2 BCOL3
11 12 13
21 22 23
31 32 33
COMBINED_TABLE
ACOL1 BCOL2 BCOL3
A1 12 13
B1 22 23
C1 32 33
I tried below query but no luck. It gives below error:
Query : create table COMBINED_TABLE AS select a.ACOL1, b.BCOL2, b.BCOL3 from (select ACOL1,rownum from TABLE1) a, (select BCOL2, BCOL3, rownum from TABLE2) b WHERE a.rownum = b.rownum
Error : ORA-01747:"invalid user.table.column, table.column, or column specification"
declare
vnum number;
vname varchar2(50):='t1';
begin
begin
select count(*) into vnum from dba_tables where table_name=vname;
dbms_output.put_line('table count '||vnum);
exception
when others then
vnum := 0;
end;
begin
if vnum>0 then
execute immediate 'drop table '||vname;
dbms_output.put_line('table dropped');
end if;
exception
when others then
dbms_output.put_line('table does not exists');
end;
execute immediate 'create table '||vname ||' ( n number)';
dbms_output.put_line('table created');
end;
I am using compress partition for a large table.During the process I have used the below command for compress---
1. ALTER TABLE <TABLE_NAME> MODIFY PARTITION P1 COMPRESS;
However I found there are different command as below:-
2. ALTER TABLE <TABLE_NAME> MOVE PARTITION P1 COMPRESS;
What is the basic difference between these two as the compression is happening for both command.
I had created a new table named USERLOG with two fields from a previous VIEW. The table already consist of about 9000 records. The two fields taken from the VIEW, i.e. weblog_views consist of IP (consists of IP address), and WEB_LINK (consists of URL). This is the code I used,
CREATE TABLE USERLOG
AS
SELECT C_IP, WEB_LINK FROM weblog_views;
I want to add another column to this table called the USER_ID, which would consists of a sequence starting with 1 to 9000 records to create a unique id for each existing rows. I'm using Oracle SQL Developer: ODMiner version 3.0.04. I tried using the AUTO-INCREMENT option,
ALTER TABLE USERLOG
ADD USER_ID INT UNSIGNED NOT NULL AUTO_INCREMENT;
But I get an error with this,
Error report:
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 - "invalid ALTER TABLE option"
I recently started working with legacy code and noticed that some huge tables (5 years worth of data, don't have more details on me right now but can post later if needed) are partitioned based on time sequence number column while majority of queries are done based on time (different column). Queries performance is degrading and I'd like to try to modify partitioning and run some tests to evaluate performance improvement.
My only concern is with so much live data I have to come up with solution on how to switch partitioning with the least impact on applications running 24 x 7. Something you have done in the same situation and it worked?