Professional Documents
Culture Documents
Tecnomatix System Maintenance Guide
Tecnomatix System Maintenance Guide
Maintenance Guide
COPYRIGHT
This software and related documentation are proprietary to Siemens Product Lifecycle Management
Software 2 (IL) Ltd.
Trademarks
Siemens and the Siemens logo are registered trademarks of Siemens AG. Tecnomatix is a trademark or
registered trademark of Siemens Product Lifecycle Management Software Inc. or its subsidiaries in the
United States and in other countries. All other trademarks, registered trademarks, or service marks
belong to their respective holders.
Adobe Reader is a trademark or registered trademark of Adobe Systems Incorporated.
Apache is a registered mark or trademark of The Apache Software Foundation or its subsidiaries in the
US and other countries.
AutoCAD is a registered mark or trademark of Autodesk, Inc. or its subsidiaries in the US and other
countries.
CATIA is a trademark or registered trademark of Dassault Systèmes or its subsidiaries in the United
States and/or other countries.
Firefox is a trademark or registered trademark of Mozilla Foundation.
Contents
1 Overview ............................................................................................................................................................... 4
1.1 General Background ....................................................................................................................................... 4
1.2 Structure of this Guide.................................................................................................................................... 4
1.3 How to Use this Guide ................................................................................................................................... 4
2 Optimizing the Tecnomatix System ...................................................................................................................... 5
2.1 Network Optimization .................................................................................................................................... 5
2.1.1 Network Validations .............................................................................................................................. 6
2.2 File Server Optimization ................................................................................................................................ 6
2.2.1 File Server Validations ........................................................................................................................... 6
2.3 eMServer Optimization .................................................................................................................................. 7
2.3.1 Preliminary Validations ......................................................................................................................... 7
2.3.2 Tuning eMServer to Environment ....................................................................................................... 10
2.3.3 Permission Settings .............................................................................................................................. 12
2.3.4 Log Tuning........................................................................................................................................... 13
3 On-going Maintenance Procedures ..................................................................................................................... 16
3.1 eMServer ...................................................................................................................................................... 16
3.1.1 Monitoring ........................................................................................................................................... 16
3.1.2 Tecnomatix Logs.................................................................................................................................. 17
3.1.3 Cleanup ................................................................................................................................................ 17
3.1.4 Restart .................................................................................................................................................. 17
4 Database Optimization ........................................................................................................................................ 18
4.1 Building the Tecnomatix Instance ............................................................................................................... 18
4.1.1 Usage: .................................................................................................................................................. 18
4.2 Preliminary Validations ............................................................................................................................... 20
4.3 Setting the System to Maintenance Mode .................................................................................................... 21
4.4 Monitoring the Database .............................................................................................................................. 22
4.4.1 The Importance of Monitoring ............................................................................................................. 22
4.4.2 Maintaining the Database ..................................................................................................................... 22
4.5 Schema Statistics ......................................................................................................................................... 24
4.5.1 The Importance of Schema Statistics ................................................................................................... 24
4.5.2 How to Utilize Schema Statistics ......................................................................................................... 24
4.6 Index Rebuilding .......................................................................................................................................... 25
4.6.1 The Importance of Index Rebuilding ................................................................................................... 25
4.6.2 How to Rebuild Indexes ....................................................................................................................... 25
4.7 Schema Cleanup........................................................................................................................................... 26
4.7.1 The Importance of Schema Cleanups ................................................................................................... 26
4.7.2 The Importance of Backing Up Schemas ............................................................................................. 26
2
Tecnomatix System Maintenance Guide
3
Tecnomatix System Maintenance Guide
1 Overview
This document provides guidance to Tecnomatix system operators for performing on-going daily
maintenance to keep the system operating smoothly over the long run.
The Tecnomatix Maintenance Guide is written for Tecnomatix system operators/administrators, DBAs,
system administrators, and Tecnomatix support engineers.
4
Tecnomatix System Maintenance Guide
DCOM ports – this is a range of ports used by DCOM. The default range is 49152-65535 for Windows Vista
and Windows Server 2008 and 1025-5000 for earlier versions of Windows. The port range can be changed
(and reduced to a smaller number of ports) by the system administrator.
5
Tecnomatix System Maintenance Guide
Item Details √
Network topology
Servers database server and the eMServer are recommended to be placed on a
LAN with an excellent, dedicated full duplex network connection of at
least 100 Mbit.
File server is recommended to be placed near the clients if possible. If
there are several client sites, you may place several file servers, one on
each site, and synchronize between them. If this is not possible, you may
place the file server in the data center.
License server is recommended to be placed near the clients if possible. If
not, try to place it at a location that offers a good connection to the client
sites. Web and Vis stream servers are recommended to be placed on the
data center and on one machine (one machine due to
3D streaming access possibilities both from the outside and inside
the organization).
Clients In general, clients can be placed on the LAN and the WAN with a minimum
of 10 MBit dedicated full duplex network connection.
It is highly recommended to put the clients inside the firewall due to
DCOM protocol problems.
Other components Check the network to ensure that there are no components that may cause
potential bottle necks, such as NAT translators routers, firewalls between
networks, etc.
Domain issues
Workgroup It is recommended to work with domains and not workgroups, however it is
possible to work with workgroups as follows: Should have the same users
and passwords on the server and on the clients.
Domains o It is recommended to put all users and machines on the same domain;
however, if this is not possible, you can use trusted domains.
o In some cases the domain name seen from the machine is an alias to
the real domain – make sure the alias points to the correct domain.
6
Tecnomatix System Maintenance Guide
Item Details √
Robcad is used) and Windows files. It is recommended that the OS
directly hosts Unix and NT without a mediator (such as Samba),
however, using a mediator is possible with specific settings (for more
details consult Tecnomatix support).
System root
Sharing The System root directory is shared, read/write for all Tecnomatix users.
Mapped drive Mapped drives can be used
UNC format UNC is fully supported.
Folder structure Make sure that:
- There is a library under the System root folder and this library
contains the .co folders.
- The System root folder resides under the mapped drive (if one
was used).
- For better performance of import and export, place all PPJ/PPD/XML
files under the System root.
From the client Check that the client can “see” the System root with its exact path and
that the client can perform import/export with the current System root.
From the eMServer Check that the eMServer can “see” the System root with its exact path.
System root location It is recommended to locate the System root in a central file server close
to the database and the eMServers.
Though there are not many configuration parameters, it is important nevertheless to exercise
careful monitoring of this layer.
The server is built on top of COM+ with one major component, the eMServer. The dllhost.exe serves as
the eMServer process.
The eMSAgent is a special service that supplies the notification mechanism.
Item Details √
Connectivity
DB connectivity Tnsping SID is OK.
DB connectivity Sqlplus <user>/<user password>@<SID>is OK.
File server connectivity
Ping the file server (in case the file server is not located in the
eMServer).
Clients connectivity Perform a sample ping to a number of clients.
Registry entries
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Oracle\ o DEFAULT_HOME=<the Oracle client home name used by
all_homes the eMServer>
o Last_home=<the required home id>
HKEY_LOCAL_MACHINE\ Check that
SOFTWARE\Oracle \homex - NLS_LANG value matches the format in the database.
- ORACLE_HOME_NAME matches the Oracle client home name.
From version 9.1.1 and onwards, the Oracle Database can be
configured to store native UTF8 characters. In this case the Oracle
Client must have the same settings as the eMServer regional settings
and the client application. For more information, refer to the
7
Tecnomatix System Maintenance Guide
Item Details √
Tecnomatix Admin Guide.
ORACLE_HOME matches the path for the Oracle client installation.
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Tecnomatix\ Current version = <the installed version number>
eMplanner
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Tecnomatix\ FileSystemRoot=<the correct path for the system root with the
eMplanner\database correct letters>
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Tecnomatix\ CnfgFolder=<path to the correct folder, the default is the initData
eMplanner\settings folder under ..\Tecnomatix\.
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Tecnomatix\ (Default)=<ClientServer or Server>
eMplanner\setuptype
HKEY_LOCAL_MACHINE\ Check that:
SOFTWARE\Tecnomatix\ License Dir = <the correct path for the license files>
License
HKEY_LOCAL_MACHINE\ If you are unable to connect to the database via the eMS Administration
SOFTWARE\\Microsoft\MS tool, check the following registry entries:
DTC\MTxOCI "OracleXaLib"="xa80.dll"
"OracleSqlLib"="SQLLib80.dll"
"OracleOciLib"="oci.dll"
8
Tecnomatix System Maintenance Guide
Item Details √
Configuration. The permission group should include all Tecnomatix
users.
For Access, set Allow access. For Launch, set Allow
launch. For Configuration, set according to your
organization’s policy.
Application\eMSAgent Check all tabs, paying special to the following:
properties - Location, the machine on which the agent runs. (In
future versions it will be possible to install the
eMSAgent separately).
- Security, with the correct permissions to allow launch
for Tecnomatix users from their client machines.
DBscripts folder
Verify that the files in the folder are the latest updates (including all
patches).
agent.log Open the log and search for errors or warnings.
eMS.log Open the log and search for errors or warnings.
Other eMS logs eMS log folder briefly inspect the other logs in the eMS log folder (you
can locate it using the ems_config.cfg) for any type of problems.
<x>_spool.txt logs briefly inspect these logs, located under the
..\Tecnomatix\..\dbscripts folder. These logs are generated by the eMS
Administration tool.
Event Viewer Search for any errors or warnings in the Microsoft Event Viewer logs:
Application log.
- System log
- Security log
ems_config file
Queue size Check queue size – it is recommended to limit this value in accordance
with the number of concurrent users multiplied by 200 (the average
number of notices per client).
For example: For a maximum of 10 concurrent users, set the queue
size to 2000 (10 x 200).
Check chunk size You may use this option on an import server (an eMServer dedicated
for large imports). Fragmentizing the import process into chunks. It is
recommended to set this when the eMS has insufficient memory to
handle the import in one transaction.
For a 1GB machine, chunk size of 10000 - 20000 is sufficient.
Connection pool size The number of open database connections for reuse. The default is 10,
but you may adjust this number to match the number of concurrent
users.
If you have an average of 20-30 concurrent users, you may have 30
connections for reuse.
Check database to verify that
connection string is correct
eMSAgent name Check the eMSAgent name, mainly to make sure that each agent has
its own, unique name (by default, the eMSAgent name is the machine
name where the eMSAgent was installed).
The existence of a non-unique name could cause a double subscription
and corrupt the AQ schema. Use the following steps to check that all
names are unique:
1. Login to eM-Planner from clients connected to different agents and
open projects on each client.
2. Sqlplus <schema_aq>/<schema password>@<SID>.
3. Select * from observing_agents.
4. The system displays all agents currently observing objects –
inspect this list to verify the uniqueness of the agents’ names.
5. Another possibility is to check all the ems_config files in all the
eMServers.
9
Tecnomatix System Maintenance Guide
Item Details √
NOTE: Setting the above parameter to 1 may degrade performance of
the eMServer.
Trace_log Check that Oracle trace is 0. Set this to 1 only when you want to track
Oracle SQLs in the database to find the most problematic SQLs. This
is equivalent to setting the SQL_TRACE to TRUE in the init.ora.
Note: Setting the above parameter to 1 may degrade performance of
the database server.
Log file location Check the eMS log folder location to make sure that you have write
permissions on this folder.
No GUI update at import Check that: NoGUIupdateAtImport is set to 0.
In case of a dedicated Import server (one of the eMServers is used as
an import server only), it is recommended to set the
NoGUIupdateAtImport to 1.
General
Oracle client Make sure that Oracle client is installed under a folder located on a
path without spaces (i.e., c:\program files\oracle).
Tnsnames.ora Make sure that the correct tnsnames file is located under
..\network\admin or any other folder according to the registry. For
setting the tnsnames file see the Tecnomatix Administration Guide.
Sqlnet.ora Make sure that the correct sqlnet.ora file is located under
..\network\admin or any other folder according to the registry. For
setting the tnsnames file see the Tecnomatix Administration Guide
OS Tuning
Performance options/Virtual It is recommended to set the page file size to system managed .
memory
Performance Set the server to run on background services.
options/Background services
File and printer sharing for It is recommended to set this value for maximal data throughput for
Microsoft network properties network applications.
10
Tecnomatix System Maintenance Guide
queue does not significantly increase (i.e., eMSAgent process memory size remains
within acceptable range of 20-40 MB).
- chunk size – For a 1GB machine, chunk size of 10000-20000 is sufficient. This parameter is
only relevant for the import phase. NOTE: when the chunk size value is too small it may
affect the total time of the import (e.g., a chunk size of 3000 for a project with more than
300000 nodes)
Running processes configuration
Monitor other processes (not Tecnomatix processes) running on the eMServer machine to
determine whether they may be affecting server performance. To check this, use the Task
Manager with the following counters:
- Mem usage
- CPU usage
If any of these processes impose a heavy usage load, consult with your system administrator about
configuring the process for more efficient use, or kill it. In many cases, the anti-virus exacts a high
process load on the server in addition to the Tecnomatix processes. It is possible to reduce server load
by configuring the anti-virus to exclude Tecnomatix files (especially ems.log) from virus scanning.
Performance monitor counters
You can use the Microsoft performance monitor to detect basic problems occurring on the server
such as poor memory management or inefficient processes. It is required that you conduct at least
one week of monitoring on the productive environment in order to gather significant results that can
indicate where obstacles may exist.
In some cases, when you suspect the occurrence of a certain problem, you may have to drill down on
some counters in order to acquire more details. This process requires a week or two for completion.
To set the performance monitor counters and the log, consult your system administrator. For preliminary
monitoring, run the performance monitor for several days on a productive or test load. When running a
monitor for several days, take a sample every hour; when running a monitor for several hours, take a
sample every 30 seconds. In either case, use the following counters:
Performance object Counters Performance aspect being
monitored
Distribution transaction 1. Active transactions COM+ transactions.
coordinator 2. Transaction/sec Since the eMServer is a COM+
3. Aborted transactions/sec component it uses the transaction
4. Active transactions mechanism.
5. Committed transactions
6. Response time – Average
7. Response time – Maximum
8. Response time –
9. Minimum
10. Transaction/sec
Memory 11. Available bytes o 1-2 To monitor memory usage
12. Cache bytes o 3-4 To detect problems with
13. Committed bytes virtual bytes
14. Commit limit o 5-10 To monitor memory
15. Page faults/sec bottlenecks and memory leaks
16. Page reads/sec
17. Page writes/sec
18. Pages Input/sec
19. Pages output/sec
20. Pages/sec
Server 1. Bytes received/sec Another view of network
2. Bytes sent/sec throughput
3. Bytes total/sec
Network interface 1. Bytes received/sec Network throughput
2. Bytes sent/sec
3. Bytes total/sec
Network segment 1. % of net utilization Network usage.
Note: This counter requires
installation of network packet
protocol.
11
Tecnomatix System Maintenance Guide
Analyze the performance monitor counters by checking their behavior, for example:
• If you notice that there is a constant increase in the amount of context switches/sec, check the thread
count to see if there is a correlation. If there is also an increase in the thread count, examine the
particular process with the rising threads. By detecting this process, you can implement the
appropriate course of action.
• If the network segment % of network utilization is more than 30% and the network throughput of
the server (total bytes/sec) is a high percentage of the network bandwidth, it may indicate a
possible bottleneck in the network.
• If the % of CPU time is high (more than 90%) and the average CPU queue length size is more than
2 and there are no high values on disks and the network, this indicates that more CPU power is
needed (accomplished by adding or replacing CPUs).
• If the pages/sec counter is more than 100, while there are less than 4MB available and the % of disk
time (for logical disks) for access of paging files is more than 70%, this may indicate a paging
problem due to lack of memory resources. This can be improved by adding more memory.
In case of one or more suspicious counters, expand your analysis to include more counters in order
to pinpoint the problem.
12
Tecnomatix System Maintenance Guide
3. Set the Access and Launch permissions for the group of permitted users (all Tecnomatix
clients connected to the current eMServer).
4. It is recommended to set the eMSAgent service to start automatically, freeing you from
the necessity of setting the launch permissions.
Default logging may provide preliminary information on errors and warnings; when encountering
specific problems, you may wish to set the logging to a more detailed level.
The default logs are located under c:\temp – however these logs may be written to any location
desired. You can set the log location from the eMServer Administration\eMS Log tab or directly from
the ems_config.cfg file (located under ..\Tecnomatix\em-planner\initdata).
NOTE: Changing the location of the ems_config.cfg file requires restarting the dllhost and the
eMSAgent service.
NOTE: If you choose the Process Sensitive log, each time the eMServer component is restarted a new ems
log is created with the extension of the DLLHOST process id (i.e. ems1234.log).
13
Tecnomatix System Maintenance Guide
3. Choose Log Type and Log Detail and click Set for each one.
Log configuration:
eMServer log – the major log ems.log
Notification agent log – the emsagent log emsagent.log
Client log – the eM-Planner log located in eM-Planner.log client application
Process sensitive – if selected, each time the dllhost.exe is restarted a new ems log is created with the
dllhost.exe process ID (i.e. ems1234.log)
14
Tecnomatix System Maintenance Guide
15
Tecnomatix System Maintenance Guide
3.1 eMServer
Detailed explanations of main Tecnomatix/eMServer objects follow. It is recommended to assign
eMServer maintenance to an engineer with system administrator skills.
3.1.1 Monitoring
It is good practice to perform minimal but regular monitoring on the eMServer in order to detect
problems and potential failures before they occur. Use the following tools:
- Microsoft built-in Performance monitor
- Microsoft built-in Event viewer
Using the Microsoft Performance monitor for counters
Run a constant monitoring log to make it easy to identify problems, while observing the following
counters:
Performance object Counters Instances When value reaches
Process - % Processor - Emsagent • When emsagent virtual bytes exceed 50 MB it is
time - dllhost#1 recommended to restart the emsagent service.
- Virtual bytes • When DLLHOST#1 exceeds 1GB, investigate the
- Thread count operation and check whether possible to run it
differently (i.e., large export of PPJ may be split
into several smaller PPD exports.
Memory - Available bytes • When page faults/sec exceed 4000, this indicates
- Page faults/sec memory management problem – requires more
- Pages/sec investigation.
• When pages/sec exceed 100 and available memory
is less than 4MB, research the paging activity and
consider adding more memory.
Processor - % Processor Total_ •If the avg. usage is more than 90% and the
time processor queue length is more than 2, find the
- Interrupts/sec process that is overloading the CPU and check
whether substituting a better CPU or adding
more CPUs is required.
•A dramatic increase from 1500 interrupts/sec
without correspondence to other system
counters may indicate a hardware problem.
System Context switches Constant increase in the number of context
switches/sec over the period of a week may indicate
the presence of too many threads in the system.
Server - Total bytes/sec • If the sum of total bytes/sec for all servers roughly
- Work equals maximum transfer rate of your network,
queue you should investigate the network throughput and
length segments.
• If the work queue value exceeds 4 there may be a
processor bottleneck. Continue to observe over
several intervals.
System - Processor • See Processor.
queue length for
multiple processors
Network - Segment % of • You must determine the threshold based on the
net utilization type of network you are running. For Ethernet
networks, for example, 30 percent is the
recommended threshold.
Note: for this counter, you will need to install
network packet protocol.
16
Tecnomatix System Maintenance Guide
3.1.3 Cleanup
The ems.log em-planner.log and agent.log are not cleaned automatically, however each time:
• the DLLHOST is restarted, the ems.log is overwritten, any aborted COM+ transactions
of Tecnomatix are cleaned
It is recommended to monitor your Tecnomatix log directory weekly and delete logs that have exceeded 200
MB, for the following reasons:
- they consume disk space
- writing to such files loads the system and degrades performance
Note: There is an option to configure the EMS log file with maximum size limit. When the file reaches the
limit, a new file is created. Refer to the Tecnomatix Administration Guide for further details.
3.1.4 Restart
It is highly recommended to reboot all servers at least once every month. In case this is not possible, use
the eMS Administration tool to restart the emsagent service and dllhost every week, as follows:
1) Open the eMS Administration tool.
2) S Use eMServer shutdown node..
This cleans the emsagent and dllhost sessions on the eMServer and shuts them down.
It is a good practice to run this procedure at night when users are not working.
17
Tecnomatix System Maintenance Guide
4 Database Optimization
The lowest tier in the Tecnomatix system is the database server and ultimately all events in the system pass
through it. Incorrect configuration of the database or lack of optimization will adversely affect users operating
the client applications in the higher tiers. Most database optimization requiring DBA competence is
implemented in the early stages of production. However, some of these tasks may also be handled later on.
Most organizations have dedicated database departments. Therefore, access to the database is achieved with
the assistance of the local DBA.
The database is installed and optimized by the DBA department. However, in many cases when no guidelines
have been set to optimize the Tecnomatix system database, the local DBA accepts the default settings.
This section relates to the most important database issues that may degrade performance when not optimized.
Install Perl first - the Tecnomatix Oracle instance is created with Perl scripts The Oracle Sever installed
version is 11.2.0.3.
4.1.1 Usage:
# DB Instance Creation
For example:
# DB Instance Creation
The following is a list of recommended database instance parameters (some of the memory parameters require
fine-tuning according to the size of the database and workload):
*.aq_tm_processes 1
*.compatible 11.2.0.3
18
Tecnomatix System Maintenance Guide
*.db_block_size 8192
*.db_file_multiblock_read_count 8
*.db_files 1024
*.db_writer_processes 4
*.fast_start_mttr_target 300
*.global_names FALSE
*.java_pool_size 0
*.job_queue_processes 2
*.max_dump_file_size 10m
*.open_cursors 400
*.optimizer_dynamic_sampling 2
*.optimizer_index_cost_adj 10
*.optimizer_mode CHOOSE
*.processes 500
*.query_rewrite_enabled FALSE
*.recyclebin off
*.remote_login_passwordfile EXCLUSIVE
*.session_cached_cursors 20
*.session_max_open_files 20
19
Tecnomatix System Maintenance Guide
*.star_transformation_enabled FALSE
*.streams_pool_size 0
*.timed_statistics TRUE
*.undo_management AUTO
*.undo_retention 600
*.undo_tablespace UNDOTBS1
*.workarea_size_policy auto
Item Details
Instance From each eMServer, open a command line window and type the following:
connectivity Tnsping <Tecnomatix instance name>
You should receive an OK message for each server.
Schema From each eMServer open a command line window and type the following:
connectivity - Sqlplus <schema name>/<schema
password>@<Tecnomatix instance name> is OK
- Sqlplus <schema name_aq>/<schema_aq
password>@<Tecnomatix instance name> is OK
- [optional, only for specific customers] Sqlplus
<schema name_bv>/<schema password>@<Tecnomatix
instance name> is OK
Instance List all the schemas in the Tecnomatix instance:
schemas list 1. Sqlplus system/<system password (DBA priviliges)>@<Tecnomatix
instance name>
2. SQL>Select username from all_users
3. All existing schemas are listed. Verify that the AQ schema is listed for
each main schema.
AQ cleanup Check that the ppq_table in the advanced queue schema is clean, as follows:
1. Sqlplus <schema>_aq/<schema password >@<Tecnomatix instance
name>
2. Select * from ppq_table – no rows should be returned as a result
3. Repeat step 2 several times until the ppq_table is empty.
List of table Verify that there is enough space for all the tables.
spaces Use the Tecnomatix Administration Guide to verify this. The following is a list of the
tables and their required space:
• AQ_DATA
• PP_DATA_128K
• PP_INDEX_128K
20
Tecnomatix System Maintenance Guide
Item Details
• PP_DATA_1M
• PP_INDEX_1M
• PP_DATA_10M
• PP_INDEX_10M
Table space All the above table spaces should be locally managed.
management
Table space Check table spaces’ initial size. All the tablespaces should be automatically
size and incremented. See the Tecnomatix Administration Guide.
increment
Table space Verify table space file locations.
files
Redo log Check redo log size. See the Tecnomatix Administration Guide.
Archive log If the system is operating in archive mode, check the archive directory size.
Running Retrieve the list of sessions running in the instance, as follows:
sessions 1. Sqlplus system/<system password (DBA priviliges)>@<Tecnomatix
instance name>
2. Select username,status from v$session
3. Check that all the sessions are relevant sessions
Instance Retrieve the Tecnomatix instance parameters and compare them to the values specified
parameters in the Tecnomatix Administration Guide.
To retrieve the parameters:
1. Sqlplus system/<sys password>@<Tecnomatix instance name>
2. Select name, value from v$parameter this lists all the instance parameters
and their values
Listener This task is done on the database server. Check listener stats as follows:
1. In a command line window type lsnrctl
2. Type stat - the listener status is displayed
3. Make sure that all relevant instances are on
NLS_LANG Recommended setting: AMERICAN_AMERICA.UTF8
Oracle patch Check that Oracle patch 11.2.0.3 is installed.
Do the following to retrieve this information:
- Sqlplus system/<sys password>@<Tecnomatix instance name>
Select comp_id, version, status from dba_registry
Disks Siemens Industry recommends storing database files on a RAID or storage subsystem:
Data and indexes in one volume
Control files and Redo logs in one volume
Archives in one volume
In all configurations, Siemens Industry recommends storing redo logs on the fastest
disks.
21
Tecnomatix System Maintenance Guide
• Row Migration: If an UPDATE statement increases the amount of data in a row so that the row no
longer fits in its data block, Oracle attempts to find another block with enough free space to hold the
entire row. If available, Oracle moves the entire row to the new block – this is called migrating a
row. Select queries on migrated rows perform more I/O, which can affect overall performance.
• Table Fragmentation: When you delete records from the database, the blocks that hosted them
remain. After many deletes, there is a high percentage of empty blocks relative to the entire table –
this can significantly degrade performance. All Oracle segments have an upper boundary containing
the data within the segment. This upper boundary is called the High Water Mark (HWM). The new
inserted rows can use this space again. The HWM is an indicator that marks the last block was ever
used in the table.
• Oracle Log Alerts: Oracle writes its own alerts. It is important to monitor these alerts periodically to
identify potential problems.
• Advanced Queue Items (optional): The Advanced Queue mechanism is part of the Tecnomatix
notification mechanism. This mechanism is critical for the Tecnomatix system. Siemens
recommends monitor it the Advanced Queue mechanism.
from user_tables
This SQL command retrieves all tables with more than 10% chained rows, based on schema analysis
statistics. Siemens recommends running this command once per week.
22
Tecnomatix System Maintenance Guide
The following example shows how this can be done in a Unix shell:
Note: Only the last 200 lines in the alert file are checked.
This example can be used in Unix without any changes to track the Oracle errors that might be of interest.
If you retrieved errors, check the Oracle documentation for the meaning of each error and how best to deal
with it.
23
Tecnomatix System Maintenance Guide
trunc(last_analyzed),temporary;
For indexes:
The temporary tables and indexes should not have any statistics.
• For schemas created with the eMServer Administration tool using the create new Oracle account option,
the following job (in bold) automatically runs every night at midnight (12.00am):
declare
jobno number;
begin
dbms_job.submit(
commit;
end;
If you did not create the schema via the eMServer Administration tool, Siemens recommends
running this job at least once a week at night when there is minimum load on the system.
• For schemas that were not created with the eMServer Administration tool, there is no default schema
analysis . If you wish to run a periodic schema analysis, run the following PL/SQL blocks (in 10G this is
automatic):
-- Set all tables of the analyzed schema to be monitored
begin
dbms_stats.ALTER_SCHEMA_TAB_MONITORING('&ora_user',true);
end;
24
Tecnomatix System Maintenance Guide
-- Set the scheduler to run the schema analysis procedure nightly (12.00)
-- The option GATHER STALE forces the schema analysis to run only on tables with more than 10%
changes
declare
jobno number;
begin
dbms_job.submit(
job => jobno,
what => 'DBMS_STATS.gather_schema_stats(''&ora_user'', method_opt => ''FOR ALL
INDEXED COLUMNS size 75'' , options => ''GATHER STALE'');',
next_date => to_date(trunc(sysdate))+1,
interval => 'trunc(sysdate) + 1');
commit;
end;
/
The latter option is recommended. This is because it does not run on all the tables and saves CPU
resources.
as
statement_idx VARCHAR2(4000);
CURSOR cur
IS
select 'alter index '||owner||'.'||index_name||' rebuild' from dba_indexes where temporary='N' and index_type
not in ('LOB','IOT - TOP') and owner<>'SYS';
BEGIN
open cur;
end loop;
END;
25
Tecnomatix System Maintenance Guide
This script rebuilds all indexes for all schemas within the instance.
If you want to rebuild the indexes only for a specific schema, replace the highlighted line with owner =
‘schema name’
Delete all logs under the …<Oracle home folder>\<SID>\bdump , udump on a weekly basis.
If you are working with archive mode, make sure that the directory is not overflowing with archive files.
There are several tools on the market for backing up databases. Oracle offers a backup solution, RMAN
(recovery manager), to backup and recover database information in an up to the last minute manner.
This utility can:
• Run a full backup (on any chosen period)
• Backup incrementally (on any chosen period)
• Recover easily and quickly up to the last minute
• Preserve constant disk space for archive logs
• Be scheduled to run automatically
• Integrate with external backup utilities
There are two methods of backups:
• Hot backup – the database is backed up on-line. Using Hot backup, you run the database in Archive
mode, in order to back up Redo log files as Archive files when they become full. Siemens recommends
the following:
Run a weekly full backup – copy all the archive files.
Run a daily incremental backup – only changes are copied.
Maintain the archive directory at a constant size.
To recover – load the full backup and the incremental backups up to date in order to
reinstate the database ‘up to the last minute’.
Database recovery time is very fast. The major disadvantage of the Hot backup method is that it may
overload the system.
• Cold backup – All database files are copied. This method requires database shut
down every time you perform a backup. But does not require implementing additional
procedures (as does the hot backup method).
Siemens recommends combining both Hot and Cold backup for a complete database backup
strategy.
Note: For database shutdown, first remove all Tecnomatix user sessions. You can do this by filtering
all the schemas in the eMServer Administrator tool in all the eMServer working with the instance,
and running truncate table dfsession.
26
Tecnomatix System Maintenance Guide
27
Tecnomatix System Maintenance Guide
Parameter Description
Level of details Change the level of details shown in the Graphic Viewer between high
quality and improved performance by moving the slide bar to the desired
position.
Decrease level of details while When selected, the level of details is decreased when changing the view
changing view point point.
Cull parts with less than When selected, small details in the 3D data are hidden. Specify the size as
a percentage of the full display. Displaying fewer parts improves the
performance of the display. By default, this option is not activated.
Use background loading Enables the Graphic Viewer to display objects while prototype files are
being loaded. You configure the graphic display redraw rate in number of
seconds during background loading. By default, this option is activated.
Fixed frame rate Ensures a minimum frame rate (Frames Per Second) for animations. To
maintain the frame rate, the Direct Model viewer reduces the display detail
level if necessary. By default, this option is not activated.
Rendering mode The following options enable you to balance memory consumption against
system performance.
28
Tecnomatix System Maintenance Guide
Parameter Description
29
Tecnomatix System Maintenance Guide
6 Maintenance Table
The following table summarizes all the on-going maintenance actions.
Monitor log alerts Weekly Look for specific Oracle alerts that
may indicate database problems.
Siemens recommends performing Refresh Schema action through the Admin Console utility after rebuilding
tables/indexes:
6.1 Fine-Tuning
This section describes basic database server tuning operations. Siemens recommends that you implement
them during the early stages of production when the database is already operative.
30
Tecnomatix System Maintenance Guide
In order to tune the database, first analyze the database behavior. Then, based on the results, implement
changes to improve performance.
Analyze Check when the last Run schema analysis if data grew significantly Recommended
schema schema analysis was since the time of the last analysis by running the to run at night
performed and determine following SQL: when system is
not overloaded.
the data growth since then.
DBMS_STATS.gather_schema_stats('ora_user',
Check the time of the last method_opt => 'FOR ALL INDEXED
analysis by running the COLUMNS size 75',cascade=>true);
following SQL statement:
When you setup the maintenance program, this
select LAST_ANALYZED script runs periodically according to data
growth.
from dba_tables;
Redo log Check the number of Increase the value of the initialization Database shut
buffer REDO BUFFER parameter LOG_BUFFER to 2M: down
ALLOCATION RETRIES
several times. If the 1. Shut down the database.
number is not close to zero 2. Change the init.ora parameter
LOG_BUFFER to 2M.
(3 or higher) increase the
3. Change the db_writer_process to
redo log buffer. 2.
4. Restart the instance.
If the database is using spfile instead of init.ora,
change the value in the spfile using "alter
system set log_buffer=2m scope=spfile;" and
restart the database.
31
Tecnomatix System Maintenance Guide
This table shows an example of the required operations to fine-tune the database. These operations are
actually what we implement in order to improve a problematic item in the database.
The operations are prioritized as follows: The operation with the lowest cost (in terms of implementation) and
the highest beneficial effect receives the highest priority, and so on.
32
Tecnomatix System Maintenance Guide
7 Appendix
In case you need to free disk space on the database server, perform the following:
• SQLPLUS SYSTEM/<SYSTEM PASSWORD>@<SID>
33
Tecnomatix System Maintenance Guide
34
Tecnomatix System Maintenance Guide
============================================================
= REM
REM rebuild_indx.sql
REM
REM Copyright (c) Oracle Software, 1998 - 2000
REM
REM Author : Jurgen Schelfhout
REM
REM The sample program in this article is provided for educational
REM purposes only and is NOT supported by Oracle Support
Services. REM It has been tested internally, however, and works as
documented. REM We do not guarantee that it will work for you, so
be sure to test REM it in your environment before relying on it.
REM
REM This script will analyze all the indexes for a given schema
REM or for a subset of schemas. After this initial analysis, the dynamic view
REM index_stats is consulted to see if an index is a likely
REM candidate for a rebuild or for a bitmap
index. REM
REM Database Version : 7.3.X and
above. REM
REM =============================================================
prompt
ACCEPT spoolfile CHAR prompt 'Output-file : ';
ACCEPT schema CHAR prompt 'Schema name (% allowed) : ';
promp
t
promp
t
prompt Rebuild the index when :
prompt - deleted entries represent 20% or more of the current
entries prompt - the index depth is more than 4 levels.
prompt Possible candidate for bitmap index :
prompt - when distinctiveness is more than 99%
prompt
spool &spoolfile
set serveroutput on
set verify off declare
c_name INTEGER;
ignore INTEGER;
height index_stats.height%TYPE := 0; lf_rows
index_stats.lf_rows%TYPE := 0; del_lf_rows
index_stats.del_lf_rows%TYPE := 0; distinct_keys
index_stats.distinct_keys%TYPE := 0; cursor c_indx
is
select owner, table_name, index_name
from dba_indexes
where owner like upper('&schema')
and owner not in ('SYS','SYSTEM');
begin
dbms_output.enable (1000000);
35
Tecnomatix System Maintenance Guide
c_name := DBMS_SQL.OPEN_CURSOR;
for r_indx in c_indx loop
DBMS_SQL.PARSE(c_name,'analyze index ' || r_indx.owner || '.' ||
r_indx.index_name || ' validate structure',DBMS_SQL.NATIVE);
ignore := DBMS_SQL.EXECUTE(c_name);
end loop;
DBMS_SQL.CLOSE_CURSOR(c_name);
end;
/
spool off
set verify on
Uninstall Statspack:
General description:
Drop statspack user then drop statspack tablespace.
36
Tecnomatix System Maintenance Guide
@<oracle home>/rdbmd/admin/spdrop
-- Drop statspack tablespace (optional in case you do not want to use statspack anymore)
drop tablespace stats;
-- Generate Statspack report, you are prompted to choose begin snapshot, end snapshot and report file name
<oracle home>/rdbms/admin/spreport
Cleaning snapshots:
General description:
You can cleanup statspack snapshots from time to time to control the backlog, limiting it to two weeks, for
example.
#------------------
#!C:\MKSNT/perl.exe
# first argument: Oracle Base - directory under which Database admin and
oradata directories will be installed
# third argument: Oracle SID - name of the database instance that will be
created
use File::Path;
37
Tecnomatix System Maintenance Guide
local $oracle_home;
local $sid;
local $ip;
local $oradata_path;
local $small_database;
local $db_block_buffers;
local $pga_aggregate_target;
local $shared_pool_size;
local $shared_pool_reserved_size;
local $system_size;
local $large_tbs_size;
local $medium_tbs_size;
local $small_tbs_size;
local $large_ext_size;
local $medium_ext_size;
local $small_ext_size;
local $large_autoext_size;
local $medium_autoext_size;
local $small_autoext_size;
local $redo_log_size;
$oracle_home = shift(@ARGV);
$sid = shift(@ARGV);
$ip = shift(@ARGV);
$port = shift(@ARGV);
$oradata_path = shift(@ARGV);
38
Tecnomatix System Maintenance Guide
#$small_database = "TRUE";
if (defined $small_database) {
$pga_aggregate_target = "50M";
$sga_target_size = "150M";
$system_size = "150M";
$large_tbs_size = "200M";
$medium_tbs_size = "150M";
$small_tbs_size = "100M";
$large_ext_size = "1M";
$medium_ext_size = "512K";
$small_ext_size = "128K";
$large_autoext_size = "10M";
$medium_autoext_size = "5120K";
$small_autoext_size = "1M";
$redo_log_size = "50M";
} else {
$pga_aggregate_target = "300M";
$sga_target_size = "400M";
$system_size = "300M";
$large_tbs_size = "500M";
$medium_tbs_size = "300M";
$small_tbs_size = "200M";
$large_ext_size = "10M";
$medium_ext_size = "1M";
39
Tecnomatix System Maintenance Guide
$small_ext_size = "128K";
$large_autoext_size = "100M";
$medium_autoext_size = "30M";
$small_autoext_size = "20M";
$redo_log_size = "100M";
mkdir "${admin_base}",777;
mkdir "${admin_path}",777;
mkdir "${admin_path}\\create",777;
mkdir "${admin_path}\\pfile",777;
mkdir "${admin_path}\\applog",777;
mkdir "${oracle_base}\\diag",777;
$oradata_path =~ tr/\\/\// ;
mkpath("${oradata_path}");
rename
"${admin_path}\\create\\build_files.log","${admin_path}\\create\\build_fi
les.log.old";
if (open(LOG_FILE, ">$logfile")) {
40
Tecnomatix System Maintenance Guide
else {
rename
"${oracle_home}\\database\\init${sid}.ora","${oracle_home}\\database\\ini
t${sid}.ora.old";
if (open(OUT_FILE, ">$ifile")) {
else {
close(OUT_FILE);
rename
"${admin_path}\\pfile\\init.ora","${admin_path}\\pfile\\init.ora.old";
if (open(OUT_FILE, ">$initora")) {
else {
41
Tecnomatix System Maintenance Guide
db_name = "${sid}"
instance_name = ${sid}
service_names = ${sid}
db_files = 1024
control_files = ("${oradata_path}\\control01.ctl",
"${oradata_path}\\control02.ctl", "${oradata_path}\\control03.ctl")
# Files Locations
diagnostic_dest= ${oracle_base}\\diag
utl_file_dir=${admin_path}\\applog
db_file_multiblock_read_count = 8
db_block_size = 8192
sga_target = ${sga_target_size}
pga_aggregate_target=${pga_aggregate_target}
log_buffer = 1638400
max_dump_file_size = 10M
processes = 500
global_names = false
remote_login_passwordfile = exclusive
os_authent_prefix = ''
compatible = 11.2.0.3
open_cursors = 400
session_cached_cursors = 20
job_queue_processes = 2
aq_tm_processes = 1
optimizer_mode = CHOOSE
optimizer_index_cost_adj = 10
optimizer_dynamic_sampling = 2
query_rewrite_enabled=FALSE
42
Tecnomatix System Maintenance Guide
star_transformation_enabled=FALSE
fast_start_mttr_target=300
undo_management=AUTO
undo_retention=600 # 10 mins
undo_tablespace=UNDOTBS1
# For statspack
timed_statistics=TRUE
sec_case_sensitive_logon=FALSE
deferred_segment_creation=FALSE
recyclebin=off
EOF
close(OUT_FILE);
if (open(OUT_FILE, ">>$tnsnames")) {
else {
${sid} =
(DESCRIPTION =
(ADDRESS_LIST =
43
Tecnomatix System Maintenance Guide
EOF
close(OUT_FILE);
if ( -e $listener) {
else {
if (open(OUT_FILE, ">$listener")) {
else {
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS_LIST =
44
Tecnomatix System Maintenance Guide
EOF
close(OUT_FILE);
if (-e $sqlnet) {
else {
if (open(OUT_FILE, ">$sqlnet")) {
else {
close(OUT_FILE);
rename "${credb_path}\\${sid}run.sql","${credb_path}\\${sid}run.sql.old";
if (open(OUT_FILE, ">$SIDrun")) {
else {
45
Tecnomatix System Maintenance Guide
spool ${credb_path}\\${sid}run.log
set echo on
group 2 ('${oradata_path}\\${sid}_g2_m1.rdo',
group 3 ('${oradata_path}\\${sid}_g3_m1.rdo',
group 4 ('${oradata_path}\\${sid}_g4_m1.rdo',
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
MAXDATAFILES 254
MAXINSTANCES 1
46
Tecnomatix System Maintenance Guide
spool off
exit
EOF
close(OUT_FILE);
rename
"${credb_path}\\${sid}run1.sql","${credb_path}\\${sid}run1.sql.old";
if (open(OUT_FILE, ">$SIDrun1")) {
else {
spool ${credb_path}\\${sid}run1.log
set echo on
----------------------------------------------------------------------
47
Tecnomatix System Maintenance Guide
48
Tecnomatix System Maintenance Guide
\@${oracle_home}\\Rdbms\\admin\\catalog.sql;
\@${oracle_home}\\Rdbms\\admin\\catproc.sql;
\@${oracle_home}\\Rdbms\\admin\\catblock.sql;
\@${oracle_home}\\Rdbms\\admin\\catoctk.sql;
\@${oracle_home}\\sqlplus\\admin\\plustrce.sql
\@${oracle_home}\\Rdbms\\admin\\utlxplan.sql;
--\@${oracle_home}\\Rdbms\\admin\\owminst.plb;
connect system/manager
\@${oracle_home}\\sqlplus\\admin\\pupbld.sql
\@${oracle_home}\\sqlplus\\admin\\help\\hlpbld.sql helpus.sql;
spool off
exit
EOF
close(OUT_FILE);
49
Tecnomatix System Maintenance Guide
close(LOG_FILE);
# Set environment:
#------------------
#!C:\MKSNT/perl.exe
# first argument: Oracle Base - directory under which Database admin and
oradata directories will be installed
# third argument: Oracle SID - name of the database instance that will be
created
@command_args = ("${oracle_home}\\bin\\oradim","-new","-sid","${sid}","-
intpwd","change_on_install","-startmode","manual","-
pfile","${admin_path}\\pfile\\init.ora");
system(@command_args) == 0
50
Tecnomatix System Maintenance Guide
@command_args =
("${oracle_home}\\bin\\sqlplus","/nolog","\@${credb_path}\\${sid}run.sql"
);
system(@command_args) == 0
@command_args =
("${oracle_home}\\bin\\sqlplus","/nolog","\@${credb_path}\\${sid}run1.sql
");
system(@command_args) == 0
@command_args = ("${oracle_home}\\bin\\oradim","-edit","-sid","${sid}","-
startmode","auto");
system(@command_args) == 0
@command_args = ("${oracle_home}\\bin\\lsnrctl","start");
system(@command_args) == 0
#------------------
#!C:\MKSNTperl.exe
# first argument: Oracle Base - directory under which Database admin and
oradata directories will be installed
# third argument: Oracle SID - name of the database instance that will be
created
51
Tecnomatix System Maintenance Guide
use File::Path;
local $oracle_home;
local $sid;
local $ip;
local $oradata_path;
local $small_database;
local $db_block_buffers;
local $pga_aggregate_target;
local $shared_pool_size;
local $shared_pool_reserved_size;
local $system_size;
local $large_tbs_size;
local $medium_tbs_size;
local $small_tbs_size;
local $large_ext_size;
local $medium_ext_size;
local $small_ext_size;
local $large_autoext_size;
local $medium_autoext_size;
local $small_autoext_size;
local $redo_log_size;
$oracle_home = shift(@ARGV);
$sid = shift(@ARGV);
$ip = shift(@ARGV);
$port = shift(@ARGV);
52
Tecnomatix System Maintenance Guide
$oradata_path = shift(@ARGV);
#$small_database = "TRUE";
if (defined $small_database) {
$pga_aggregate_target = "50M";
$sga_target_size = "150M";
$system_size = "150M";
$large_tbs_size = "200M";
$medium_tbs_size = "150M";
$small_tbs_size = "100M";
$large_ext_size = "1M";
$medium_ext_size = "512K";
$small_ext_size = "128K";
$large_autoext_size = "10M";
$medium_autoext_size = "5120K";
$small_autoext_size = "1M";
$redo_log_size = "50M";
} else {
$pga_aggregate_target = "300M";
$sga_target_size = "400M";
$system_size = "300M";
$large_tbs_size = "500M";
$medium_tbs_size = "300M";
$small_tbs_size = "200M";
$large_ext_size = "10M";
53
Tecnomatix System Maintenance Guide
$medium_ext_size = "1M";
$small_ext_size = "128K";
$large_autoext_size = "100M";
$medium_autoext_size = "30M";
$small_autoext_size = "20M";
$redo_log_size = "100M";
rename "db_files/build_files.log","db_files/build_files.log.old";
if (open(LOG_FILE, ">$logfile")) {
else {
###rename
"${oracle_home}/database/init${sid}.ora","${oracle_home}/database/init${s
id}.ora.old";
if (open(OUT_FILE, ">$ifile")) {
else {
54
Tecnomatix System Maintenance Guide
close(OUT_FILE);
if (open(OUT_FILE, ">$initora")) {
else {
db_name = "${sid}"
instance_name = ${sid}
service_names = ${sid}
db_files = 1024
control_files = ("${oradata_path}/control01.ctl",
"${oradata_path}/control02.ctl", "${oradata_path}/control03.ctl")
# Files Locations
DIAGNOSTIC_DEST = ${admin_path}/diag
utl_file_dir=${admin_path}/applog
db_file_multiblock_read_count = 8
db_block_size = 8192
sga_target = ${sga_target_size}
pga_aggregate_target=${pga_aggregate_target}
log_buffer = 1638400
max_dump_file_size = 10M
processes = 500
global_names = false
55
Tecnomatix System Maintenance Guide
remote_login_passwordfile = exclusive
os_authent_prefix = ""
compatible = 11.2.0.3
open_cursors = 400
session_cached_cursors = 20
job_queue_processes = 2
aq_tm_processes = 1
optimizer_mode = CHOOSE
optimizer_index_cost_adj = 10
optimizer_dynamic_sampling = 2
query_rewrite_enabled=FALSE
star_transformation_enabled=FALSE
fast_start_mttr_target=300
undo_management=AUTO
undo_retention=600 # 10 mins
undo_tablespace=UNDOTBS1
# For statspack
timed_statistics=TRUE
sec_case_sensitive_logon=FALSE
deferred_segment_creation=FALSE
recyclebin=off
EOF
close(OUT_FILE);
56
Tecnomatix System Maintenance Guide
if (open(OUT_FILE, ">>$tnsnames")) {
else {
${sid} =
(DESCRIPTION =
(ADDRESS_LIST =
EOF
close(OUT_FILE);
if ( -e $listener) {
else {
if (open(OUT_FILE, ">$listener")) {
else {
57
Tecnomatix System Maintenance Guide
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS_LIST =
EOF
close(OUT_FILE);
if (-e $sqlnet) {
else {
if (open(OUT_FILE, ">$sqlnet")) {
else {
58
Tecnomatix System Maintenance Guide
close(OUT_FILE);
rename "db_files/${sid}run.sql","db_files/${sid}run.sql.old";
if (open(OUT_FILE, ">$SIDrun")) {
else {
spool db_files/${sid}run.log
set echo on
connect / as SYSDBA
group 2 ('${oradata_path}/${sid}_g2_m1.rdo',
group 3 ('${oradata_path}/${sid}_g3_m1.rdo',
group 4 ('${oradata_path}/${sid}_g4_m1.rdo',
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
59
Tecnomatix System Maintenance Guide
MAXDATAFILES 254
MAXINSTANCES 1
spool off
exit
EOF
close(OUT_FILE);
rename "db_files/${sid}run1.sql","db_files/${sid}run1.sql.old";
if (open(OUT_FILE, ">$SIDrun1")) {
else {
spool db_files/${sid}run1.log
set echo on
connect / as SYSDBA
60
Tecnomatix System Maintenance Guide
----------------------------------------------------------------------
61
Tecnomatix System Maintenance Guide
\@${oracle_home}/rdbms/admin/catalog.sql;
\@${oracle_home}/rdbms/admin/catproc.sql;
\@${oracle_home}/rdbms/admin/catblock.sql;
\@${oracle_home}/rdbms/admin/catoctk.sql;
\@${oracle_home}/sqlplus/admin/plustrce.sql
\@${oracle_home}/rdbms/admin/utlxplan.sql;
--\@${oracle_home}/rdbms/admin/owminst.plb;
62
Tecnomatix System Maintenance Guide
connect system/manager
\@${oracle_home}/sqlplus/admin/pupbld.sql
\@${oracle_home}/sqlplus/admin/help/hlpbld.sql helpus.sql;
spool off
exit
EOF
close(OUT_FILE);
close(LOG_FILE);
#------------------
#!C:\MKSNT/perl.exe
# first argument: Oracle Base - directory under which Database admin and
oradata directories will be installed
# third argument: Oracle SID - name of the database instance that will be
created
use File::Path;
use File::Copy;
63
Tecnomatix System Maintenance Guide
rename "db_files/build_db.log","db_files/build_db.log.old";
if (open(LOG_FILE, ">$logfile")) {
else {
mkpath ("${admin_base}");
mkpath ("${admin_path}");
mkpath ("${admin_path}/create");
mkpath ("${admin_path}/applog");
mkpath ("${admin_path}/diag");
mkpath ("${admin_path}/pfile");
64
Tecnomatix System Maintenance Guide
mkpath("${oradata_path}");
rename
"${oracle_home}/database/init${sid}.ora","${oracle_home}/database/init${s
id}.ora.old";
rename
"${oracle_home}/database/PWD${sid}.ora","${oracle_home}/database/PWD${sid
}.ora.old";
rename "${admin_path}/pfile/init.ora","${admin_path}/pfile/init.ora.old";
rename "${net8_path}/listener.ora","${net8_path}/listener.ora.old";
rename "$${net8_path}/sqlnet.ora","${net8_path}/sqlnet.ora.old";
# copy files
copy ("db_files/init${sid}.ora",
"${oracle_home}/database/init${sid}.ora");
if (open(TNS_FILE, ">>$tnsnames"))
else {
65
Tecnomatix System Maintenance Guide
@lines=<TMP_FILE>;
foreach (@lines)
else
close(TNS_FILE);
close(TMP_FILE);
##########################################
@command_args =
("${oracle_home}/bin/orapwd","file=${oracle_home}/dbs/orapw${sid}","passw
ord=change_on_install");
system(@command_args) == 0
@command_args =
("${oracle_home}/bin/sqlplus","/nolog","\@db_files/${sid}run.sql");
system(@command_args) == 0
66
Tecnomatix System Maintenance Guide
@command_args =
("${oracle_home}/bin/sqlplus","/nolog","\@db_files/${sid}run1.sql");
system(@command_args) == 0
@command_args = ("${oracle_home}/bin/lsnrctl","start");
system(@command_args) == 0
close(LOG_FILE);
67