Delete the data in partitioned tables
Hello
Oracle 11.2.0.3.0 version, running on Linux Enterprise.
I need to remove all the data from two tables (several 100 million lines each) that are partitioned.
(1) table 1 is a partition table have varied to a DATE column
(2) Table2 is a partition of reference table; partitioning is referenced on a relationship of foreign key to Table1 (column: key Table1.Primary)
As I have no need for data, but want to keep the structure of the table, I would ideally like to delete partitions at the same time that the deletion of the data, so that the 2 tables partitioned and empty.
Additionally, Table1 has some partitioned index I would be rebuilt as an index unpartitioned (given that Table1 will be empty).
I thought I would start by removing all partitions of Table1 (via "ALTER TABLE DROP PARTITION nom_partition Table1"), but when the script came to the last partition, I got this error message:
ORA-14083: cannot delete the only one partition of a partitioned table
ORA-06512: at "SYS." DROP_PARTITIONS', line 46
If someone could advise as to the best approach to what I want to achieve with regard to the two tables? Two tables down and recreate them then without partitions would be the easiest way?
Thanks in advance for any guidance.
If someone could advise as to the best approach to what I want to achieve with regard to the two tables? Two tables down and recreate them then without partitions would be the easiest way?
Yes - delete the tables and re-create them.
As says the exception that you cannot delete the last partition. A table is partitioned either or it is not.
There was no interest at all to use DBMS_REDEFINITION to redefine tables because you do not want the data anyway.
Tags: Database
Similar Questions
-
Recovery disk is deletes the data at the 2nd disk on Satellite A300?
Hello
I use a laptop Toshiba A300, which has 2 hard drives (250GB). The laptop has Windows Vista Home Edition 32-bit installed, but I want to change for Windows Vista 64-bit, which comes with the recovery disk, in order to use all 4 GB of RAM.I have all the backup data and move them to the 2nd HARD drive (D, C named first name).
So I wonder if Recovery Wizard will delete the data of the two hard disks or just a 1st.
Thanks in advance
KevinHello
Your laptop was equipped with HARD drive recovery option allows you to create the own Toshiba Recovery disk which would be contains the preinstalled operating system.
In your case the Vista 32 bit.And Yes, install from the recovery disk format the whole HARD drive and removes all the disk, also of the second partition.
That's why to create the recovery disk before you install or change anything on the HARD drive
-
Kindly help me with the request to find the data in two tables
Hello Guru
Kindly help me to recover the data from two tables-
BASEBALL
LEGAL_ENT_ID (PK)
GAME_ID (FK)
LEGAL_ENT_NM
INACTIVE_DT
DATE OF INS_TS
INS_LOGIN
DATE OF UPD_TS
UPD_LOGIN
FOOTBALL
GAME_ID (PK)
BRKR_NM,
BRKR_ISR_ID
BROKER_SYMBOL
INACTIVE_DT
BRKR_SWIFT_FLG
BRKR_INTERNAL_FLG
BRKR_CATEGORY
UPD_TS
MINORITY_FLG
BROKER_TYP
STATUS
INS_TS
INS_LOGIN
UPD_LOGIN
APP_USER
ACTIVE_FLG
and if I want fecth data from these two tables according to the following condition then it is fine with the suite of applications.
1 select distinct values only table of BASEBALL by using the following query.
SELECT DISTINCT B.GAME_ID as 'CLEARING GAME ID', B.BRKR_NM "NAME of THE GAME of COMPENSATION" OF BASEBALL A, FOOTBALL B WHERE A.BROKER_RELATION_CD IN ('FUTBRKR1', 'FUTBRKR2') AND A.GAME_ID = B.GAME_ID
2 Select all the table BRKR_NM OF FOOTBALL as well by using the query - next
SELECT GAME_ID "RUNNING GAME ID", 'NAME OF THE GAME OF EXECUTION' BRKR_NM SOCCER
Now, my query is that--
I want a query that gives me a combination of above mentioned queries... and if I tried to use Union or Union All, then she is not giving me the result as expected.
I like the result to look like who has a few conditions such as -
1 - the records in the table Football are high vs Baseball table because there is no condition to filter the records of the Football.
2 - football is a superset of records and Baseball is a subset.
3 - COMPENSATION NOM_JEU and RUNNING NOM_JEU may return the same values as well.
I want the result to be in the following form-
EXECUTION ID GAME | NAME OF THE GAME TO RUN. COMPENSATION ID GAME | DELETE THE NAME OF THE GAME.
2123 test1 2345 test5
2456 test10 2456 test10
Thanks in advance. Kindly help me.
Published by: user555994 on January 4, 2011 23:48In the output you want.
All the values of baseball;
Values of football that are matched;
But on what condition you want to match? -
My browser is running do not. I uninstall, install several times. Uninstall cookies, delete the data from the user, install in another user - no reaction. What's wrong? Help, please
Start Firefox in Safe Mode {web link} by holding down the < shift >
(Mac options) key and then from Firefox. Is always the problem?Start your computer in safe mode with network. Then launch Firefox.
Try the sites secure web. Is always the problem? -
Deleting your iCloud account deletes the data?
I don't ask if the data can be retrieved by the user, just that Apple still keep or not?
I'm in Australia and we have mandatory data retention laws so they may be required by law.
Thank you.
I'm not aware of any way to delete an account iCloud. You can remove an account from a device and you can delete the data in an account, but in both cases, the account itself still exists.
-
concatenate the data in 2 tables in a third table as well as in CONCATENATE strings
Hello. as the title says, I wish to only concatenate the data in 2 tables in a similar third table that concatenate strings don't. All tables should be 1 d. For example, suppose that there is 1 table with the following: 1. 2; 3; 4 and table 2 with:; b; c; d. I would like a table 3 either 1 a, 2 b, 3 c, 4 d. Now this could be done easily with above mentioned concatenate strings, then table construction. but table 1 and 2 have something like 150 items. Rather painful. Any ideas?
Hold arrays of two strings in a loop for example, concatentate the strings inside the loop and run the result réécrirait array3.
Autoindexing manages table manipulations.
MIke...
-
partition 'Windows cannot delete the active system partition on this disk.
I created a partition of HARD drive in order to install a system in multiboot using XP and Vista, but I did mess up the BONES of the two. Now I want to do a clean install of Vista ONLY, but I don't know how to get rid of the partition! * Example: Computer management > disk management > right-click on the volume (M) > Delete Volume * but I get an error: "Windows cannot delete the active system partition on this disk" can someone help me to get my Vista to original?
P.S. I have the "Microsoft Windows Vista Home Premium32 - bit Operating System Disk" provided with my computer when I bought it new. Thank you! -Jeff
If install a cleaning is required with a good DVD of Vista (not HP, Dell recovery disks):
At the startup/power on you should see at the bottom of the screen either F2 or DELETE, go to Setup/Bios or F12 for the Boot Menu
Go to your Bios/Setup, or the Boot Menu at startup and change the Boot order to make the DVD/CD drive 1st in the boot order, then reboot with the disk in the drive.
Delete the existing Partitions during the process.
http://support.Microsoft.com/default.aspx/KB/918884
MS advice on the conduct of clean install.
http://www.theeldergeekvista.com/vista_clean_installation.htm
A tutorial on the use of a clean install
http://www.winsupersite.com/showcase/winvista_install_03.asp
Super Guide Windows Vista Installation
See you soon.
Mick Murphy - Microsoft partner
-
Select the data in a table and update in another table
Dear experts,
create the table TB_ENCRYPT
(
Identification number,
Varchar2 (200) KEY
);
INSERT INTO TB_ENCRYPT VALUES(1,'HJUVHDUIFBSDGVU');
SELECT * FROM TB_ENCRYPT;
1 HJUVHDUIFBSDGVU
create TABLE users)
username, NUMBER of
password VARCHAR2 (200)
);
Insert users
values (1, 123 # "")
Insert users
values (2, 456 #')
Select * from users;
1 123 #.
# 2 456
I want to select the data KEY for table TB_ENCRYPT column and update in the column of tables for the respective key user password
TB_ENCRYPT table contains only a single key value. Comparing this key, I want to update the old value of the key to the new value.
For encryption and decryption I followed the java class method.no is worried about that.
create or replace
PACKAGE PCK_ENC AUTHID CURRENT_USER AS
FUNCTION DECRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.decrypt (java.lang.String, java.lang.String) return java.lang.String ';
FUNCTION ENCRYPT (VARCHAR arg0, arg1 VARCHAR) AS VARCHAR BACK LANGUAGE JAVA NAME 'Encrclass.encrypt (java.lang.String, java.lang.String) return java.lang.String ';
END;
SELECT PCK_ENC. ENCRYPT('1234','HJUVHDUIFBSDGVU') FROM DUAL;
HERE,
1234 - is the password of the users table column data
HJUVHDUIFBSDGVU - represents the key of table TB_ENCRYPT column data.
Comparing this key, I want to update the old value of the key to the new value.
I tried with this method
declare
cursor c1 is
Select the key
of TB_ENCRYPT
where id = 1
update the id;
Start
for c1_rec looping c1
update users
password is PCK_ENC. Encrypt (Password, Key)
the location being c1;
commit;
end loop;
end;
/
Help, please
You can use the MERGE statement.
merge into users using tb_encrypt on (id = userid) when matched then update set password = PCK_ENC.ENCRYPT(password,key);
And why you encrypt your password. This isn't a good idea. Just password hash.
-
Cannot delete the data and source ERPI loading system rules 11.1.1.3
Hello
I am trying to remove the source system screen ERPI in the workspace (what of more, we use in our application UAT), but it throws to up and say error message "could not delete the Source System. There are Applications associated with this Source system targets. Please remove all associated target Applications. »
I tried to delete the data load rules, but are all not valid and deletion icon (trash) is disabled.
Can someone help me how to clean these invalid instances?
Version: 11.1.1.3
Thank you
Jehanne
Figured out, remove the application of "Target Application Registartion" and your rules of metadata and loading data are deleted.
-
Size of the data in a table and the size of the table
I am trying to determine the size of the data in a table and also the overall table size. I use the following query:
SELECT BOTTOM (a.owner) as owner,
LOWER (a.table_name) AS table_name,
a.tablespace_name,
a.Num_Rows,
ROUND ((a.blocks * 8 / 1024)) AS size_mb,
a.Blocks,
a.Blocks * 8 Blocks_Kilo_Byte.
a.PCT_FREE,
a.compression,
a.Logging,
b.bytes / 1024 / 1024
From all_tables a, dba_segments b
WHERE the a.owner AS SUPERIOR ("USER_TEST")
AND a.table_name = "X_TEST_TABLE."
AND b.segment_name = a.table_name
AND b.owner = a.owner
ORDER BY 1, 2;
Is this the right way to go about finding the size of the data in a table? If this isn't the case, please give your suggestions.
BTW, this in a 10g version.You probably want to use the DBMS_SPACE package. In particular, the procedures SPACE_USAGE and UNUSED_SPACE to get an accurate account of the use of space in a table. Your application may give you a relatively accurate estimate if the optimizer on your table's statistics are reasonably accurate estimates. But there is no guarantee that the optimizer statistics are accurate.
If you want just an approximate answer and you're comfortable that your statistics are accurate, this query may be close enough. If you want a specific response, however, use the DBMS_SPACE package.
Justin
-
Inventory of the data of all Tables in a database
Hello
We do the analysis of the existing data base (Oracle 10 g) and I want to prepare an inventory of the data of all tables in a database that is
1. total number of records in a table
2. total number of records that have null values in a column
3. total number of standalone tables IE have no connection with other tables
etc...
Please let me know if there are tools or query that can do these tasks.
Thank you and best regards,
Lokeshselect owner "Owner", table_name "Table_Name", column_name "Column_Name", initcap(data_type) || decode(data_type, 'CHAR', '('|| char_length ||')', 'VARCHAR', '('|| char_length ||')', 'VARCHAR2', '('|| char_length ||')', 'NCHAR', '('|| char_length ||')', 'NVARCHAR', '('|| char_length ||')', 'NVARCHAR2', '('|| char_length ||')', 'NUMBER', '('|| nvl(data_precision,data_length)|| decode(data_scale,null,null, ','||data_scale)||')', null) "Type", nullable "Nullable", decode(to_char(num_distinct), 0,'No', 'YES') "Have Data", owner sdev_link_owner, table_name sdev_link_name, 'TABLE' sdev_link_type from sys.dba_tab_columns where (:OWNER is null or instr(owner,upper(:OWNER)) > 0) and (:TABLE_NAME is null or instr(upper(table_name),upper(:TABLE_NAME)) > 0) and (:COLUMN_NAME is null or instr(upper(column_name),upper(:COLUMN_NAME)) > 0) and substr(table_name,1,4) != 'BIN$' and substr(table_name,1,3) != 'DR$' order by owner, table_name, column_id
I added a new column with an alias "get data". This new column will display "NO" is the entire column is zero and 'YES' if there is even a value not null in the column. But caution is that statistics table must be updated to get the correct results.
Thus, it may be useful to gather current statistics before executing the query.
Exec dbms_stats.gather_schema_stats or even dbms_stats.gather_database_stats.
-
"shuffle" the data in a table...
Hello world...
Pleade help me solve this problem.
Is it possible to combine the data in a table?
Let say if i have a table with following data.. PERSON_ID PERSON_LAST_NAME PERSON_FIRST_NAME DOB 1 Test1 Test1 01/01/1970 2 Test2 Test2 01/01/1971 3 Test3 Test3 01/01/1972 4 Test4 Test4 01/01/1973 5 Test5 Test5 01/01/1974 I am trying to shuffle the above data so that no person will have their "real last,first and dob match". I need the output like this or in any combinations so that no one can identify a person actual "last name,first name and dob" PERSON_ID PERSON_LAST_NAME PERSON_FIRST_NAME DOB 1 Test1 Test2 01/01/1974 2 Test2 Test4 01/01/1975 3 Test3 Test5 01/01/1971 4 Test4 Test3 01/01/1972 5 Test5 Test1 01/01/1973 please help me to solve this issue. Thanks in advance
Hello
You can do something like this:
WITH got_nums AS ( SELECT person_id , ROW_NUMBER () OVER (ORDER BY dbms_random.value) AS person_id_num , person_last_name , ROW_NUMBER () OVER (ORDER BY dbms_random.value) AS person_last_name_num , person_first_name , ROW_NUMBER () OVER (ORDER BY dbms_random.value) AS person_first_name_num , dob , ROW_NUMBER () OVER (ORDER BY dbms_random.value) AS dob_num FROM table_x -- WHERE ... -- Any filtering goes here ) SELECT id.person_id , ln.person_last_name , fn.person_first_name , db.dob FROM got_nums id JOIN got_nums ln ON id.person_id_num = ln.person_last_name_num JOIN got_nums fn ON id.person_id_num = fn.person_first_name_num JOIN got_nums db ON id.person_id_num = db.dob_num ;
This does not guarantee that no column of the same original line will be on the same line of output. I don't think that you really want it.
-
Move the data from partition to partition of MAX table?
11 GR 2, RHEL, 64-bit
Guys,
Is there a way to MOVE data to a specific partition on MAX in a partitioned table?
While I can drop this specific partition and recreate it later, but I want the data to be resident in the MAX score until I recreate this specific partition.
Pls suggest me?
Thank you
Hari
Depends on the way in which the partitions are defined (the partition limit values), each partition will allow only certain values must be stored.
Logically, the lines that are in partition 'A' cannot return to the partition'm ' because the limit / list of values for the two partitions is different.
You can move the lines of a fictitious table / temp, but probably not to another partition until and unless MERGE you partitions (in which case the original partition doesn't exist).
Hemant K Collette
-
Hello
Search page, I developed with two buttons, go and clear.and data sought are displayed in the table on the page.
using the 'clear' button I can able to clear data from text boxes, but I want to data displayed in the table on the page must also be clear.
Please provide assistance to achieve this.
and iam also getting a problem more clearly by clicking the button twice, the first time it is deletion of the data, where, like the second time, it's
What gives exception.how to prevent null pointer is not to get a null pointer exception.
Hello
in, click clear, you want data from the table are evacuated, do you want to text boxes to clear snow?
You can achieve this by extending the controller and clear data that VO, so to clear the table.
1 handle the button click clear
If (oapagecontext. GetParameter("ClearBtn")! = null)
2 claire VO associated table
SVO OAViewObject = (OAViewObject) am.findViewObject ("yourVO"););
svo.setWhereClause ("1 = 2");
svo.executeQuery ();
3. If you want to clear the text boxes you can use following code
OAMessageTextInputBean mtib = (OAMessageTextInputBean) webBean.findIndexedChildRecursive ("bean_id");
if(MTIB!=null)
mtib.setValue (pageContext, null);
-
Delete the data in table dumy ABC if I logout, click sign OUT
Hi friend
I want to delete all the data in table dumy ABC if I logout in click the LOGOUT link in Upper right side.
How can I do that.
Thank youJust tried original link, I've included a few... after the link: http://dgielis.blogspot.com/2007/07/oracle-apex-behind-scenes-logout.html
Try it now...
Thank you
Tony Miller
Webster, TX
Maybe you are looking for
-
How to save the document iWork on iCloud drive?
I have 4 files in my player to iCloud. When I create a new document in Pages and save it in the folder of chemistry, I noticed that the Pages also saves a copy in the Pages folder. So I find myself with two copies of the document. The same thing h
-
Satellite Pro U300 not wakeup from hibernation opening lid - drums
When my laptop was new, a prolonged Sessen could be restarted by opening the cover. During this time, this feature is reduced in this case, external power supply is plugged. If I use only internal battery power, my computer laptop doen't start until
-
Hello! I have a problem, I want to calculate tan (90), but my program shows as a result 1.63 x 10 ^ 16 and it is impossible, I don't know what the problem is, how can I solve this problem? Thank you in advance for the advice PS I leave you a photo of
-
Acer model 571G v5 has key activated?
The site of acer said all aspire v5 models have active touch. I bought an acer model 517G v5. is this a function touch. ? I currently have the default windows7 Home Basic. Thanks in advance!
-
BlackBerry Smartphones phone stops ringing when only I pick it up
Hello I have a Blackberry 9720. 1. I want to know why my phone stop ringing when I pick it up to answer? 2. How can I me it ring any longer because she sounds for such a short time? Thank you very much Barbara