|
ADR包含着DRA和HM以及Support WorkBench:
ADRCI可以看作文本形式的Support Workbench浏览器:
以下是命令行制作Support Workbench包:
- adrci> help SET HOMES
- Usage: SET HOMES | HOME| HOMEPATH <homepath_str1 homepath_str2 ...>
- Purpose: Set the ADR homes to query in the current ADRCI session.
- Arguments:
- <homepath_str1 homepath_str2 ...>: The paths of the home,
- relative to the ADR base.
- Note:
- The "diag" directory name can be omitted from the homepath_str.
- If the specified path contains multiple homes, for instance, it is
- set to the database ID which is running RAC. All of the ADR homes
- corresponding to the instances of the database will be added to the
- current ADRCI home settings.
- Example:
- set homepath diag/rdbms/aime3/aime3 diag/rdbms/aime3/aime32
- set homepath rdbms/aime3
- adrci> set homepath diag/rdbms/orcl/orcl
- adrci> help SHOW PROBLEM
- Usage: SHOW PROBLEM [-p <predicate_string>]
- [-last <num> | -all]
- [-orderby (field1, field2, ...) [ASC|DSC]]
- Purpose: Show the problem information. By default, this command will
- only show the last 50 problems.
- Options:
- [-p <predicate_string>]: The predicate string must be double-quoted.
- The field names that users can specify in the predicate are:
- PROBLEM_ID number
- PROBLEM_KEY text(550)
- FIRST_INCIDENT number
- FIRSTINC_TIME timestamp
- LAST_INCIDENT number
- LASTINC_TIME timestamp
- IMPACT1 number
- IMPACT2 number
- IMPACT3 number
- IMPACT4 number
- SERVICE_REQUEST text(64)
- BUG_NUMBER text(64)
- [-last <num> | -all]: This option allows users to either select
- the last <num> of qualified problems to show or to show all the
- qualified problems. If this option is not specified, this command
- will only show 50 incidents.
- [-orderby (field1, field2, ...) [ASC|DSC]]: If specified, the results
- will be ordered by the specified fields' values. By default, it will be
- in the ascending order unless "DSC" is specified. Note that the field
- names that can be specified here are from the "PROBLEM" relation.
- Examples:
- show problem
- show problem -p "problem_id>123"
- adrci> show problem
- ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
- *************************************************************************
- PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
- -------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
- 2 ORA 603 13506 2014-08-06 17:34:15.747000 +08:00
- 1 ORA 600 [1433] 13281 2014-08-06 17:36:00.102000 +08:00
- 3 ORA 600 [kdliOpen] 89088 2018-07-15 17:23:37.457000 +08:00
- 5 ORA 445 200364 2018-07-23 09:54:23.496000 +08:00
- 4 ORA 1578 205036 2018-07-24 21:32:45.753000 +08:00
- 5 rows fetched
- adrci> help ips
- HELP IPS [topic]
- Available Topics:
- ADD
- ADD FILE
- ADD NEW INCIDENTS
- CHECK REMOTE KEYS
- COPY IN FILE
- COPY OUT FILE
- CREATE PACKAGE
- DELETE PACKAGE
- FINALIZE PACKAGE
- GENERATE PACKAGE
- GET MANIFEST
- GET METADATA
- GET REMOTE KEYS
- PACK
- REMOVE
- REMOVE FILE
- SET CONFIGURATION
- SHOW CONFIGURATION
- SHOW FILES
- SHOW INCIDENTS
- SHOW PACKAGE
- UNPACK FILE
- UNPACK PACKAGE
- USE REMOTE KEYS
- adrci> help CREATE PACKAGE
- DIA-48433: Unknown help topic
- adrci> help ips CREATE PACKAGE
- Usage: IPS CREATE PACKAGE
- [INCIDENT <incid> | PROBLEM <prob_id> | PROBLEMKEY <prob_key> |
- SECONDS <seconds> | TIME <start_time> TO <end_time>]
- [CORRELATE BASIC | TYPICAL | ALL]
- Purpose: Create a package, and optionally select contents for the package.
- Arguments:
- <incid>: ID of incident to use for selecting package contents.
- <prob_id>: ID of problem to use for selecting package contents.
- <prob_key>: Problem key to use for selecting package contents.
- <seconds>: Number of seconds before now for selecting package contents.
- <start_time>: Start of time range to look for incidents in.
- <end_time>: End of time range to look for incidents in.
- Options:
- CORRELATE BASIC: The package will include the incident dumps, and the
- incident process trace files.
- Additional incidents can be included automatically,
- if they share relevant correlation keys.
- CORRELATE TYPICAL: The package will include the incident dumps, and all
- trace files that were modified in a time window around
- each incident.
- Additional incidents can be included automatically,
- if they share relevant correlation keys, or occurred
- in a time window around the main incidents.
- CORRELATE ALL: The package will include the incident dumps, and all
- trace files that were modified between the first
- selected incident and the last selected incident.
- Additional incidents can be included automatically,
- if they occurred in the same time range.
- Notes:
- If no package contents are specified (incident, problem, etc), an empty
- package will be created. Files and incidents can be added later.
- If no correlation level is specified, the default level is used.
- The default is normally TYPICAL, but it can be changed using the command
- IPS SET CONFIGURATION.
- Example:
- ips create package incident 861;
- ips create package time '2006-12-31 23:59:59.00 -07:00' to
- '2007-01-01 01:01:01.00 -07:00';
- adrci> ips create package PROBLEM 4;
- Created package 2 based on problem id 4, correlation level typical
- adrci> adrci>
- adrci> help GENERATE PACKAGE
- DIA-48433: Unknown help topic
- adrci> help ips GENERATE PACKAGE
- Usage: IPS GENERATE PACKAGE <package_id> [IN <path>]
- [COMPLETE | INCREMENTAL]
- Purpose: Create a physical package (zip file) in target directory.
- Arguments:
- <package_id>: ID of package to create physical package file for.
- <path>: Path where the physical package file should be generated.
- Options:
- COMPLETE: The package will include all package files, even if a
- previous package sequence has been generated.
- This is the default.
- INCREMENTAL: The package will only include files that have been added
- or changed since the last package generation.
- Notes:
- If no target path is specified, the physical package file is generated
- in the current working directory.
- Example:
- ips generate package 12 in /tmp
- adrci> ips generate package 2 in /home/oracle/
- Generated package 2 in file /home/oracle/ORA1578_20180726195647_COM_1.zip, mode complete
- adrci>
复制代码
HM的两种形式:1.应激性, 2.手工的
- select t.tablespace_name,t.segment_space_management
- from dba_tablespaces t;
-
- ---pct_used
-
- create tablespace tbs1 datafile size 5M segment space management manual;
-
- select t.owner, t.table_name , t.pct_free , t.pct_used , t.pct_increase
- from dba_tables t
- where t.owner='HR' and t.table_name like 'T05207%';
-
复制代码- [root@station90 ~]# su - oracle
- [oracle@station90 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 26 20:56:33 2018
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL> conn hr/oracle_4U
- Connected.
- SQL> create table t05207_auto ( a number ) tablespace users;
- Table created.
- SQL> create table t05207_manual ( a number ) tablespace tbs1;
- Table created.
- SQL> alter table t05207_auto pctfree 20;
- Table altered.
- SQL> alter table t05207_manual pctfree 20 pctused 50 ;
- Table altered.
- SQL> alter table t05207_auto pctfree 20 pctused 50 ;
- Table altered.
- SQL>
复制代码 | OWNER | TABLE_NAME | PCT_FREE | PCT_USED | PCT_INCREASE | 1 | HR | T05207_MANUAL | 20 | 50 | | 2 | HR | T05207_AUTO | 20 | | |
段的第一个块和段头块:
- select t.tablespace_name,t.extent_management,t.allocation_type
- from dba_tablespaces t;
-
- select * from dba_extents e where e.owner='HR' and e.segment_name='T04209_UNAME';
复制代码 | OWNER | SEGMENT_NAME | PARTITION_NAME | SEGMENT_TYPE | TABLESPACE_NAME | EXTENT_ID | FILE_ID | BLOCK_ID | BYTES | BLOCKS | RELATIVE_FNO | 1 | HR | T04209_UNAME | | TABLE | EXAMPLE | 0 | 5 | 488 | 65536 | 8 | 5 | 2 | HR | T04209_UNAME | | TABLE | EXAMPLE | 1 | 5 | 696 | 65536 | 8 | 5 | 3 | HR | T04209_UNAME | | TABLE | EXAMPLE | 2 | 5 | 704 | 65536 | 8 | 5 | 4 | HR | T04209_UNAME | | TABLE | EXAMPLE | 3 | 5 | 712 | 65536 | 8 | 5 | 5 | HR | T04209_UNAME | | TABLE | EXAMPLE | 4 | 5 | 1408 | 65536 | 8 | 5 | 6 | HR | T04209_UNAME | | TABLE | EXAMPLE | 5 | 5 | 1416 | 65536 | 8 | 5 | 7 | HR | T04209_UNAME | | TABLE | EXAMPLE | 6 | 5 | 1424 | 65536 | 8 | 5 | 8 | HR | T04209_UNAME | | TABLE | EXAMPLE | 7 | 5 | 1432 | 65536 | 8 | 5 | 9 | HR | T04209_UNAME | | TABLE | EXAMPLE | 8 | 5 | 1440 | 65536 | 8 | 5 | 10 | HR | T04209_UNAME | | TABLE | EXAMPLE | 9 | 5 | 1448 | 65536 | 8 | 5 | 11 | HR | T04209_UNAME | | TABLE | EXAMPLE | 10 | 5 | 1456 | 65536 | 8 | 5 | 12 | HR | T04209_UNAME | | TABLE | EXAMPLE | 11 | 5 | 1464 | 65536 | 8 | 5 | 13 | HR | T04209_UNAME | | TABLE | EXAMPLE | 12 | 5 | 1472 | 65536 | 8 | 5 | 14 | HR | T04209_UNAME | | TABLE | EXAMPLE | 13 | 5 | 10392 | 65536 | 8 | 5 | 15 | HR | T04209_UNAME | | TABLE | EXAMPLE | 14 | 5 | 10400 | 65536 | 8 | 5 | 16 | HR | T04209_UNAME | | TABLE | EXAMPLE | 15 | 5 | 10408 | 65536 | 8 | 5 | 17 | HR | T04209_UNAME | | TABLE | EXAMPLE | 16 | 5 | 512 | 1048576 | 128 | 5 |
- select * from dba_segments s where s.owner='HR' and s.segment_name='T04209_UNAME';
复制代码 | OWNER | SEGMENT_NAME | PARTITION_NAME | SEGMENT_TYPE | SEGMENT_SUBTYPE | TABLESPACE_NAME | HEADER_FILE | HEADER_BLOCK | BYTES | BLOCKS | EXTENTS | INITIAL_EXTENT | NEXT_EXTENT | MIN_EXTENTS | MAX_EXTENTS | MAX_SIZE | RETENTION | MINRETENTION | PCT_INCREASE | FREELISTS | FREELIST_GROUPS | RELATIVE_FNO | BUFFER_POOL | FLASH_CACHE | CELL_FLASH_CACHE | 1 | HR | T04209_UNAME | | TABLE | ASSM | EXAMPLE | 5 | 490 | 2097152 | 256 | 17 | 65536 | 1048576 | 1 | 2147483645 | 2147483645 | | | | | | 5 | DEFAULT | DEFAULT | DEFAULT |
OLTP密集的系统,建议创建uniform size的表空间:
- create tablespace tbs2 datafile size 5M uniform size 512K;
-
- alter table hr.t04209_uname move tablespace tbs2;
-
-
- select * from dba_extents e where e.owner='HR' and e.segment_name='T04209_UNAME';
复制代码 | OWNER | SEGMENT_NAME | PARTITION_NAME | SEGMENT_TYPE | TABLESPACE_NAME | EXTENT_ID | FILE_ID | BLOCK_ID | BYTES | BLOCKS | RELATIVE_FNO | 1 | HR | T04209_UNAME | | TABLE | TBS2 | 0 | 8 | 128 | 524288 | 64 | 8 | 2 | HR | T04209_UNAME | | TABLE | TBS2 | 1 | 8 | 192 | 524288 | 64 | 8 | 3 | HR | T04209_UNAME | | TABLE | TBS2 | 2 | 8 | 256 | 524288 | 64 | 8 | 4 | HR | T04209_UNAME | | TABLE | TBS2 | 3 | 8 | 320 | 524288 | 64 | 8 |
- alter tablespace tbs2 add datafile size 5M;
-
- select * from dba_data_files where tablespace_name='TBS1';
-
- alter database datafile '+DATA/orcl/datafile/tbs1.267.982529779' resize 10M;
-
- --------------------------
- create bigfile tablespace tbs3 datafile size 5M autoextend on maxsize 4T;
复制代码 permenet空间用量:
- select
- (select sum(bytes)/1024/1024 from dba_data_files
- where tablespace_name='SYSTEM')
- -
-
- ( select sum(bytes)/1024/1024 from dba_free_space
- where tablespace_name='SYSTEM') from dual;
复制代码 undo空间用量:
- select sum(u.bytes)/1024/1024
- from dba_undo_extents u
- where u.status <> 'EXPIRED';
复制代码 temp:
-
- select sum(m.BYTES)/1024/1024
- from v_$temp_extent_map m;
- select sum(p.BLOCKS_CACHED)/1024/1024 ,
- sum(p.EXTENTS_USED )/1024/1024
- from v_$temp_extent_pool p;
复制代码
|
|