Database user passwords are currently stored as plain text in configuration files. To store encrypted passwords, proceed as follows:
-
Launch SQL*Plus and connect to your database as M_SYS.
-
Execute this command to get the encrypted password of M_SERVICE user:
select M_PCK_DB.epa('PASSWORD') from dual;
For example:
SQL> select M_PCK_DB.epa('PASSWORD') from dual;
M_PCK_DB.EPA('PASSWORD')
-------------------------------------------------
aw7ZXJ234XD
-
Open the databases.xml file, which can be found at:
<Product root>\DeploymentFolder\databases.xml
You can find user and password in the <Databases> section, for example:
<?xml version="1.0" encoding="utf-8"?>
<Databases>
<database name="XYZ" user="M_SERVICE" psw="HUGO" />
</Databases>
-
Remove psw attribute and add psw2 attribute with the encrypted password selected with the SQL statement above, for example:
<database name="XYZ" user="M_SERVICE" psw2="aw7ZXJ234XD" />
-
Additionally, the encrypted password is stored in the web.config file, which can be found at:
<Product root>\Web\DataBrokerService\Web.config
You can find user and password under SmartPlantDefaultConnection, for example:
<SmartPlantDefaultConnection>
<add key="Database" value="TEST" />
<add key="User" value="M_SERVICE" />
<add key="Password" value="HUGO" />
</SmartPlantDefaultConnection>
-
Remove Password and add Password2 with the encrypted password, for example:
<SmartPlantDefaultConnection>
<add key="Database" value="TEST" />
<add key="User" value="M_SERVICE" />
<add key="Password2" value="aw7ZXJ234XD" />
</SmartPlantDefaultConnection>
Each time the M_SERVICE password changes this procedure must be applied again.