Scheduling LID Commands for export/import

 6 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
JoelB
New Member Send Private Message
Posts: 3
New Member

I want to export my Lawson prod DB 2-3 times per week then copy and import the file into a Disaster Recovery productline server at a different site. I'm told Lawson LID doesn't support this type of automation.

I'm using the command: expsysdb -s ProdlineName to-filename.bak

When I tried the command from DOS prompt I get a security error. I am a Domain administrator so that our network shouldn't be the issue. Has anyone been able to run these?

John Henley
Send Private Message
Posts: 3351
You would not schedule via LID. Since you're on Windows you would schedule via Windows Scheduled Tasks.
Thanks for using the LawsonGuru.com forums!
John
John Henley
Send Private Message
Posts: 3351
You would create a batch file or script to set the Lawson environment variables, execute the expsysdb, and copy off the file.
Thanks for using the LawsonGuru.com forums!
John
JoelB
New Member Send Private Message
Posts: 3
New Member

Thanks  John

I'm new to much of this. Can you direct me to some skeleton batch files tha do what I need.

mondrar
Advanced Member Send Private Message
Posts: 35
Advanced Member

I have experimented with the tools Lawson provides for export, import, product line copies, and you are better off using your database native tools. They are much more efficient. What DB are you running? Below is a simple unix export script using Oracle datapump for Oracle 10g. I have another script that cleans up exports and keeps only three in the rotation. If you are looking for a backup strategy, use RMAN, it's great. I have scripts for RMAN as well if you are running Oracle.

#!/bin/ksh
# ******************************************************************
# ******************************************************************
# Lawson Production Oracle Environment Variables
ORACLE_HOME=/oracle/product/10.1.0; export ORACLE_HOME
ORACLE_SID=prod; export ORACLE_SID

# Lawson Developement Oracle Environment Variables
#ORACLE_HOME=/oracle/product/10.1.0; export ORACLE_HOME
#ORACLE_SID=prod; export ORACLE_SID

LIBPATH=$ORACLE_HOME/lib; export LIBPATH
PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/sbin; export PATH

#========================================================
# Nightly Export of PROD, LAWGEN, LAWLOGAN
#
# Frequency : Daily
#========================================================

expdp system/ DIRECTORY=DPUMP_DIR1 SCHEMAS=LAWGEN,LAWLOGAN,LAWPROD DUMPF
ILE=EXPORT.dmp LOGFILE=DPUMP_DIR1:EXPORT.log VERSION=COMPATIBLE PARALLEL=5 ESTIM
ATE=BLOCKS CONTENT=ALL

mondrar
Advanced Member Send Private Message
Posts: 35
Advanced Member

If you insist on using a lawson utility, I prefer the dbdump command. It's faster than the expsysdb command, and a bit more flexible. You will need to create a script with a dbdump command to export each your lawson files individually

dbdump -d prod GLUNITS > GLUNITS.dmp
dbdump -d prod GLUNITSX > GLUNITSX.dmp
dbdump -d prod GLTRANS > GLTRANS.dmp
dbdump -d prod GLTRANSREL > GLTRANSREL.dmp

 

mondrar
Advanced Member Send Private Message
Posts: 35
Advanced Member

Here is a script that will create the dbdump and dbload commands in a file for you. If you are running Windows just change the output file name from .sh to .bat.

Take a look at http://www.schronce.net/lawson/ for more scripts.

count -d mssql prod > prod.count
awk '{print $2}' prod.count > prod.tables
awk '{print "dbdump -d prod",$1,">",$1".dmp"}' prod.tables > proddump.sh
awk '{print "dbload -f prod",$1,$1".dmp"}' prod.tables > prodload.sh