Professional Documents
Culture Documents
ORACLE 10g
Agenda
Whats behind the 10g buzzwords Manageability enhancements Performance tuning enhancements Exp/imp with Data Pump Parameters, views SQL and PL/SQL Recovery and Flashback Wrap-up Questions
2
Simplicity vs Flexibility
Automatic statistics gathering Advisories Automatic tuning Less than 30 basic (init.ora) parameters
Basic, advanced, hidden parameters
Easier operations
alter tablespace rename flashback queries undrop table etc..
3
Manageability
SGA_TARGET
Sets total size for all SGA components Buffer Cache, Shared Pool, Large Pool, Java Pool Dynamically and automatically adjustable Automatic changes persist in SPFILE
PGA_AGGREGATE_TARGET
Available since 9i Sets total size target for all server processes sort_area_size, sort_area_retained_size, hash_area_size, bitmap_merge_area_size Contents automatically managed
4
Basic Parameters
COMPATIBLE CONTROL_FILES DB_BLOCK_SIZE DB_CREATE_FILE_DEST DB_CREATE_ONLINE_LOG_DEST DB_DOMAIN DB_NAME DB_RECOVERY_FILE_DEST DB_RECOVERY_FILE_DEST_SIZE INSTANCE_NUMBER JOB_QUEUE_PROCESSES LOG_ARCHIVE_DEST_n LOG_ARCHIVE_DEST_STATE_n NLS_LANGUAGE NLS_TERRITORY OPEN_CURSORS PROCESSES REMOTE_LISTENER REMOTE_LOGIN_PASSWORDFILE ROLLBACK_SEGMENTS SESSIONS SHARED_SERVERS STAR_TRANSFORMATION_ENABLED UNDO_MANAGEMENT UNDO_TABLESPACE
Manageability
SYSAUX tablespace for system utilities
Module SYS objects Oracle Data Mining OEM Repository Oracle OLAP Oracle interMedia Oracle Spatial Oracle Ultra Search RMAN Recovery Catalog Sample Schemas Workspace Manager Oracle XML DB Auto. Workload Repository Tablespace SYSTEM (includes AUD$ and FGA_LOG$ tables) ODM OEM_REPOSITORY CWMLITE SYSTEM SYSTEM DRSYS TOOLS Example SYSTEM XDB_RESINFO New in 10g
6
SYSAUX
Online Operations
Some functionality there already in 8i, 9i
Online index build, rebuild Online index organized table rebuild Analyze/validate structure online
Free Space
alter table enable row movement; alter table t1 shrink space cascade;
TABLE HEADER 11001101 10101111 11101101 00001101 11001101 10101111 11101101 00001101 11001101 00001101
Free Space
8
Rename Tablespace
Useful in Transportable Tablespace scenarios ALTER TABLESPACE prod RENAME to arc1;
Cant rename SYSTEM or SYSAUX Tablespace and all datafiles must be online Can also rename READ ONLY tablespaces
PROD
ARC1
Bigfile Tablespaces
Support for sizes up to 8 Exabytes!
8 000 000 Terabytes Max 65535 files in database SYSTEM & SYSAUX cant be bigfile tablespaces
8 000 000 000 000 000 000 bytes
CREATE BIGFILE TABLESPACE bigtbs DATAFILE '/u02/oracle/data/bigtbs01.dbf SIZE 50G EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
11
Crossplatform Transportable TS
RMAN> CONVERT TABLESPACE sales_1,sales_2 2> TO PLATFORM Microsoft Windows NT 3> FORMAT /temp/%U; ... Transporting Tablespaces Between Databases input datafile fno=00004 name=/u01/oracle/oradata/salesdb/sales_101. dbf converted datafile=/temp/data_D-10_I3295731590_TS-EXAMPLE_FNO-4_06ek24vl channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:45
13
Data Pump
A server-managed data transportation tool Direct load/extract capabilities Very high performance/efficient with large data sets Data Replacement for exp/imp Pump
old exp/imp remain supported
Client Data Pump Client
Data Pump
Data Pump
Data Warehouse
PROD
14
Data Pump
Commands expdp/impdp Can use files or direct network transfer Dynamic configuration, resumable operations Client can detach and reconnect Can be parallelized using PARALLEL
Even loads to/from external text files Parallelization level can be changed on the fly for long running jobs
FlashBack Database
Flash Recovery Area must be configured
Flashback logs are stored there Consisting of old database block images Fast rollback of database, no redologs required
Server Process Server Process Server Process
DB
Flashback Log
17
FlashBack Database
Configuration parameters: DB_RECOVERY_FILE_DEST DB_RECOVERY_FILE_DEST_SIZE DB_FLASHBACK_RETENTION_TARGET Commands: ALTER DATABASE FLASHBACK ON; ALTER DATABASE FLASHBACK OFF; ALTER TABLESPACE test1 FLASHBACK OFF; ALTER TABLESPACE test1 FLASHBACK ON;
18
FlashBack Options
Flashback Query: exec dbms_flashback.enable_at_time(); select * from table; exec dbms_flashback.disable; select * from table AS OF timestamp ; Flashback Table: FLASHBACK TABLE t1 TO SCN 12345; FLASHBACK TABLE t1 TO TIMESTAMP '2003-03-03 12:05:00';
19
FLASHBACK TABLE RB$$3560$TABLE$1 TO BEFORE DROP RENAME TO scott.emp; PURGE RECYCLEBIN; DROP TABLE X PURGE; 22
Performance Tuning
RBO is dead, long live the CBO!
Even data dictionary, SYS tables using CBO However, RBO is gone nowhere, its available
Multiple Advisors
SQL Access & Tuning Advisor Memory Advisors (SGA, Shared Pool, etc..) Segment Advisor (Fragmentation, etc..) Undo Advisor
23
Advisor Information
DBA_ADVISOR_FINDINGS DBA_ADVISOR_RECOMMENDATIONS DBA_ADVISOR_RATIONALE And many more All the information is accessible through DBA_ and V$ data dictionary views The reasons and rationale behind recommendations can be seen
24
Performance Troubleshooting
Automatic Workload Repository
Runtime execution statistics are gathered in memory MMON background process flushes stats to disk
V$SQL_BIND_CAPTURE
Samples bind variables for all sessions Faster than sql_trace (10046 trace on level 4) But doesnt capture all variable types And doesnt capture occurences of bindings
_cursor_bind_capture_interval defaults to 900 seconds
dbms_monitor package
set tracing and statistics gathering in sessions based on sessionid, client_id, module and action attributes RAC aware, monitoring remains active until explicitly disabled
trcsess tool for gathering sessions SQL from in shared server environment
Sql trace (10046) reports module, action, client_id information to trace file
26
New opportunities
V$EVENTMETRIC, V$SESSMETRIC, V$SYSMETRIC, V$FILEMETRIC V$SYSMETRIC_HISTORY, V$SESSION_WAIT_HISTORY Contain same statistics, but sampled over interval, also history views
27
SQLPLUS Changes
Improvements SPOOL CREATE | REPLACE | APPEND
also works for SAVE command
glogin.sql and login.sql scripts are executed also on CONNECT Deimprovements No graphical sqlplusw.exe in Windows COPY command deprecated
28
Other
dbms_scheduler
calendar Expressions: Yearly, Monthly, Weekly, Daily, Hourly, Minutely, Secondely
Conclusion
This was probably < 1% of all new features Lots of new features = lots of new bugs Automatic for small to medium systems Big & heavily loaded systems still need care
30
Thank you!
31