http://www.oracle-base.com/articles/10g/Services10g.php#jobs_and_services
11g 에서는 instance_id 가 추가된다고는 하지만..10g에서는 꽁수로 가능함
Posted by maceo
Posted by maceo
Posted by maceo
Posted by maceo
Oracle 에서는 IOT를 잘 쓰질 않는다. SQL Server 에서는 Clustered Index를 습관적으로 사용하는데 비해서 오라클에서는 확실히 분위기가 좀 다른 것 같다. 잘만 쓰면 여러모로 좋은 점이 많을텐데 습관의 벽을 잘 넘어서지 않는 것 같다는 생각이 든다.
이번에 통계DB 테이블을 IOT 전환하면서 알아낸 몇가지..
테스트 내역
날짜 + 분류코드로 PK가 잡힌 5억건의 일반 테이블을 IOT로 전환
테스트 결과 요약
결론
일반 테이블을 IOT 전환시 redo 발생을 최소화하기 위하여 Partitoned IOT 를 CTAS nologging 으로 생성하자.
추가 테스트 필요 사항
heap table / IOT table / Partitioned IOT 에 DML (insert/update/delete모두) 을 발생시킬 때 redo/undo 의 양
Posted by maceo
Posted by maceo
Posted by maceo
Posted by maceo
SGA에서 shared pool 과 buffer cache 가 커졌다 작아졌다 난리부르스를 출 때...
확인은
Posted by maceo
일단 위의 3권을 보시는데만 6개월은 족히 걸릴거 같습니다.
제가 서평을 3~4 개월 마다 올리므로 그때 참조하시는 것도하나의 방법이 되겟습니다.
참고로 제가 고민 했던 7~8 권은 아래와 같습니다.
1.SQL 을 자유자재로 구사할수 있는 책
SQL COOK BOOK
The Art of SQL
대용량 데이터베이스 솔루션 2권
2.SQL 튜닝책:
Oracle SQL High-Performance Tuning (2/E)
대용량 데이터 베이스 솔루션1 OLD 버젼
3.PL/SQL 튜닝책
Oracle PL/SQL Best Practices
Expert Oracle PL/SQL
Posted by maceo
When it comes to setting the optimizer_mode parameter you often hear people say that first_rows_N (for one of the legal values of N) should be used for OLTP systems and all_rows should be used for decision support and data warehouse systems.
There is an element of truth in the statement - but it’s really a hangover from the early days of CBO, and remembrance of the old first_rows optimizer mode (** See footnote).
Prior to the introduction of parameters like optimizer_index_cost_adj (Oracle 8), and system statistics (Oracle 9 - but optional until 10g), the cost based optimizer often seemed too keen to use execution plans that involved tablescans and hash joins - which could be most unsuitable in an OLTP system.
This problem appeared because the optimizer did not attempt to distinguish between the potential performance of a “db file sequential read” (single block read) compared to a “db file scattered read” (multiblock read). Setting the optimizer_mode to first_rows introduced some simple rules that (to a large extent) stopped the optimizer from using tablescans unless there were no alternatives.
In 9i, however, first_rows_N optimisation is geared towards using arithmetic to make decisions about avoiding tablescans. You can see the results of this in some of the odd numbers that appear in execution plans as the optimizer works out whether, for example, it is better to use an index to pick up 10 rows from a table, or whether running 2.3% of a tablescan (which would probably get the first 10 rows) is the cheaper option.
Think about what this means - first_rows_N is trying to work out the cheapest way of collecting the first N rows of the result set, whereas all_rows is trying to work out the cheapest way of collecting all the rows of the result set.
But when you are running an OLTP system a huge fraction of typical end-user queries will be returning just a handful of rows - and if you have a query that’s only supposed to return 5 or 6 rows (say), then first_rows_10 actually means “all the rows I expect”, i.e. all_rows. If the optimizer works correctly, then both options should produce the same execution plan.
Of course, some end-user queries (even in an OLTP system) are reports, and for reports you don’t want to generate a plan that’s optimised to return the first few lines so, again, you’re really interested in all_rows optimisation.
Your conclusion should therefore be: for OLTP systems, first_rows_N ought to be irrelevant. You should be using all_rows - unless you can demonstrate that this introduces a large number of execution plans that have to be fixed individually because of some unexpected side effects (Again, though, see footnote).
So why would we ever need first_rows_N ?
Think Google, or Amazon, or any of the “forum” software suppliers. There are systems which are effectively ad hoc query systems where users can supply query predicates that could return a lot of data - but the code limits the amount of data sent back to the user to “page at a time”. Think “web-based reporting system”, and you’ve identified the basic rationale for first_rows_N.
Even for the web-base reporting system, though, you may still be able to run under all_rows from from 10g onwards. In 10g when the optimizer sees predicates like “rownum <= 35″ it will behave as if you had included the hint /*+ first_rows(35) */ in the query.
As a closing thought: even if you think that first_rows_N may be the correct logical and strategic choice for your system, remember that it hasn’t been “field-tested” to the extent that all_rows has been tested.
There are bugs (or side effects) in the optimizer that make their first appearance only in the strange circumstances of “real-world” applications - and it’s a good bet that such oddities are found (and probably fixed) faster in the all_rows environment than in the first_rows_N environment simply because far more systems use all_rows.
Even when first_rows_N seems to be the right choice, you could decide to stick with all_rows and adjust critical statements with a /*+ first_rows(N) */ hint.
Footnote: If you still have any systems running 9i or later and using first_rows, you should be planning to change the optimizer_mode when you next go through a full test cycle. As the manuals point out (9.2 Performance Tuning Guide and Reference p1-12): “first_rows is available for backward compatibility and plan stability”.
Backward compatibility is important, and until you enable system statistics, clean up various other optimizer related parameters, sort out your statistics collection strategy, and clean out a load of redundant hints and SQL hacks, you may find that changing the optimizer_mode introduces as many problems as it solves - and that’s why this is a change that needs a lot of testing
Posted by maceo