Oracle 11gR2 Partition tables not creating in default user tablespace
Hi all:
Not sure if i'm missing something or overlooked but when i create a partition table in a user schema, it is not creating in the schema's default tablespace instead creating with no assigned to any and using SYSTEM tablesspace.
create user dgp identified by dgp default tablespace dgp temporary tablespace temp;
grant connect, resource to dgp;select USERNAME,DEFAULT_TABLESPACE from dba_users where username ='DGP';
USERNAME DEFAULT_TABLESPACE
DGP DG
select table_name, tablespace_name, partitioned from all_tables where owner='DGP';
TABLE_NAME TABLESPACE_NAME PAR
AUDITLOG_P2 DG NO
AUDITLOG_P YES
This is the partition script i used --i also gave the tablespace name:
CREATE TABLE dgp.AUDITLOG_P(
entry_time DATE,
username VARCHAR2(14),
groupname VARCHAR2(100),
ip VARCHAR2(15),
command VARCHAR2(15),
directory VARCHAR2(300)
PARTITION BY RANGE (entry_time)
partition P_PAST VALUES LESS THAN (TO_DATE('2010-01-01','YYYY-MM-DD')),
tablespace DG;
============
What is it i'm missing? Anything different with Oracle 11gR2 on the partition creations?
Thanks for your help..
Regards,
Ash
Yes, i tried using the schema login adn creating the table as well as system with schemaname prefix....
this is what i get from the below
SQL> select def_tablespace_name from dba_part_tables where table_name ='AUDITLOG_P';
DEF_TABLESPACE_NAME
DG
SQL> select partition_name, tablespace_name from dba_tab_partitions where table_name='AUDITLOG_P';
PARTITION_NAME TABLESPACE_NAME
P_PAST DG
P_20100101 DG
P_20100102 DG
P_20100103 DG
P_20100104 DG
P_20100105 DG
P_20100106 DG
P_20100107 DG
P_20100108 DG
P_20100109 DG
P_20100110 DG
P_20100111 DG
P_20100112 DG
P_20100113 DG
P_20100114 DG
P_20100115 DG
P_20100116 DG
P_20100117 DG
P_20100118 DG
P_20100119 DG
P_20100120 DG
P_20100121 DG
P_20100122 DG
P_20100123 DG
P_20100124 DG
P_20100125 DG
P_20100126 DG
P_20100127 DG
P_20100128 DG
P_20100129 DG
P_FUTURE DG
31 rows selected.
Similar Messages
-
Creating a default User account for new users
Today I tried creating a default setting for and account that could be used for all new users. I did web searches after web serches and not luck. In the old systems it was simple, but Mavericks made it difficult. But after much hair pulling and putting several suggestions together it is just as simple as it was before.
Step 1 Create a new user account
Step 2 log on to that account and set it up totally, that means background picture, preferences, dock, everything
Step 3 click on the home incon in a finder window then go to Finder view select view options and at the bottom check show library
Step 4 go to HD>system library>user templates, you will need to select the file, Command I for info, unlock the lock, click + at bottom select your admin account, give youself read write permissions, go click on the folder you wish/need to change and get info and repeat the step above for each folder.
Step 5 replace the library folder and any other you wish to change with the one from the new account
Step 6 you can also place any documents on the desktop or document folder and replace them
Step 7 create a new user account and verify that the settings and dock are correct.
This takes about 5 minutes or so and is much easier for the non proI don't always understand how things can be different from one computer to the other running the same systems and following the same steps but I have 2 iMac's and the steps above for the desktop picture worked on one but not on the other, go figure. So as a fix the default picture was named Wave in the Desktop Picture folder so I changed the name of it to Wave1 and renamed the new photo Wave, did not change the alias in the CoreService folder, now the second computer creates and new user account with all my perferred settings and background picture.
As a recap of my orginal post by creating a default user account, setting up the preferences for finder, and setting up the dock, I simply replaced the preference folder in the User Template file and it works perfectly. Remember that you can do the same with the Document folder or the desktop if you want to place them for all new users.
Since I am not a professional computer person I do not feel comfortable using the terminal or scripting so this works very well for the common person to create a new user template. -
I can not create a new user account on eprint
i can not create a new user account on eprint. I have been trying for over an hour and it repeats telling me that my email addresses are not entered correctly, however they match. ?
I have tried to create an account via ePrintCenter and it seems that the published application has several flaws in interpreting the provided input.
1) In the Filed for last Name I enter my last name, which consist of only Alph Characters. The form however thinks that there is some sort of special character and rejects my Input.
2) E-Mail address. is not identical; OK, so I do a quick OCR on the E-Mail and guess what they are identical. Again the form Fails to recognize this.
3) Enter a password (2 Fields) and a third is displayed which is marked as "*required" but is not labeled as to what the required info could possibly be. Or is it a 3 password confirmation box, who knows.
All I know is that a simple registration is a major pain with this HP site.
Any Help as to how to alleviate this would of course be greatly appreciated. -
How do i create a default user in os 10.8.2
how do i create a default user in os 10.8.2
You need to work with the files in:
/System/Library/User Template
and then choose the language you're using. Be very careful when working in there - by default, your user (even an admin) has no read/write permissions. You may wish to go in through the terminal with sudo.
Matt -
I have just downloaded the trial After Effects CC. I'm running Mavericks 10.9.4 on my Macbook Pro.
When I try to launch After Effects, this message appears:
"After Effects warning: Could not create the file '/Users/Library/Preferences/Adobe/After Effects/13.0/dummy'"
I have followed the advice from other posts on this issue regarding resetting all of the permissions in the Adobe folder in my library to read and write , but it doesn't change anything. I still get the same message when I try to launch the program. Moreover, there is no After Effects folder in my Adobe folder, even though it's clearly in my Applications folder.
I also uninstalled After Effects and tried to reinstall it, but to no avail.
I sure would like to give it a try, as I was planning on purchasing it, but this is just one more issue in a long irritating line of issues that have arisen since trying to download it from CC.
Any help is much appreciated.
Thanks.I am having this problem and this response does not make sense. I made the "Preferences" ,"Adobe" & "After Effects" folder along with the 10.0,11.0,13.0,13.2 folders all read/write. Can't seem to find an answer.
-
I installed the CC trial with an error window saying: Could not create the file '/Users/dranim/Library/Preferences/Adobe/After Effects/13.2/dummy'. That was the first window. Heres the second: After Effects can’t continue: unexpected failure during application startup I paid for the month subscription of 29.99. It claims it is downloading again?! Am I missing something here? Why is this process so complicated? I need to get this resolved asap and start working.
I originally had Adobe Photoshop Extended, then upgraded to the Production Suite. I ran the Adobe Cleaner, and that uninstalled most Adobe products, including my existing Adobe install, and then I re-installed everything with the same error code. Since CS4 came with CS5, I've installed AE CS4, but would really like to upgrade because I'm new to Creative Suite, and not sure how CS4 integrates with CS5...CS4 After Effects installed perfectly. I do have a 64 bit system, and installing to an OCZ Vertex 2....every other suite installs perfectly, except AE. And I think that is the coolest program in the Suite. I thank you all so much for taking the time to help, I really want to get AECS5 running...I did try to install after doing the recommended items Adobe suggests for Exit Codes 6 and 7, including turning off many startups...
I'm baffled....
Ben -
When I launch After Effects I get a warning saying: Could not create the file'/Users/mayname/Library/Adobe/After effects/13.0/dummy'.
See this:
fixing permissions problem that impedes start of Adobe applications -
TIP 01: Default User Tablespace in 10g by Joel Pèrez
Hi OTN Readers!
Everyday I get connection on Internet and one of the first issues that
I do is to open the OTN main page to look for any new article or any
new news about the Oracle Technology. After I open the main page of
OTN Forums and I check what answers I can write to help some people
to work with the Oracle Technology and I decide to begin to write some
threads to help DBAs and Developers to learn the new features of 10g.
I hope you can take advantage of them which will be published here in
this forum. For any comment you can write to me directly to : [email protected]
Please do not replay this thread, if you have any question related to
this I recommend you to open a new post. Thanks!
The tip of this thread is: DEFAULT USER TABLESPACE
Joel Pérez
http://otn.oracle.com/expertsStep 9: At the step 5 We changed the default tablespace of the database but there is an
important detail that We have to realize. That detail is the following : when you change
the default tablespace of the database. The users were using it are move to store its objects
in the new default tablespace but the objects that were stored in the original tablespace
remain there. Let's go to look at it:
Here We are connected to the database as system user
SQL> show user
USER is "SYSTEM"Let's go to get connection as new_user user in order to create a table
SQL> conn new_user/new_user@base1
Connected.
Creating a table in the schema NEW_USER
SQL> create table t1_new_user(c1 number);
Table created.As you can see that table is stored in the default tablespace assigned to the user new_user
SQL> select TABLE_NAME, TABLESPACE_NAME from dba_tables
2 where owner='NEW_USER';
TABLE_NAME TABLESPACE_NAME
T1_NEW_USER USERS1Now, We are going to perform the change at the database level regarding the default tablespace
SQL> alter database default tablespace TEST;
Database altered.Now, Let's go to see where the object is stored
SQL> select TABLE_NAME, TABLESPACE_NAME from dba_tables
2 where owner='NEW_USER';
TABLE_NAME TABLESPACE_NAME
T1_NEW_USER USERS1The object remain in the original tablespace assigned to the user new_user.
Here We can realize that the change was successful but the table still remain in the original
tablespace. You will have to move manually the objects to a new default tablespace.
SQL> select USERNAME, DEFAULT_TABLESPACE from dba_users
2 where username='NEW_USER';
USERNAME DEFAULT_TABLESPACE
NEW_USER TESTJoel Pérez
http://otn.oracle.com/experts -
We have tables that are interval range partitioned on a DATE column, with a partition for each day - all very standard and straight out of Oracle doc.
A 3rd party application queries the tables to find number of rows based on date range that is on the column used for the partition key.
This application uses date range specified relative to current date - i.e. for last two days would be "..startdate > SYSDATE -2 " - but partition pruning does not take place and the explain plan shows that every partition is included.
By presenting the query using the date in a variable partition pruning does table place, and query obviously performs much better.
DB is 11.2.0.3 on RHEL6, and default parameters set - i.e. nothing changed that would influence optimizer behavior to something unusual.
I can't work out why this would be so. It very easy to reproduce with simple test case below.
I'd be very interested to hear any thoughts on why it is this way and whether anything can be done to permit the partition pruning to work with a query including SYSDATE as it would be difficult to get the application code changed.
Furthermore to make a case to change the code I would need an explanation of why querying using SYSDATE is not good practice, and I don't know of any such information.
1) Create simple partitioned table
CREATETABLE part_test
(id NUMBER NOT NULL,
starttime DATE NOT NULL,
CONSTRAINT pk_part_test PRIMARY KEY (id))
PARTITION BY RANGE (starttime) INTERVAL (NUMTODSINTERVAL(1,'day')) (PARTITION p0 VALUES LESS THAN (TO_DATE('01-01-2013','DD-MM-YYYY')));
2) Populate table 1million rows spread between 10 partitions
BEGIN
FOR i IN 1..1000000
LOOP
INSERT INTO part_test (id, starttime) VALUES (i, SYSDATE - DBMS_RANDOM.value(low => 1, high => 10));
END LOOP;
END;
EXEC dbms_stats.gather_table_stats('SUPER_CONF','PART_TEST');
3) Query the Table for data from last 2 days using SYSDATE in clause
EXPLAIN PLAN FOR
SELECT count(*)
FROM part_test
WHERE starttime >= SYSDATE - 2;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 8 | 7895 (1)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 8 | | | | |
| 2 | PARTITION RANGE ITERATOR| | 111K| 867K| 7895 (1)| 00:00:01 | KEY |1048575|
|* 3 | TABLE ACCESS FULL | PART_TEST | 111K| 867K| 7895 (1)| 00:00:01 | KEY |1048575|
Predicate Information (identified by operation id):
3 - filter("STARTTIME">=SYSDATE@!-2)
4) Now do the same query but with SYSDATE - 2 presented as a literal value.
This query returns the same answer but very different cost.
EXPLAIN PLAN FOR
SELECT count(*)
FROM part_test
WHERE starttime >= (to_date('23122013:0950','DDMMYYYY:HH24MI'))-2;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 8 | 131 (0)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 8 | | | | |
| 2 | PARTITION RANGE ITERATOR| | 111K| 867K| 131 (0)| 00:00:01 | 356 |1048575|
|* 3 | TABLE ACCESS FULL | PART_TEST | 111K| 867K| 131 (0)| 00:00:01 | 356 |1048575|
Predicate Information (identified by operation id):
3 - filter("STARTTIME">=TO_DATE(' 2013-12-21 09:50:00', 'syyyy-mm-dd hh24:mi:ss'))
thanks in anticipation
JimAs Jonathan has already pointed out there are situations where the CBO knows that partition pruning will occur but is unable to identify those partitions at parse time. The CBO will then use a dynamic pruning which means determine the partitions to eliminate dynamically at run time. This is why you see the KEY information instead of a known partition number. This is to occur mainly when you compare a function to your partition key i.e. where partition_key = function. And SYSDATE is a function. For the other bizarre PSTOP number (1048575) see this blog
http://hourim.wordpress.com/2013/11/08/interval-partitioning-and-pstop-in-execution-plan/
Best regards
Mohamed Houri -
Oracle Exchange partition feature not working as expected?
I used the Exchange Partition feature to swap segments between 2 tables- one Partitioned, and one Non-Partitioned. The exchange went well. However, all the data in the partitioned table has gone to the partition which stores the maxbound values.
Any ideas if this is the default behavior or have i missed out something?
/** actual table names changed due to client confidentiality issues */
-- Drop the 2 intermediate tables if they already exist
drop table ordered_inv_bkp cascade constraints ;
drop table ordered_inv_t cascade constraints ;
1st create a Non-Partitioned Table from ORDERED_INV and then add the primary key and unique index(s):
create table ordered_inv_bkp as select * from ordered_inv ;
alter table ordered_inv_bkp add constraint ordinvb_pk primary key (ordinv_id) ;
create unique index ordinv_scinv_uix on ordered_inv_bkp(
SCP_ID ASC,
INV_ID ASC,
ANATLOC_ID ASC,
SOI_ID ASC,
CANCEL_TS ASC );
-- Next, we have to create a partitioned table ORDERED_INV_T with a similar
-- structure as ORDERED_INV.
-- This is a bit tricky, and involves a pl/sql code
declare
l_dt_start DATE;
l_ptn VARCHAR2(50);
cnt PLS_INTEGER;
l_cnt_initial PLS_INTEGER;
ts_name VARCHAR2(50);
l_sql VARCHAR2(10000);
ts_indx VARCHAR2(100);
l_num_errors NUMBER ;
l_num_errors_ok NUMBER ;
l_user_name VARCHAR2(50) ;
l_sysdate VARCHAR2(50);
l_cnt_script PLS_INTEGER ;
BEGIN
SELECT COUNT(*) INTO cnt FROM user_TABLES
WHERE TABLE_NAME='ORDERED_INV_T';
IF cnt=0 THEN
l_sql:= 'CREATE TABLE ORDERED_INV_T
PARTITION BY RANGE (ORDINV_TIME)
( PARTITION TP_ORDINV_MAX VALUES LESS THAN (MAXVALUE)
TABLESPACE TEST_TPT_DATA
ENABLE ROW MOVEMENT
AS SELECT * FROM ORDERED_INV WHERE 1=0 ';
EXECUTE IMMEDIATE l_sql;
-- Add section to set default values for the intermediate table OL_ORDERED_INV_T
FOR crec_cols IN (
SELECT u.column_name ,u.nullable, u.data_default,u.table_name
FROM USER_TAB_COLUMNS u WHERE
u.table_name ='ORDERED_INV' AND
u.data_default IS NOT NULL )
LOOP
l_sql:= 'ALTER TABLE ORDERED_INV_T MODIFY '||crec_cols.column_name||' DEFAULT '||crec_cols.data_default;
-- dbms_output.put_line('chk data default => ' || l_sql) ;
EXECUTE IMMEDIATE l_sql;
END LOOP;
END IF;
-- Split partition to create more partitions
select TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI:SS') into l_sysdate from dual;
DBMS_OUTPUT.PUT_LINE ('Finding oldest value at ' || l_sysdate) ;
EXECUTE IMMEDIATE 'SELECT NVL(TRUNC(MIN(OL_ORDINV_TIME),''MONTH''),TRUNC(SYSDATE,''MONTH''))
FROM ORDERED_INV' INTO l_dt_start;
select TO_CHAR(SYSDATE,'YYYY-MM-DD HH24:MI:SS') into l_sysdate from dual;
DBMS_OUTPUT.PUT_LINE ('Started creating partitions at ' || l_sysdate) ;
LOOP
EXIT WHEN l_dt_start > ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),1);
l_ptn:='tp_ordinv_'|| TO_CHAR(l_dt_start,'YYYYMM');
l_sql:= 'ALTER TABLE ORDERED_INV_T
split partition TP_ORDINV_MAX at (TO_DATE('''|| TO_CHAR(ADD_MONTHS(l_dt_start,12),'YYYYMM') ||''',''YYYYMM''))
into ( partition '||l_ptn||' , partition TP_ORDINV_MAX)';
execute immediate l_sql;
l_dt_start:=add_months(l_dt_start,12);
END LOOP;
END;
-- Also, add indexes to this table
alter table ORDERED_INV_T add constraint ordinvt_pk primary key (ordinv_id) ;
create unique index ordinvt_uix on ordered_inv_t(
SCP_ID ASC,
INV_ID ASC,
ANATLOC_ID ASC,
SOI_ID ASC,
CANCEL_TS ASC );
-- Next, use exchange partition for actual swipe
-- Between ordered_inv_t and ordered_inv_bkp
-- Analyze both tables : ordered_inv_t and ordered_inv_bkp
BEGIN
DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HENRY220', TABNAME => 'ORDERED_INV_T');
DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HENRY220', TABNAME =>'ORDERED_INV_BKP');
END;
SET TIMING ON;
ALTER TABLE ordered_inv_t
EXCHANGE PARTITION TP_ORDINV_MAX
WITH TABLE ordered_inv_bkp
WITHOUT VALIDATION
UPDATE GLOBAL INDEXES;
-- Check query :
select partition_name, num_rows, high_value from user_tab_partitions where table_name = 'ORDERED_INV_T' ;
These are the results:
TP_ORDINV_199801 0 TO_DATE(' 1999-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_199901 0 TO_DATE(' 2000-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200001 0 TO_DATE(' 2001-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200101 0 TO_DATE(' 2002-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200201 0 TO_DATE(' 2003-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200301 0 TO_DATE(' 2004-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200401 0 TO_DATE(' 2005-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200501 0 TO_DATE(' 2006-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200601 0 TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200701 0 TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200801 0 TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_200901 0 TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_201001 0 TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_201101 0 TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_201201 0 TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
TP_ORDINV_MAX 24976 MAXVALUE
Pay attention to the last record>
used the Exchange Partition feature to swap segments between 2 tables- one Partitioned, and one Non-Partitioned. The exchange went well. However, all the data in the partitioned table has gone to the partition which stores the maxbound values.
>
That isn't possible. The data in the partition before the exchange could only have gone to the non-partitioned table.
Please edit you post and add \ tags on the lines before and after your code to preserve formatting. See the FAQ for details. -
Hi Experts,
Actually i have Production Partition table SMS_DELIVERY_NODETAILS its have partitions "PS_WD_01,PS_WD_02........... PS_WD_30". Partition base on date "TOOPERATOR" column like "10-11-2012 , 11-11-2012 ........".
I have create local index "DELIVERY_CAMP" on "CAMPAIGN_NAME" column.
I face issue in :
case 1: Query using index "DELIVERY_CAMP" when i was use query with partition name "PS_WD_07"
case 2: when query running with TOOPERATOR='2012-11-25' then table_sance_full.
Oracle version =10g
Os version = Linux 5.5
SQL> DESC SMS_DELIVERY_NODETAILS
Name Null? Type
MSISDN VARCHAR2(15)
TRANSACTIONID NOT NULL VARCHAR2(50)
TOOPERATOR VARCHAR2(25)
FROMOPERATOR VARCHAR2(25)
STATUS VARCHAR2(25)
TID_INDEX NUMBER
CAMPAIGN_NAME VARCHAR2(100)
NETWORK_ERROR_CODE VARCHAR2(20)
Case 1:
SQL> EXPLAIN PLAN FOR
2 SELECT count(*) from SMS_DELIVERY_NODETAILS partition(PS_WD_07) where CAMPAIGN_NAME ='1353814653772_ftp_Churnscore100_pe_100';
Explained.
SQL> set line 200
@?/rdbms/admin/utlxpls.sql
SQL>
PLAN_TABLE_OUTPUT
Plan hash value: 2934568714
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 38 | 53 (0)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 38 | | | | |
| 2 | PARTITION RANGE SINGLE| | 6320 | 234K| 53 (0)| 00:00:01 | 31 | 31 |
| 3 | PARTITION LIST ALL | | 6320 | 234K| 53 (0)| 00:00:01 | 1 | 100 |
|* 4 | INDEX RANGE SCAN | DELIVERY_CAMP | 6320 | 234K| 53 (0)| 00:00:01 | 3001 | 3100 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
4 - access("CAMPAIGN_NAME"='1353814653772_ftp_Churnscore100_pe_100')
16 rows selected.
case 2:
SQL> SQL> EXPLAIN PLAN FOR
2 SELECT count(*) from SMS_DELIVERY_NODETAILS WHERE TOOPERATOR='2012-11-25' and CAMPAIGN_NAME ='1353814653772_ftp_Churnscore100_pe_100';
Explained.
SQL> @?/rdbms/admin/utlxpls.sql
PLAN_TABLE_OUTPUT
Plan hash value: 3258763602
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 58 | 76394 (2)| 00:15:17 | | |
| 1 | SORT AGGREGATE | | 1 | 58 | | | | |
| 2 | PARTITION RANGE SINGLE| | 1 | 58 | 76394 (2)| 00:15:17 | 31 | 31 |
| 3 | PARTITION LIST ALL | | 1 | 58 | 76394 (2)| 00:15:17 | 1 | 100 |
|* 4 | TABLE ACCESS FULL | SMS_DELIVERY_NODETAILS | 1 | 58 | 76394 (2)| 00:15:17 | 3001 | 3100 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
4 - filter("TOOPERATOR"='2012-11-25' AND "CAMPAIGN_NAME"='1353814653772_ftp_Churnscore100_pe_100')
16 rows selected.Dear rp0428 ,
1. the table and index DDL
Table=>
Table_name Partition_name Subpartition_name
SMS_DELIVERY_NODETAILS TOOPERATOR TID_INDEX
Index=>
create local index DELIVERY_TID_MSISDN_NODETAILS on SMS_DELIVERY_NODETAILS(TRANSACTIONID,MSISDN);
create local index DELIVERY_CAMP on SMS_DELIVERY_NODETAILS(CAMPAIGN_NAME);2. the query you used to collect the table and index stats
SELECT count(*) from SMS_DELIVERY_NODETAILS WHERE TOOPERATOR='2012-11-25' and CAMPAIGN_NAME ='1353814653772_ftp_Churnscore100_pe_100'; 3. the table, partition,subpartition row counts
SQL> select PARTITION_POSITION,PARTITION_NAME,SUBPARTITION_COUNT,HIGH_VALUE from user_tab_partitions where TABLE_NAME='SMS_DELIVERY_NODETAILS' order by PARTITION_POSITION ;
PARTITION_POSITION PARTITION_NAME SUBPARTITION_COUNT HIGH_VALUE
1 PS_WD_10 100 '2012-10-28'
2 PS_WD_11 100 '2012-10-29'
3 PS_WD_12 100 '2012-10-30'
4 PS_WD_13 100 '2012-10-31'
5 PS_WD_14 100 '2012-11-01'
6 PS_WD_15 100 '2012-11-02'
7 PS_WD_16 100 '2012-11-03'
8 PS_WD_17 100 '2012-11-04'
9 PS_WD_18 100 '2012-11-05'
10 PS_WD_19 100 '2012-11-06'
11 PS_WD_20 100 '2012-11-07'
PARTITION_POSITION PARTITION_NAME SUBPARTITION_COUNT HIGH_VALUE
12 PS_WD_21 100 '2012-11-08'
13 PS_WD_22 100 '2012-11-09'
14 PS_WD_23 100 '2012-11-10'
15 PS_WD_24 100 '2012-11-11'
16 PS_WD_25 100 '2012-11-12'
17 PS_WD_26 100 '2012-11-13'
18 PS_WD_27 100 '2012-11-14'
19 PS_WD_28 100 '2012-11-15'
20 PS_WD_29 100 '2012-11-16'
21 PS_WD_30 100 '2012-11-17'
22 PS_WD_31 100 '2012-11-18'
PARTITION_POSITION PARTITION_NAME SUBPARTITION_COUNT HIGH_VALUE
23 PS_WD_32 100 '2012-11-19'
24 PS_WD_01 100 '2012-11-20'
25 PS_WD_02 100 '2012-11-21'
26 PS_WD_03 100 '2012-11-22'
27 PS_WD_04 100 '2012-11-23'
28 PS_WD_05 100 '2012-11-24'
29 PS_WD_06 100 '2012-11-25'
30 PS_WD_07 100 '2012-11-26'
31 PS_WD_08 100 '2012-11-27'
32 PS_WD_09 100 '2012-11-28'
33 PS_WD_DEFAULT 100 MAXVALUE
33 rows selected. -
Deadlock issue in Oracle 10g Partitioned Tables
Hi ALL,
I am facing an issue of Deadlock while inserting data into a partitioned table.
I get an error "ORA-00600: Deadlock detected". when i see the trace files, following lines are appearing in them:
"Single resource deadlock: blocking enqueue which blocks itself".
Here is the detail of my test case:
1. I have a list-partitioned table, with partitioning defined on some business codes.
2. I have a query that merges data into partitioned table (actually compares unique keys between temporary table and partitioned table and then issue an insert if keys not matched, no update part).
3. The temporary table contains transactional data against many business codes.
3. when calling the above query from multiple (PL/SQL) sessions, i observe that when we merge data in same partition (from different sessions) than deadlock issue occurs, otherwise it is OK.
4. Note that all sessions are executed at same time. Also note that Commit is called after each session is completed. Each session contains 2-3 more queries after the mentioned merge statement.
Is there an issue with oracle merge/insert on same partition (from different sessions)? What is the locking mechanism for this particular case (partitioned tables)?
My oracle version is Oracle 10g (10.2.0.4). Kindly advice.
Thanks,
QQ.Could you print the deadlock tree so we can see the type and mode of the locking. (Please use the 'code' tags - see FAQ at top right of screen - to showthe output in fixed font). can you list any SQL operated by this session that gets reported in the trace file.
Does the table reference itself in a foreign key.
Is this table involved in any referential integrity constraints.
Do you have a global primary key index, or a local primary key index ?
Are there any triggers on the table - if so do they contain autonomous transactions.
At present the only though that springs to mind is that the merge command has to lock the target table to do the insert/update, but it also has to lock any child table. The mode of the child lock depends on whether it has a suitable index or not, and whether the child table IS also the parent table. If you have two merges to the same partition one partition may get its locks, and the other partition may be in a state where it can't get one of the locks because it's wait for the other. (This shouldn't be a self-deadlock, though, but the scenario might be heading in the right direction for a self-deadlock).
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." (Stephen Hawking) -
Oracle 11gR2 RAC clusterware not picking up ASM diskgroups
Hello: I had to deinstall a failed oracle 11gR2 rac cuslterware. But, not the asm disks are not in the OUI pick list. How can I resolve that?
The storage is on SAN partitions.Probably the install already put something on the disks.
Clean them with dd if=/dev/zero of=<your asm disks> bs=1M count=10
Regards
Sebastian -
Oracle Materialized view tables not getting refreshed automatically.
At Destination:--
CREATE MATERIALIZED VIEW PROG_MEDIA
TABLESPACE ONA_TS1
BUILD IMMEDIATE
REFRESH FAST with rowid
START WITH SYSDATE
NEXT SYSDATE+1/96
AS (select /*+ PARALLEL(a,6) */ * from PROG_MEDIA@onair a);
exec dbms_mview.refresh('PROG_MEDIA','C');
At Source:--
CREATE MATERIALIZED VIEW LOG ON ONAIR.PROG_MEDIA
TABLESPACE MVLOG
WITH ROWID;
Fired manually:--
13:00:43 SQL> exec dbms_mview.refresh('PROG_MEDIA','C');
PL/SQL procedure successfully completed.
At source:--
13:18:35 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
PROG_MEDIA_ID
PROG_MEDIA_NAME
102226
test
At Destination:--
14:03:28 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
PROG_MEDIA_ID PROG_MEDIA_NAME
102226 UTSAV-5-162077
JOB LOG_USER THIS_DATE LAST_DATE_TIME NEXT_DATE_TIME INTERVAL FAILURES WHAT
242 ONAIR 17-05-11 14:17:24 SYSDATE+1/96 7 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
A"');
242 ONAIR 17-05-11 14:32:25 SYSDATE+1/96 8 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
A"');
1> I have scheduled this refresh job for every 15mins, but its not getting executed. Also my job_queue_process is '20'. Whenever i execute it manually it get's refresh.
2> I can schedule a cron for the same for every 15mins but i really dont want to do it.
Kindly help me out.Hi,
I have created MV_CAPABILITIES_TABLE & executed below commands:--
17:56:54 SQL> EXECUTE DBMS_MVIEW.EXPLAIN_MVIEW ('"ONAIR"."PROG_MEDIA"');
PL/SQL procedure successfully completed.
17:57:26 SQL> SELECT capability_name, possible, SUBSTR(related_text,1,8)
17:57:27 2 AS rel_text, SUBSTR(msgtxt,1,60) AS msgtxt
17:57:27 3 FROM MV_CAPABILITIES_TABLE
17:57:27 4 ORDER BY seq;
CAPABILITY_NAME P REL_TEXT MSGTXT
PCT N
PCT N
REFRESH_COMPLETE Y
REFRESH_COMPLETE Y
REFRESH_FAST Y
REFRESH_FAST Y
REWRITE N
REWRITE N
PCT_TABLE N PROG_MED relation is not a partitioned table
PCT_TABLE N PROG_MED relation is not a partitioned table
REFRESH_FAST_AFTER_INSERT Y
REFRESH_FAST_AFTER_INSERT Y
REFRESH_FAST_AFTER_ONETAB_DML Y
REFRESH_FAST_AFTER_ONETAB_DML Y
REFRESH_FAST_AFTER_ANY_DML Y
REFRESH_FAST_AFTER_ANY_DML Y
REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_GENERAL N materialized view cannot support any type of query rewrite
REWRITE_GENERAL N materialized view cannot support any type of query rewrite
REWRITE_GENERAL N query rewrite is disabled on the materialized view
REWRITE_GENERAL N query rewrite is disabled on the materialized view
REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
34 rows selected.
Elapsed: 00:00:00.09
What to be done next?
Also i fired the job manually by:--
17:38:02 SQL> set serveroutput on
17:39:45 SQL> EXEC DBMS_JOB.RUN(242);
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.48 -
Oracle 11gR2: partition key column, need to be modified
Hi folks,
Have a situation, need to increase a column width, which is also a partition key and table is pretty huge, can any one assist, what is the best possible way to achieve this task.
Thanks in advance.No need to build multiple temp tables, do multiple swaps, and do multiple redefines of the temp table columns when you can just build the one table that you need.OK. Could you show us a script for your approach.
Meantime I show mine.
Preparation
create table PART_TEST (part_key number(1), val varchar2(100))
partition by range(part_key)(
partition P0 values less than (1),
partition P1 values less than (2),
partition P2 values less than (3),
partition P3 values less than (4)
insert into PART_TEST values (0,'zero');
insert into PART_TEST values (1,'one');
insert into PART_TEST values (2,'two');
insert into PART_TEST values (3,'three');
commit;The modification
set timing on
create table PART_TEST_P0 as select * from PART_TEST where 1=0;
create table PART_TEST_P1 as select * from PART_TEST where 1=0;
create table PART_TEST_P2 as select * from PART_TEST where 1=0;
create table PART_TEST_P3 as select * from PART_TEST where 1=0;
alter table PART_TEST exchange partition P0 with table PART_TEST_P0;
alter table PART_TEST exchange partition P1 with table PART_TEST_P1;
alter table PART_TEST exchange partition P2 with table PART_TEST_P2;
alter table PART_TEST exchange partition P3 with table PART_TEST_P3;
alter table PART_TEST_P0 modify part_key number(6);
alter table PART_TEST_P1 modify part_key number(6);
alter table PART_TEST_P2 modify part_key number(6);
alter table PART_TEST_P3 modify part_key number(6);
drop table PART_TEST;
create table PART_TEST (part_key number(6), val varchar2(100))
partition by range(part_key)(
partition P0 values less than (1),
partition P1 values less than (2),
partition P2 values less than (3),
partition P3 values less than (4)
alter table PART_TEST exchange partition P0 with table PART_TEST_P0;
alter table PART_TEST exchange partition P1 with table PART_TEST_P1;
alter table PART_TEST exchange partition P2 with table PART_TEST_P2;
alter table PART_TEST exchange partition P3 with table PART_TEST_P3;Whole modification of the column takes a fraction of second because there is no need to physically move data. Only metadata is changed.
Maybe you are looking for
-
Unable to open query designer while able to access BI system
Hi Experts, I have problem while opening query designer, analyzer , WAD . I get the below error. But when i access the relevant BI system i am able to access it well , i dont get any RFC Error. Will there any port setting for query designer separa
-
Now let me understand this battery issue !
Most everyone is complaining about poor battery life ,,, correct ? My HTC TP2 could go strong w/12hrs b4 needing a charge, Iphone would last 10hrs. with heavy use until a charge needed. Verizon/Htc put up commercials that had a lightening/heavy elect
-
Windows 8.1 wont release dead wi-fi profiles - will actually use them - Ghost profiles
Serious bug in both Windows 8.1 and Windows Phone wifi profiles if you change routers/names I have 3 Laptops and 2 Windows Phones running at home. All laptops on 8.1 , Windows Phone current. They were attached to a Netgear Router with router access n
-
Mail attachement more than 5KB user is unable to receive
Hi All We are trying to send the mail from SAP to Lotus notes with attachment, if more than 5KB user is unable to receive attached mail, at the same time user is able to receive the mail if less the 5KB of SIZE. where we need to change the setup to a
-
Windows 7 Backup error code 0x81000039
Hi Everyone, I was trying to perform a backup across our peer-peer network from a Windows 7 computer to an XP Pro computer. The user has full access to the additional harddrive on the XP computer, but I get error code 0x81000039, remote share path n