Database Functions/Utilities
Removing Company ZZ
CMiC software installs with a pre-defined company ZZ already setup. This is done on purpose. It allows new clients to run the system without having to know how to setup a company. This makes it easier for CMiC consultants to show the system, and discuss different areas, aspects, and relationships between the modules.
At some point, during the installation and training process some companies would like to see company ZZ removed from their system, as they have now defined their own companies.
Procedure
Before beginning, find out into which syscontact company the user DA is to be placed. The desired company must already have been set up in the database (da.company) before beginning. Further, the Login screen for each and every user (for each application), which uses ZZ company as the default, must have been manually corrected before proceeding.
The system ships with scripts named UTDELCO.sql and UTDELCO_SAMPLE.sql which reside in the SQL directory. Make sure there is nothing else running (no one else is using the system) when running these scripts. The version of UTDELCO_SAMPLE.sql must be dated 2008 or later. CMiC recommends to contact support before running the script.
-
On the Application Server create a temporary working directory.
-
Open a DOS Prompt in the temporary working directory (making it the current directory).
Part I
-
Copy UTDELCO_SAMPLE.sql into the temporary working directory:
Copycopy D:\CM\V12\PROD\SQL\UTDELCO_SAMPLE.sql
-
Load the copied UTDELCO_SAMPLE.sql into an editor, enter the value for C_new_comp_code, and save.
-
Start SQL Plus by issuing the following command at the DOS prompt:
Copysqqlplus
-
Login as the user DA to the database where company ZZ is to be removed.
-
Start utdelco_sample.sql.
-
When the script finishes running, “rollback;” if any errors or invalid data has been displayed, else, “commit;”
-
In either case, execute (copy and paste) the two commands that the script displays on the screen at the end. If there are any errors when executing the pasted commands, correct the errors and try this step again.
-
When there are no more errors, proceed to Part II.
Part II
-
Exit sqlplus to be in the temporary working directory.
-
Set the SQL path correctly by issuing the following command at the DOS prompt:
CopySet SQLPATH=.;D:\CM\V12\PROD\SQL;
-
Start SQL Plus by issuing the following command at the DOS prompt:
Copysqlplus
-
Login as the user DA to the database where company ZZ is to be removed.
-
At the SQL prompt, type in the following statements:
Copybegin
execute immediate 'purge recyclebin';
end;
/
Start utdelco.sqlUtdelco.sql will create a secondary script in the working directory called utdelcox.sql that contains the delete statements.
-
Start utdelcox.sql
This script creates an ouput LST file UTdelcox.lst.
-
Review the file UTdelcox.lst – if it has no error messages, you are done. If not, then repeat step 6 (or in rare cases, go back to step 5 in Part I if necessary) until the output file is clean. It depends on the usage of company ZZ as to how many times UTDELCOX.sql needs to be run. It will normally run clean within four runs. If it takes more than four runs and it is still not clean, contact CMiC Support.