Video Screencast Help
Search Video Help Close Back
to help

Shrink the Symantec Endpoint Protection Manager 12.1 embedded database

Created: 26 Mar 2012 | Updated: 06 Feb 2013 | 48 comments
Elisha's picture
+14 14 Votes
Login to vote

We have created a tool based on customer demand to shrink the Symantec Endpoint Protection Manager 12.1 embedded database.  Here are the steps to use this tool:

1. Backup your database.

Before running this tool, please backup the DB manually by stopping the Symantec Endpoint Protection Manager service and copying the sem5.db and sem5.log from "..\Symantec\Symantec Endpoint Protection Manager\db\"  to another folder. You can copy them back and start the SEPM service and embedded database service to restore the previous SEPM status.

2. Copy this tool into the "Tools" folder of the SEP Manager.

Copy the file ShrinkEmbeddedDB.bat and ShrinkEmbeddedDB.jar to folder "..\Symantec\Symantec Endpoint Protection Manager\Tools\".

3. Double click file ShrinkEmbeddedDB.bat or run it from a command window.

4. Follow the prompt of the tool to delete the sem5.db.bak and sem5.log.bak after shrinking the database successfully.

** Updated to work with SEPM 12.1.2 (RU2) **

Legal: Symantec shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with your use of or reliance of this tool.

Comments 48 CommentsJump to latest comment

Srikanth_Subra's picture

Thanks for sharing the tool, but having one doubt that shrinking of db will create any performance issues?

Thanks & Regards,

 Srikanth.S

"Defeat the Defeat before the Defeat Defeats you"
(Swami Vivekananda)

0
Login to vote
Elisha's picture

No.  Shrinking the database will not create performance issues.  In fact in many cases it will make the database run faster.  What happens is that over time data is added to the database and then removed from the database causing the database file to bloat.  This bloat can cause performance issues.  This tool will rebuild the database file, reducing the bloat and causing the data to be contiguous.

0
Login to vote
ken43's picture

I downloaded the zip file to fun the program, but when I try to extract it is asking for a password to extract the files?

0
Login to vote
Elisha's picture

Ok.  I reposted it.  This time without the password.

0
Login to vote
Srikanth_Subra's picture

Ok..Thanks for the reply.

Thanks & Regards,

 Srikanth.S

"Defeat the Defeat before the Defeat Defeats you"
(Swami Vivekananda)

0
Login to vote
LeeD's picture

Awesome Tool for SEP 12.1

Thank you,

Dorothy

0
Login to vote
consorcisg's picture

Thank you for the tool. Any way to specify another temp folder for the temporary files created by shrink? We have the HD absolutelly full by the DB, and the only way to have free space is using external disk.

Thank you

+1
Login to vote
Welsh's picture

This question needs to be answered!

0
Login to vote
Elisha's picture

Unfortunately there is no way to change the temp folder for this tool.  You need to make sure that you have enough disk space before running this tool.

0
Login to vote
oxbow's picture

Shrinking stopped in the end with the message:

error at line 1 cannot open transaction log file -- sem5.log

Any info what could be the problem?

 

 

0
Login to vote
Elisha's picture

What version of the Symantec Endpoint Protection Manager are you using and what operating system do you have the SEP Manager installed on?

Try stopping the SEP Manager and copying the sem5.db and sem5.log files to a separate folder first before running the tool.

0
Login to vote
oxbow's picture

OS: Win2008R2 SP1
Manager: 12.1.1000.157 (RU1)
 

Manager was stopped and database service also.
Without stopping DB service i could not copy log file to separate folder.

0
Login to vote
Adrenaline_X's picture

I can't get this tool to work.

 

I did as the article suggested, made backup of log and db, but when i run the tool i get "failed to unload DB" error.

 

Shows the unloading DB gets to 55% and then dies.

 

+1
Login to vote
Elisha's picture

Try stopping the SEP Manager and copying the sem5.db and sem5.log files to a separate folder first before running the tool.

0
Login to vote
PollockBP's picture

I'm getting the same error.  I stopped the SEPM service and the embedded database service.  Created a subfolder (C:\Program Files\Symantec\Symantec Endpoint Protection Manager\db\Backup DB) and then copied sem5.db and sem5.log to that folder.  When I run the tool it stops with the error "Failed to unload DB".  SEPM service and the embedded database service are stopped after the error.

0
Login to vote
Adrenaline_X's picture

i did.

And copied the files to a different folder.. Not sure why copying the sem5.db and sem5.log files makes any difference.. the tool doesn't ask which files to load.

Unless you mean move the files.

 

0
Login to vote
xbrandon's picture

Will it work in Symantec endpoint protection small business edition 12 (where SPC is the management console)?

Does it decrease the size of the database?

0
Login to vote
Elisha's picture

It will work on SEP 12.1 Small Business Edition (SBE).  It will not work on SEP 12.0 SBE.

It can reduce the size of the database file in cases where the database file has gotten bloated.  However it will not reduce the amount of data that is in the database itself.

0
Login to vote
xbrandon's picture

Thank you for your answer.

One last question, will the memory usage of the DBSRV9 reduce as well? 

0
Login to vote
Elisha's picture

No.  This is not intended to reduce the memory usage of the Embedded database.  The memory usage of the Embedded database is configured based on how many users you selected when you installed the product.  Note: if using the SBE version it will be set to 256MBs.

0
Login to vote
Chetan Savade's picture

Thanks Elisha for providing this tool. It's great help to the support team.

 

Chetan Savade
Technical Support Engineer, Endpoint Security
Enterprise Technical Support
CCNA | CCNP | MCSE | SCTS |

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.&

0
Login to vote
tombaby's picture

 

Dear All ,

Our SEPM 12.1 was working perfectly , from yesterday started the problem,   Symantec  Embedded  Database services not starting  ( no any error message) . I have downloaded  the tool and run with the instruction  , but I  am getting error “ fail to unload DB”

Anyone can help us  from  this  situation , it should be a great appreciate 

Regards 

Tom

0
Login to vote
Ashish-Sharma's picture

hi,

Sure we will help you with that, But do you mind creating a new thread for this.

Thanks In Advance

Ashish Sharma

SEPM Knowledgebase Documents  

 

0
Login to vote
tombaby's picture

Dear Ashish,

Thanks for your quick response, request you to kindly go ahead to the new thread 

 

Best Regards

0
Login to vote
Welsh's picture

We also have this issue..

I have now run the shrink.dbf ansd its errored out onec with "lack of space"!!!!!

We have now deleted the two backups stored localy and re-run..

It is now stuck at 10% progress and the disk space is running out again!!!!!

Symantec, you need to provide more information on what this shrink actually does before advising users to rune it!!!

I am now stuck here waiting for it to fail again when the disk space has been depleted, again..

Any assistance ASAP would be greatly appreceated..

E.g How much space do we require to run this fix in the 1st instance is a good 1st question..

Regards,

DaveW...

0
Login to vote
ub40's picture

I have negative experience....

For shrink db with size 12 999 MB toll was demanded 38 GB free disk space.

After completion tools work db size growth to 13 011 MB.

Regards.

Victor

 

0
Login to vote
Elisha's picture

Hello Victor,

This tool will free up unused space from the database file.  Since your database file did not have any unused space it could not make the database file any smaller.

In your case it increased the size by 12MBs which is one tenth of one percent (0.1%).  This is normal, as the tool will rebuild the database file from scratch and when this happens the database will reserve room between each table in the database to allow additional data to be inserted later, this way the tables won't get as fragmented when they grow.

Thanks,

0
Login to vote
ttrodatt's picture

Is there a way to rebuild the sem5.db from the unloaded data stored during the shrinkembeddeddb.bat process? I have a folder full of what seem to be juicy files and information waiting to be loaded back into a database...

I'm just not readily aware of a process list to do so.

No, during the backup process, the sem5.db.bak was lost, so I do not have that.

When I attempt to recover from the symantec recovery application it errors on the connection.

0
Login to vote
Kaz Fernandes's picture

I've followed the instructions above, but when I run the ShrinkEmbeddedDB tool it halts at the "detectBackupFile" step, with the following message:

Detect bak DB file ...

(It's been stopped at this step for several hours now.)

The SEP software has used 264 GB of the 280 GB available on the hard disk, which (needless to say) is absolutely ridiculous. As a result, the mail server has stopped working and the customer is not receiving work-related emails - which is obviously having a serious impact on their business.

Is there a way to get this tool to run properly, or should we just uninstall the product and get the customer to use a less-bloated software security product? (such as Avira)

0
Login to vote
Elisha's picture

Hello Kaz,

The SEPM database should not be using that much disk space.  It could be quite fragmented  If the customer is using SEP 12.1 then you could follow these steps (note some customer data will get lost here):

1. Export each of the policies out of SEPM.

2. Uninstall SEPM and delete the database file.  Make sure to to keep the Recovery File, this is needed to restore client communicating.

3. Install SEPM using the Recovery File.

4. Import the policies back into SEPM

If you are still having issue feel free to contact me offline by sending me a message via SymConnect.  I can help you with this.

Thanks,

Elisha

0
Login to vote
Reisenberger's picture

I tried shrinking the dataqbase, receive the following error:

"C:\Program Files (x86)\Symantec\Symantec Endpoint Protection Manager\Tools>Shr
kEmbeddedDB.bat
java.io.IOException: Couldn't get lock for C:\Program Files (x86)\Symantec\Sym
tec Endpoint Protection Manager\Tools\..\tomcat\logs\scm-server-%g.log
        at java.util.logging.FileHandler.openFiles(FileHandler.java:372)
        at java.util.logging.FileHandler.<init>(FileHandler.java:306)
        at com.sygate.scm.server.util.ServerLogger.<clinit>(ServerLogger.java:
9)
        at com.sygate.scm.tools.db.ShrinkEmbededDB.initLogger(ShrinkEmbededDB.
va:75)
        at com.sygate.scm.tools.db.ShrinkEmbededDB.main(ShrinkEmbededDB.java:9

Exception in thread "main" com.sygate.scm.server.util.ScmServerError: java.io.
Exception: Couldn't get lock for C:\Program Files (x86)\Symantec\Symantec Endp
nt Protection Manager\Tools\..\tomcat\logs\scm-server-%g.log
        at com.sygate.scm.server.util.ServerLogger.<clinit>(ServerLogger.java:
4)
        at com.sygate.scm.tools.db.ShrinkEmbededDB.initLogger(ShrinkEmbededDB.
va:75)
        at com.sygate.scm.tools.db.ShrinkEmbededDB.main(ShrinkEmbededDB.java:9

Caused by: java.io.IOException: Couldn't get lock for C:\Program Files (x86)\S
antec\Symantec Endpoint Protection Manager\Tools\..\tomcat\logs\scm-server-%g.
g
        at java.util.logging.FileHandler.openFiles(FileHandler.java:372)
        at java.util.logging.FileHandler.<init>(FileHandler.java:306)
        at com.sygate.scm.server.util.ServerLogger.<clinit>(ServerLogger.java:
9)
        ... 2 more

"

I tried copying the sem5.db and .log for to a different directory (not sure what copying the file accomplishes in the first place, but hey).. made no difference.

 

Any help is appreciated

0
Login to vote
pkecun's picture

I've had success using this tool in the past but doesn't seem to work with SEP 12.1 RU2. Any chance of this being updated?

Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB initLogger INFO: logger initialized ...
Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB shrinkDB INFO: shrinkDB: Start to shrink DB.
Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB getDBProperties INFO: getDBProperties: The JDBC driver class is: sybase.jdbc4.sqlanywhere.IDriver
Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB getDBProperties INFO: getDBProperties: The JDBC url is: jdbc:sqlanywhere:CommLinks=tcpip(dobroadcast=none;host=localhost;port=2638;verify=no);ServerName=localhost
Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB checkDBType INFO: checkDBType: The DB is not embeded DB
Dec 31, 2012 3:34:04 PM com.sygate.scm.tools.db.ShrinkEmbededDB shrinkDB INFO: shrinkDB: The current DB is not Embeded DB! Cannot shrink this DB!

I'm guessing this is because the embedded database server has switched from "Adaptive Server Anywhere 11.0.1.2472" in SEPM 12.1.1101.401. RU1 MP1 to "Embedded (SQL Anywhere) 12.0.1.3551" in SEPM 12.1.2015.2015.
0
Login to vote
pete_4u2002's picture

this is fixed in latest version, why do you want to run on SEP 12.1 RU 2?

0
Login to vote
pkecun's picture

Because once you've done numerous SEPM upgrades and removed the many (no longer needed) older installation packages, the DB file itself doesn't automatically shrink (unless there's another automated process somewhere, didn't see anything in the SEPM console)

It isn't a big deal most of the time, the re-index and truncate are working as expected, I was just trying to avoid database bloat as I have several installations I've inheritied that are installed on smaller partitions and for one reason or another (mostly politic) moving the installation to a different partition isn't feasible so I've got to keep the size down.

0
Login to vote
pete_4u2002's picture

actually you have got the answer in your previous thread i.e. about different version.
with RU 2 you have to rely on the DB maintenance.

0
Login to vote
Elisha's picture

We are working on an update for this tool that works on SEP 12.1 RU2.

0
Login to vote
pkecun's picture

That's great to hear. Thanks for the update, keep up the great work!

0
Login to vote
Elisha's picture

I updated the tool to work with SEPM 12.1.2 (RU2).

+1
Login to vote
Nguyen Cao's picture

Thanks Elisha for your update. It works properly on our SEPM 12.1.2 (RU2)

0
Login to vote
Gai-jin's picture

I've just tried running this tool on our server, and got an error when Reloading DB.  The progress bar is at 80%, and a window came up titled dbisqlc, with this text:

Error in file: "C:\program files (x86)\Symantec\Symantec Endpoint Protection Manager\dbdump\reload.sql" at line 9100 

Table 'mt' not found

The window has Continue, Stop, and Exit buttons.  I hit continue, but it doesn't seem to be doing anything at this point, the progress bar hasn't moved since the error came up.

 

Edit: Okay, a few minutes after posting, the progress bar moved on and I got a notice that the shrink completed successfully.  Based on that error message, should I restore the old db files at this point to avoid db issues related to this error, or is the shrunken db ok to use?

+1
Login to vote
pkecun's picture

I've experienced the same thing but not at every site so not sure if it's DBUnload or a problem with the DB.

If you edit the reload.sql file after DBUnload has finished dumping, you can see that the section to create the mt table is commented out..

 

-------------------------------------------------
--   Create tables
-------------------------------------------------
 
----CREATE TABLE "DBA"."mt" (
----    "id"                             integer NULL
----   ,"name"                           char(20) NULL
----)
----go
----

but further down it tries to load into the table..

 

LOAD TABLE "DBA"."mt" ("id","name")
    FROM 'C:/Program Files (x86)/Symantec/Symantec Endpoint Protection Manager/dbdump/703.dat'
    FORMAT 'TEXT' QUOTES ON
    ORDER OFF ESCAPES ON
    CHECK CONSTRAINTS OFF COMPUTES OFF
    STRIP OFF DELIMITED BY ','
    ENCODING 'UTF-8'
go
 

Despite having that problem, I've kept a backup and left the shrunk DB in place. If I experience any strangeness, will let you know.

0
Login to vote
Elisha's picture

Hello pkecun, would you be able to send me a copy of your database that has this issue?  Our development team would like to look at it to see what the issue is.

0
Login to vote
dhenard's picture

I too am having this issue although every time I would hit exit.  I ended opening a case to try and solve it.  The case number was 04182597, but is now closed and it was unresolved.  Would you like me to also send you a copy of my database?  I also have a screenshoot of the commandline as well.  Thanks for your help.

0
Login to vote
dowlingm's picture

I've also seen this this morning.

0
Login to vote
Elisha's picture

The tool is looking for a table called "mt".  However this table is not needed and the tool will to run fine once you click "Continue" on this error.  You can safely ignore the "Table 'mt' not found" error message.

+1
Login to vote
subhashsa222's picture

Dear All,

please suggest what information contain sem5.log file.
in my condition its size is 159 GB. kindly suggest what i should do.

----subhash

Regards
Subhash

0
Login to vote
Elisha's picture

It looks like the transaction log has not been truncated.  I recommend logging on to the management server console, going to the Admin --> Servers tab and clicking on the database node from the Servers tree.  From there you can run the "Truncate Transaction Log Now" task.  This should shrink that file.

Once you have done that I recommend that you click "Edit the Database Properties" and enable the two Database Maintenance Tasks and chose a schedule for them run on a regular basis.  The recommended setting is to truncate the transaction log daily and rebuild the indexes once a week.

0
Login to vote