Presentation is loading. Please wait.

Presentation is loading. Please wait.

Oracle 9.2 – New features in the SAP world

Similar presentations


Presentation on theme: "Oracle 9.2 – New features in the SAP world"— Presentation transcript:

1 Oracle 9.2 – New features in the SAP world
Jürgen Kirschner (Oracle) Senior Principal Technical Consultant

2 Who we are? Our group: We are working for Oracle’s ”Solution Center SAP Support and Services” Based at SAP Responsible for Development Support offers Advanced Product Services - APS (Workshops, Migration, Onsite Services) Customers: Dow Corning, Chevron, Shell, Hershey, Bristol-Myers Squibb, SAP, Schindler, Grainger, Black & Decker, Callaway, Wyeth, GPU, ...

3 Who we are? Paul Loos Contact person in the US:
Sr. Principal Support Engineer SolutionSupportDelivery Phone:

4 Why should I upgrade? Performance Stability Company decision
Nice presentation Features

5 Because you have to! Why should I upgrade?
8.1.7 will be desupported by the end of Please check SAP note # and Oracle metalink note # Whether or not there will be an Extended Maintenance Support (EMS) for SAP customers has not yet been decided. We recommend to start the evaluation process soon. Please check note #

6 Features SAP note#598678 (at the moment released internally only)
Describes the current features officially supported by SAP. Will be updated continuously during the next months to reflect changes. The following presentation is covering the features from the Oracle point of view and is only talking about such features where their usage makes sense in an SAP environment

7 Features (Part I) Automatic PGA tuning Automated undo management (AUM)
Flashback query Parameter file (spfile) Online table redefinition Resumable session

8 Automated PGA tuning

9 Automated PGA tuning Automated PGA tuning Oracle 6/7/8 Oracle 9i
Parameters which control memory allocation of EACH shadow process (sort_area_size, hash_area_size, …) Oracle 9i Parameters which control memory allocation of EACH shadow process (sort_area_size, hash_area_size, …) OR Automated PGA tuning

10 Automated PGA tuning Idea: Note: The memory will not be pre-allocated.
Instead of each shadow process allocating private memory (and keeping it) for temporary operations like sorts, Oracle is providing a kind of ‘shared area’. If this workarea is no longer needed, the memory is freed against the OS and therefore can be used by all other shadow processes. Note: The memory will not be pre-allocated.

11 Automated PGA tuning Example: First peak: Sort by session A
Second peak: Sort by session B Third peak: Sort by session A+B at the same time

12 Automated PGA tuning How to activate? Init.ora or spfile:
WORKAREA_SIZE_POLICY = AUTO PGA_AGGREGATE_TARGET = <maximum amount of memory> Please check OSS note # for SAP’s recommendations for BW systems.

13 Automated PGA tuning Restrictions (I):
Each shadow process can by default only allocate up to 5% of the overall pga_aggregate_target value Parallel operations can allocate up to 30% of the overall pga_aggregate_target value Each shadow process can by default only allocate up to 200MB of memory. CKPT process is permanently checking/controlling the utilization and adjusting the memory allocation requests

14 Automated PGA tuning Restrictions (II):
If not enough memory is available, space in the temporary tablespace will be allocated (as with the ‘old’ behavior)

15 Automated Undo Management (AUM)

16 Automated Undo Management (AUM)
Question: How long would it take if I now leave the room and request from ALL of you to define a concept for a classic rollback segment layout to which EVERYONE agrees? Answer: Private opinion: Forever!

17 Automated Undo Management (AUM)
With 9i, Oracle has introduced the Automated Undo Management (AUM). What is new in AUM? Oracle controls the number of undo segments (adding new if necessary) A special tablespace is introduced for handling only undo segments You can decide for how long the undo information SHOULD stay in the undo segments

18 Automated Undo Management (AUM)
How to activate? Init.ora or spfile: UNDO_MANAGEMENT = AUTO UNDO_TABLESPACE = <tablespace name> Note: The tablespace must be created BEFORE switching to AUM. The default value for undo_management is ‘MANUAL’ (=classic rollback segment setup)

19 Automated Undo Management (AUM)
How to create an undo tablespace? SQL: Create undo tablespace <name> <datafile>; Note: The TS will be created as a locally managed TS with autoallocate (OEM screenshot)

20 Automated Undo Management (AUM)
Additional information: After startup, 10 undo segments are always active If more than 10 active concurrent DML operation are present, for every new concurrent DML operation, a new undo segment will be created/activated (automatically) You can create multiple undo tablespaces. However only 1 undo tablespace can be active at one time The name of the segments are: ‘_SYSSMU<n>$’ The segment type is: ‘TYPE2 UNDO’

21 Automated Undo Management (AUM)
Parameter ‘undo_suppress_errors’ The default value for this parameter is false. If you set this parameter to true, errors regarding classic rollback segments will not be signaled. Mainly the Oracle error ORA will be suppressed. This parameter can help if you have scripts or optimized code for the classic rollback segment setup. Otherwise, after switching to AUM an error would be signaled.

22 Automated Undo Management (AUM)
Example (I): SQL> set transaction use rollback segment prs_1; set transaction use rollback segment prs_1 * ERROR at line 1: ORA-30019: Illegal rollback Segment operation in Automatic Undo mode SQL> alter system set undo_suppress_errors = true scope=memory; System altered. SQL> set transaction use rollback segment prs_1; Transaction set.

23 Automated Undo Management (AUM)
Example (II): SQL> create rollback segment RBS_NEW; create rollback segment RBS_NEW * ERROR at line 1: ORA-30019: Illegal rollback Segment operation in Automatic Undo mode SQL> alter session set undo_suppress_errors = true; Session altered. SQL> create rollback segment RBS_NEW; Rollback segment created. SQL> select * from dba_rollback_segs where segment_name = 'RBS_NEW'; no rows selected  ONLY THE ERROR WILL BE SUPPRESSED!!

24 Automated Undo Management (AUM)
Parameter ‘undo_retention’ (I) The default value for this parameter is 900 (value is seconds). This parameters controls for how long Oracle is TRYING to keep read consistent information within the undo segments. If you set this to a large value, the number of ORA-1555 errors can be reduced, however, you may will need a lot of space.

25 Automated Undo Management (AUM)
Parameter ‘undo_retention’ (II) If the undo tablespace does not have more free space but we have not yet reached the time specified with undo_retention, no error will be signaled. We are then reusing existing blocks. Advice: Create the undo tablespace with the same size as your current PSAPROLL and set undo retention to e.g. 12 hours. Then monitor the usage of undo segments by checking V$rollstat and V$undostat

26 Flashback query

27 Flashback query This is one of the really nice features with 9i. Let us have a look at an example: SQL> select * from flash_new; T1 T2 1 xsdfsadf This is the current SCN: SQL> delete flash_new; 1 row deleted. SQL> commit; Commit complete. no rows selected SQL> create table flash_rescue as select * from flash_new as of scn ; Table created. SQL> select * from flash_rescue; T1 T2 1 xsdfsadf

28 Flashback query Facts about flashback query:
will work with AUM and classic RBS (but flashback query is designed to work with AUM – parameter undo_retention) prerequisite is, that the data is still in the undo segments (otherwise ORA-1555 will be signaled) you can use a time based or a scn based approach for LONG or LONG RAW columns, you have to create a view and then use PL/SQL to get the data. exp can also be used (FLASHBACK_SCN, FLASHBACK_TIME) maximum flashback time is 5 days (if the system is running the whole time – server uptime)

29 Flashback query Attention:
If you create a new table, you can not immediately use flashback query. You have to wait several minutes before you can use this feature.

30 SPFILE

31 Spfile Spfile = Server parameter file
Binary parameter file managed by the Oracle server Location: default: $ORACLE_HOME/dbs (Unix) %ORACLE_HOME%/database (NT) Default name: spfile<SID>.ora Search path (Unix): $OH/dbs/spfile$ORACLE_SID.ora $OH/dbs/spfile.ora $OH/dbs/init$ORACLE_SID.ora Search path (NT): same as above; just replace dbs with database

32 Spfile How to activate: SQL> create spfile from pfile;
How to check if a spfile is active: SQL> show parameter spfile For the creation of a spfile, you need sysdba privileges If a parameter cannot be changed online, an error will be raised (ORA ) Advantages: no OS login necessary Changes can be made immediately (in memory) and in the spfile

33 Spfile Examples: - alter system set optimizer_index_cost_adj = 20 scope=spfile; alter system set max_dump_file_size=unlimited scope=BOTH ; - alter system set max_dump_file_size=1000 scope=memory; - alter system reset user_dump_dest scope=spfile sid='*'; - alter system set optimizer_index_cost_adj = comment = 'Changed on July/19/ old: 10 new: 20 reason: advised by JK - Oracle‘ scope = spfile; - alter system set event = '10191 trace name context forever, level 1', '10181 trace name context forever, level 1' scope=spfile;

34 Spfile Advices: backup your spfile in regular timeframes SQL> create pfile=/../../../ from spfile; Be careful when you change parameters which can have multiple lines (events) If you switch to a spfile setup, you should rename your original init<SID>.ora Get familiar with V$parameter, V$parameter2, V$spparameter V$system_parameter Note: If you are using the Oracle Upgrade Assistant, a spfile will be created automatically!!!

35 Online table redefinition

36 Online table redefinition
“OR” Online table reorganization Online redefinition is based on a PL/SQL package By default, a table which is planned to be redefined, needs a primary key constraint Tables which contain LONG or LONG RAW fields can NOT be redefined online Online table redefinition is based on the materialized view concept The target table can have a different layout than the source table. This is the reason for the wording ‘redefinition’ You are responsible for the creation of the target table and the correct settings for this table (default values)

37 Online table redefinition
Walk through example: SQL> create table test_redef (t1 number, t2 varchar2(10)); Table created. SQL> alter table test_redef add constraint pk_test_redef primary key (t1); Table altered. SQL> begin for i in loop insert into test_redef values (i,'XXX'); end loop; end; / PL/SQL procedure successfully completed. SQL> create table test_redef_new as select * from test_redef where rownum < 1; Table created. SQL> exec dbms_redefinition.can_redef_table('SAPR3','TEST_REDEF'); PL/SQL procedure successfully completed. SQL> exec dbms_redefinition.start_redef_table('SAPR3','TEST_REDEF','TEST_REDEF_NEW'); PL/SQL procedure successfully completed.

38 Online table redefinition
SQL> select count(*) from test_redef; COUNT(*) SQL> select count(*) from test_redef_new; COUNT(*) SQL> begin for i in loop insert into test_redef values (i,'XXX'); end loop; end; / PL/SQL procedure successfully completed. SQL> commit; Commit complete.

39 Online table redefinition
SQL> select count(*) from test_redef; COUNT(*) SQL> select count(*) from test_redef_new; COUNT(*) SQL> exec dbms_redefinition.sync_interim_table('SAPR3','TEST_REDEF','TEST_REDEF_NEW'); PL/SQL procedure successfully completed. SQL> select count(*) from test_redef_new; COUNT(*) SQL> begin for i in loop insert into test_redef values (i,'XXX'); end loop; end; / PL/SQL procedure successfully completed.

40 Online table redefinition
SQL> commit; Commit complete. SQL> comment on table test_redef is 'This is the original table'; Comment created. SQL> comment on table test_redef_new is 'This is the new table'; Comment created. SQL> select count(*) from test_redef_new; COUNT(*) SQL> select count(*) from test_redef; COUNT(*)

41 Online table redefinition
SQL> alter table test_redef_new add constraint pk_test_redef_new primary key (t1); Table altered. SQL> create index i_test_redef_new on test_redef_new (t2); Index created. SQL> analyze table test_redef_new compute statistics; Table analyzed. SQL> exec dbms_redefinition.finish_redef_table('SAPR3','TEST_REDEF','TEST_REDEF_NEW'); PL/SQL procedure successfully completed.

42 Online table redefinition
SQL> select table_name, substr(comments,1,29) from dba_tab_comments where table_name like 'TEST_REDEF%'; TABLE_NAME SUBSTR(COMMENTS,1,29) TEST_REDEF This is the new table TEST_REDEF_NEW This is the original table  Tables are automatically renamed SQL> select table_name, index_name from dba_indexes where table_name like 'TEST_REDEF%‘ order by table_name; TABLE_NAME INDEX_NAME TEST_REDEF PK_TEST_REDEF_NEW TEST_REDEF I_TEST_REDEF_NEW TEST_REDEF_NEW PK_TEST_REDEF

43 Online table redefinition
Summary: Based on a step by step implementation, the DBA always has full control over the procedure Based on the materialized view implementation, this is not a completely new concept You can perform ALL tasks on the ‘shadow’ table before performing the final switch (statistics, index creation) If you decide to terminate the reorg, you simply execute: exec dbms_redefinition.abort_redef_table ('SAPR3',‘orig_tab ,‘new_tab'); The original table will not be dropped automatically after the switch

44 Resumable session

45 Resumable session Example:
SQL> create tablespace test datafile 'D:\ORACLE\ORADATA\V92\test.dbf' size 5M; Tablespace created. SQL> create table test_resumable (t1 number) tablespace test storage (initial 10M); create table test_resumable (t1 number) * ERROR at line 1: ORA-01659: unable to allocate MINEXTENTS beyond 4 in tablespace TEST

46 Resumable session SQL> alter session enable resumable;
Session altered. SQL> create table test_resumable (t1 number) tablespace test storage (initial 10M); The session is waiting! V$session_wait will show us: “statement suspended, wait error to be cleared”

47 Resumable session In the alert file we will find:
Thu Apr 17 09:43: statement in resumable session 'User SAPR3(62), Session 13, Instance 1' was suspended due to ORA-01659: unable to allocate MINEXTENTS beyond 4 in tablespace TEST In the view dba_resumable will find additional information about this suspended statement!

48 Resumable session Summary:
‘alter session resumable’ is setting statements, which are running into SPACE errors, ‘on hold’ Errors which are covered are (for example): ORA-1536, ORA-1653, ORA-1659, ORA-30036 The suspend time is by default 7200 seconds The suspend time can be also set: SQL> alter session enable resumable timeout 10; To activate for all sessions, a logon trigger is necessary You can also setup an ‘AFTER SUSPEND’ trigger on database level, where you can define actions depending on the kind of error

49 Resumable session Attention:
‘alter session resumable’ does NOT work in combination with database links: SQL> create database link to_my_own_database 2 connect to sapr3 identified by sap using 'V92'; Database link created. SQL> alter session enable resumable; Session altered. SQL> select * from select * from * ERROR at line 1: ORA-30044: Resumable cannot be enabled with distributed transactions

50 Features (Part II)

51 Features (Part II) Alter system suspend holds all I/O
Dynamic SGA dynamic increasing/decreasing of different areas of the SGA CBO Index skip scan Dynamic sampling New first_rows hint CBO Parameter changes Bind variable peeking

52 Features (Part II) Different Oracle block sizes for tablespaces
Automated Space Management also called Bitmap Managed Blocks (BMB) new method of block dispatching for insert operations and handling of re-usage of blocks (pctused will not work anymore) Two pass recovery Merge statement (upsert) combination of insert/update for synchronization of two tables RAC (Real Application Cluster) Compress for tables

53 There is a lot for you to learn!
Summary 9.2 offers a lot of helpful and good features for the daily work of a DBA. There is a lot for you to learn!

54 Information At 12:30 PM, there will be a Round Table Lunch – “Oracle SIG” If you have time, you are welcome to join. We will meet after this presentation at the Oracle booth at the vendor fair.

55 Thank you for attending!
Please remember to complete and return your evaluation form following this session. Session Code: [902A]


Download ppt "Oracle 9.2 – New features in the SAP world"

Similar presentations


Ads by Google