Académique Documents
Professionnel Documents
Culture Documents
Version 2013
March 2013
DSPI2-PE-200013B
Copyright
Copyright 1995-2013 Intergraph Corporation. All Rights Reserved. Intergraph is part of Hexagon.
Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement;
contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret
law, and international treaty, and may not be provided or otherwise made available without proper authorization from Intergraph
Corporation.
U.S. Government Restricted Rights Legend
Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies: This was
developed at private expense and is "restricted computer software" submitted with restricted rights in accordance with
subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at 52.227-19 of the Federal
Acquisition Regulations ("FAR") and its successors, and is unpublished and all rights are reserved under the copyright laws of the
United States. For units of the Department of Defense ("DoD"): This is "commercial computer software" as defined at DFARS
252.227-7014 and the rights of the Government are as specified at DFARS 227.7202-3.
Unpublished - rights reserved under the copyright laws of the United States.
Intergraph Corporation
P.O. Box 240000
Huntsville, AL 35813
Terms of Use
Use of this software product is subject to the End User License Agreement ("EULA") delivered with this software product unless the
licensee has a valid signed license for this software product with Intergraph Corporation. If the licensee has a valid signed license
for this software product with Intergraph Corporation, the valid signed license shall take precedence and govern the use of this
software product. Subject to the terms contained within the applicable license agreement, Intergraph Corporation gives licensee
permission to print a reasonable number of copies of the documentation as defined in the applicable license agreement and
delivered with the software product for licensee's internal, non-commercial use. The documentation may not be printed for resale or
redistribution.
Warranties and Liabilities
All warranties given by Intergraph Corporation about equipment or software are set forth in the EULA provided with the software or
applicable license for the software product signed by Intergraph Corporation, and nothing stated in, or implied by, this document or
its contents shall be considered or deemed a modification or amendment of such warranties. Intergraph believes the information in
this publication is accurate as of its publication date.
The information and the software discussed in this document are subject to change without notice and are subject to applicable
technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document.
The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms
of this license. No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by
Intergraph or its affiliated companies. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL EVALUATION AS
TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.
Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and symbol data.
Users should verify for themselves that the data is accurate and suitable for their project work.
Trademarks
Intergraph, the Intergraph logo, PDS, SmartPlant, SmartMarine, FrameWorks, I-Convert, I-Export, I-Sketch, IntelliShip, INtools,
ISOGEN, MARIAN, SmartSketch, SPOOLGEN, SupportManager, and SupportModeler are trademarks or registered trademarks of
Intergraph Corporation or its subsidiaries in the United States and other countries. Microsoft and Windows are registered
trademarks of Microsoft Corporation. MicroStation is a registered trademark of Bentley Systems, Inc. Other brands and product
names are trademarks of their respective owners.
Contents
Preface .......................................................................................................................................................... 5
Index ........................................................................................................................................................... 61
SmartPlant Instrumentation
Configuration and Maintenance
This set of documents describes the procedure for configuring and maintaining the SmartPlant
Instrumentation Version 2013 database to ensure optimal performance.
In this guide, whenever a string appears in brackets, type the desired value substituting the
entire string, including the brackets. For example: instead of <Oracle home folder>, type
c:\orawin.
If you encounter problems during any configuration or maintenance process, contact your
local SmartPlant Instrumentation provider or Intergraph Support. To locate your Intergraph
Support service provider, use a World Wide Web browser to connect to
http://support.intergraph.com (http://support.intergraph.com/).
During the lifetime of your instrumentation data, you store in your SmartPlant Instrumentation
database important data and spend a lot of time creating it. Therefore, it is imperative that
you maintain backup procedures, and back up the appropriate SmartPlant Instrumentation
data regularly.
If you have saved external files, for example, trimmed audit trail data files, spec files saved in
.psr or .isf format, keep the original external file paths the same on all client machines when
restoring your SmartPlant Instrumentation database.
SmartPlant Instrumentation does not have its own backup utility that allows you to back up the
entire Oracle or SQL Server database and relies on you to correctly use the backup utility of the
selected database. If you want to back up a specific domain in your database, or back up a
database implemented in Sybase Adaptive Server Anywhere, use the Administration module
options of SmartPlant Instrumentation.
Shut down all engines that use your database (for example, InfoMaker) before
backing up or restoring your Oracle or SQL Server database.
This document includes information about using the backup and restore procedures in SQL
Server and Oracle. The information provided here is not intended to substitute the information
given in the relevant database platform manual but to supplement it with requirements specific to
SmartPlant Instrumentation. Therefore, we strongly recommend that you familiarize yourself
with the backup and restore procedures described in your Oracle and SQL Server user's guides
before you read this document.
In addition to regular backups, it is highly recommended to backup the SmartPlant Instrumentation
database in the following special cases:
Before upgrading the version of the software
Before and after a massive import
At any milestone in your set of tasks (for example, when you finish creating your domain)
It is also recommended to test the backup of your data, and restore it once prior to the first
major modifications to your data using the following sequence of operations:
1. Make a database backup.
2. Make some changes to your database.
3. Restore the database.
4. Make sure you have your previous version of data.
The following section explains how to restore a backed up SmartPlant Instrumentation database
on the target server. The restore procedure is divided into preliminary tasks, restore tasks, and
post-restore tasks.
You must have SQL Server installed on your target server with exactly the same
character set and sort order as on the source server.
Make sure that you have enough disk space for each data file. To improve the restore
performance, create the Indexes, Data, and Log files on different physical disks if
possible.
6. Create an initial SmartPlant Instrumentation database that contains the following file groups:
Admin data
Admin indexes
Log file
7. To create these file groups, in the Query window, type the following:
CREATE DATABASE <source SmartPlant Instrumentation database>
ON PRIMARY (NAME = <source Admin data datafile name>,
FILENAME = '<full path and name of source Admin data datafile>',
SIZE = <source Admin data datafile size>MB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 10%),
2. Do the following to create the Admin and SPI_LOGIN schema logins and two logins for each
domain:
a. In the Query window, type:
CREATE LOGIN <Admin schema name> WITH PASSWORD = '<Admin schema
password>',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN SPIsuper WITH PASSWORD = 'spisuper_pwd',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN SPI_LOGIN WITH PASSWORD = 'spi_login_pwd',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN <Domain schema name> WITH PASSWORD = '<Domain schema
password>',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN <View-Only Domain schema name> WITH PASSWORD =
'<View-Only Domain schema password>',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
b. Repeat the last two CREATE LOGIN commands for each existing domain in your
database.
c. Click Execute Query.
3. When the domain type is Owner operator, create the As-Built schema login for each domain.
Also, for each project, create Project and Combined Project schema logins as follows:
a. In the Query window, type:
CREATE LOGIN <Domain schema name> WITH PASSWORD = '<Domain schema
password>_A_1',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN <Domain schema name>_E_<Project Number>, WITH PASSWORD
= '<Domain schema password>_E_<Project Number>',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
CREATE LOGIN <Domain schema name>_C_<Project Number>,
WITH PASSWORD = '<Domain schema password>_C_<Project Number>',
DEFAULT_DATABASE = <SmartPlant Instrumentation database name>,
CHECK_POLICY = OFF
b. Repeat the last two CREATE LOGIN commands for each project defined in each domain.
c. Click Execute Query.
4. Define a default database for the SPIsuper login as follows:
a. In the Query window, type:
EXEC SP_ADDSRVROLEMEMBER 'SPIsuper', 'sysadmin'
b. Click Execute Query.
5. Check the relationship between the SQL Server logins and the SQL Server database users in
the restored database. Run the following SQL to generate the login-user relationship report:
EXEC SP_CHANGE_USERS_LOGIN 'REPORT'
6. Fix the database user logins according to the generated report if required as follows:
Press Enter.
2. On the target server, create a new Oracle instance with a new database. Follow the
Installation Guide instructions to create the new instance compatible with SmartPlant
Instrumentation. Note that the new database must have the same character set as the
source database.
3. To improve the restore performance, create the Indexes, Data, and Temporary files on
different physical disks if possible.
4. Create table spaces for Admin data, Admin indexes, Admin temporary data, Domain data,
Domain indexes, and temporary data for each domain.
a. In the SQL Plus window, type and then press Enter as follows:
CREATE TABLESPACE <Admin data tablespace name>
DATAFILE '<full path and name of the Admin data file>'
SIZE <Admin data file size>M
REUSE AUTOEXTEND ON NEXT 2M MAXSIZE 3000M
DEFAULT STORAGE (INITIAL 500K NEXT 500K MINEXTENTS 1 MAXEXTENTS 249
PCTINCREASE 50) ONLINE PERMANENT;
Press Enter.
Type the following:
CREATE TABLESPACE <Admin index tablespace name>
DATAFILE '<full path and name of the Admin index file>'
SIZE <Admin index file size>M
REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 3000M DEFAULT STORAGE (INITIAL
500K NEXT 500K MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50) ONLINE
PERMANENT;
Press Enter.
Type the following:
CREATE TEMPORARY TABLESPACE <Admin temporary data tablespace name>
TEMPFILE '<full path and name of the Admin temporary data file>'
SIZE <Admin temporary data file size>M REUSE AUTOEXTEND ON NEXT 2M
MAXSIZE 3000M;
Press Enter.
Type the following:
CREATE TABLESPACE <Domain data tablespace name>
DATAFILE '< full path and name of the Domain data file>'
SIZE <Domain data file size>M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE
3000M DEFAULT STORAGE (INITIAL 500K NEXT 500K MINEXTENTS 1 MAXEXTENTS
249 PCTINCREASE 50) ONLINE PERMANENT;
Press Enter.
Type the following:
CREATE TABLESPACE <Domain index tablespace name>
DATAFILE '<full path and name of the Domain index data file>'
SIZE <Domain index data file size>M REUSE AUTOEXTEND ON NEXT 5M
MAXSIZE 3000M DEFAULT STORAGE (INITIAL 500K NEXT 500K MINEXTENTS 1
MAXEXTENTS 249 PCTINCREASE 50) ONLINE PERMANENT;
Press Enter.
Press Enter.
Type the following:
CREATE USER <Combined project schema logon name>
IDENTIFIED BY <Combined project schema logon password>
DEFAULT TABLESPACE <Domain data tablespace name>
TEMPORARY TABLESPACE <Domain temporary data tablespace name>;
Press Enter.
Press Enter.
GRANT RESOURCE TO <As-Built schema logon name>;
Press Enter.
GRANT INTOOLS_ENGINEER TO <As-Built schema logon name>;
Press Enter.
GRANT CONNECT TO <Project schema logon name>;
Press Enter.
GRANT RESOURCE TO <Project schema logon name>;
Press Enter.
GRANT INTOOLS_ENGINEER TO <Project schema logon name>;
Press Enter.
GRANT CONNECT TO <Combined project schema logon name>;
Press Enter.
GRANT RESOURCE TO <Combined project schema logon name>;
Press Enter.
GRANT INTOOLS_ENGINEER TO <Combined project schema logon name>;
Press Enter.
i. Repeat the last six GRANT commands for each required combination of Project and
Combined Project in the source domain.
j. Continue setting the ALTER options:
ALTER USER INTOOLS_LOGIN DEFAULT ROLE ALL;
Press Enter.
ALTER USER <Admin schema logon name> DEFAULT ROLE ALL;
Press Enter.
ALTER USER <View-Only Domain schema logon name> DEFAULT ROLE ALL;
Press Enter.
ALTER USER <Domain schema logon name> DEFAULT ROLE ALL;
Press Enter.
k. Repeat the last two ALTER commands for each required domain.
ALTER USER <As-Built schema logon name> DEFAULT ROLE ALL;
Press Enter.
ALTER USER <Project schema logon name> DEFAULT ROLE ALL;
Press Enter.
ALTER USER <Combined schema project schema logon name> DEFAULT ROLE
ALL;
Press Enter.
l. Repeat the last two ALTER commands for each required combination of Project and
Combined Project in the source domain.
m. Continue setting the ALTER options:
ALTER USER <Admin schema logon name> QUOTA UNLIMITED ON <Admin data
tablespace name>;
Press Enter.
ALTER USER INTOOLS_LOGIN QUOTA UNLIMITED ON <Admin data tablespace
name>;
Press Enter.
ALTER USER <Domain schema logon name> QUOTA UNLIMITED ON <Domain index
tablespace name>
QUOTA UNLIMITED ON <Domain Data tablespace name>;
Press Enter.
ALTER USER <View-Only Domain schema logon name>
QUOTA UNLIMITED ON <Domain Data tablespace name>;
Press Enter.
n. Repeat the last two ALTER commands for each required domain.
o. Continue setting the ALTER options:
ALTER USER <As-Built schema logon name> QUOTA UNLIMITED ON <Domain
Data tablespace name>;
Press Enter.
ALTER USER <Project schema logon name> QUOTA UNLIMITED ON <Domain Data
tablespace name>;
Press Enter.
ALTER USER <Combined project schema logon name> QUOTA UNLIMITED ON
<Domain Data tablespace name>;
Press Enter.
p. Repeat the last two ALTER commands for each required combination of Engineering and
Combined project in the source domain.
9. Restart the target database.
4. Import the source Domain schemas from the dump file. For each required Domain schema,
type the following at the operating system command prompt:
IMP SYSTEM/MANAGER<new instance alias> FROMUSER=<Domain schema logon
name> TOUSER=<Domain schema logon name> FILE=<target dump file full
filepath> IGNORE=Y BUFFER=5000000 LOG=<full path and name of the Domain
schema import log file>
Press Enter.
5. Import the required source View-Only Domain schemas from the dump file. For each
required View-Only Domain schema, type the following at the operating system command
prompt:
IMP SYSTEM/MANAGER<new instance alias> FROMUSER=<View-Only Domain
schema logon name> TOUSER=<View-Only Domain schema logon name>
FILE=<target dump file full filepath> IGNORE=Y BUFFER=5000000 LOG=<full
path and name of the View-Only Domain schema import log file>
Press Enter.
6. If the source database contains an As-Built schema, import the source As-Built schemas from
the dump file. At the operating system command prompt, type:
IMP SYSTEM/MANAGER@<new instance alias> FROMUSER=<As-Built schema logon
name> TOUSER=<As-Built schema logon name> FILE=<target dump file full
filepath> IGNORE=Y BUFFER=5000000 LOG=<full path and name of the
As-Built schema import log file>
Press Enter.
7. To import the Project schemas from the dump file, for each required Project schema, at the
operating system command prompt, type:
IMP SYSTEM/MANAGER@<new instance alias> FROMUSER=
<Project schema logon name> TOUSER=<Project schema logon name>
FILE=<target dump file full filepath> IGNORE=Y BUFFER=5000000 LOG=<full
path and name of the Project schema import log file>
Press Enter.
8. To import the Combined Project schemas from the dump file, for each required Combined
Project schema, at the operating system command prompt, type:
IMP SYSTEM/MANAGER@<new instance alias> FROMUSER=<Combined Project
schema logon name> TOUSER=<Combined Project schema logon name>
FILE=<target dump file full filepath> IGNORE=Y BUFFER=5000000 LOG=<full
path and name of the Combined Project schema import log file>
Press Enter.
Post-Restore Tasks
Post restore tasks include procedures that verify the validity of the imported objects. You can
also run SQL queries to find and correct problems.
Steps 1 and 2 in the following procedure are only relevant if you are working with old title
blocks created before Version 7.0 of SmartPlant Instrumentation.
1. Create Power Builder System tables for the SmartPlant Instrumentation database. Run the
SQL Plus utility and log on as the system manager. In the Oracle SQL Plus window, type:
CREATE TABLE PBCATCOL (
pbc_tnam varchar2(30),
pbc_tid float,
pbc_ownr varchar2(30),
pbc_cnam varchar2(30),
pbc_cid float,
pbc_labl varchar2(254),
pbc_lpos float,
pbc_hdr varchar2(254),
pbc_hpos float,
pbc_jtfy float,
pbc_mask varchar2(31),
pbc_case float,
pbc_hght float,
pbc_wdth float,
pbc_ptrn varchar2(31),
pbc_bmap varchar2(1),
pbc_init varchar2(254),
pbc_cmnt varchar2(254),
pbc_edit varchar2(31),
pbc_tag varchar2(254));
Press Enter.
ALTER TABLE PBCATCOL ADD CONSTRAINT PBSYSCATCOLDICT_IDX PRIMARY KEY
(pbc_tnam,pbc_ownr,pbc_cnam);
Press Enter.
GRANT ALL ON PBCATCOL TO PUBLIC;
Press Enter.
CREATE TABLE PBCATEDT (
pbe_name varchar2(30),
pbe_edit varchar2(254),
pbe_type float,
pbe_cntr float,
pbe_seqn float,
pbe_flag float,
pbe_work varchar2(32));
Press Enter.
ALTER TABLE PBCATEDT ADD CONSTRAINT PBSYSPBE_IDX PRIMARY KEY
(pbe_name,pbe_seqn);
Press Enter.
GRANT ALL ON PBCATEDT TO PUBLIC;
Press Enter.
CREATE TABLE PBCATFMT (
pbf_name varchar2(30),
pbf_frmt varchar2(254),
pbf_type float,
pbf_cntr float);
Press Enter.
ALTER TABLE PBCATFMT ADD CONSTRAINT PBSYSCATFRMTS_IDX PRIMARY KEY
(pbf_name);
Press Enter.
GRANT ALL ON PBCATFMT TO PUBLIC;
Press Enter.
if enabled then
tmpbuf := tmpbuf || to_char(a);
end if;
end;
procedure put(a date) is
begin
if enabled then
tmpbuf := tmpbuf || to_char(a);
end if;
end;
procedure put_line(a varchar2) is
begin
if enabled then
tmpbuf := tmpbuf || a;
new_line;
end if;
end;
procedure put_line(a number) is
begin
if enabled then
tmpbuf := tmpbuf || to_char(a);
new_line;
end if;
end;
procedure put_line(a date) is
begin
if enabled then
tmpbuf := tmpbuf || to_char(a);
new_line;
end if;
end;
procedure new_line is
strlen binary_integer;
begin
if enabled then
if get_in_progress then
get_in_progress := FALSE;
putidx := 1;
amtleft := 500;
buf(putidx) := '';
end if;
strlen := lengthb(tmpbuf);
if strlen > 255 then
tmpbuf := '';
raise_application_error(-20000, 'ORU-10028: line length
overflow, ' ||
'limit of 255 bytes per line');
end if;
if strlen > amtleft then
if putidx >= idxlimit then
tmpbuf := '';
raise_application_error(-20000, 'ORU-10027: buffer
overflow, ' ||
'limit of ' || to_char(buf_size) || ' bytes');
end if;
buf(putidx) := buf(putidx) || ' -1';
putidx := putidx + 1;
amtleft := 500;
buf(putidx) := '';
end if;
buf(putidx) := buf(putidx) || to_char(strlen,'999')
|| tmpbuf;
amtleft := amtleft - strlen - 4;
tmpbuf := '';
end if;
end;
procedure get_line(line out varchar2, status out integer)
is
strlen binary_integer;
begin
if not enabled then
status := 1;
return;
end if;
if not get_in_progress then
buf(putidx) := buf(putidx) || ' -1';
putidx := putidx + 1;
get_in_progress := TRUE;
getidx := 1;
getpos := 1;
tmpbuf := '';
end if;
while getidx < putidx loop
strlen := to_number(substrb(buf(getidx),getpos,4));
if strlen >= 0 then
line := substrb(buf(getidx), getpos+4, strlen);
getpos := getpos + strlen + 4;
status := 0;
return;
else
getidx := getidx + 1;
getpos := 1;
end if;
end loop;
status := 1;
return;
end;
procedure get_lines(lines out chararr, numlines in out
integer) is
linecnt integer := 1;
s integer;
begin
if not enabled then
numlines := 0;
return;
end if;
while linecnt <= numlines loop
get_line(lines(linecnt), s);
if s = 1 then
numlines := linecnt - 1;
return;
end if;
linecnt := linecnt + 1;
end loop;
numlines := linecnt - 1;
return;
end;
end;
/
Press Enter.
DROP PUBLIC SYNONYM PBDBMS ;
Press Enter.
CREATE PUBLIC SYNONYM PBDBMS FOR PBDBMS ;
Press Enter.
GRANT EXECUTE ON PBDBMS TO PUBLIC ;
Press Enter.
3. Check if the imported database contains any invalid objects. In the Oracle SQL Plus
window, type:
SELECT OWNER,OBJECT_TYPE,OBJECT_NAME
FROM DBA_OBJECTS WHERE STATUS = 'INVALID' ORDER BY 1,2,3;
Press Enter.
4. To fix the invalid objects, in the Oracle SQL Plus window, type:
BEGIN
FOR REC IN (SELECT OWNER,OBJECT_TYPE,OBJECT_NAME
FROM DBA_OBJECTS WHERE STATUS = 'INVALID' ORDER BY 1,2,3)
LOOP
DBMS_DDL.ALTER_COMPILE(REC.OBJECT_TYPE,REC.OWNER,
REC.OBJECT_NAME);
END LOOP;
END;
/
Press Enter.
5. To ensure that the imported database is free of invalid objects, run the check again as
explained in step 3 above.
6. If the imported database still contains an invalid object, do the following:
If the number of invalid objects after running the check the next time is a smaller than the
number of invalid objects received the previous time (but larger than zero), run the
PL/SQL block again as in step 4.
If the number of invalid objects after running the check the next time is the same as the
number of invalid objects received the previous time, connect to the schema of each
invalid object and find out the cause of the invalid object. Correct each cause separately.
For example, to correct an invalid stored procedure, type:
ALTER PROCEDURE <stored procedure name> COMPILE;
Press Enter.
SHOW ERRORS
Press Enter.
For example, if there is an error showing a missing sequence, to correct the problem, type:
CREATE SEQUENCE <sequence name>;
Press Enter.
ALTER PROCEDURE <stored procedure name> COMPILE;
Press Enter.
If the result of the previous command is "Statement processed", the problem is solved. If you
get another message, run the SHOW ERRORS command again.
7. If, after running the SELECT query in step 3, there are SmartPlant Instrumentation audit
triggers (triggers starting with TR_CL_) that are invalid objects, but the P_Audit_Triggers
stored procedure is valid, connect to the appropriate Domain schema and run the following
PL/SQL block:
DECLARE ISTAT INTEGER;
BEGIN
P_AUDIT_TRIGGERS(ISTAT);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/
Press Enter.
8. If you want to import only some of the existing source domains, do the following in the target
database:
a. Run the SQL Plus utility.
b. Connect to the Admin schema.
c. Run the following SELECT query:
SELECT PROJ_ID,PROJ_NAME,PROJ_LOG_NAME,PROJ_LOG_PASS,PROJ_DEL FROM
PROJECT;
d. Run the DELETE query where you specify the project IDs of the domains that you want to
keep. The domains whose project IDs are not specified will be deleted. In the SQL
Plus window, type:
DELETE FROM ACTIVITY_TRACKING WHERE PROJ_ID IN
(SELECT PROJ_ID FROM PROJECT
WHERE PROJ_DEL <> 'H' AND PROJ_ID NOT IN (<project ID to be
kept>,<project ID to be kept>,));
Press Enter.
DELETE FROM MODULE_LICENSE_PROJECT WHERE PROJ_ID IN
(SELECT PROJ_ID FROM PROJECT
WHERE PROJ_DEL <> 'H' AND PROJ_ID NOT IN (<project ID to be
kept>,<project ID to be kept>),);
Press Enter.
DELETE FROM PROJECT
WHERE PROJ_ID NOT IN (<project ID to be kept>,<project ID to be kept>,)
AND PROJ_DEL <> 'H';
Press Enter.
COMMIT;
Press Enter.
Multi-User Strategy
Locking Mechanism
The internal locking mechanism of the RDBMS prevents two or more users from writing to the
same data simultaneously. However, SmartPlant Instrumentation requires an additional locking
mechanism to enforce some engineering rules. This is done to prevent simultaneous access by
more than one user to the same item or related data. For example, when User A is updating a
spec sheet, the system prevents User B from updating the same spec sheet or from modifying the
same instrument tag number from the Instrument Index module. Another example is when User
A is making changes to a cable. The system prevents User B from modifying the cable, its sets,
and its wires. Furthermore, if the wires are connected to a terminal, User B cannot access the
panels, strips and terminals to which these wires are connected. In this case, neither can User B
access panels, strips and terminals associated with these wires by propagation from a device
panel.
We implemented this locking in the multi-user RDBMS using stored procedures.
On Oracle, the locking is done using the statements select ... from ... where ... for update
nowait.
On SQL Server, a locking table exists on which each locked item has a record. This record will
have been created when the transaction is completed.
SmartPlant Instrumentation user This user has privileges limited to mainly connected
schemas including some minimal rights in the Admin schema. SmartPlant Instrumentation
Domain Administrator is a SmartPlant Instrumentation user who has privileges to grant access
rights for user groups and perform various administration activities.
Synonym
On Oracle, the synonym is given to Admin tables for each domain so it can be read from each
domain.
Sequence
The sequence is used to create unique numbers for the table's Primary Keys.
SEQ_NEXT_ID - to give the next sequence number for the row ID.
All new records use the same sequence except the cascade tables: cable-set-wire; and
panel-strip-terminal. For these tables, the top-level item type is given a sequence number like
all the other tables, then the system just selects the lowest number available and grows
sequentially (that is, when creating a panel, the panel_id will be taken from the sequence, the
first strip ID will be 1, the first terminal in this strip will be 1, and the rest of the terminals will go
from there: 2,3,4,...).
On Oracle, the sequence cache is 100. Oracle needs to complete reading a set of 100
sequence numbers before accessing the disk to read the next set of sequence numbers.
On Sybase Adaptive Server Anywhere and SQL Server, tables with the same names
(SEQ_NEXT_ID and so forth) replace the functionality of the sequence.
Action
The Action menu is available only when the Database Type Test and Query window is
open. Note that you can access most of these commands by clicking the icons that become
active when you open this window.
(Database connection actions)
Use INI file Copies the database settings from the Intools.ini file to the fields under the
Connection setting group box.
Connect Connects to the database indicated by the parameters.
(Database query actions) Active only after you connect to a database.
Execute Executes any SQL commands that you typed in the Query pane.
Settings
Available only from the Internal Setup window.
Create ODBC Profile Creates an ODBC profile to configure SmartPlant Instrumentation
database files.
Rebuild Procedures and Triggers Identifies abnormal database behavior and corrects it by
rebuilding the stored procedures and triggers in the database.
Within each domain, there are plant hierarchy levels. By default, each domain has three levels as
follows: <plant>, <area>, and <unit>. When you perform an upgrade, the Admin schema is
updated first, and then the software prompts you to upgrade domains (one domain at a time).
The following table shows most common types of data you can define at each level of the
hierarchy:
Admin Schema
The Admin schema holds SmartPlant Instrumentation administration data managed by the
System Administrator. The logo name and password of the Admin schema depend on your
database platform.
By default, regardless of the database platform, the Admin schema logon password
is not encrypted. On Oracle or SQL Server, if needed, the System Administrator can encrypt the
Admin schema logon password. For more information, see User's Guide, Administration Module
> System Administration > Database Security > Encrypt the Admin Schema Logon
Password. When encrypting the password, the software removes the Admin schema logon name
and password from the Intools.ini file and stores this data in the INTOOLS_LOGIN table of the
INTOOLS_LOGIN schema.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
Domain Schema
The Domain schema holds SmartPlant Instrumentation domain data, managed by the Domain
Administrator and engineers. The software creates the Domain schema when the System
Administrator initializes a domain. The System Administrator is prompted to define the Domain
schema name and password and the defined Domain schema name becomes the domain logon
name in the database. In Sybase Adaptive Server Anywhere, the Domain schema password is
not encrypted and cannot be encrypted; after initializing a domain, the Domain schema logon
name and password become set permanently in the software. In Oracle or SQL Server, the
System Administrator can encrypt all the Domain schema logon passwords in the database if
needed. When performing a database connection, the software retrieves the logon name and
password from the PROJECT table of the Admin schema.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
INTOOLS_LOGIN Schema
INTOOLS_LOGIN is a SmartPlant Instrumentation database schema created only in Oracle
during the database setup. This schema stores the encrypted Admin schema password in the
database. The schema logon name and password are both intools_login. The logon name is
set permanently in the software. The System Administrator can change and encrypt the
intools_login password if needed.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
SPI_login Schema
SPI_login is a SmartPlant Instrumentation database schema (database user) created only in SQL
Server during the database setup. Each SPI_login schema stores the encrypted Admin schema
password in the database. This schema login is shared for all databases you create in a
particular SQL Server instance. For example, if you create SPI1 and SPI2 databases in the same
instance, each database contains the SPI_login schema but, at the instance level, both schemas
share the same login, whose name is SPI_login and password is spi_login_pwd (lower
case). The login name is set permanently in the software. The System Administrator can
change and encrypt the spi_login_pwd password if needed.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
SPIsuper Schema
SPIsuper is a SmartPlant Instrumentation database user created only in SQL Server during the
database setup. This schema is used when you initialize and define a domain, and also when
you back up, upgrade, or delete a domain. Furthermore, this schema is used when you run any
DBA menu option in the System Administration window.
The schema login is shared for all databases you create in a particular SQL Server instance. For
example, if you create SPI1 and SPI2 databases in the same instance, each database contains
the SPIsuper schema but, at the instance level, both schemas share the same login. The login
name is SPIsuper and the password is spisuper_pwd (lower case). Both the login name and
password are set permanently in the software.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
Combined Project Schema Holds database views of a project used in a combination with
As-Built. In SmartPlant Instrumentation, such a combination enables the user to open a project
with As-Built items displayed. The software creates the logon name and password automatically
using the following naming convention:
<domain name>_c_<project id number>. The <domain name> segment corresponds to the
Domain schema logon name in the database. The Combined Project schema logon name and
password are identical to each other. When performing a database connection, the software
retrieves the logon name and password from the ENGINEERING_PROJECT table of the Domain
schema. The password <domain name>_c_<project id number> is not encrypted. The logon
name and password are set permanently in the software.
See Also
Connecting to the SmartPlant Instrumentation Database (on page 42)
When a SmartPlant Instrumentation user opens a project with As-Built items displayed, the
software connects to the Combined Project schema and retrieves the logon name and
password from the ENGINEERING_PROJECT table of the Domain schema.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
ODBC Profiles (on page 55)
Checking Database Version Compatibility (on page 49)
To connect directly to the target Domain schema without specifying the Admin schema
parameters first, under Database type, select Sybase Adaptive Server Anywhere.
If the Database name box does not display any setting, you can leave it blank.
If you connected to the Admin schema using the Intools.ini file parameters, the DBParm
string is retrieved automatically from the Intools.ini file. When you change the login name
and password, the software automatically updates the DBParm string. For example, if
the DBParm string for connecting to the Admin schema is
ConnectString='DSN=INTOOLS;UID=IN_DBAMN;PWD=IN_DBAMN' and your target
Domain schema name is DEMO and password is also DEMO, the DBParm string
changes to ConnectString='DSN=INTOOLS;UID=DEMO;PWD=DEMO'.
5. Do one of the following:
Click Actions > Connect.
Click .
The Results pane displays the result of the connection. A zero (0) indicates a successful
operation. Codes that indicate a connection failure include a message explaining the reason for
the failure.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
Checking Database Version Compatibility (on page 49)
4. In the Server name and Database name boxes, enter the Oracle instance alias name, which
is the same for the Oracle server name and Oracle database name.
5. Do one of the following:
Click Actions > Connect.
Click .
The Results pane displays the result of the connection. A zero (0) indicates a successful
operation. Codes that indicate a connection failure include a message explaining the reason for
the failure.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
Checking Database Version Compatibility (on page 49)
For SQL Server 2008, the default ODBC profile name for SQL Server is MSS2008. For
SQL Server 2012, the default ODBC profile name for SQL Server is MSS2012.
If the Server name and Database name boxes do not display any settings, you can leave
them blank.
7. Do one of the following:
Click Actions > Connect.
Click .
The Results pane displays the result of the connection. A zero (0) indicates a
successful operation. Codes that indicate a connection failure include a message explaining
the reason for the failure.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
Checking Database Version Compatibility (on page 49)
The Eng Log Name and Eng Log Pass columns contain As-Built and Project schema
logon information.
In the ENGINEERING_PROJECT table, the As-Built row is the one whose Eng Proj ID
column value is 1.
6. Type the As-Built schema logon name, which appears in the Eng Log Name column, in the
Schema logon name box in the Database Type Test and Query window.
7. Type the As-Built schema logon password, which appears in the Eng Log Pass column, in
the Schema logon password box in the Database Type Test and Query window.
8. Do one of the following:
Click Actions > Connect.
Click .
The Results pane displays the result of the connection. A zero (0) indicates a successful
operation. Codes that indicate a connection failure include a message explaining the reason for
the failure.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
The Results pane displays the result of the connection. A zero (0) indicates a successful
operation. Codes that indicate a connection failure include a message explaining the reason for
the failure.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
If the version information file number is higher than the corresponding domain database
number, the most likely reason for the incompatibility is that the database needs
updating. In this case, you should open the Administration module and run the upgrade
option on the domain.
If the version information file number is lower than the corresponding domain database
number, the most likely reason is that an older SmartPlant Instrumentation version was
installed over an existing database. In this case, you should contact Intergraph Support
for further assistance.
The template database does not have a version number.
Database type
In this group box, you select the platform on which your database runs. The following options are
available:
Sybase Adaptive Server Anywhere
Oracle
SQL Server
If you click Actions > Use INI File, the software selects the database type automatically.
ODBC driver Accept the default value for the database platform, or type a different value. If
your database is Oracle, you must enter the DBMS parameter of your Oracle version. For
example, for Oracle 11g, enter ORA. If you click Actions > Use INI File, the software retrieves
the DBMS parameter value from the [Database] section of Intools.ini file and displays this value in
the ODBC driver box automatically.
When the database platform is SQL Server, make sure that the ODBC driver box
displays MSS in upper case. In the Intools.ini file, the string DBMS=MSS must display MSS in
upper case; otherwise, it is not possible to work with specifications in SmartPlant Instrumentation.
Connection settings
Displays the connection settings retrieved from the Intools.ini file or allows you to enter the
connection settings manually if you need to connect to another database.
Schema logon name Allows you to type the logon name of the Admin or Domain schema.
Schema logon password Allows you to type the logon password of the Admin or Domain
schema. The password characters appear masked.
Server name Allows you to type the Oracle instance alias for the server to which you want to
connect.
Only required when the database type is Oracle.
Database name Allows you to type the Oracle instance alias for the database to which you
want to connect. The alias name is the same for both boxes.
Only required when the database type is Oracle.
DBParm Displays the connection string as defined for the DBParm parameter under the
[Database] section of the Intools.ini file.
Only required when the database type is SQL Server or Sybase Adaptive Server
Anywhere.
On SQL Server, if you first connected to the Admin schema by using the Intools.ini
file parameters, when connecting to a Domain schema on SQL Server, you must manually change
the UID and PWD values to match the displayed target Domain schema logon name and
password respectively. On Sybase Adaptive Server Anywhere, the DBParm string is updated
automatically as you change the values in the Schema logon name or Schema logon
password boxes.
Auto commit Allows you to execute a batch of SQL commands. If you clear the check box,
when executing SQL commands, the software prompts you to execute each SQL command
manually.
Query Allow you to enter the SQL command that you want to execute for the database to which
you are connected.
Results Displays the result of making a database connection or executing SQL
commands. On connecting to the database, a zero (0) parameter indicates a successful
connection.
Versions
Use this dialog box together with Intergraph Support to compare SmartPlant Instrumentation and
template database versions with the version information file, c_ver.pbd.
Read from
From this group box, select one or more of the following:
User database Select to read version data from the database used for creating and managing
SmartPlant Instrumentation data.
Template database Select to read version data from the SmartPlant Instrumentation template
database file, in_templ.db. This file is used for database upgrade.
Version file Select to read version data from the version information file, c_ver.pbd.
Domain After clicking Read to display the data, select the domain to which you want to
compare the version information.
Admin Displays the Admin schema version ID in each category.
Domain Displays the Domain schema version ID in each category.
SQL Queries
This section contains topics about using SQL Queries in the Internal Setup Utility.
In This Section
Executing SQL Commands ........................................................... 53
Execute a SQL Command ............................................................. 53
Examples of SQL Commands ....................................................... 54
Save SQL Results in a Specified File Format ............................... 54
Commands and Controls ............................................................... 55
You can save a result in the original format as an SQL file under the name of the table that you
specified in the Select command. When you run the SQL file, it creates the table. You can
delete all the data except for the set of values under the first insert into section and run the file
as a script to insert the zero (default) line if it is missing. This is a requirement for making
correct validations in Sybase Adaptive Server Anywhere.
If you save SQL results in SQL format and you intend to open the SQL file in the Internal Setup
Utility later, make sure you select the correct encoding, which is Unicode LE.
Original
Saves the data in all the fields, including internal database ID numbers and so forth. This option
is recommended if you want to save the file in . psr, .xls, or .sql format, or if you want to re-import
the data into SmartPlant Instrumentation at a later stage.
Data only
Saves only the report data that is visible in the preview. This option is recommended for easier
viewing of the data, and enables you to manipulate the headers and select the columns you want
to display.
Include headers Allows you to include the column headers in the new file you are
saving. This option is available only if you selected Data only.
Edit headers Opens the Edit Column Headers dialog box where you can edit the column
headers SmartPlant Instrumentation saves in the new external file. This option is available only if
you selected Data only and Include headers.
ODBC Profiles
SmartPlant Instrumentation uses an ODBC profile when connecting to a SmartPlant
Instrumentation database on SQL Server or Sybase Adaptive Server Anywhere. When you
install SmartPlant Instrumentation on SQL Server or Sybase Adaptive Server Anywhere, the
software automatically creates an ODBC profile on your client machine. The created profile type
is System DSN, which allows every user working on this machine to connect to the database using
this profile. You do not need to configure this profile to connect to SmartPlant Instrumentation.
To ensure that you do not receive errors when opening a domain from your database, in the
[Database] section of the Intools.ini file, the ServerName parameter must have the same
value as <ODBC profile name> in the ODBC connection string.
You must use your tools to create an ODBC profile if you want to connect from your client
machine to another SmartPlant instrumentation database residing on a different machine.
You can also configure the profile using the Windows Control Panel, Data Sources option,
on the System DSN tab or User DSN tab.
If a database profile row already exists in the intools.ini file, the Internal Setup Utility adds the
profile as a new DBParm row, for example, for a Sybase Adaptive Server Anywhere ODBC
profile, the following row is added:
DBParm=ConnectString='DSN=TEST;UID=IN_DBAMN;PWD=IN_DBAMN'
If there are more than three rows representing database profiles, the Internal Setup Utility
deletes the first row from the intools.ini file when adding the new row.
Service Operations
This section contains topics about various service operations performed in the Internal Setup
Utility.
This procedure should only be carried out when you are specifically instructed to do so by
Intergraph Support.
Make sure that all users have logged out of the SmartPlant Instrumentation database before
starting this procedure. When you start rebuilding stored procedures and triggers, no users
should attempt to log on to SmartPlant Instrumentation.
When rebuilding stored procedures and triggers of the Admin schema, the Domain list is
redundant.
If the process stops for any reason, you can restart the process and the process continues
from where it stopped. If you get an error that cannot be corrected, contact Intergraph
Support with the error description. It is recommended that you have your log file
available when contacting Intergraph Support.
4. On the Rebuild Stored Procedures dialog box you can click Browse to specify the log file
path and filename, if you do not want to use the default Log.txt file. This file contains
information of the current session and any errors that may have occurred in previous
sessions. The log file is concatenated, if you use the same log file name.
5. Click OK to start rebuilding the stored procedures and triggers of the selected schema.
At the end of the process, an appropriate message is displayed and an additional log file
Logerror.txt is generated in the SmartPlant Instrumentation home folder. The data in the
Logerror.txt file is incremented between sessions. Send the Logerror.txt file to Intergraph
Support after you complete the process.
See Also
SmartPlant Instrumentation Database Schemas (on page 38)
Connecting to the SmartPlant Instrumentation Database (on page 42)
Printer settings
Displays the current printer settings after you click Test.
Printer name Displays the name and model of the printer.
Horizontal resolution Displays the horizontal resolution of your printer in dpi (dots per inch).
Vertical resolution Displays the vertical resolution of your printer in dpi.
Port Displays the port connecting your computer to the printer.
Paper width Displays the width of the paper you selected in setup.
Paper height Displays the height of the paper you selected in setup.
Paper size Displays the name of the paper-size you selected, for example: A4, Letter, with the
appropriate dimensions.
Print driver Displays the name of the driver file you set for this printer on your computer.
Printing orientation Displays Portrait or Landscape selected, according to the print setting.
Make sure that all users have logged out of the database before rebuilding stored
procedures and triggers. When you start rebuilding stored procedures and triggers, no users
should attempt to log on to SmartPlant Instrumentation.
C
comments on documentation 5
configuration and maintenance 7
overview 7
consulting services 5
customer support 5
D
documentation comments 5
L
logon data 32
M
multi-user strategy 31
S
security 32
T
technical review 31, 32, 33
logon data and security 32
multi-user strategy 31
other database objects 33
technical support 5