Stopping TM1 services

Post Reply
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Stopping TM1 services

Post by Ajay »

Hi All,

I have a dos shell which is supposed to stop services and then create a folder and backup my data directory.

It is working but one thing I noticed was that despite my commands to stop the three services when I looked in "Services" I could still see a "started" status against the TM1 Admin Server (x64) service.

The command i am using in my dos shell is only:

NET STOP TM1SERV2 /Y
NET STOP TM1EXCELSERVICE /Y
NET STOP TM1ADMSDX64 /Y

Is there perhaps a certain order in which these need to be run as I've tried it a few times this evening and none seems obvious ? or am I missing a trick ?

I am stopping the services, then copying the data directory, then rebooting the machine. I have noticed in the event viewer that an error does occur (although i assume bypassed) on the restart where the event properties description for the TM1ADMSDX64 service gives me a "C12) Log File exists. Do you want to recover changes ?", which I thought is happening becasue it didn't stop correctly before the reboot.

For info I am running 9.0 Sp3 U7 on 64bit server.

Any help would be gladly welcome

Thanks
Ajay
User avatar
Daniel Lennon
Posts: 6
Joined: Fri May 30, 2008 6:33 am
OLAP Product: TM1
Version: 9.1 SP2 Build 9.1.2.49
Excel Version: 2003 2007
Location: Sydney, Australia

Re: Stopping TM1 services

Post by Daniel Lennon »

Hi Ajay,

Are you running a 'Save Data' before the batch file runs?

I am wondering if the service starts a Save Data when it is issued the stop command but then the OS is terminating the service before the Save Data has finished?

Hope that helps.

Kind Regards,
Daniel.
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Re: Stopping TM1 services

Post by Ajay »

Hi Daniel

I do have a SaveData Process running 30 mins before I stop the services, but there is normally never any traffic at that time of the night.

I've copied the .bat below, just in case there is something else

Ajay



REM Ajay Chandhok 26-MAY-2008
REM =========================
REM Following batch job is designed to stop TM1 services and then backup the
REM data directory from production TM1 (UK-BASA-APP007) to the development
REM server (UK-BASA-APP006). Production server is then rebooted.

REM Stop all TM1 services before backing up all data
REM ------------------------------------------------
NET STOP TM1SERV2 /Y
NET STOP TM1EXCELSERVICE /Y
NET STOP TM1ADMSDX64 /Y

REM Move to the Backup area
REM -----------------------
R:
CD R:\Server9\PRODBACKUP

REM Set up date/time variables
REM --------------------------
set YYYY=%Date:~-4,4%
set MM=%Date:~-7,2%
set DD=%Date:~-10,2%
set HH=%Time:~-11,2%
set MI=%Time:~-8,2%
set SS=%Time:~-5,2%

REM Force Hours to have leading zero
REM --------------------------------
set /a lzHH=%HH+100
set HH=%lzHH:~-2,2%

REM Create unique name to hold backup
REM ---------------------------------
set backup=TM1DATABKUP_%YYYY%%MM%%DD%%HH%%MI%%SS%

REM Create new folder for backup
REM ----------------------------
MD R:\Server9\PRODBACKUP\%backup%

REM Copy data over to new backup folder
REM -----------------------------------
D:
cd D:\Server9
xcopy D:\Server9\TM1DATA R:\Server9\PRODBACKUP\%backup% /S /E /I

REM Restart TM1 Server
REM ------------------
SHUTDOWN /R /F /D P:4:1 /C "Scheduled TM1 Restart"
User avatar
Daniel Lennon
Posts: 6
Joined: Fri May 30, 2008 6:33 am
OLAP Product: TM1
Version: 9.1 SP2 Build 9.1.2.49
Excel Version: 2003 2007
Location: Sydney, Australia

Re: Stopping TM1 services

Post by Daniel Lennon »

Hi Ajay,

I'll have a look at the batch file for you tomorrow.

Are you activating the batch file from TM1? ie. Turbo?

Kind Regards,
Daniel.
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Stopping TM1 services

Post by Steve Vincent »

Ajay,

I'm on 32bit and use a slightly different command to stop the services, but i think you need to put a pause in between each one to allow it time to sort itself out.

Code: Select all

REM Stop the TM1 Services
sc \\GLKAS1025V stop "RP"

sleep 60

sc \\GLKAS1025V stop "TM1ADMSD"
Killing them all in one go is likely to fail, the admin server will not be allowed to stop if there is anything else using it, as a service has that as a dependancy. If you give the service 60 seconds or so to complete any saves and shutdown correctly, the admin server should then shutdown correctly as well.
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
Ajay
Regular Participant
Posts: 183
Joined: Wed May 14, 2008 8:27 am
OLAP Product: TM1
Version: 10.2.0, PA 2.0.9
Excel Version: 2016
Location: London

Re: Stopping TM1 services

Post by Ajay »

Thanks Steve,

I've downloaded the sleep.exe utility and have now inserted a SLEEP 30 line in between the three NET STOPs. Hopefully this should do the trick tonight. Will report back with feedback after the weekend.

Thanks
Ajay
Paul Segal
Community Contributor
Posts: 306
Joined: Mon May 12, 2008 8:11 am
OLAP Product: TM1
Version: TM1 11 and up
Excel Version: Too many to count

Re: Stopping TM1 services

Post by Paul Segal »

As an alternative to the batch file, SyncbackSE from http://www.2brightsparks.com/ is a free and extremely useful sync and backup utility, which has the ability to run the net stops and starts within it, as well as a host of other things. I think it may have been recommended by someone in the old Applix forum.
Paul
Post Reply