ALTER index rebuild (parallel nologing) vs (parallel nologging)
The below statements have difference the behavior of oracle or it is just the other way to use the syntax:SQL > create index test_idx on test (owner, table_name, nom_tablespace);
The index is created.
What is the best way to use?
SQL > alter index test_idx reconstruction nologging parallel 16;
The index is modified.
SQL > alter index rebuild nologging test_idx parallel (16 degrees);
The index is modified.
SQL > alter index rebuild nologging test_idx parallel (measure 16);
The index is modified.
and
SQL > alter index test_idx connection parallel 1.
The index is modified.
SQL > alter index test_idx parallel 1 operating forest;
The index is modified.
All I'm trying to understand y - no difference in the statements of reconstruction? I have
If you read the link below, I'm sure you cela and the rest doubts will never be around you...!
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_1008.htm
Logging and parallel clauses are optional, and there is no effect on the order of the optional clauses.
Concerning
Girish Sharma
Tags: Database
Similar Questions
-
ALTER INDEX with parallel and Nologging
I want to move some indexes to a different tablespace. For this I use the SQL below:
XYZ ALTER INDEX REBUILD TABLESPACE TS_INDX01 NOLOGGING PARALLEL 8;
I use NOLOGGING and PARALLEL thinking it will speed up the process of movement. But now I'm confused because I think that this will change the index property, as in, when we create an index specify us certain parallels and logging properties.
So I want to understand:
1. the SQL above to change the properties of the index?
2. How can I check the existing nologging and parallel properties of an index?
SQL> create table temp (no integer, name varchar2(100)); Table created. SQL> create index temp_idx on temp(no); Index created. SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX'; DEGREE LOG ---------------------------------------- --- 1 YES SQL> drop index temp_idx; Index dropped. SQL> create index temp_idx on temp(no) nologging parallel 5; Index created. SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX'; DEGREE LOG ---------------------------------------- --- 5 NO SQL> alter index temp_idx parallel 1 logging 2 ; Index altered. SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX'; DEGREE LOG ---------------------------------------- --- 1 YES
-
My database is out 10 gr 2. Sometimes, I pass command ALTER INDEX < index name > REBUILD online on the indexes that are 500 MB in size. It takes about ten minutes to run the command. The database alert log shows no activity for the first six minutes, and DML is allowed on the associated table. At about minute seven journal alerts shows the first of a series of five online redo logs switches. They are each 100 MB.
During the time that online redo logs, DML execution sessions cannot fill. When the new version of the index was created again online records switching station, the original copy of the index disappears, the ALTER INDEX command ends, and blocking for DML ceases.
I read that the DML statements are not affected by executing ALTER INDEX REBUILD online, but experience shows that the blocking of the above sessions. Can someone explain to me what is happening in the different stages of the index rebuild? Is there something I can do to eliminate the blocking of the DML statements during the period when redo online record switch?
Thank you
BillBill,
A useful reference for you:
http://jonathanlewis.WordPress.com/2009/06/05/online-rebuild/Another very useful reference - of many articles:
http://richardfoote.WordPress.com/category/index-rebuild/For what reason you rebuild the index?
Charles Hooper
Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
http://hoopercharles.WordPress.com/
IT Manager/Oracle DBA
K & M-making Machine, Inc. -
ALTER INDEX REBUILD and large waste area
Hello world.
Concerns the RDBMS EE 10.2.0.2 on a box with 16CPUs. Non-standard initialization parameters:
db_16k_cache_size = 3G
pga_aggregate_target = 3G
SGA_MAX_SIZE = 12G
SGA_TARGET = 5G
workarea_size_policy = AUTO
I have a large table partitioned on a monthly basis with a local couple of bitmap index on this subject. Table and index are stored in different areas of storage. The index tablespace is
EXTENT MANAGEMENT UNIFORM LOCAL 1 M SIZE
16K BLOCKSIZE
SEGMENT SPACE MANAGEMENT AUTO
Nightly batch processing allows a few partitions index unusable then inserts/adds one part of the data and rebuilds the index with
ALTER INDEX... REBUILD PARTITION... NOLOGGING PARALLEL
When you are finished, query on DBA_IND_PARTITIONS shows that, for all the index, partition value SCOPES is much greater than the value of used BYTES, for example one of the partitions has 106 DEGREES (1 MB each so he made 106 MB space) while only 15 MB for the BYTES.
I understand that during the reconstruction of the parallel process slave create segments in the tablespace of the index of destination so that spend a lot more space than this segment takes finally. But it also means that the space is not released. (Deallocation/shrinkage will not help). Same thing can be demonstrated by the queries on DBA_SEGMENTS and DBA_FREE_SPACE. Because of this behavior, I have huge waste of space in the tablespace to index.
Can someone help, please?
Przemek
Allocate space for parallel process slave is documented in the book 'Data warehousing database Oracle 10 g 2', chapter 25 "run in parallel to assistance.user2038804 wrote:
Concerns the RDBMS EE 10.2.0.2 on a box with 16CPUs. Non-standard initialization parameters:When you are finished, query on DBA_IND_PARTITIONS shows that, for all the index, partition value SCOPES is much greater than the value of used BYTES, for example one of the partitions has 106 DEGREES (1 MB each so he made 106 MB space) while only 15 MB for the BYTES.
Przemek,
I can confirm that there is a bug in 10.2.0.2 leading to inconsistent information related to size in DBA_SEGMENTS / DBA_EXTENTS after an index rebuild in parallel to a big clue, maybe a bug 4771672 in 10.2.0.3. If I remember correctly the information of MEASUREMENT is correct and the information provided in DBA_SEGMENTS is misleading.
The Metalink note suggests to use DBMS_SPACE_ADMIN Procedure TABLESPACE_FIX_SEGMENT_EXTBLKS to correct erroneous information in the dictionary, but I don't know if it was the one we used when encountering the problem.
Kind regards
RandolfOracle related blog stuff:
http://Oracle-Randolf.blogspot.com/SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/ -
At the same time index rebuild...
OK, so I have a question that has puzzled me a bit. I think I understand the theory, but I am not convinced, so looking for 3xp3rt thoughts.
I have the following table with the indexes following:
Departments of instance name table Name Index
AWESOME_DETAIL 20 1 AWESOME_DETAIL_B8
The table itself has a DEGREE of 2 BODIES 1 value.
What is happening is when the following is executed:
ALTER INDEX REBUILD AWESOME_DETAIL_B8.
the table is read in series, despite the index with a DOP of 20. However, when we do the following:
ALTER INDEX REBUILD PARALLEL OF 20 AWESOME_DETAIL_B8
The table is read with the parallelism and the treatment is faster (no surprise on the second part).
When the index is rebuilt with the first statement, the degree of parallel remained unchanged at 20. If we run the second statement, and the index have had a degree of parallelism of the 2, then I expect the degree of parallelism of the index itself will be replaced by 20 (because I've seen this before).
Is this expected behavior? Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.
Essentially, the first statement is a pure DDL operation and the second statement is a DDL operation with storage options, where the change? And DDL operations ignore the declaration of principles on the subject, unlike, for example, a SELECT statement.
I tried with a DISPLACEMENT of ALTER TABLE and saw the same behavior: without specifying PARALLEL in my statement, it read the table in series. When I specified PARALLEL, it read the table in parallel.
MarkWhen you specify PARALLEL creating / REBUILD / MOVE, the degree is used for the C/R/M. it is always "in place" for all the readings (and will be used in DML If ALTER SESSION ACTIVATE PARALLEL_DML has been paid).
However, the degree of PARALLEL set of the GET on the table / index is not automatically reused for the next RECONSTRUCTION/MOVE (although the degree that has been set remains!)Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.
Yes, precisely.
See http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/clauses006.htm#g1058315
NOPARALLEL
Specify NOPARALLEL for serial execution. It is the default value.Hemant K Collette
-
Hello
I must set my DB and move some tables from one tablaspace to another.
For example, a PRODUCT stored on tablespace TBL_1 table I wrote a script like this:
ALTER table PRODUCT move tablespace TBL_2
storage
*(*
initial 1 M
According to 1 M
PCTINCREASE 0
*);*
Its index to perform a script like this?
ALTER index rebuild of IDX_PRODUCT;
I just want to rebuid the index because I guess that after having pass the array to another tablaspace, the index is no longer gets its records, but I don't need to move the index to a different tablespace.
My alter index statement above is fair?
My version is Oracle 8.1.7.
Thank youYes.
ALTER index rebuild oftablespace ; -
Question about parallel hint and 'alter table enable parallel DML'
Hi all
I have a DML as follows:
Insert / * + append * / into table1
Select *.
of COMPLEX_VIEW;
Here complex_view contains a very complicated SQL, in which there is some heavy tables joins, subqueries, and aggregations.
Question 1:
Let's assume that the underlying tables have no attribute "parallel." Where should I add "parallel index" to force it to be run in parallel and can get better performance?
Some members think that what follows is good.
Insert / * + append * / into table1
Select / * + parallel (a 4) * / *.
of COMPLEX_VIEW;
But I think that indicators must be put in the defintion of the complex view where they should be and do not put advice to the main insert DML, like this:
Insert / * + append * / into table1
Select *.
of COMPLEX_VIEW; -I added the indicators in the COMPLEX_VIEW.
What is your opinion?
Quesion2:
Without ' alter session enable parallel DML ", I can see the parallel session in v$ px_session thus." And the execution time has been shortened. This proves without this statement, the DML is also run in parallel.
So, what is the effect of this statement?
Best regards
LeonI prefer the suspicion out of the COMPLEX_VIEW. This way, only this application forces the suspicion. If you put the indicator in the COMPLEX_VIEW, any other query on COMPLEX_VIEW (or Assembly of COMPLEX_VIEW to another view or a table) would also "encode" indicator in its execution. You don't then isolation parallel query to only where it is needed.
If you put the parallel indicator in SELECT it (or view), the query is parallelized. This does not necessarily mean that the INSERT is parallelized. What you see v$ px_session are only slaves to PQ to SELECT.
You must ALTER SESSION ACTIVATE PARALLEL DML and add the PARALLEL indicator in the INSERT.Hemant K Collette
-
DB version 10.2
When I try to do more high I am hit with ORA-02242 after reconstitution with nologging parallel 4. But when I run manuallyBEGIN FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('PORT') and index_type='NORMAL') LOOP EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' REBUILD nologging parallel 4 '; 5 dbms_output.put_line('-----------------'); --EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || 'NOPARALLEL'; END LOOP; begin FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('PORT') and index_type='NORMAL') LOOP EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || 'NOPARALLEL'; end loop; end; END; /
then ok.ALTER INDEX' <index_name> NOPARALLEL
Some can help me please
ERROR on line 1:
ORA-02242: no option specified for the ALTER INDEX statement
ORA-06512: at line 11 levelBEGIN FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('EMPLOYEES') and index_type='NORMAL') LOOP EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' REBUILD nologging parallel 4 '; EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' NOPARALLEL '; END LOOP; END; /
-
Capture the Index Rebuild process time in a table
Dear Experts,
I have a stored procedure to rebuild the indexes. I would like to capture reconstruction of start and end time for a table. I created the table with structure below: I am writing an insert statement in the procedure that captures rebuild timings, might well want to suggest how to implement this?
MAINT DESC
Name Null? Type
------------------------------------------- ------------------------------------
OWNER VARCHAR2 (30)
TABLE-NAME VARCHAR2 (30)
START_TIME DATE
END_TIME DATE
VARCHAR2 (200) COMMENTS
CODE PLEASE
=======
CREATE OR REPLACE PROCEDURE "USER1". "" ONLINE_REORG ".
(v_owner IN varchar2, v_tablename IN varchar2) AS
v_rebuild_statement VARCHAR2 (1000);
v_rebuild_statement1 VARCHAR2 (1000);
err_msg VARCHAR2 (100);
v_cdc number (6);
cursor c1 is select master index_name table_name, nom_tablespace
of dba_indexes
where table_owner = upper (v_owner) and
nom_tablespace is not null and
index_type = 'NORMAL' and
table_name = Upper (v_tablename);
BEGIN
DBMS_OUTPUT. Put_line ('Rebuild Index procedure begins execution At' | to_char (sysdate, ' DD-MM-YYYY HH24:MI:SS'));))
FOR c1_rec IN c1 LOOP
Start
v_rebuild_statement: = 'edit index' | c1_rec. Owner: '.' | c1_rec.index_name |' REBUILD PARALLEL 6 LOGGING COMPRESS TABLESPACE ' | c1_rec.tablespace_name;
DBMS_OUTPUT. Put_line(v_rebuild_statement||';');
EXECUTE IMMEDIATE v_rebuild_statement;
exception when others then
null;
end;
Start
v_rebuild_statement: = 'edit index' | c1_rec. Owner: '.' | c1_rec.index_name |' NOPARALLEL ';
DBMS_OUTPUT. Put_line(v_rebuild_statement||';');
EXECUTE IMMEDIATE v_rebuild_statement;
exception when others then
null;
end;
END LOOP;
DBMS_OUTPUT. Put_line ("Rebuild Index procedure completes execution to ' |") TO_CHAR
(sysdate, ' DD-MM-YYYY HH24:MI:SS'))) ;
EXCEPTION
WHILE OTHERS THEN
DBMS_OUTPUT. Put_line ("Rebuild Index ended execution without success to")
' || TO_CHAR (sysdate, ' DD-MM-YYYY HH24:MI:SS'));)
err_msg: = SUBSTR (SQLERRM, 1, 100);
raise_application_error(-20001,err_msg);
END;
-
schedule the index rebuild online
Hello
I need to schedule a task at the level of the database to rebuild the index online each month. all script exist? as the procedure to call on every month to rebuild indexes for the 5 tables identified in our project?
It is in production
We run in oracle 10g in the solaris platform.Dear Raman,
I have no why yon need this.
Try this, you can change next_date and interval you condition
declare VJOBNUMBER BINARY_INTEGER; begin DBMS_JOB.SUBMIT( job => VJOBNUMBER, NEXT_DATE => sysdate, interval => 'SYSDATE + 30', WHAT => 'BEGIN FOR S IN (SELECT ''alter index'' || INDEX_NAME || '' rebuild;'' A FROM ALL_INDEXES) LOOP EXECUTE IMMEDIATE S.A; END LOOP; END;'); DBMS_OUTPUT.PUT_LINE('Job number assigned: ' || TO_CHAR(VJOBNUMBER)); end;
-
Hello
Someone has modified the table and made Index unusable. How to make it usable again?
ALTER INDEX 'REP_ODI35 '. "' AK_COL ' UNUSABLE;
Kindly help
Thank you
Concerning
GathaHello
rebuild your index...
ALTER index index-name rebuild
-
Index rebuild after moving table to a different tablespace?
Index rebuild after moving table to a different tablespace?
Oracle-Meng wrote:
Index rebuild after moving table to a different tablespace?
Only if you want to reuse.
See DBA guide
http://docs.Oracle.com/CD/B28359_01/server.111/b28310/tables006.htm#i1106606
Pass an array to a new Segment or a Tablespace
Move a table changes the ROWID of the rows in the table. This causes the indexes on the table to be marked
UNUSABLE
, and DML, access the table using these clues you will receive an ORA-01502 error. The indexes on the table must be deleted or rebuilt. Similarly, all the statistics in the table become invalid and new statistics should be collected after the removal of the table. -
Hello
I have little doubt below the topics listed. Please explain each topics and where we need to use for the same thing. Can I use any of that? What are the subjects of these advantages and disadvantages?
(1) index rebuild and index rebuild online
(2) analyze index-static calculation and validate the strcture
(3) DBMS_STATS. GATHER_INDEX_STATSIn order to make good use of the cost based optimizer, you create statistics for data in the database.
-
During the rebuilding of the index on the production of databases what precautions because a DBA will take? If dba disable the application or not?
When online index rebuilding, what performance question will come on the production database?
Thanks in advanceReconstruction on-line during the index of what will be the impact on the database?
1 space of index segments can be roughly doubled as Oracle retains the original index segment during the reconstruction. It creates a new index segment, he switches rapidly, then deletes the old.
2 CPU will be consumed
3 oracle perhaps fully analyze the old index, other index or table.If a user makes a request at the time of the index to rebuild which will have an impact on this user?
a shared lock on the table will be held
brief exclusive lock tables and indexes metadata will be held during the switch. -
Index rebuild required after truncate the table and load data
Hello
I have a situation that we truncate tables bit and then we loaded data [only content] on these tables. What you need to rebuild the index online is necessary or not?
And another question is if we drop a few clues is the total amount of space is released or not. And re-create indexes will use the same amount of space. As I don't have disk space more? In this situation, rebuild the index online will be a better idea...
Can you please on this...
truncate the table some the few loading tables + reconstruction markings online is the best (or) droping little tables, a few tables loading + re-create the index is better
Can you suggest the best way... We have a time that it currently we don't have enough space on the disk... [Option should not effect the space]user13095767 wrote:
Ok. I have it...u want to say if we disbale the index while loading... Next, we need to spend the time to build.
If the indexes are enabled, then rebuild again is not necessary after loading tables...
Please answer if my understanding is correct...
above is correct
>
If so, how abt the differences in the space occupied by the spaces of storage during the index rebuild and re-create... T he acquires more space if recreate us [deletion and creation] or rebuild online is preferable to an index...?
space used is the same for all options.
Maybe you are looking for
-
Said unverified configuration if she said that Mozilla has found. What now?
Old computer crashed and I now try to configure Thunderbird on the new computer, but I can't make it work. First Mozilla tell configuration found while it is not verified. I have an account on another computer where I can receive messages. Informatio
-
Hi guys, im fairly new to all this labview, so I apologize if this is a silly question, im using an elapsed timer, I got a signal when it is greater than a constant, it resets the timer that gives a value of 0 for a defiler, when the signal is in the
-
Windows search is stuck in a loop. The message I get is: wait to receive indexing status... when I shoot to the top of the index of the button to start indexing id already depressed and does nothing. I am running Windows XP Home edition with service
-
I have a total of 11 mp3 files that I need to add to this photo film and I have 10 mp3 files already imported, but it won't let me add the last of them.
-
Reinstall the application that has been deleted by mistake
Microsort Word 2007 has been uninstalled & installed Windows Word 2010... can't find Windows 2007 to reinstall... can someone help the learner...