Teamcenter Oracle数据库维护最佳实践

1.将Oracle单独安装在物理机上。

1.1CPU:

    1)、尽可能高的主频;

     2)、不超过总体负载的80%;

     

1.2内存:

 

 

1.3:存储:

1)对于大型部署,强烈建议使用基于高吞吐量低延迟光纤通道的SAN文件服务器。基准测试表明,对于高负载使用情况,内部磁盘阵列可能无法跟上,即使使用了正确配置的RAID阵列。

2)考虑多个较小的、快速的磁盘驱动器,而不是几个大的驱动器。然后,数据可以分布在多个驱动器上。跨驱动器分发数据允许操作系统同时执行多个驱动器操作,从而提高吞吐量。合适的驱动器数量取决于驱动器类型、接口和控制器;请咨询您的硬件供应商以获得指导。

3)、对于内部驱动器,考虑多个磁盘控制器,每个驱动器上有多个驱动器。这也允许数据在控制器之间传播,允许并行读取和写入数据。与驱动器一样,请咨询您的硬件供应商,以获得有关建议控制器数量的指导。

4)对于内部驱动器,考虑RAID配置,提高(或至少不降低)吞吐量。

1)、RAID 5不能用于 【Oracle redo log files】

2)、使用RAID10用于数据库。

3)、在线或存档的重做日志文件可以放在RAID 0设备上,如果容错很重要,可以放在RAID 1设备上。临时表空间/tempdb数据文件也应该放在RAID 0或1上,而不是RAID 5上。原因是,在大多数硬件实现中,分布式奇偶校验(RAID 5)的流式写入性能不如简单镜像(RAID 1)的流式写入性能有效。

5)临时数据库文件单独分区存放:临时数据文件是数据库的工作区,用于排序、子查询、聚合等,尽管其大小应较小,以允许快速增长。

6)、对于非常大的部署,考虑高容量/吞吐量优化的文件系统,如NETApp的FAS系列,以及可选的Flash Cache性能加速器。这些服务器已被证明可支持多达10000名Teamcenter并发用户,而闪存缓存等加速器则通过价格较低的SATA驱动器提供FC驱动器级性能。

7)使用固态缓存盘,提交性能。

1.4网络:

1)Performance is noticeably slower if the network latency exceeds 5–10 ms between tcserver process and database server.

2)、将pool和Db放在同一个网段里,带宽建议最少1G。

 

 

 

2.索引维护:

2.1索引合并:

exec dbms_stats.gather_schema_stats(ownname =>'INFODBA', estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE AUTO', degree=>DBMS_STATS.AUTO_DEGREE, cascade=>true, no_invalidate=>FALSE);

需要将此命令设置为在已知应用程序在一天中的活动最少的时间(用户的休息时间)内每天运行。在这个活动中,运行statistics命令的服务器进程读取INFODBA模式所拥有的所有表中的数据,并使用具有默认度数或数字的并行查询服务器来运行数据的完整扫描以收集统计信息。收集统计数据所需的时间取决于INFODBA模式的大小、缓冲区缓存或SGA的大小、运行活动的可用CPU以及I/O子系统的I/O吞吐量。

2.2验证索引是否丢失

index_verifier -u=username -p=password -g=group   -o=DRYRUN > index_verifier_dryrun.txt

2.3验证并添加丢失的索引:

$TC_BIN/index_verifier -u=username -p=password -g=group -o=DO_IT

 

To make the task of creating missing indexes easier, pipe the output of the verifier to a text file:
index_verifier -u=<user> -p=<password> -g=<group> > indices.txt
Then filter out only the CREATE INDEX statements to create an SQL script. For example on UNIX use:
grep ″CREATE INDEX″ indices.txt > create_indices.sql
You can then execute the resulting SQL script file to create all the missing indexes in one operation. For example using SQLPLUS in Oracle:
SQL> @create_indices

3.设置数据库参数以提高性能效率

 4.删除无用的临时表

查询临时表:

select trunc(created) CREATED ,count(*) TEMP_TABLES_COUNT
from dba_objects o,dba_tables t
where o.object_type='TABLE'
and o.object_name=t.table_name
and t.temporary='Y'
and t.owner=(select owner from dba_segments where segment_name='PPOM_USER')
group by trunc(created)
order by 1;

查询所有的TC临时表

$TC_BIN/ install -temp_table -u=infodba -p=$INFOPWD -g=dba list

删除临时表:

$TC_BIN/ install -temp_table -u=infodba -p=$INFOPWD -g=dba drop older_than_date=2018/01/06 00:00:00


Any temporary table that is dropped or purged will get recreated if it is needed for application use so dropping temporary tables older than a month usually helps to keep temporary table count low enough to not affect database performance.

 

 

 

Coalesce index script

Step 1: Using sqlplus connect to the database as system.
Step 2: To create the sql script to coalesce all INFODBA indexes copy following commands in a sql script called bc.sql and run it. It will create script to be run in next step.
set echo off feed off serveroutput off term off head off lines 120 pages 0
spool coalesce_indexes.sql
select 'set echo on feed on time on' from dual;
select 'spool coalesce_indexes.log' from dual;
set serveroutput on
BEGIN
FOR INDEx_RECORD IN (select owner||'.'||object_name as obj
from dba_objects
where object_type = 'INDEX' and
owner =(select owner from dba_segments where segment_name='PPOM_USER')
order by created desc
)
LOOP
dbms_output.put_line ('ALTER INDEX '||INDEx_RECORD.obj||' COALESCE;');
END LOOP;
END;
/
select 'spool off' from dual;
select 'exit' from dual;
spool off
Step 3: Now run coalesce_indexes.sql script created by running above bc.sql script.
Step 4 : Collect full statistics on the INFODBA schema after the indexes are coalesced.
SQL>exec dbms_stats.gather_schema_stats(ownname =>'INFODBA', estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE AUTO', degree=>DBMS_STATS.AUTO_DEGREE, cascade=>true, no_invalidate=>FALSE);

 

 

5.小表缓存、大表单独分区存储

5.1通常,缓存小的热表(<100行),并将大的热表分隔到单独的表空间中,而不是固定它们。缓存表比重新组织表空间更直接,所以前者将首先解决。

查询哪些表,经常访问磁盘:

select DISK_READS, SQL_TEXT from v$sqlarea order by disk_reads;

 

 

5.2经常用到的小表:

 

 PAM_ACE
 PAM_ACL
 PATTACHMENT_TYPES
 PATTACHMENTS
 PEPMTASK
 PIMANTYPE
 PITEMMASTER
 PITEMVERSIONMASTER
 POM_F_LOCK
 POM_M_LOCK

 POM_R_LOCK
 PPOM_USER
 PPSVIEWTYPE
 PSIGNOFF
 PUSER

To cache a table into memory, a ‘keep’ buffer pool must first be created by adding an entry to the init<sid>.ora file:
db_keep_cache_size = (buffers:number) (10g or later)

添加到缓存:For example:
alter table POM_M_LOCK storage(buffer_pool keep);

从缓存移除:
To remove tables from the keep pool:
alter table tablename storage(buffer_pool default);

 

 

5.3带有热表的SQL语句列表可能包含一些表,例如POM_BACKPOINTER或PPOM_OBJECT,这些表也经常被访问。然而,这些文件的大小通常不允许缓存它们。不应缓存大型表。频繁访问的大型表可能是单独磁盘上它们自己的表空间的候选表,但是,您可以选择将表分组到表空间中。例如:

 将前三个表放在各自独立的表空间中

 将接下来的两个表放在一个单独的表空间中

 将接下来的五个表放在一个单独的表空间中

 将剩余的表放在一个单独的表空间中

如上所述,不建议Teamcenter系统管理员新手将热表重新组织为单独的表空间。然而,许多客户的经验表明,将以下表格组织为单独的表空间可能是有益的,但前提是每个表空间位于单独的磁盘驱动器或文件系统卷上。在一个有经验的Oracle DBA的帮助下,考虑以下表空间配置:

 将POM_反向指针表及其索引放在自己的表空间中。

 将PPOM_对象表和索引放在自己的表空间中。

 将POM_M_锁、POM_R_锁、POM_F_锁表和索引放在一个表空间中。

 将PEPMTASK表及其索引与其关联的VLAs附件和附件类型放在一个表空间中。

posted @   张永全-PLM顾问  阅读(1120)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
点击右上角即可分享
微信分享提示