Network Management

 View Only

Inconsistent SQL database and file naming conventions in the latest IMC 7.1

This thread has been viewed 0 times
  • 1.  Inconsistent SQL database and file naming conventions in the latest IMC 7.1

    Posted Apr 13, 2015 06:18 PM

    Greetings,

     

    Just had to post this after going through the trouble to move all my IMC SQL log files to their own partition like they should be.. unfortunately IMC setup does not allow you to set log file locations or database naming standards. This might be acceptable for a freeware app, but this is far from freeware. I assume it is because they have different groups working on all the different pieces and they don't talk to each other or follow naming standards.

     

    Below is the T-SQL to change the location of log files for all 12 databases including an option wlan module. This is still a very manual process which would be made easier if programmers used consistent naming conventions for database and file names.

     

    Hey HP please set some consistent standards for all your IMC pieces... or even better let us dumb users specify log file locations during setup!

     

    T-SQL to move the logfiles from the E: drive to L: drive.. you have to manually select snipits below to detach each DB, manually copy logfile then attach the database... drag

     

     

    --config_db

    Use MASTER
    GO
    ALTER DATABASE config_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'config_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    USE master
    GO

    sp_attach_DB 'config_db',
    'E:\MSSQL\IMCData\config_db01.mdf',
    'L:\MSSQL\logs\config_db_log01.ldf'
    GO

    use config_db
    go

    sp_helpfile
    go



    --icc_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE icc_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'icc_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    USE master
    GO

    sp_attach_DB 'icc_db',
    'E:\MSSQL\IMCData\icc_db01.mdf',
    'L:\MSSQL\logs\icc_db_log01.ldf'
    GO

    --invent_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE invent_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'invent_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    USE master
    GO

    sp_attach_DB 'invent_db',
    'E:\MSSQL\IMCData\invent_db01.mdf',
    'L:\MSSQL\logs\invent_db_log01.ldf'
    GO


    --monitor_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE monitor_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'monitor_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    USE master
    GO

    sp_attach_DB 'monitor_db',
    'E:\MSSQL\IMCData\monitor_db01.mdf',
    'L:\MSSQL\logs\monitor_db_log01.ldf'
    GO

    --perf_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE perf_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'perf_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    USE master
    GO

    sp_attach_DB 'perf_db',
    'E:\MSSQL\IMCData\perf_db01.mdf',
    'L:\MSSQL\logs\perf_db_log01.ldf'
    GO

    --report_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE report_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'report_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- Now HP's file naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'report_db',
    'E:\MSSQL\IMCData\report_db01.mdf',
    'L:\MSSQL\logs\report_db_log01.ldf'
    GO

    --reportplat_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE reportplat_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'reportplat_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- Now HP's file naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'reportplat_db',
    'E:\MSSQL\IMCData\reportplat_db01.mdf',
    'L:\MSSQL\logs\reportplat_db_log01.ldf'
    GO

    --unba_master

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE unba_master
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'unba_master'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- Now HP's file and database naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'unba_master',
    'E:\MSSQL\IMCData\unbamaster_db01.mdf',
    'L:\MSSQL\logs\unbamaster_db_log01.ldf'
    GO

    --unba_slave

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE unba_slave
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'unba_slave'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- Now HP's file and database naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'unba_slave',
    'E:\MSSQL\IMCData\unbaslave_db01.mdf',
    'L:\MSSQL\logs\unbaslave_db_log01.ldf'
    GO

    --vlanm_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE vlanm_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'vlanm_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- And again, this time they drop the numeric! Hard to believe it even changes again!! Now they drop the underscore! HP's file and database naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'vlanm_db',
    'E:\MSSQL\IMCData\vlanm_db.mdf',
    'L:\MSSQL\logs\vlanm_db_log.ldf'
    GO


    --wips_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE wips_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'wips_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- Now it is back to the proper standard.. jeesh guys

    USE master
    GO

    sp_attach_DB 'wips_db',
    'E:\MSSQL\IMCData\wips_db01.mdf',
    'L:\MSSQL\logs\wips_db_log01.ldf'
    GO

    --wlan_db

    -- Set database to single user mode
    USE master
    GO
    ALTER DATABASE wlan_db
    SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
    GO

    -- Detach the database
    sp_detach_db 'wlan_db'
    GO

    -- !!! Now copy old log file to new location then Attach the database
    -- And again they go back to numeric! Hard to believe it even changes again!! Now they drop the underscore! HP's file and database naming convention falls on its face! Who checked this stuff??? Changed logfile names to be consistent!!

    USE master
    GO

    sp_attach_DB 'wlan_db',
    'E:\MSSQL\IMCData\wlan_db01.mdf',
    'L:\MSSQL\logs\wlan_db_log01.ldf'
    GO

     

     

    Thank you!

    Ron