文档库 最新最全的文档下载
当前位置:文档库 › Oracle8iDBA必备卡

Oracle8iDBA必备卡

INSTANCE

v$fixed_table, v$fixed_view_definition, v$indexed_fixed_column, v$instance, v$sga v$sgastat,, v$session, v$process, v$bgprocess, v$version,

v$product_component_version, v$license, v$option, v$access, v$timer, v$parameter, v$parameter2, v$system_parameter, v$system_parameter2, v$obsolete_parameter, v$sql, v$sqlarea, v$sqltext, v$sqltext_with_newlines, v$sql_cursor, v$sql_bind_data, v$sql_bind_metadata,

v$sql_shared_memory, v$librarycache, v$rowcache, v$rowcache_parent, v$object_dependency, v$rowcache_subordinate, v$open_cursor,

v$db_object_cache, v$shared_pool_reserved, v$bh, v$cache, v$subcache, v$buffer_pool, v$buffer_pool_statistics, v$filestat, v$sysstat, v$sesstat,

v$mystat, v$statname, v$waitstat, v$latch, v$latchname, v$latchholder, v$latch_parent, v$latch_children, v$event_name, v$system_event,

v$session_event, v$session_wait, v$mts, v$circuit, v$shared_server,

v$dispatcher, v$dispatcher_rate, v$reqdist, v$queue, v$lock,

v$enqueue_lock, v$locked_object, v$global_blocked_locks,

v$session_connect_info, v$session_longops, v$system_cursor_cache,

v$session_cursor_cache, v$session_object_cache, v$sess_io, v$bsp,

v$px_session, v$px_sesstat, v$px_process, v$px_process_sysstat,

v$pq_sesstat, v$pq_slave, v$pq_sysstat, v$pq_tqstat, v$execution,

v$mls_parameters, deptree, session_context

'instance_name', 'service_names', 'db_block_size', 'db_block_buffers', 'buffer_pool_keep', 'buffer_pool_recycle', 'db_block_lru_latches', 'shared_pool_size', 'log_buffer',

'large_pool_size', 'java_pool_size', 'shared_pool_reserved_size', 'pre_page_sga', 'sessions', 'processes', 'user_dump_dest', 'background_dump_dest', 'max_dump_file_size',

'local_listener', 'mts_service', 'mts_dispatchers', 'mts_max_dispatchers', 'mts_servers', 'mts_max_servers', 'dbwr_io_slaves', 'remote_os_authent', 'os_authent_prefix', 'dml_locks', 'enqueue_resources', 'parallel_automatic_tuning', 'parallel_min_servers',

'parallel_max_servers', 'parallel_min_percent', 'parallel_adaptive_multi_user',

'parallel_threads_per_cpu', 'parallel_execution_message_size',

'parallel_broadcast_enabled', 'oracle_trace_enable', 'oracle_trace_collection_{name | path | size}', 'oracle_trace_facility_{name | path}', 'java_soft_sessionspace_limit',

'java_max_sessionspace_size', 'lock_sga', 'shared_memory_address',

'hi_shared_memory_address', 'object_cache_optimal_size',

'object_cache_max_size_percent', 'serial_reuse', 'session_max_open_files',

'timed_os_statistics', 'use_indirect_data_buffers'

[obsolete: v$recent_bucket, v$current_bucket, 'db_block_lru_extended_statistics',

'db_block_lru_statistics', 'lock_sga_areas', 'shared_pool_reserved_min_alloc',

'parallel_server_idle_time', 'parallel_transaction_resource_timeout',

'parallel_min_message_pool', 'mts_rate_log_size', 'mts_rate_scale' ]

init.ora

Background:SMON, PMON, DBW, CKPT, LGWR, ARC, SNP, RECO, D, S, P, RFS

Failure of LGWR (Err 470), CKPT (470), DBW (471), ARC (473), SMON (474) or RECO (476) lead to termination of instance by PMON. Failure of PMON leads to termination of instance by DBW (Err 472). Failed SNP processes are restarted by PMON.

Packages DBMS_SYSTEM (set_sql_trace_in_session), DBMS_SESSION (set_sql_trace), DBMS_SHARED_POOL (keep, unkeep, sizes), DBMS_APPLICATION_INFO (set_module, set_action, set_client_info, read_module, read_client_info) dbmspool.sql, prvtpool.plb, utlbstat.sql, utlestat.sql, catparr.sql, utldtree.sql

Tuning/Contention

Buffer cache: 'Cache Hit Ratio' (v$sysstat) or per pool (v$buffer_pool_statistics)

1 – ('physical reads' / ('db block gets' + 'consistent gets')) < 90–95%

-> increase 'db_block_buffers'

or 'buffer_pool_keep', 'buffer_pool_recycle'

Shared pool: 'Shar. Cursors' (v$librarycache) gethitratio for SQL AREA < 99% Library cache: sum(reloads) / sum(pins) > 1% (v$librarycache)

Dict. cache: sum(getmisses) / sum(gets) > 15% (v$rowcache)

-> increase 'shared_pool_size'

LRU latch: "cache buffers lru chain" (v$latch) sleeps / gets > 1%

-> increase 'db_block_lru_latches' (max. CPU * 6 or BUFFERS / 50) show parameter

alter system set = [deferred];

mts_dispatchers = "{ (protocol = ) | (description = (address =...) ) | (address = (protocol = ) (host = ) (port = ) )} (connections = ) (dispatchers = <1>) (listener = ) ( {pool | multiplex} = ) (ticks = <15>) (service = ) (presentation = {ttc | oracle.aurora.server.{SGiopServer | GiopServer} } ) ", mts_servers = , resource_limit = {true | false}, global_names = {true | false}, scan_instances = , cache_instances = , license_max_sessions = , license_sessions_warning = , license_max_users = , remote_dependencies_mode = {timestamp | signature}, resource_manager_plan

alter session set = ;

optimizer_goal = {all_rows | first_rows | rule | choose}, sql_trace = {true | false}, global_names = {true | false}, skip_unusable_indexes = {true | false}, label = {'' | dbhigh | dblow | oslabel}, mls_label_format = , flagger = {entry | immediate | full | off}, session_cached_cursors = , close_cached_open_cursors = {true | false}, instance = , parallel_instance_group = '', hash_area_size = ,

hash_multiblock_io_count = , remote_dependencies_mode = {timestamp | signature}, isolation_level = {serializable | read committed}, constraints = {immediate | deferred | default}, , events ‘{10015 | 10046 | 10049 | 10210 | 10211 | 10212 | 10231 | 10235} trace name context forever, level ’, events ‘immediate trace name {heapdump | controlf} level

startup [force] [restrict] [pfile=]

[ { nomount | {mount | open [recover] } []

[ exclusive | parallel [retry] | shared [retry] ] } ] shutdown [ normal | transactional | immediate | abort ]

alter database []

{ mount [ {standby | clone} database]

[exclusive | parallel] << obsolete | dismount

| open [read only | [read write] [resetlogs | noresetlogs] ]

| close [normal | immediate] };

alter system flush shared_pool;

alter system {enable | disable} restricted session;

alter system kill session ‘,’;

alter system disconnect session ‘,’ post_transaction;

orapwd file= password= entries=

oradim –{new | edit | delete | startup | shutdown}

–{sid | srvc } –newsid

–usrpwd –intpwd –maxusers

–startmode {a | m} –shutmode {a | i | n}

–{starttype | shuttype} {srvc | inst | srvc, inst}

–pfile –timeout

tkprof [explain=/@] [table=]

[print=] [sys=no] [insert=] [record=] [aggregate=]

[sort=]

otrcfmt

oemctrl {start | stop} oms, oemapp console, vppcntl –start, vtm

DATABASE

v$database, v$controlfile, v$controlfile_record_section, v$deleted_object,

v$compatibility, v$compatseg, dictionary, dict_columns, dba_catalog,

dba_objects, dba_object_size, dba_analyze_objects, props$,

database_compatible_level

'control_files', 'db_name', 'db_domain', 'db_files', 'compatible', 'read_only_open_delayed'

catalog.sql, catproc.sql, u0703040.sql, r0703040.sql, u08000.sql, r080000.sql,

d0800.sql, utlrp.sql, utlip.sql, utlirp.sql, utlconst.sql, utlincmpt.sql, utldst.sql,

catlg803.sql

Tuning/Contention

phyrds, phywrts (v$filestat)

create database []

[datafile ‘’ [,...] size [reuse]

[autoextend {on | off} [next maxsize { | unlimited} ] ] ]

[logfile [group ] (‘’ [,...] ) size [reuse]

[, [group ] (‘’ [,...] ) size [reuse] ] ... ]

[controlfile reuse] [maxdatafiles ] [maxinstances ]

[maxlogfiles ] [maxlogmembers ] [maxloghistory ]

[character set ] [national character set ]

[archivelog | noarchivelog] [exclusive];

alter database [] rename global_name to ;

alter database [] convert;

alter database [] reset compatibility;

alter database [] [national] character set ;

alter database [] set

{dblow = | dbhigh = | dbmac {on | off} };

create controlfile [''] [reuse] set database

[datafile...] [logfile...] ... [ [no]resetlogs];

alter database [] backup controlfile to

{'' [reuse] | trace [resetlogs | noresetlogs] };

alter database [] create standby controlfile as '' [reuse];

alter database [] activate standby database;

dbassist

TABLESPACES, DATAFILES & SEGMENTS

v$tablespace, v$datafile, v$datafile_copy, v$datafile_header, v$dbfile,

v$offline_range, v$tempfile, v$tempstat, v$temp_extent_map,

v$temp_extent_pool, v$temp_space_header, v$temp_ping, v$backup,

v$recover_file, v$recovery_file_status, v$recovery_log,

v$recovery_progress, v$recovery_status, v$recovery_transactions,

v$instance_recovery, v$fast_start_servers, v$fast_start_transactions,

dba_tablespaces, dba_ts_quotas, dba_data_files, filext$,

dba_temp_files, dba_segments, dba_extents, dba_free_space,

dba_free_space_coalesced, dba_free_space_coalesced_tmp[1-3],

ts_pitr_objects_to_be_dropped, ts_pitr_check, transport_set_violations,

dba_dmt_free_space, dba_dmt_used_extents, dba_lmt_free_space,

dba_lmt_used_extents, pluggable_set_check, uni_pluggable_set_check,

straddling_ts_objects

'db_block_checking', 'db_block_checksum', 'recovery_parallelism', 'fast_start_io_target',

'fast_start_parallel_rollback', 'db_file_name_convert', 'log_checkpoint_interval',

'log_checkpoint_timeout', 'log_checkpoints_to_alert', 'db_writer_processes',

'db_file_simultaneous_waits', 'read_only_open_delayed', 'db_block_max_dirty_target'

[obsolete: 'db_file_simultaneous_writes', 'db_block_checkpoint_batch',

'parallel_transaction_recovery' ]

Packages DBMS_REPAIR (check_object, {skip | fix}_corrupt_blocks, dump_orphan_keys,

rebuild_freelists, admin_tables)

DBMS_SPACE_ADMIN (tablespace_verify, tablespace_{rebuild|fix}_bitmaps,

tablespace_migrate_{from | to}_bitmap, segment_{verify | corrupt | dump},

segment_drop_corrupt, segment_extent_map_dump)

DBMS_TTS (transport_set_check, downgrade)

create [temporary] tablespace

{datafile | tempfile} ‘’ [size ] [reuse]

[autoextend {off | on [next ] [maxsize { | unlimited} ] } ]

[,’’... [autoextend...] ] [minimum extent ]

[ default storage ( [initial <5xBS>] [next <5xBS >] [pctincrease <50>]

[minextents <1>] [maxextents { | unlimited} ]

[freelists <1>] [freelist groups <1>]

[buffer_pool {default | keep | recycle} ] ) ]

[logging | nologging] [permanent | temporary] [online | offline]

[extent management { dictionary

| local [autoallocate | uniform [size <1M>] ] } ];

drop tablespace [including contents [cascade constraints] ];

alter tablespace add {datafile | tempfile}

’ size [reuse] [autoextend...];

alter tablespace rename datafile ‘’ [,...] to ‘’ [,...];

alter tablespace { online | offline [ normal | temporary

| immediate | for recover ] };

alter tablespace { read {write | only} | permanent | temporary };

alter tablespace [minimum extent ] default storage (...);

alter tablespace coalesce;

alter tablespace {begin | end} backup;

alter system {suspend | resume};

alter database [] datafile [,...] end backup;

alter system checkpoint [global | local];

alter system check datafiles [global | local];

alter database [] {datafile | tempfile} ‘’ [,...] resize ;

alter database [] {datafile | tempfile} ‘’ [,...] autoextend...;

alter database [] datafile ‘’ [,...] {online | offline [drop] };

alter database [] tempfile ‘’ [,...] {online | offline | drop};

alter database [] rename file ‘’ [,...] to ‘’ [,...];

alter database [] create datafile '' [,...] [as '' [,...] ];

alter database [] recover [automatic] [from '']

{ database [until { cancel | change

| time '' } ]

[using backup controlfile]

| [managed] standby database [timeout | cancel [immediate] ]

| [standby] tablespace '' [,...] [until [consistent with] controlfile]

| [standby] datafile {'' | } [,...]

[until [consistent with] controlfile]

| logfile '' | continue [default] | cancel }

[noparallel | parallel [] ];

set autorecovery {on | off}

set logsource

recover [automatic] [from '']

{ database [until { cancel | change

| time '' } ]

[using backup controlfile]

| [managed] standby database [timeout | cancel [immediate] ]

| [standby] tablespace '' [,...] [until [consistent with] controlfile]

| [standby] datafile {'' | } [,...]

[until [consistent with] controlfile]

| logfile | continue [default] | cancel}

[ { noparallel | parallel (degree { | default}

[instances <1> | default] ) } ]

dbv file= start= end= logfile= blocksize=<2048>

feedback=<0>

BLOCKS

v$type_size

Header:static(61B), row directory(2B*rec), transaction headers

(23B*TX) [Cluster: table directory]

ROWID

Logical:hex string of variable length

Extend(10B):DataObj#{32b} - RelFile#{10b} - Block#{22b} - Row#{16b}

Base64OOOOOO – FFF – BBBBBB – RRR

Restrict(6B):Block#{Xb} - Row#{Xb} - RelFile#{Xb}

Package DBMS_ROWID

(rowid_create, rowid_object, rowid_relative_fno, rowid_block_number,

rowid_row_number, rowid_to_absolute_fno, rowid_to_extended,

rowid_to_restricted)

LOGFILES

v$log, v$logfile, v$thread, v$loghist, v$log_history, v$database, v$archive,

v$archive_dest, v$archived_log, v$archive_processes, v$logmnr_dictionary,

v$logmnr_parameters, v$logmnr_logs, v$logmnr_contents, v$targetrba

'thread', 'log_buffer', 'log_archive_max_processes', 'log_archive_start', 'log_archive_dest',

'standby_archive_dest', 'log_archive_dest_[1-5]' = '{ location = | service = }

[optional | mandatory] [reopen [=<300>] ]', 'log_archive_dest_state_[1-5]' = {enable | defer},

'log_archive_duplex_dest', 'log_archive_min_succeed_dest', 'log_archive_format',

'log_file_name_convert', 'arch_io_slaves', 'utl_file_dir',

‘_allow_resetlogs_corruption’ (undocumented & unsupported)

[obsolete: 'log_archive_buffers', 'log_archive_buffer_size', 'log_block_checksum',

'log_simultaneous_copies', 'log_small_entry_max_size', 'lgwr_io_slaves']

Packages DBMS_LOGMNR_D (build), DBMS_LOGMNR (add_logfile, start_logmnr,

end_logmnr)

dbmslogmnrd.sql

Tuning/Contention

v$system_event, v$sysstat

Redo latch: "redo allocation", "redo copy" (v$latch) misses / gets > 1% or

immediate_misses / (immediate_gets + immediate_misses) > 1%

-> decrease 'log_small_entry_max_size'

-> increase 'log_simultaneous_copies' (max. CPU * 2)

archive log { list | stop | {start | next | all | } } [to ]

alter database [] {archivelog | noarchivelog};

alter system archive log [thread ]

{ start [to ''] | stop | current | next | all

| sequence | group | change | logfile '' };

alter system switch logfile;

alter database [] add logfile

[thread ] [group ] (‘’,...) size ;

alter database [] {enable [public] | disable} thread ;

alter database [] add logfile member ‘’ [reuse] to group ;

alter database [] rename file ‘’ [,...] to ‘’ [,...];

alter database [] drop logfile group ;

alter database [] drop logfile member ‘’;

alter database [] clear [unarchived] logfile { group | ‘’ }

[unrecoverable datafile];

TABLES & CONSTRAINTS & TRIGGERS

dba_tables, dba_all_tables, dba_object_tables, dba_tab_comments,

dba_tab_columns, col, dba_tab_col_statistics, dba_associations,

dba_ustats, dba_col_comments, dba_updatable_columns,

dba_unused_col_tabs, dba_tab_modifications, dba_nested_tables,

dba_part_tables, dba_tab_partitions, dba_tab_subpartitions,

dba_part_col_statistics, dba_part_key_columns, dba_partial_drop_tabs,

dba_subpart_col_statistics, dba_subpart_key_columns, dba_constraints,

dba_cons_columns, dba_triggers, dba_trigger_cols, dba_internal_triggers,

dba_tab_histograms, dba_part_histograms, dba_subpart_histograms,

hist_head$

[obsolete: dba_histograms, 'cache_size_threshhold' ]

Packages DBMS_UTILITY (analyze_database, analyze_schema, analyze_part_object)

DBMS_SPACE (unused_space, free_blocks) [dbmsutil.sql, utlvalid.sql]

DBMS_STATS (gather_{database | schema | table | index}_stats, {export |

import}_schema_stats)

utlexcpt.sql, utlexcpt1.sql, dbmsstdx.sql

Tuning/Contention

pctfree = UPD/AVG, pctused = 1 – pctfree – AVG/nBLK

scans: "table scans%" (v$sysstat)

-> adjust 'db_file_multiblock_read_count'

row migr.: table_name, head_rowid (chained_rows <- utlchain.sql, utlchain1.sql) or

"table fetch continued row" (v$sysstat)

-> increase pctfree

-> recreate table (create as, delete from, insert into select, commit, drop)

freelists: "segment header" (v$waitstat), "buffer busy waits" (v$system_event)

-> alter pctfree/pctused, inittrans, or

-> increase freelist/freelist groups

(v$session_wait -> dba_extents -> dba_segments -> recreate object)

full & partial partition-wise joins

create [global temporary] table (max. 1000 col)

[of ]

[object identifier is {primary key | system generated

[oidindex ( [tablespace ...] [storage (...) ] ) ] } ]

( [ {default | := } ]

[with rowid] [scope is ]

[constraint ]

[ { [not] null

| primary key [using index...]

| unique [using index...]

| check ()

| references [ () ] [on delete {cascade | set null} ] }

[ [not] deferrable [initially {immediate | deferred} ] ]

[ {disable | enable} [validate | novalidate] [exceptions into ] ]

[,... [constraint ]...] [,...]

[, constraint ...]

[ref () with rowid] [scope for () is ] )

[tablespace ] [organization {heap | index} ] [storage (...) ]

[pctfree <10>] [pctused <40>] [initrans <1>] [maxtrans ]

[logging | nologging] [recoverable | unrecoverable] <- obsolete

[cache | nocache] [monitoring | nomonitoring]

[noparallel | parallel [] ]

[ partition by range ( [,...] )

[ subpartition by hash ( [,...] )

[subpartitions [store in ( [,...] ) ] ]

( partition values less than ( { [,...] | maxvalue} )

[storage (...) ] [tablespace ]

[ ( subpartition [tablespace ]

[, subpartition...] ) ]

[, partition... [ ( subpartition...) ] ] ) ]

[ partition by hash ( [,...] )

{ ( partition [tablespace ] [, partition...] )

| partitions store in ( [,...] ) } ]

[ {disable | enable} row movement]

[ lob () store as

( [tablespace ] [storage (...) ]

[ {disable | enable} storage in row]

[pctversion <10>] [chunk ]

[cache | nocache {logging | nologging} ]

[ index ([tablespace ] [storage (...) ] ) ] ) ] << deprecated [ varray store as lob [] ([tablespace ] ) ] [nested table store as [ ( () [storage (...) ] ) ] [return as {locator | value} ]

[on commit {delete | preserve} rows];

create table [logging | nologging] ... as select...;

alter table modify (...);

alter table add (...);

alter table set unused { ( [,...] ) | column }

[cascade constraints] [invalidate];

alter table drop { ( [,...] ) | column }

[cascade constraints] [invalidate] [checkpoint <512>]; alter table drop {unused columns | columns continue}

[checkpoint <512>];

drop table [cascade constraints];

rename to ;

alter table move [tablespace ] [storage (...) ]

[logging | nologging] [noparallel | parallel [] ]; truncate table [ [preserve | purge] snapshot log]

[ {drop | reuse} storage];

alter table [storage (...) ] [noparallel | parallel [] ] ...

[ {nominimize | minimize} records_per_block];

alter table { allocate extent

( [size ] [datafile ''] [instance ] );

| deallocate unused [keep ] };

lock table in {share [row exclusive] | exclusive} mode [nowait]; alter table {enable | disable} table lock;

comment on {table | column .} is ‘’;

alter table add partition

values less than ( [,...] ) [tablespace ];

alter table add partition [ [tablespace ] ]; alter table drop partition [,...];

alter table coalesce partition;

alter table truncate {partition | subpartition}

[ {drop | reuse} storage];

alter table rename {partition | subpartition} to ; alter table modify partition

[storage (...) ] [allocate extent...] [logging | nologging] ... [ [rebuild] unusable local indexes]

[ add subpartition [ [tablespace ] ]

| coalesce subpartition];

alter table modify subpartition

[storage (...) ] [allocate extent...] [logging | nologging] ... [ [rebuild] unusable local indexes];

alter table modify default attributes

[for partition ] [storage (...) ] ...;

alter table move {partition | subpartition}

tablespace [parallel [] ] [logging | nologging];

alter table split partition at ()

into (partition , partition [,...] );

alter table merge partitions ,

[into partition ];

alter table exchange {partition | subpartition}

with table [including indexes] [ {with | without} validation]; alter table add

( [constraint ]

{ primary key ( [,...] ) [using index...]

| unique ( [,...] ) [using index...]

| foreign key ( [,...] ) references ( [,...] ) [on delete {cascade | set null} ]

| check () }

[ [not] deferrable [initially {immediate | deferred} ] ]

[ {disable | enable} [validate | novalidate] [exceptions into ] ] ); alter table {disable | enable} [validate | novalidate]

{ constraint | primary key | unique ( [,...] ) } [using index...] [exceptions into ] [cascade];

alter table modify constraint ... [rely | norely];

alter table drop

{ constraint | primary key | unique ( [,...] ) } [cascade]; set constraint[s] { [,...] | all} {immediate | deferred};

alter table {enable | disable} all triggers;

create [or replace] trigger { before | after | instead of }

{ {delete | insert | update [of [,...] ] } [or...]

on { | [nested table of] } | { {create | alter | drop} [or...]

| {shutdown | startup | servererror | logon | logoff} [or...] }

on {schema | database} }

[referencing

{old [as] | new [as] | parent [as] } [,...] ]

[for each row] [when () ]

{ begin ; end;

| call ... ;}

alter trigger { enable | disable | compile [debug] };

drop trigger ;

analyze table [partition() ]

{ compute statistics

| estimate statistics [sample <1064> {rows | percent} ] }

[for table] [for all [local] indexes]

[for all [indexed] columns [size <75>] ]

[for columns [size <75>] ];

analyze table delete statistics;

analyze table list chained rows [into ];

analyze table validate

{ structure [into ] [cascade]

| ref update [set dangling to null] };

associate statistics with

{ columns [.] [,...]

| functions [,...] | packages [,...] | types [,...]

| indexes [,...] | indextypes [,...] }

[using ] [default cost (, , ) ]

[default selectivity ];

disassociate statistics from

{ columns [.] [,...]

| functions [,...] | packages [,...] | types [,...]

| indexes [,...] | indextypes [,...] } [force];

VIEWS & SYNONYMS & SEQUENCES

dba_views, dba_synonyms, dba_sequences

create [or replace] [force | no force] view [ ( [,...] ) ]

[of with object oid [default | (,...) ] ]

as [with { read only | check option [constraint ] } ];

alter view compile;

drop view ;

create [public] synonym for ;

drop [public] synonym ;

create sequence [start with <1>] [increment by <1>]

[maxvalue <1027> | nomaxvalue] [minvalue <1> | nominvalue]

[cycle | nocycle] [nocache | cache <20>] [order | noorder];

alter sequence ...;

drop sequence ;

CLUSTERS

dba_clusters, dba_clu_columns, all_tab_columns,

dba_cluster_hash_expressions

create cluster ( [,...] )

[index | [single table] hashkeys [hash is ] ]

[size <1xBS>] [tablespace ] [storage (...) ]

[pctfree <10>] [pctused <40>] [initrans ] [maxtrans <255>];

create index on cluster

[storage (...) ] [tablespace ] [pctfree ]

[initrans ] [maxtrans ];

create table

(... [constraint ...] )

cluster ( [,...] );

alter cluster ...;

truncate cluster [ {drop | reuse} storage];

drop cluster [including tables [cascade constraints] ];

analyze cluster ...;

INDEX-ORGANIZED TABLES

all_tables (iot_type, iot_name), all_indexes

create table (... primary key...)

organization index

[tablespace ] [pctfree ] [initrans ] [maxtrans ]

[storage (...) ] [pctthreshold <50> [including ] ]

[compress [] | nocompress]

[ overflow [tablespace ] [pctfree <10>]

[initrans <1>] [maxtrans <255>] [storage (...) ]

[allocate...] [deallocate...] [logging | nologging] ]

[ partition by range ( [,...] )

( partition values less than ( [,...] )

[storage (...) ] [tablespace ] [overflow tablespace ...]

[, partition...] ) ];

alter table ... [overflow...];

alter table add overflow ... [ (partition ...) ];

alter table move [online] [compress [] | nocompress]

[tablespace ] [overflow...] ... [noparallel | parallel [] ];

alter table modify default attributes [for partition ]

[storage (...) ] [pctthreshold <50> [including ] ]

[compress [] | nocompress] [overflow tablespace ...];

analyze table compute statistics;

INDEXES

dba_indexes, dba_indextypes, dba_indextype_operators, dba_ind_columns,

dba_ind_expressions, index_stats, dba_part_indexes, dba_ind_partitions,

dba_ind_subpartitions, dba_part_col_statistics, dba_subpart_col_statistics,

index_histogram

'create_bitmap_area_size', 'bitmap_merge_area_size'

Package DBMS_PCLXUTIL (build_part_index)

Tuning

(index_stats) del_lf_rows_len / lf_rows_len > 20% -> rebuild index

create [unique | bitmap] index

on ( [] [asc | desc] [,...] )

[tablespace { | default } ] [storage (...) ]

[pctfree <10>] [initrans ] [maxtrans <255>]

[logging | nologging] [nosort] [reverse] [online]

[noparallel | parallel [] ] [nocompress | compress [] ]

[ local

[ { ( partition [] [storage (...) ] [tablespace ] on range p. tab

[logging | nologging] [, partition...] )

| { store in ( { [,...] | default} ) on hash p. tab

| ( partition [] [tablespace ] [, partition...] ) }

| store in ( { [,...] | default} ) on comp. p. tab

[ ( partition [] [storage (...) ] [tablespace ]

[logging | nologging]

[ { store in ( { [,...] | default} )

| ( subpartition [] [tablespace ]

[, subpartition...] ) } ]

[, partition...] ) ] } ] ]

[ global partition by range ()

( partition values less than ( { [,...] | maxvalue} )

[storage (...) ] [tablespace ] [logging | nologging]

[, partition...] ) ]

[indextype is [parameters ('') ] ];

drop index ;

alter index {enable | disable};

alter index unusable;

alter index rename to ;

alter index drop partition [,...];

alter index rename {partition | subpartition} to ;

alter index modify {partition | subpartition}

[storage (...) ] ... [logging | nologging] [unusable]

[rebuild unusable local indexes];

alter index modify default attributes [for partition ]

[storage (...) ] [pctfree ] ...;

alter index rebuild {partition | subpartition}

[tablespace ] [parallel [] ];

alter index split partition at values less than ()

into ( partition , partition [,...] );

alter index [storage (...) ] [initrans ] [maxtrans ]

[nocompress | compress [] ];

alter index allocate extent

( [size ] [datafile ''] [instance ] );

alter index [datafile ''] deallocate unused [keep ];

alter index rebuild

[ {partition | subpartition} ] [tablespace ] [storage (...) ]

[pctfree <10>] [initrans ] [maxtrans <255>]

[logging | nologging] [noparallel | parallel [] ]

[nocompress | compress ] [compute statistics] [online]

[noreverse | reverse] [parameters ('') ];

alter index coalesce;

analyze index ...;

analyze index validate structure;

ROLLBACK SEGMENTS

v$rollname, v$rollstat, v$transaction, v$transaction_enqueue,

v$global_transaction, dba_rollback_segs, dba_pending_transactions

'rollback_segments', 'transactions', 'transactions_per_rollback_segment'

Package DBMS_TRANSACTION (use_rollback_segment)

Tuning/Contention

RBS Header: "undo segment tx slot" (v$system_event) > 0 or

(v$rollstat) sum(waits) / sum(gets) > 5% or

-> add RBS

RBS Segment: "%undo%" (v$waitstat) / "consistent gets" (v$sysstat) (count/value) > 1%

-> add RBS

create [public] rollback segment [tablespace ]

[storage ( [initial <5xBS>] [next <5xBS>] [optimal ]

[minextents <1>] [maxextents { | unlimited} ] ) ];

drop rollback segment ;

alter rollback segment {online | offline};

alter rollback segment storage (...);

alter rollback segment shrink [to ];

set transaction use rollback segment ;

TEMPORARY SEGMENTS

v$sort_segment, v$sort_usage, dba_segments

'sort_area_size', 'sort_area_retained_size', 'sort_multiblock_read_count'

[obsolete: 'sort_direct_writes', 'sort_write_buffers', 'sort_write_buffer_size' ]

Tuning

"sorts (disk)", "sorts (memory)", sorts (rows)" (v$sysstat)

disk.value / mem.value > 5%

-> increase 'sort_area_size' (+ decrease 'sort_area_retained_size')

USERS & PRIVILEGES & RESOURCES & POLICIES

v$enabledprivs, v$resource, v$resource_limit, v$pwfile_users, v$context,

v$rsrc_plan, v$rsrc_plan_cpu_mth, v$rsrc_consumer_group,

v$rsrc_consumer_group_cpu_mth, v$parallel_degree_limit_mth,

v$max_active_sess_target_mth, dba_users, dba_roles, dba_profiles,

dba_ustats, dba_ts_quotas, dba_sys_privs, dba_tab_privs, dba_col_privs,

dba_role_privs, role_sys_privs, role_tab_privs, role_role_privs,

user_tab_privs_made, user_tab_privs_recd, user_col_privs_made,

user_col_privs_recd, user_password_limits, user_resource_limits,

session_privs, session_roles, dba_context, dba_policies, proxy_users,

resource_cost, dba_rsrc_plans, dba_rsrc_plan_directives,

dba_rsrc_consumer_groups, dba_rsrc_consumer_group_privs,

dba_rsrc_manager_system_privs

'o7_dictionary_accessibility', 'remote_os_authent', 'os_roles', 'remote_os_roles',

'max_enabled_roles', 'resource_limit', 'resource_manager_plan', 'ent_domain_name'

Environment: $ORA_ENCRYPT_LOGIN

Packages DBMS_RESOURCE_MANAGER (set_initial_consumer_group, {create |

submit | clear | validate}_pending_area, {create | update | delete}_{plan |

plan_directive | consumer_group}, delete_plan_cascade,

switch_consumer_group_for_{sess | user} ),

DBMS_RESOURCE_MANAGER_PRIVS ( {grant | revoke}_system_privilege,

{grant | revoke}_switch_consumer_group), DBMS_SESSION

(switch_current_consumer_group), DBMS_RLS ( {add | drop | enable |

refresh}_policy)

create user

identified { by | externally | globally as '' }

[default tablespace ] [temporary tablespace ]

[quota { | unlimited} on [quota...] ]

[password expire] [account {lock | unlock} ]

[profile { | default} ];

alter user ...;

drop user [cascade];

create role [ [not] identified {by | externally | globally} ];

alter role ...;

drop role ;

alter user default role { [,...] | all [except [,...] ] | none};

set role { [identified by ] [, [identified by ]...]

| all [except [,...] ] | none };

grant { [,...] | [,...] } to

{ [,...] | [,...] | public } [with admin option];

revoke { | } from { | | public };

grant { [ ( [,...] ) ] [,...] | all } on

to { [,...] | [,...] | public } [with grant option];

revoke { [ ( [,...] ) ] | all [privileges] } on [directory]

from { | | public } [cascade constraints];

create profile limit

[sessions_per_user { | unlimited | default} ]

[cpu_per_session { | unlimited | default} ]

[cpu_per_call { | unlimited | default} ]

[connect_time { | unlimited | default} ]

[idle_time { | unlimited | default} ]

[logical_reads_per_session { | unlimited | default} ]

[logical_reads_per_call { | unlimited | default} ]

[composite_limit { | unlimited | default} ]

[private_sga { | unlimited | default} ]

[failed_login_attempts { | unlimited | default} ]

[password_lock_time { | unlimited | default} ]

[password_life_time { | unlimited | default} ]

[password_grace_time { | unlimited | default} ]

[password_reuse_time { | unlimited | default} ]

[password_reuse_max { | unlimited | default} ]

[password_verify_function { | null | default} ];

alter profile limit...;

drop profile [cascade];

alter resource cost [connect_time ] [cpu_per_session ]

[logical_reads_per_session ] [private_sga ];

AUDITING

all_def_audit_opts, dba_stmt_audit_opts, stmt_audit_option_map,

dba_priv_audit_opts, dba_obj_audit_opts, user_tab_audit_opts,

dba_audit_trail, dba_audit_session, dba_audit_statement, dba_audit_object, dba_audit_exists, audit_actions, sys.aud$

'audit_trail', 'transaction_auditing'

cataudit.sql, catnoaud.sql

[no]audit { [,...] | [,...] } [by [,...] ]

[by {session | access} ] [whenever [not] successful];

(shortcuts: user, table, procedure, resource, connect, dba,...)

[no]audit [,...] on { | default}

[by {session | access} ] [whenever [not] successful];

NLS

v$nls_parameters, v$nls_valid_values, nls_database_parameters,

nls_instance_parameters, nls_session_parameters, props$

Server:init.ora

NLS_LANGUAGE

è NLS_DATE_LANGUAGE, NLS_SORT

NLS_TERRITORY

è NLS_DATE_FORMAT

è NLS_CURRENCY (fm L), NLS_ISO_CURRENCY (fm C),

NLS_DUAL_CURRENCY, NLS_UNION_CURRENCY

è NLS_MONETARY_CHARACTERS

è NLS_NUMERIC_CHARACTERS (fm DG)

è NLS_LIST_SEPARATOR

è NLS_CALENDAR

è NLS_CREDIT, NLS_DEBIT

lxinst [oranls=<$ORA_NLS33>] [sysdir=] [destdir=]

[help=] [warning={0 | 1 | 2 | 3} ]

lxbcnf [oranls=<$ORA_NLS33>] [userbootdir=] [destdir=] [help=]

lxegen

Client:environment variables

NLS_LANG, NLS_NCHAR

è NLS_DATE_LANGUAGE, NLS_SORT

è NLS_DATE_FORMAT

è NLS_CURRENCY, NLS_ISO_CURRENCY, NLS_DUAL_CURRENCY

è NLS_MONETARY_CHARACTERS

è NLS_NUMERIC_CHARACTERS

è NLS_CREDIT, NLS_DEBIT

è NLS_COMP

Session:

alter session set NLS_LANGUAGE= NLS_TERRITORY=;

Package DBMS_SESSION.SET_NLS(,)

SQL-Functions:

è to_char (NLS_DATE_LANGUAGE, NLS_NUMERIC_CHARACTERS, NLS_CURRENCY, NLS_ISO_CURRENCY, NLS_CALENDAR)

è to_date (NLS_DATE_LANGUAGE, NLS_CALENDAR)

è to_number (NLS_NUMERIC_CHARACTERS, NLS_CURRENCY,

NLS_ISO_CURRENCY)

è nls_upper (NLS_SORT)

è nls_lower (NLS_SORT)

è nls_initcap (NLS_SORT)

è nlssort (NLS_SORT)

EXPORT & IMPORT & LOADS & MIGRATION

v$loadcstat, v$loadistat, v$loadpstat, v$loadtstat, dba_exp_files,

dba_exp_objects, dba_exp_version, sys.incexp, sys.incfil, sys.incvid catexp.sql, catexp7.sql, migrate.bsq

exp userid=/ parfile= file=

filesize= volsize= log= buffer= silent= recordlength= direct= rows= indexes= grants= constraints= triggers= feedback=<0> inctype={complete | cumulative | incremental} statistics={estimate | compute | none} record= compress= consistent= help= { full= | owner= | tables=([:] [,...] [query=] ) } transport_tablespace= tablespaces= [,...]

point_in_time_recover= recovery_tablespaces= [,...]

imp userid=/ parfile= file=

filesize= volsize= log= buffer= recordlength= rows= grants= indexes= constraints= commit= ignore= inctype={system | restore} feedback=<0> show= analyze= recalculate_statistics= help= destroy= skip_unusable_indexes= indexfile= toid_novalidate= ( [,...] ) { full= | tables=([:] [,...] ) } fromuser= [,...] touser= [,...]

transport_tablespace= datafiles='( [,...] )'

tablespaces= [,...] tts_owners= [,...]

point_in_time_recover=

[Order: table creation – index defs – table data – B-tree index data

– triggers, constraints, bitmap indexes] sqlldr userid=/ data= control= parfile=

log= bad= discard= discardmax=

skip= load= errors= rows= bindsize=<65536>

readsize=<65536> silent= direct= parallel= file=

skip_unusable_indexes= skip_index_maintenance=

commit_discontinued=

mig dbname= new_dbname= pfile= spool=

check_only= no_space_check= multiplier=<15>

nls_nchar=

RECOVERY MANAGER

rc_database, rc_database_incarnation, rc_backup_set, rc_backup_piece,

rc_checkpoint, rc_tablespace, rc_datafile, rc_backup_datafile,

rc_datafile_copy, rc_proxy_datafile, rc_offline_range, rc_backup_controlfile,

rc_controlfile_copy, rc_proxy_controlfile, rc_redo_log, rc_redo_thread,

rc_backup_redolog, rc_archived_log , rc_log_history, rc_stored_script,

rc_stored_script_line, rc_backup_corruption, rc_copy_corruption, rc_resync,

v$backup, v$backup_set, v$backup_piece, v$backup_datafile,

v$datafile_copy, v$proxy_datafile, v$offline_range, v$backup_redolog,

v$proxy_archivedlog, v$backup_device, v$backup_corruption,

v$copy_corruption, v$backup_async_io, v$backup_sync_io,

v$session_longops, v$session_wait

'backup_tape_io_slaves', 'db_file_direct_io_count', 'disk_asynch_io', 'tape_asynch_io',

'control_file_record_keep_time'

[obsolete: 'arch_io_slaves', 'backup_disk_io_slaves', 'large_pool_min_alloc' ]

Packages DBMS_BACKUP_RESTORE (dbmssbkrs.sql, prvtbkrs.plb)

DBMS_RCVCAT,DBMS_RCVMAN (dbmsrman.sql, prvtrmns.plb)

catrman.sql, prgrmanc.sql

rman [target '/@']

[catalog '/@' | nocatalog ]

[auxiliary '/@']

[ {cmdfile [=] | @} ] [log [=] [append] ]

[msgno] [trace [=] ''] [debug] [send [=] '']

set dbid [=] ;

connect {target | catalog | auxiliary} /@

startup [nomount | mount] [force] [dba] [pfile [=] ];

shutdown [normal | transactional | immediate | abort];

{mount | open} database;

alter database {mount | open};

host [''];

debug {on | off};

set echo {on | off};

set command id to '';

set snapshot controlfile name to '';

send [channel [,...] | device type [,...] ]

'' [parms [=] ''];

{create | replace} script