SQL Queries - Common SQL Queries - How to check the database migration history

Purpose of Query

The queries below will allow you to see all the migration history of a particular CAST database, as well as check the migration history for a specific CAST database type (local, central, or management).

Applicable CAST Version
Release
Yes/No
8.3.x(tick)
8.2.x(tick)
8.1.x(tick)
8.0.x(tick)
7.3.x(tick)
Applicable RDBMS

 

RDBMS
Yes/No
Oracle Server(question)
Microsoft SQL Server(question)
CSS3(tick)
CSS2(tick)
Query for CSS

Use the query below to check the general migration history information for all components of a database. Ignore results whose revision is '-1.-1.-1.-1'

SELECT *
FROM   sys_package_history;
Query result example
 ...

"CORE_PMC";"8.2.0.1375";0;"2017-01-12 20:17:35.331";"CAST 8.2.0 ( Build 1375 )"
"PMC";"7.3.0.1";0;"2017-01-12 20:17:35.334";"CAST 8.2.0 ( Build 1375 )"

...
Query result interpretation

The query results above will list the history of all components, their versions, the date of the installation, and the installer used during the installation.

Be careful in examining these as some components may not have values that correspond to the CAST version number, like the PMC component does in the results above.

If you are not familiar with the results returned, you may want to try the query below which will provide a more simple result for examination by comparing just one component on a database over the history of the migration.

 

Use the Query Below to check the migration history of a particular central, local, or management CAST database. For local, replace XXXXX in the query below with ADG_LOCAL_APPW; For central, replace XXXXX in the query below with ADG_FULL_CENTRAL; For management, replace XXXXX in the query below with PMC_MAIN

SELECT package_name ,
       revision     ,
       revision_type,
       revision_date,
       installer
FROM   sys_package_history
WHERE  package_name = 'XXXXX'
AND    revision    != '-1.-1.-1.-1'
Query result example
 

"ADG_FULL_CENTRAL";"7.0.5.1";0;"2012-04-16 09:19:29.062";"CAST 7.0.5 ( Build 3708 )"
"ADG_FULL_CENTRAL";"7.0.8.1";0;"2012-10-02 10:39:38.274247";"CAST 7.0.8 ( Build 3998 )"
"ADG_FULL_CENTRAL";"7.3.5.1";0;"2016-02-01 15:55:03.658702";"CAST 7.3.5 ( Build 7496 )"
"ADG_FULL_CENTRAL";"8.2.1.1";0;"2017-03-08 13:01:07.103";"CAST 8.2.1 ( Build 1425 )"

Query result interpretation
 The query results above are for a central (ADG_FULL_CENTRAL) and indicate that the central database was created on 7.0.5, then migrated to 7.0.8, then migrate to 7.3.5, and finally migrated to 8.2.1
Query for Oracle
Enter the SQL query
Query result example
 
Query result interpretation
 
Query for SQL server
Enter the SQL query
Query result example
 
Query result interpretation
 
Notes/comments
 

 

 

Related Pages