PL/SQL :: Dropping Partitions At Once
Nov 2, 2012
ALTER TABLE table_name DROP PARTITION (partition_1000);
ALTER TABLE table_name DROP PARTITION (partition_1001);
...
.........
......
ALTER TABLE table_name DROP PARTITION(partition_1320);(b
it is a delta partition,so trying to remove 320 partitions at once in pl/sql developer for a single table.
Like this i have to remove for more then 15 tables one by one, will this effect the database like filling up the archinve log destination by writing more logs.
kind of problems that i am going to face , as i am doing it on the production box directly.
View 5 Replies
ADVERTISEMENT
Jul 1, 2010
Initially 2008 to 2010 and 2009 to 2011 partitions are created, After that two more new partitions are created 2008 to 2009 and 2009 to 2010.
How can we move data from old partitions to corresponding new partitions.
View 9 Replies
View Related
Apr 13, 2008
I am unable to drop a snapshot , i tried even from sys, it is giving the following error,
drop snapshot adm.dup_resource_status
9:46:29 ORA-08103: object no longer exists
but, when i try to create a new snapshot with the same name
CREATE MATERIALIZED VIEW ADM.DUP_RESOURCE_STATUS
..............
I get
ORA-12006: a materialized view with the same user.name already exists.
View 31 Replies
View Related
Jul 7, 2012
Do i have to create indexes again if i drop a partition on a table?
View 6 Replies
View Related
Jun 9, 2010
Would like to know:
When you drop a user profile, Oracle automatically assigns the default profile to that user - knowing that no other profile has been assigned to that user.
Does this happen in the same session or after a restart?
A user must have a profile at all times, so if a profile is dropped, then the default profile should be assigned in the same session because if not, then during that session the user has no assigned profile which shouldn't happen?
View 2 Replies
View Related
Apr 26, 2012
When the procedure is executing can we drop a procedure . Is there any way to drop the procedure with force .
View 5 Replies
View Related
Jun 18, 2012
we are refreshing data base for our application from the base load,Every time when ever there is refresh required we need to drop the users and recreate every thing from the base load. For this we need to kill the sessions and drop the users ,Putting the instance in the restricted mode and refreshing the db.Some time when ever During the killing and dropping process there are some errors like you can not drop the users which is currently connected .
set termout on
set echo on
spool Kill_sessions_drop_users.log
DECLARE
[code]...
how to get rid of this
View 6 Replies
View Related
Mar 29, 2013
I created an encrypted tablespace for testing. I later dropped it but don't remember if I specified "including contents and datafiles". The tablespace was empty and there are no datafiles for it. However, the information for this dropped tablespace still shows up in v$encrypted_tablespaces. How do I get that lingering information removed?
View 3 Replies
View Related
Nov 10, 2010
i have many partitions in one table. i need metadata for some of the partitions. We have any option to get the metadata for partitions only.because while selecthing the table meatdata i am getting long script.
View 2 Replies
View Related
Aug 20, 2013
I have a day based partitioned table TAB1.Let say for month Aug 2013 Partitions are like P010813,P020813,P030813 up to P310813.When gather stats job will run i want to analyze only the last 3 used partitions based on current date, this would be P180813,P190813,P200813. write a query which will give the last 3 used partitions.e.g.
If run query on 20-AUG-2013.P180813P190813P200813FOR 25-AUG-2013P230813P240813P250813
View 1 Replies
View Related
Aug 9, 2012
I am trying to drop a column from a huge partitioned table (non compressed including partitions). I am working on 11gR2 database for information.
i used below approach
1. alter table <tab_name> set t1 unused column;
2. alter table <tab_name> drop unused columns;
then i got the below error message
ORA-39726: unsupported add/drop column operation on compressed tables
First statement did work i could be able to add another column with the same name but still don't want the unused column on the table.
View 5 Replies
View Related
Dec 9, 2010
I am trying to drop a user but i get the following error
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables
A couple of questions on this error:
- I did a search on the forum and the thread [URL] appears to have a solution to it by using
DBMS_AQADM.DROP_QUEUE_TABLE(queue_table => 'DEF$_AQCALL', force =>TRUE);
What i am not sure of is which queue will the above statement drop if run as sys and there are multiple schemas with different schema names but with the same queue name?
- We recently rebuilt the database server and prior to the rebuild i have always managed to drop a user without the above error. Is it likely that some setting somewhere is changed?
View 2 Replies
View Related
Jan 21, 2003
I have been trying to drop an unused column in a partitioned table, and the number of records stored in this unused column was very high. I kept on running into errors as follows:
ORA-01562: failed to extend rollback segment number 10
ORA-01650: unable to extend rollback segment R09 by 256 in tablespace RBS
I tried to "SET TRANSACTION USE ROLLBACK SEGMENT <name>" with a larger rollback segment, but it still did not work. Can I drop the "unused column" from each partition instead?
How to apply that? Or, what are my options besides increasing the size of the rollback segment?
View 6 Replies
View Related
Oct 21, 2011
I am working on Oracle 10g. I want to drop a schema and I want to re use the space in data files to other schema.
If I drop the user by "DROP USER USERNAME CASCADE" , tables in that schema are purged by default or do I have to explicitly drop the tables , purge the re cycle bin and then drop the schema?
View 2 Replies
View Related
Aug 21, 2013
when going through some white papers i find athing which made me confusing it stats that dropping a database will also drop the sp file.
is it true
sp file is important is n't it
View 1 Replies
View Related
Mar 27, 2013
I want to drop some users in Oracle DB using sqlplus but I am getting error:
SQL> DROP USER test CASCADE;
DROP USER test CASCADE
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected.But when I ran below command to know sessions connected I am not getting any results:
SQL> select sid,serial# from v$session where username = 'test';
no rows selected
View 3 Replies
View Related
Dec 23, 2012
i Cannot drop old undo tablespace. While dropping the old undo tablespace we get an error
ERROR at line 1: ORA-01548: active rollback segment '_SYSSMU77$' found, terminate dropping tablespace
SQL> select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE';
TABLESPACE_NAME STATUS SEGMENT_NAME
------------------------------ ---------------- ------------------------------
SYSTEM ONLINE SYSTEM
APPS_UNDO NEEDS RECOVERY _SYSSMU77$
View 11 Replies
View Related
Jan 8, 2011
If I try create table from the following syntax
create table a as select * from table b;
Then I could get only base table structure alone, I would like to get partition syntax as well.
View 1 Replies
View Related
Nov 2, 2010
I have more 100 partition in a table, I would like to query 10 partitions alone in single statement, Hope it could be possible like query data for single partitions, provide the syntax for the same.
Because if I try to query for all the partition then the query is Hanging due to the large no of data, then I can query single partition by partition then it takes more than a day. so, I would like query data for 10 partition in a single select.
View 1 Replies
View Related
Sep 26, 2011
Query to drop partitions on a table who have no.of rows as zero.
select 'ALTER' || '' || 'TABLE' || TABLE_NAME || 'DROP' || 'PARTITION' || PARTITION_NAME from dba_tab_partitions where TABLE_OWNER='xyz' ;
select count(*) from table_name partition (partition_name);
View 14 Replies
View Related
Jul 4, 2012
Lets say I have a table like the following -
ID--------DATE_TIME-----------------VALUE
101----- 01/01/2012 14:00:00 ---12
101----- 11/01/2012 23:00:00 ---17
101----- 13/01/2012 10:00:00 ---22
101----- 19/03/2012 08:00:00 ---7
101----- 19/03/2012 19:00:00 ---7
101----- 19/03/2012 20:00:00 ---7
101----- 20/03/2012 02:00:00 ---3
101----- 20/03/2012 03:00:00 ---3
101----- 21/03/2012 13:00:00 ---14
101----- 21/03/2012 14:00:00 ---14
101----- 21/03/2012 21:00:00 ---13
101----- 21/03/2012 22:00:00 ---13
101----- 21/03/2012 23:00:00 ---13
101----- 22/03/2012 00:00:00 ---13
I'm looking for a script to partition the data into sections where the VALUE is the same over a constant period of time with no breaks. I'd like to give each partition a value to identify it by.
So the outcome of the script would be the following -
ID--------DATE_TIME-----------------VALUE-----IDENTIFIER
101----- 01/01/2012 14:00:00 ---12----------1
101----- 11/01/2012 23:00:00 ---17----------2
101----- 13/01/2012 10:00:00 ---22----------3
101----- 19/03/2012 08:00:00 ---7------------4
101----- 19/03/2012 19:00:00 ---7------------5
101----- 19/03/2012 20:00:00 ---7------------5
101----- 20/03/2012 02:00:00 ---3------------6
101----- 20/03/2012 03:00:00 ---3------------6
101----- 21/03/2012 13:00:00 ---14----------7
101----- 21/03/2012 14:00:00 ---14----------7
101----- 21/03/2012 21:00:00 ---13----------8
101----- 21/03/2012 22:00:00 ---13----------8
101----- 21/03/2012 23:00:00 ---13----------8
101----- 22/03/2012 00:00:00 ---13----------8
I was trying to do something with trunc(date_time) but that didnt work out right as the blocks of data can carry over several days as seen in the rows with IDENTIFIER = 8.
View 7 Replies
View Related
Nov 29, 2012
Can we add partitions for materialized views like tables ? ALTER TABLE owner.tablename ADD PARTITION p1 VALUES LESS THAN (2012,12);
Like is there any syntax for mview ALTER TABLE mv.mviewname ADD PARTITION ..... ?
View 2 Replies
View Related
Sep 13, 2012
My developer came with a requirement of creating partitions on a table which has 40 million records. His exact requirement is to create as many as partitions in such a way that 1 partition should not exceed 5k-10k records and these records should be inserted/updated on the same date (i.e. using a column as source_timestamp field). How to accomplish this?
View 2 Replies
View Related
Jul 26, 2010
Is it possible to change the start with value on a sequence without dropping and recreating it?
View 3 Replies
View Related
Oct 2, 2013
is there a way to modify supertypes without dropping / recreating its subtypes?
View 6 Replies
View Related
Mar 30, 2012
Got following error while droping user
DB:9.2.0.8.0 OS:Windows 2003
SQL> drop user custom cascade;
drop user custom cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-21700: object does not exist or is marked for delete
View 1 Replies
View Related
Jul 11, 2012
I have a data base for the bank application development. So there might be more than one sessions of the application running on the data base as well as there might be more than one data base sessions being connected from the dbas.
There is refresh procedure to refresh the data base from the baseload scripts ,So for that first we need to disconnect the users (Kill the sessions) and then drop the users then recreate the users and populate the users with the base load data.
I have prepared the killing and dropping user script in the following manner, Most of the times it is working fine and killing the users but some times it is not able to kill the drop the users it is erroring out with the error that can not dorp the users as there are active sessions running ,
set termout on
set echo on
spool Kill_sessions_drop_users.log
DECLARE
v_alt_stmt VARCHAR2(1000) := 'ALTER SYSTEM DISCONNECT SESSION ''';
v_kill_stmt VARCHAR2(1000);
[code].......
--This will kill all the sessions except the current session
CURSOR cur_usr_dtls IS SELECT username FROM all_users WHERE username IN ('ACTIVITI','TP','TPCORR','TPTUX','TPVIEW');
v_dr_stmt VARCHAR2(1000);
BEGIN
EXECUTE IMMEDIATE 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
DBMS_OUTPUT.PUT_LINE('The database has been put in the restricted mode');
FOR v_cur_ssn IN cur_session
[code]........
--Here we are making the processor to wait for 60 mins so that that the killing will happen at the OS label
DBMS_LOCK.SLEEP(60);
FOR v_cur_usr_dtls IN cur_usr_dtls LOOP
v_dr_stmt :='DROP USER '||v_cur_usr_dtls.username ||' CASCADE';
BEGIN
EXECUTE IMMEDIATE v_dr_stmt;
[code]........
View 4 Replies
View Related
Aug 22, 2012
I have created an Interval Partition Table as show below, Is their any way, i can drop the partition dynamically when i truncate the table as oracle creates them with system generated name? Instead Alter table drop partition !
Create Table Script :
------------------------------------------------------------------------------------------------------------------------------------------------
CREATE TABLE TBL_EMP_SALES
(
EMP_ID NUMBER(38),
EMPNAME VARCHAR2(9),
EMP_SALES_AMOUNT NUMBER(5),
EMP_SALES_DATE DATE,
[Code]....
Insert Script :
------------------------------------------------------------------------------------------------------------------------------------------------
INSERT INTO TBL_EMP_SALES VALUES (1001,'A',50,SYSDATE);
INSERT INTO TBL_EMP_SALES VALUES (1002,'B',100,SYSDATE+1);
INSERT INTO TBL_EMP_SALES VALUES (1003,'C',80,SYSDATE+2);
[Code]....
Partitions Created :
-------------------------------------------------------------------------------------------------------------------------------------------------
select segment_name,partition_name,bytes from user_segments where segment_name = 'TBL_EMP_SALES';
segment_name partition_name bytes
TBL_EMP_SALES P0 8388608
TBL_EMP_SALES SYS_P602 8388608
TBL_EMP_SALES SYS_P603 8388608
[Code]....
View 5 Replies
View Related
Nov 10, 2010
I have tables in production which has got huge no of partitions(say more than 100), but I would like to extract table definiation along with mentioned few partitions(say 10 partitions) alone. How to do that, which way is the best to extract DDL with right format.
because when I use metadata package the format for the extraction is not good, is there a way to extract table definition with mentioned partition names.
View 2 Replies
View Related
Mar 9, 2010
How can we partition the existed table.
The table is like this
CREATE TABLE my_table (
id NUMBER,
description VARCHAR2(50)
);
[Code]...
I want to partition this table into 3 partitions.
The first partition should contain the values less than 3.
The Second partition should contain the values less than 5.
The third partition should contain the values less than 6.
View 16 Replies
View Related