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附件和附件類型放在一個表空間中。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM