Difference between revisions of "FAQ:NewInstanceMongoDB"

From Wiki_dbSQWare
Jump to: navigation, search
m (Test sendmail (non obligatoire))
 
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Work In Progress
+
[[File:DeclarationInstanceMongoDB.png|thumb]]
 
 
 
==General Information==
 
==General Information==
 
<br>
 
<br>
Line 10: Line 9:
 
Use the sections that apply to your environment and use the match or manual method, as preferred!<br>
 
Use the sections that apply to your environment and use the match or manual method, as preferred!<br>
  
===General MODOP for integrating a new Sybase instance===
+
===General MODOP for integrating a new mongodb instance===
 
There will potentially be one or two connection cases to handle:
 
There will potentially be one or two connection cases to handle:
 
* "local", for Unix machines (or with Cygwin), where you connect to the machine hosting the instance (ssh connection from dbsqware@sqwarebox)
 
* "local", for Unix machines (or with Cygwin), where you connect to the machine hosting the instance (ssh connection from dbsqware@sqwarebox)
Line 22: Line 21:
 
You'll see that these steps can be completed one by one or in batches!
 
You'll see that these steps can be completed one by one or in batches!
  
==Integration of a Sybase Instance==
+
==Integration of a mongodb instance==
  
 
===Setting Up the Environment===
 
===Setting Up the Environment===
 
====General====
 
====General====
 
=====Explanation of "DbAlias" (the unique dbSQWare key)=====
 
=====Explanation of "DbAlias" (the unique dbSQWare key)=====
The dbSQWare key must be unique and consistent with what has been configured for the gvsqw_DbAlias ​​variable in sqwsyb_GlobalVar.cfg!<br/>
+
The dbSQWare key must be unique and aligned with the value configured for the gvsqw_DbAlias variable in the sqwmng_GlobalVar.cfg file.<br/>
There are roughly two cases...<br/>
+
We will use a variable named MNG_SID, which has no intrinsic value for MongoDB but is used to identify the instance within dbSQWare.<br/>
*Your DSQUERYs are unique across the entire database => gvsqw_DbAlias='$DSQUERY'
+
By convention, the format often used is MNG + "_" + APPLICATION + "_" + ENV.<br/>
*You have "duplicate" DSQUERYs => gvsqw_DbAlias='$DSQUERY:$(hostname|cut -d '.' -f1)'
+
Examples: MNG_APP_DEV...<br/>
+ any other cases that may arise or that "suit you" !<br/>
+
But this is not mandatory — you are free to choose whatever suits you best!<br/>
 +
You just need to define the MNG_SID variable in the profile of the mongodb account (or another user) with the desired value.<br/>
 +
 
 +
====Status explanation====
 +
*An instance will be handled in "local" mode, meaning that psql will be used to connect locally on the machine hosting the instance (via SSH access from dbsqware@sqwarebox), with status set to ON.
 +
*An instance for which there is no local Unix access will be managed in "remote" mode (e.g., Windows, RDS, etc.), with status DIST.
 +
*The OFF status makes the instance "disappear" from the web interface.
 +
*The NEW status is used as an intermediate state during the initial configuration of a new instance.
 +
*All other statuses (notably KEEP) allow the instance to appear in the repository but will not be included in automated processes.
 +
 
  
=====Status Explanation=====
 
*A "classic" instance will be processed in "local" mode, meaning that the user will connect locally to the machine hosting the instance (SSH access from dbsqware@sqwarebox), status "ON".<br/>
 
*An instance without local UNIX access will be processed in "remote" mode (Windows style, RDS, etc.), status "DIST".<br/>
 
*The "OFF" status makes the instance "disappear" from the web view.<br/>
 
*The "NEW" status is used as an intermediate status between the start and end of the configuration of a new instance.<br/>
 
*All other statuses allow the instance to be displayed in the repository (notably "KEEP") but will not be taken into account by automatic processing.<br/>
 
 
<br/>
 
<br/>
 
Status Summary:<br/>
 
Status Summary:<br/>
Line 67: Line 69:
 
====Declaring the instance in SQWareRepository with SQWareWeb====
 
====Declaring the instance in SQWareRepository with SQWareWeb====
 
We will declare the new instance from the SQWareWeb administration interface.<br/>
 
We will declare the new instance from the SQWareWeb administration interface.<br/>
[[Fichier:Admin_dbSQWare.png||admin|Lien vers la console d'administration]]<br/>
+
[[File:Admin dbSQWare.png||admin|Admin dbSQWare]]
  
 
Declare the new instance in "NEW" status (Add or Duplicate)<br/>
 
Declare the new instance in "NEW" status (Add or Duplicate)<br/>
[[Fichier:AjoutInstance.png||admin|Ajout d'une instance]]
+
[[File:AjoutInstance.png||admin|Add an instance]]
[[Fichier:DuplicateInstance.png||admin|Ajout par duplication d'une instance]]<br/>
+
[[File:DuplicateInstance.png||admin|Duplicate an instance]]<br/>
[[Fichier:DeclarationInstanceSybase.png|adminSybase|Déclaration de la nouvelle instance Sybase]]
+
[[File:DeclarationInstanceMongoDB.png|admin|Add by duplicating an MongoDB instance]]
  
 
Explanation of fields:<br/>
 
Explanation of fields:<br/>
Line 87: Line 89:
 
|-
 
|-
 
| Virtual Host
 
| Virtual Host
| Virtual Host (same as Host if not clustered, will be used to generate tnsname.ora)
+
| Virtual Host (same as Host if not clustered)
 
|-
 
|-
 
| Host Name
 
| Host Name
Line 96: Line 98:
 
|-
 
|-
 
| Port
 
| Port
| Listening port of the instance (will be used to generate tnsname.ora)
+
| Listening port of the instance (
 
|-
 
|-
 
| Comments
 
| Comments
Line 140: Line 142:
 
bash:
 
bash:
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
# From : sybase@my_syb_host
+
# From : mongodb@mongodbhost
 
type bash
 
type bash
 
#or
 
#or
Line 147: Line 149:
 
rsync:
 
rsync:
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
# sybase@my_syb_host
+
# mongodb@mmongodbhost
 
type rsync
 
type rsync
 
#or
 
#or
Line 169: Line 171:
 
apt install -y bash rsync
 
apt install -y bash rsync
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
====Modification user unix ====
 +
Adapt to your machine type and user (use sudo if you are not root).<br/>
 +
Changing the home directory (optional, but helps avoid ending up in /var/lib/mongo):<br/>
 +
<syntaxhighlight lang="sh" line>
 +
# From : root@my_mongodb_host
 +
mkdir -p /home/mongod
 +
chown mongodb:mongod /home/mongod
 +
chmod 750 /home/mongod
 +
##Stop instance
 +
usermod -d /home/mongod mongod
 +
##Start instance
  
 +
#or with vi /etc/passwd !
 +
</syntaxhighlight>
 +
 +
Assign a passwd to the mongod user (otherwise key-based authentication will not work!):
 +
<syntaxhighlight lang="sh" line>
 +
# From : root@my_mongodb_host
 +
passwd mongod
 +
</syntaxhighlight>
 
====Deploying SSH Key(s) from SQWareCentral to the Target Machine(s)====
 
====Deploying SSH Key(s) from SQWareCentral to the Target Machine(s)====
 
There are two ways to do this:
 
There are two ways to do this:
*Automatic (from dbsqware@sqwarebox, but this requires you to know the password for your Sybase Unix account)
+
*Automatic (from dbsqware@sqwarebox, but this requires you to know the password for your MongoDB Unix account)
*Manual, which you apply to each Sybase Unix account
+
*Manual, which you apply to each mongodb Unix account
/!\ Your Sybase Unix account password must have been initialized; otherwise, the key exchange connection will not work!
+
/!\ Your MongoDB Unix account password must have been initialized; otherwise, the key exchange connection will not work!
  
 
=====Deploying SSH Key(s): Batch Method=====
 
=====Deploying SSH Key(s): Batch Method=====
Line 186: Line 207:
 
=====Deploying SSH Key(s): Manual Method=====
 
=====Deploying SSH Key(s): Manual Method=====
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
# From : sybase@my_sybcle_host
+
# From : MongoDB@my_sybcle_host
 
if [ ! -r $HOME/.ssh/id_rsa ]
 
if [ ! -r $HOME/.ssh/id_rsa ]
 
then
 
then
Line 224: Line 245:
 
Once again, there are two ways to do this:
 
Once again, there are two ways to do this:
 
*Automatic (from dbsqware@sqwarebox)
 
*Automatic (from dbsqware@sqwarebox)
*Manual, which you apply to each Sybase Unix account
+
*Manual, which you apply to each MongoDB Unix account
  
 
=====Adding the dbSQWare environment: Batch method=====
 
=====Adding the dbSQWare environment: Batch method=====
Line 237: Line 258:
 
Add the following lines to ~/.profile or ~/.bash_profile
 
Add the following lines to ~/.profile or ~/.bash_profile
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
# From : sybase@my_syb_host
+
# From : MongoDB@my_syb_host
  
 
#dbSQWare
 
#dbSQWare
export gvsqw_SybBin=$HOME/SQWareProduction/sybase/bin
+
export gvsqw_SybBin=$HOME/SQWareProduction/MongoDB/bin
 
export gvsqw_Env='PRD'
 
export gvsqw_Env='PRD'
 
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
 
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
Line 247: Line 268:
 
. $gvsqw_SybBin/../etc/.profile_confort
 
. $gvsqw_SybBin/../etc/.profile_confort
 
fi
 
fi
 +
</syntaxhighlight>
 +
=====Adding the MNG_SID variable=====
 +
Adding the MNG_SID in the ~/.profile or ~/.bash_profile
 +
<syntaxhighlight lang="sh" line>
 +
# From : mongod@my_mongodb_host
 +
export MNG_SID=MNG_INST_PRD
 +
</syntaxhighlight>
 +
 +
====Configuring the connection method====
 +
In the dbSQWare configuration environment of your instance (default:$HOME/MNG_INST_PRD/sqwConfig)
 +
<syntaxhighlight lang="sh" line>
 +
#Enter the instance name
 +
e MNG_INST_PRD
 +
cfg
 +
</syntaxhighlight>
 +
 +
The file containing the functions that will be loaded at session startup (you can add your own):
 +
<syntaxhighlight lang="sh" line>
 +
mongod@my_mongodb_host:/home/mongo/MNG_INST_PRD/sqwConfig (MNG_INST_PRD) $ cat env.js
 +
cd ("/home/mongo/MNG_INST_PRD/sqwConfig")
 +
load ("login.js")
 +
</syntaxhighlight>
 +
 +
Functions used to connect to the instance :
 +
<syntaxhighlight lang="sh" line>
 +
mongod@my_mongodb_host:/home/mongo/MNG_INST_PRD/sqwConfig (MNG_INST_PRD) $ cat login.js
 +
function js_LocalConnection(){
 +
db = connect("my_mongodb_host:9999/admin");
 +
db.auth("administrator","administratorpwd")
 +
}
 +
function l1(){
 +
db = connect("my_mongodb_host:9999/admin");
 +
db.auth("administrator","administratorpwd")
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 255: Line 310:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====Tests de connexion "manuels" à l'instance Sybase====
+
====Manual connection test to the MongoDB instance (local connection)====
Le but étant de tester la ou les méthodes de connexion automatique à l'instance Sybase.
+
/!\ Only instances that will be in "ON" status!
* "locale", pour les instances qui seront en statut "ON"
+
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
 
+
menu_mng TestInstConnectionOnNoMail GenLstInstanceNew
=====Test connexion "locale"=====
 
/!\ Uniquement que les instances qui seront en statut "ON" !
 
<syntaxhighlight lang="sh" line>
 
# From : dbsqware@sqwarebox
 
menu_syb TestInstConnectionOnNoMail GenLstInstanceNew
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===Procédure spécifique pour la partie "distante" (statut DIST)===
+
===Specific procedure for the "remote" part (DIST status)===
  
====Création d'un compte Sybase spécifique dbSQWare====
+
====Creating a specific MongoDB dbSQWare account====
/!\ Uniquement que les instances qui seront en statut "DIST" !<br/>
+
/!\ Only instances that will be in "DIST" status!<br/>
Exemple d'ordre de création :
+
Example of creation order:
 
<syntaxhighlight lang="sql" line>
 
<syntaxhighlight lang="sql" line>
exec  sp_addlogin  'mylogin', 'NePasMettreCePassword!', @defdb='master', @deflanguage='us_english', @fullname='login admin dbsqware', @auth_mech = 'ANY'
+
mongo
go
 
exec  sp_locklogin  '$lvsqw_Login', 'unlock'
 
go
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Vous pouvez mettre le nom et le mot de passe que vous souhaitez !<br/>
+
You can enter any username and password you like!<br/>
Ce compte devra être déclaré sur le compte unix sybase@sqwarebox ...<br/>
+
This account must be registered under the Unix account MongoDB@sqwarebox...<br/>
Si une entrée spécifique est trouvée c'est elle sui est prise, si non, on prend l'entrée "DEFAULT".<br/>
 
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
sybase@sqwarebox:/home/sybase (NoSID) $ cat .passwd_sybase
+
MongoDB@sqwarebox:/home/Mongodb () $ cat .passwd_MongoDB
DEFAULT;SaUser;SaUserPasswd
+
DbAlias;UserName;Passwd;HostName;Port
SPECIFIC_SYB;sa;sapasswd
+
MNG_MONAPPLI_PRD;dbsdba;myPassword;srvdbmng01;9999
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====Test connexion "distante"====
+
====Test "remote" connection====
/!\ Uniquement si besoin ! (pour AWR et/ou connexion distante)
 
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
# From : dbsqware@sqwarebox
 
# From : dbsqware@sqwarebox
Line 294: Line 339:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==Mise en exploitation de l'instance==
+
==Deployment of the Instance==
===Génération de la configuration par défaut SQWareProduction===
+
===Generating the Default SQWareProduction Configuration===
/!\ Uniquement que les instances qui seront en statut "ON" !
+
/!\ Only instances that will be in "ON" status!
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
# From : dbsqware@sqwarebox
 
# From : dbsqware@sqwarebox
Line 302: Line 347:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===Mise à jour de SQWareRepository===
+
===Update SQWare Repository===
Dans le repository dbSQWare via la console d’administration, mettre à jour le statut de la nouvelle instance Sybase (à NEW actuellement) avec la valeur souhaitée (ON, DG, DIST)
+
In the dbSQWare repository via the administration console, update the status of the new MongoDB instance (currently NEW) to the desired value (ON, DG, DIST).
  
===Test de "reprise" des indicateurs===
+
===Testing the "Recovery" of Indicators===
A ce moment là, vous pouvez tester la reprise des indicateurs manquants (en principe, uniquement les instances que vous venez d'intégrer !)
+
At this point, you can test the recovery of the missing indicators (in principle, only the instances you have just integrated!)
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
# From : dbsqware@sqwarebox
 
# From : dbsqware@sqwarebox
## Pour les statuts "ON"
+
## For "ON" status
repind_syb
+
repind_mng
## Pour les statuts "DIST"
+
## For "DIST" status
repind_syb_dist
+
repind_mng_dist
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===Exploitation (stats, backups, ) pour les instance "ON"===
+
===Operation (stats, backups, etc.) for "ON" instances===
====Génération des conf SQWareProduction====
+
====Generating SQWareProduction conf====
Si vous avez suivi la procédure d’insertion de l’instance, cette partie est déjà fait par l’étape "menu_syb GenDefConf_SQWareProduction GenLstInstanceNew".<br/>
+
If you followed the instance insertion procedure, this part is already done by the step "menu_syb GenDefConf_SQWareProduction GenLstInstanceNew".<br/>
Vous pouvez vérifier avec le chapitre suivant.<br/>
+
You can check with the next chapter.<br/>
 
<br/>
 
<br/>
Se connecter à la machine qui porte l'instance « Sybase » et taper les commandes suivantes :<br/>
+
Log in to the machine hosting the "MongoDB" instance and type the following commands:<br/>
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
# From dbsqware@vsybwarebox
 
# From dbsqware@vsybwarebox
c SYBDBS
+
c MNG_INST_PRD
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
#Source de l'env si multi-instance (from sybase@my_syb_host)
+
#Sourcing environment if multi-instance (from MongoDB@my_syb_host)
e SYBDBS
+
e MNG_INST_PRD
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 335: Line 380:
 
./sqwsyb_GenerateCreateInstance.ksh -dbsOnly
 
./sqwsyb_GenerateCreateInstance.ksh -dbsOnly
 
</syntaxhighlight>
 
</syntaxhighlight>
Vérifier que ce qui est proposé est bon et tapez « y » si c’est le cas.<br/>
+
Check that the proposed settings are correct and type "y" if so.
A ce moment, vous avez généré les fichiers de configuration par défaut de SQWareProduction.
+
 
 +
At this point, you have generated the default configuration files for SQWareProduction.
  
====Explications====
+
====Explanations====
Les étapes précédentes ont créé certains fichiers par défaut. ($HOME/SYBDBS/sqwConfig)
+
The previous steps created some default files. ($HOME/MNG_INST_PRD/sqwConfig)
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
#Entrez le nom de l’instance
+
#Enter the instance name
e SYBDBS
+
e MNG_INST_PRD
 
cfg
 
cfg
cat sqwsyb_Jobs.cfg
+
cat sqwmng_Jobs.cfg
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
#IndicDba: Gather indicators DBAs
+
#IndicDba: Gather DBAs indicators
IndicDba:$gvsqw_SybBin/sqwsyb_GatherIndicators.ksh -S SYBDBS
+
IndicDba:$gvsqw_MngBin/sqwmng_GatherIndicators.ksh -I MNG_INST_PRD
 +
#Dump: Dump all databases
 +
Dump:$gvsqw_MngBin/sqwmng_DumpAllDatabases.ksh -I MNG_INST_PRD -Exec
 +
</syntaxhighlight>
 +
It is a configuration file used by the script sqwmng_RunJob.ksh to execute actions.<br/>
 +
File for a default cron $HOME/CrontabRef_MNG_INST_PRD :
 +
<syntaxhighlight lang="sh" line>
 +
## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
 +
# Dump
 +
00 20 * * * bash -c '. $HOME/.profile MNG_INST_PRD;$gvsqw_MngBin/sqwmng_RunJob.ksh -I MNG_INST_PRD -A Dump > $HOME/tmp/Dump_MNG_INST_PRD.log 2>&1'
 +
</syntaxhighlight>
  
#DumpFull: Dump full all databases
+
====Deployment====
DumpFull:$gvsqw_SybBin/sqwsyb_DumpAllDatabases.ksh -S SYBDBS -Type full -Exec
+
Setting up the cron :
 
+
<syntaxhighlight lang="sh" line>
#DumpInc: Dump tran
+
mv $HOME/CrontabRef_MNG_INST_PRD $HOME/CrontabRef
DumpInc:$gvsqw_SybBin/sqwsyb_DumpAllDatabases.ksh -S SYBDBS -ID mydblist -Type inc -Exec
+
vi $HOME/CrontabRef
 
+
crontab $HOME/CrontabRef
#Checkstorage: Checkstorage all databases
+
crontab -l
Checkstorage:$gvsqw_SybBin/sqwsyb_CheckstorageAllDatabases.ksh -S SYBDBS -Exec
+
</syntaxhighlight>
 +
Updating the CrontabRef file :
 +
<syntaxhighlight lang="sh" line>
 +
crontab -l > $HOME/CrontabRef
 +
cat $HOME/CrontabRef
 +
</syntaxhighlight>
 +
====Useful commands====
 +
Interesting aliases :
 +
<syntaxhighlight lang="sh" line>
 +
e DBALIAS => Load the environment for the instance
 +
bin, etc, too ... => To navigate to the standard SQWareProduction directory
 +
cbin, cetc, ctoo ... => To navigate to the custom SQWareProduction directory
 +
log => logs SQWareProduction
 +
dmp => Navigate to the backup paths
 +
</syntaxhighlight>
 +
Some script options: -h => online help -s => online examples -Exec => when present, executes the commands; if not set, only shows the commands without executing them.
 +
Exemples :
 +
<syntaxhighlight lang="sh" line>
 +
mongod@my_mng_host:$HOME/admin/MNG_INST_PRD/logs/DumpAllDatabases (MNG_INST_PRD) $ bin
 +
total 48
 +
drwxr-x---  2 mongod mongod 4096 Aug 16 15:50 .
 +
drwxr-x--- 15 mongod mongod 4096 Aug 16 15:50 ..
 +
-rwxr-x---  1 mongod mongod 3071 Aug 16 15:50 sqwmng_CompactAllDatabases.ksh
 +
-rwxr-x---  1 mongod mongod 2610 Aug 16 15:50 sqwmng_CompactDatabase.ksh
 +
-rwxr-x--- 1 mongod mongod 3774 Aug 16 15:50 sqwmng_CopyDumpAllDatabases.ksh
 +
-rwxr-x---  1 mongod mongod 5167 Sep  6 15:12 sqwmng_CopyDumpDatabase.ksh
 +
-rwxr-x---  1 mongod mongod 3250 Aug 16 15:50 sqwmng_DumpAllDatabases.ksh
 +
-rwxr-x---  1 mongod mongod 2930 Aug 16 15:50 sqwmng_DumpDatabase.ksh
 +
lrwxrwxrwx  1 mongod mongod  36 Feb 16  2021 sqwmng_ExecSQL.ksh -> ../../generic/bin/sqwgen_ExecSQL.ksh
 +
-rwxr-x--- 1 mongod mongod 2482 Aug 16 15:50 sqwmng_GatherIndicators.ksh
 +
lrwxrwxrwx  1 mongod mongod  38 Oct  4  2014 sqwmng_NetBackup.ksh -> ../../generic/bin/sqwgen_NetBackup.ksh
 +
lrwxrwxrwx  1 mongod mongod  40 Oct  4  2014 sqwmng_ParallelRun.ksh -> ../../generic/bin/sqwgen_ParallelRun.ksh
 +
-rwxr-x---  1 mongod mongod 3325 Aug 16 15:50 sqwmng_RestoreAllDatabases.ksh
 +
-rwxr-x---  1 mongod mongod 3056 Aug 16 15:50 sqwmng_RestoreDatabase.ksh
 +
lrwxrwxrwx  1 mongod mongod  35 Oct  4  2014 sqwmng_RunJob.ksh -> ../../generic/bin/sqwgen_RunJob.ksh
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="sh" line>
 +
ongod@my_mng_host:$HOME/SQWareProduction/mongod/bin (MNG_INST_PRD) $
 +
./sqwmng_DumpAllDatabases.ksh -h
 +
 +
Sourcing sqwmng_Global.lib v2023.06 SQWareProduction for MongoDB (dbSQWare) ...
  
#Reorg: Reorg all databases
+
Usage: sqwmng_DumpAllDatabases.ksh [-h] -I instance [+ options]
Reorg:$gvsqw_SybBin/sqwsyb_RebuildAllDatabases.ksh -S SYBDBS -Exec
 
  
#UpdateStats: Update statistics all databases
+
DESCRIPTION
UpdateStats:$gvsqw_SybBin/sqwsyb_StatisticsAllDatabases.ksh -S SYBDBS -Exec
+
  sqwmng_DumpAllDatabases.ksh Dump databases in parallel
 +
SUPPORT
 +
  MongoDB supported versions: 2.4 <= v <= 5.1
  
#Dbcc: Dbcc all databases
+
PARAMETERS
Dbcc:$gvsqw_SybBin/sqwsyb_DbccAllDatabases.ksh -S SYBDBS -Exec
+
    -I  instance      : Target instance to mongodump.
</syntaxhighlight>
+
OPTIONS
 +
    -h  help          : Display the full usage.
 +
    -s                : Display samples of usage.
 +
    -P  Nb threads    : Number of threads in parallel (by default 2).
 +
    -ID listdb        : List of databases to be dumped (by default all).
 +
    -ED listdb        : List of databases to exclude from dump.
 +
    -IL likeclause    : Like clause to generate databases list (example: 'db', egrep syntax!).
 +
    -EL likeclause    : Like clause to exclude databases (example: 'nodb', egrep syntax!).
 +
    -HI Nb_Generations : Number of generations to keep (by default 2).
 +
    -WCD  whereclause  : Where clause to generate databases list (egrep syntax!).
 +
    -AGR  Nb sec      : Nb of seconds between two runs (by default 1s).
 +
    -AGE  Nb sec      : Nb of seconds between two checks of end (by default 10s).
 +
    -FRT  return_code  : Force return code value on error.
 +
    -Opt  option      : Additional options for mongodump.
 +
    -Dist              : For distant connection to database (change $gvsqw_ConnectString to $gvsqw_DistConnectString ).
 +
    -AddMail email    : Email address to add at 'pmexpdba@gmail.com'.
 +
    -SendReport        : Send execution log report.
 +
    -NoMail            : Deactivate sendmail on error pmexpdba@gmail.com (by default, send on error).
 +
    -Tar              : Tar generated dump dir after mongodump (default : Tar).
 +
    -NoTar            : Don't tar generated dump dir after mongodump (default : Tar).
 +
    -Locale  locale  : Force Locale for help display (fr,en).
 +
    -Exec             : Execute commands (default, display generated commands)
  
C’est un fichier de paramétrage qui est utilisé par le script sqwsyb_RunJob.ksh pour exécuter des actions.<br/>
 
<br/>
 
Fichier pour une cron par défaut $HOME/CrontabRef_SYBDBS :
 
<syntaxhighlight lang="sh" line>
 
## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
 
## dump full
 
00 17 * * 1-6 bash -c '. $HOME/.profile SYBDBS;$gvsqw_SybBin/sqwsyb_RunJob.ksh -S SYBDBS -A DumpFull 2>&1 >~/tmp/DumpFull_SYBDBS.log'
 
## Checkstorage
 
00 12 * * 6  bash -c '. $HOME/.profile SYBDBS;$gvsqw_SybBin/sqwsyb_RunJob.ksh -S SYBDBS -A Checkstorage 2>&1 >~/tmp/Checkstorage_SYBDBS.log'
 
## Reorg
 
00 04 * * 6  bash -c '. $HOME/.profile SYBDBS;$gvsqw_SybBin/sqwsyb_RunJob.ksh -S SYBDBS -A Reorg 2>&1 >~/tmp/Reorg_SYBDBS.log'
 
## Update statistics
 
00 16 * * 2 bash -c '. $HOME/.profile SYBDBS;$gvsqw_SybBin/sqwsyb_RunJob.ksh -S SYBDBS -A UpdateStats 2>&1 >~/tmp/UpdateStats_SYBDBS.log'
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====Mise en exploitation====
+
====Startup====
Mise en place de la cron :
+
Setting up cron:
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
mv $HOME/CrontabRef_SYBDBS $HOME/CrontabRef
 
mv $HOME/CrontabRef_SYBDBS $HOME/CrontabRef
Line 394: Line 499:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Mise à jour du fichier CrontabRef :
+
Update CrontabRef file:
 +
 
 
<syntaxhighlight lang="sh" line>
 
<syntaxhighlight lang="sh" line>
 
crontab -l > $HOME/CrontabRef
 
crontab -l > $HOME/CrontabRef
Line 400: Line 506:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====Commandes utiles====
+
====Useful commands====
alias intéressants :
+
interesting aliases:
  e DBALIAS => source l'env pour l'instance
+
  e DBALIAS => source env for the instance
  bin, etc, too ... => pour aller dans arbo SQWareProduction standard
+
  bin, etc, too ... => to go to the standard SQWareProduction tree
  cbin, cetc, ctoo ... => pour aller dans arbo SQWareProduction custom
+
  cbin, cetc, ctoo ... => to go to the custom SQWareProduction tree
  log => logs SQWareProduction
+
  log => SQWareProduction logs
  dmp => on va dans les chemins de backup
+
  dmp => go to the backup paths
  
Quelques options des scripts :
+
Some script options:
  -h => aide en ligne
+
  -h => online help
  -s => exemples en ligne
+
  -s => online examples
  -Exec => lorsque elle est présente, si non settée ne sort que les commandes sans les exécuter
+
  -Exec => when present, if not set, only outputs the commands without executing them
  
Exemples :
+
Examples:
  sybase@my_syb_host:$HOME/admin/SYBDBS/logs/DumpAllDatabases (SYBDBS) $ bin
+
  MongoDB@my_syb_host:$HOME/admin/SYBDBS/logs/DumpAllDatabases (SYBDBS) $ bin
 
  total 112
 
  total 112
 
  drwxr-x---  2 sybase dba 4096 Aug 16 15:50 .
 
  drwxr-x---  2 sybase dba 4096 Aug 16 15:50 .

Latest revision as of 16:04, 30 April 2025

DeclarationInstanceMongoDB.png

Contents

General Information


Nuvola apps important.png
Warning:
First of all, don't proceed any further if you haven't read the "dbSQWare Concepts" section!.

In this chapter, we'll assume that SQWareCentral has been installed on dbsqware@sqwarebox...

Limitations of this section

This chapter only deals with adding a new instance to an already configured and functional base.
Use the sections that apply to your environment and use the match or manual method, as preferred!

General MODOP for integrating a new mongodb instance

There will potentially be one or two connection cases to handle:

  • "local", for Unix machines (or with Cygwin), where you connect to the machine hosting the instance (ssh connection from dbsqware@sqwarebox)
  • "remote", for the case where you has access to the machine via ssh (Windows, RDS, etc.)

Typical steps:

  • Setting up the environment
  • Checking system requirements for the "local" part (bash + rsync)
  • Manual testing
  • Starting the instance

You'll see that these steps can be completed one by one or in batches!

Integration of a mongodb instance

Setting Up the Environment

General

Explanation of "DbAlias" (the unique dbSQWare key)

The dbSQWare key must be unique and aligned with the value configured for the gvsqw_DbAlias variable in the sqwmng_GlobalVar.cfg file.
We will use a variable named MNG_SID, which has no intrinsic value for MongoDB but is used to identify the instance within dbSQWare.
By convention, the format often used is MNG + "_" + APPLICATION + "_" + ENV.
Examples: MNG_APP_DEV...
But this is not mandatory — you are free to choose whatever suits you best!
You just need to define the MNG_SID variable in the profile of the mongodb account (or another user) with the desired value.

Status explanation

  • An instance will be handled in "local" mode, meaning that psql will be used to connect locally on the machine hosting the instance (via SSH access from dbsqware@sqwarebox), with status set to ON.
  • An instance for which there is no local Unix access will be managed in "remote" mode (e.g., Windows, RDS, etc.), with status DIST.
  • The OFF status makes the instance "disappear" from the web interface.
  • The NEW status is used as an intermediate state during the initial configuration of a new instance.
  • All other statuses (notably KEEP) allow the instance to appear in the repository but will not be included in automated processes.



Status Summary:

Status Description
ON Local management under UNIX (most common)
DIST Remote management only
KEEP Temporary status, for example, during maintenance or before complete deletion
NEW Temporary status, during configuration
OFF Visual deletion of the instance (without deleting its configuration)
XXX Not supported...

Declaring the instance in SQWareRepository with SQWareWeb

We will declare the new instance from the SQWareWeb administration interface.
Admin dbSQWare

Declare the new instance in "NEW" status (Add or Duplicate)
Add an instance Duplicate an instance
Add by duplicating an MongoDB instance

Explanation of fields:

Field Description
Db Alias Unique key that identifies the instance in dbSQWare
Dbms Name DBMS Type
Virtual Host Virtual Host (same as Host if not clustered)
Host Name Hostname of the instance
User Name User that hosts the instance
Port Listening port of the instance (
Comments A short description of what the instance hosts
Status Instance status (see above for explanations)
Contact A contact if needed
Environment Instance environment (PRD, PPR, REC, DEV, TST, etc.)
Client Used only for filtering (enter a client name and/or department and/or service name, etc.)
GlobalHost Free field, often used to enter the hypervisor host, for example.
Custom1 Free field 1
Custom2 Free field 2
Regenerate SQWareCentral Reference Files

Type the following command to generate the reference files:

1 # From : dbsqware@sqwarebox
2 gen_all

Specific procedure for the "local" part (ON status)

/!\ Only instances that will be in "ON" status!

Checking the system requirements for the "local" part (bash + rsync)

Since SQWareProduction is written primarily in the bash shell and is synchronized from SQWareCentral with rsync, we need "bash" and "rsync" installed!

Verification

Adapt to your username and machine name.

bash:

1 # From : mongodb@mongodbhost
2 type bash
3 #or
4 which bash

rsync:

1 # mongodb@mmongodbhost
2 type rsync
3 #or
4 which rsync
Installation

Adapt to your machine type (sudo if you're not root).

RedHat / CentOS / ... :

1 # From : root@my_syb_host
2 yum install -y bash rsync
3 #or
4 dnf install -y bash rsync

Ubuntu / Debian / ... :

1 # From : root@my_syb_host
2 apt install -y bash rsync

Modification user unix

Adapt to your machine type and user (use sudo if you are not root).
Changing the home directory (optional, but helps avoid ending up in /var/lib/mongo):

1 # From : root@my_mongodb_host
2 mkdir -p /home/mongod
3 chown mongodb:mongod /home/mongod
4 chmod 750 /home/mongod
5 ##Stop instance
6 usermod -d /home/mongod mongod
7 ##Start instance
8 
9 #or with vi /etc/passwd !

Assign a passwd to the mongod user (otherwise key-based authentication will not work!):

1 # From : root@my_mongodb_host
2 passwd mongod

Deploying SSH Key(s) from SQWareCentral to the Target Machine(s)

There are two ways to do this:

  • Automatic (from dbsqware@sqwarebox, but this requires you to know the password for your MongoDB Unix account)
  • Manual, which you apply to each mongodb Unix account

/!\ Your MongoDB Unix account password must have been initialized; otherwise, the key exchange connection will not work!

Deploying SSH Key(s): Batch Method
1 # From : dbsqware@sqwarebox
2 menu_syb GenDeplSshKeys_SQWareCentral GenLstInstanceNew

Check that this is the list you want to deploy, then choose 1...
=> Enter your UNIX password when prompted!

Deploying SSH Key(s): Manual Method
1 # From : MongoDB@my_sybcle_host
2 if [ ! -r $HOME/.ssh/id_rsa ]
3 then
4 ssh-keygen -t rsa -N ''''''' -f $HOME/.ssh/id_rsa
5 fi
6 chmod go-w $HOME
7 echo "ssh-rsa AAAAB......XSPpdV11 dbsqware@sqwarebox" >>$HOME/.ssh/authorized_keys
8 chmod 700 $HOME/.ssh
9 chmod 600 $HOME/.ssh/authorized_keys

=> Enter the correct key in the "echo" field (the one for dbsqware@sqwarebox)

Testing the ssh connection from SQWareCentral

1 # From : dbsqware@sqwarebox
2 menu_syb TestSshConnection GenLstInstanceNew

Testing prerequisites on the target host (bash+rsync) ssh from SQWareCentral

1 # From : dbsqware@sqwarebox
2 menu_syb TestSysPrerequisites GenLstInstanceNew

Deploying SQWareProduction

1 # From : dbsqware@sqwarebox
2 
3 #If deployment on "unique" user
4 menu_syb DeplScripts GenLstUniqueNew
5 
6 #If deployment on "instance" user, the one specified in SQWareRepository
7 menu_syb DeplScripts GenLstInstanceNew

Adding the dbSQWare environment to ~/.profile or ~/.bash_profile

Once again, there are two ways to do this:

  • Automatic (from dbsqware@sqwarebox)
  • Manual, which you apply to each MongoDB Unix account
Adding the dbSQWare environment: Batch method
1 # From : dbsqware@sqwarebox
2 menu_syb AdddbSQWareProfile GenLstInstanceNew

Verify that this is the list you want to deploy, then select 1...
=> In ~/.profile or ~/.bash_profile, change the following variable to the appropriate value: gvsqw_Env='XXX'

Adding the dbSQWare environment: manual method

Add the following lines to ~/.profile or ~/.bash_profile

 1 # From : MongoDB@my_syb_host
 2 
 3 #dbSQWare
 4 export gvsqw_SybBin=$HOME/SQWareProduction/MongoDB/bin
 5 export gvsqw_Env='PRD'
 6 lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
 7 if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_SybBin/../etc/.profile_confort ]
 8 then
 9 . $gvsqw_SybBin/../etc/.profile_confort
10 fi
Adding the MNG_SID variable

Adding the MNG_SID in the ~/.profile or ~/.bash_profile

1 # From : mongod@my_mongodb_host
2 export MNG_SID=MNG_INST_PRD

Configuring the connection method

In the dbSQWare configuration environment of your instance (default:$HOME/MNG_INST_PRD/sqwConfig)

1 #Enter the instance name
2 e MNG_INST_PRD
3 cfg

The file containing the functions that will be loaded at session startup (you can add your own):

1 mongod@my_mongodb_host:/home/mongo/MNG_INST_PRD/sqwConfig (MNG_INST_PRD) $ cat env.js
2 cd ("/home/mongo/MNG_INST_PRD/sqwConfig")
3 load ("login.js")

Functions used to connect to the instance :

1 mongod@my_mongodb_host:/home/mongo/MNG_INST_PRD/sqwConfig (MNG_INST_PRD) $ cat login.js
2 function js_LocalConnection(){
3 db = connect("my_mongodb_host:9999/admin");
4 db.auth("administrator","administratorpwd")
5 }
6 function l1(){
7 db = connect("my_mongodb_host:9999/admin");
8 db.auth("administrator","administratorpwd")
9 }

Test sendmail (Non mandatory)

1 # From : dbsqware@sqwarebox
2 menu_syb TestSendmail GenLstInstanceNew

Manual connection test to the MongoDB instance (local connection)

/!\ Only instances that will be in "ON" status!

1 # From : dbsqware@sqwarebox
2 menu_mng TestInstConnectionOnNoMail GenLstInstanceNew

Specific procedure for the "remote" part (DIST status)

Creating a specific MongoDB dbSQWare account

/!\ Only instances that will be in "DIST" status!
Example of creation order:

1 mongo

You can enter any username and password you like!
This account must be registered under the Unix account MongoDB@sqwarebox...

1 MongoDB@sqwarebox:/home/Mongodb () $ cat .passwd_MongoDB
2 DbAlias;UserName;Passwd;HostName;Port
3 MNG_MONAPPLI_PRD;dbsdba;myPassword;srvdbmng01;9999

Test "remote" connection

1 # From : dbsqware@sqwarebox
2 menu_syb TestInstConnectionDistNoMail GenLstInstanceNew

Deployment of the Instance

Generating the Default SQWareProduction Configuration

/!\ Only instances that will be in "ON" status!

1 # From : dbsqware@sqwarebox
2 menu_syb GenDefConf_SQWareProduction GenLstInstanceNew

Update SQWare Repository

In the dbSQWare repository via the administration console, update the status of the new MongoDB instance (currently NEW) to the desired value (ON, DG, DIST).

Testing the "Recovery" of Indicators

At this point, you can test the recovery of the missing indicators (in principle, only the instances you have just integrated!)

1 # From : dbsqware@sqwarebox
2 ## For "ON" status
3 repind_mng
4 ## For "DIST" status
5 repind_mng_dist

Operation (stats, backups, etc.) for "ON" instances

Generating SQWareProduction conf

If you followed the instance insertion procedure, this part is already done by the step "menu_syb GenDefConf_SQWareProduction GenLstInstanceNew".
You can check with the next chapter.

Log in to the machine hosting the "MongoDB" instance and type the following commands:

1 # From dbsqware@vsybwarebox
2 c MNG_INST_PRD
1 #Sourcing environment if multi-instance (from MongoDB@my_syb_host)
2 e MNG_INST_PRD
1 too
2 ./sqwsyb_GenerateCreateInstance.ksh -dbsOnly

Check that the proposed settings are correct and type "y" if so.

At this point, you have generated the default configuration files for SQWareProduction.

Explanations

The previous steps created some default files. ($HOME/MNG_INST_PRD/sqwConfig)

1 #Enter the instance name
2 e MNG_INST_PRD
3 cfg
4 cat sqwmng_Jobs.cfg
1 #IndicDba: Gather DBAs indicators
2 IndicDba:$gvsqw_MngBin/sqwmng_GatherIndicators.ksh -I MNG_INST_PRD
3 #Dump: Dump all databases
4 Dump:$gvsqw_MngBin/sqwmng_DumpAllDatabases.ksh -I MNG_INST_PRD -Exec

It is a configuration file used by the script sqwmng_RunJob.ksh to execute actions.
File for a default cron $HOME/CrontabRef_MNG_INST_PRD :

1 ## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
2 # Dump
3 00 20 * * * bash -c '. $HOME/.profile MNG_INST_PRD;$gvsqw_MngBin/sqwmng_RunJob.ksh -I MNG_INST_PRD -A Dump > $HOME/tmp/Dump_MNG_INST_PRD.log 2>&1'

Deployment

Setting up the cron :

1 mv $HOME/CrontabRef_MNG_INST_PRD $HOME/CrontabRef
2 vi $HOME/CrontabRef
3 crontab $HOME/CrontabRef
4 crontab -l

Updating the CrontabRef file :

1 crontab -l > $HOME/CrontabRef
2 cat $HOME/CrontabRef

Useful commands

Interesting aliases :

1 e DBALIAS => Load the environment for the instance
2 bin, etc, too ... => To navigate to the standard SQWareProduction directory
3 cbin, cetc, ctoo ... => To navigate to the custom SQWareProduction directory
4 log => logs SQWareProduction
5 dmp => Navigate to the backup paths

Some script options: -h => online help -s => online examples -Exec => when present, executes the commands; if not set, only shows the commands without executing them. Exemples :

 1 mongod@my_mng_host:$HOME/admin/MNG_INST_PRD/logs/DumpAllDatabases (MNG_INST_PRD) $ bin
 2 total 48
 3 drwxr-x---  2 mongod mongod 4096 Aug 16 15:50 .
 4 drwxr-x--- 15 mongod mongod 4096 Aug 16 15:50 ..
 5 -rwxr-x---  1 mongod mongod 3071 Aug 16 15:50 sqwmng_CompactAllDatabases.ksh
 6 -rwxr-x---  1 mongod mongod 2610 Aug 16 15:50 sqwmng_CompactDatabase.ksh
 7 -rwxr-x---  1 mongod mongod 3774 Aug 16 15:50 sqwmng_CopyDumpAllDatabases.ksh
 8 -rwxr-x---  1 mongod mongod 5167 Sep  6 15:12 sqwmng_CopyDumpDatabase.ksh
 9 -rwxr-x---  1 mongod mongod 3250 Aug 16 15:50 sqwmng_DumpAllDatabases.ksh
10 -rwxr-x---  1 mongod mongod 2930 Aug 16 15:50 sqwmng_DumpDatabase.ksh
11 lrwxrwxrwx  1 mongod mongod   36 Feb 16  2021 sqwmng_ExecSQL.ksh -> ../../generic/bin/sqwgen_ExecSQL.ksh
12 -rwxr-x---  1 mongod mongod 2482 Aug 16 15:50 sqwmng_GatherIndicators.ksh
13 lrwxrwxrwx  1 mongod mongod   38 Oct  4  2014 sqwmng_NetBackup.ksh -> ../../generic/bin/sqwgen_NetBackup.ksh
14 lrwxrwxrwx  1 mongod mongod   40 Oct  4  2014 sqwmng_ParallelRun.ksh -> ../../generic/bin/sqwgen_ParallelRun.ksh
15 -rwxr-x---  1 mongod mongod 3325 Aug 16 15:50 sqwmng_RestoreAllDatabases.ksh
16 -rwxr-x---  1 mongod mongod 3056 Aug 16 15:50 sqwmng_RestoreDatabase.ksh
17 lrwxrwxrwx  1 mongod mongod   35 Oct  4  2014 sqwmng_RunJob.ksh -> ../../generic/bin/sqwgen_RunJob.ksh
 1 ongod@my_mng_host:$HOME/SQWareProduction/mongod/bin (MNG_INST_PRD) $ 
 2 ./sqwmng_DumpAllDatabases.ksh -h
 3  
 4 Sourcing sqwmng_Global.lib v2023.06 SQWareProduction for MongoDB (dbSQWare) ...
 5 
 6 Usage: sqwmng_DumpAllDatabases.ksh [-h] -I instance [+ options]
 7 
 8 DESCRIPTION
 9    sqwmng_DumpAllDatabases.ksh Dump databases in parallel
10 SUPPORT
11    MongoDB supported versions: 2.4 <= v <= 5.1
12 
13 PARAMETERS
14      -I  instance       : Target instance to mongodump.
15 OPTIONS
16      -h  help           : Display the full usage.
17      -s                 : Display samples of usage.
18      -P  Nb threads     : Number of threads in parallel (by default 2).
19      -ID listdb         : List of databases to be dumped (by default all).
20      -ED listdb         : List of databases to exclude from dump.
21      -IL likeclause     : Like clause to generate databases list (example: 'db', egrep syntax!).
22      -EL likeclause     : Like clause to exclude databases (example: 'nodb', egrep syntax!).
23      -HI Nb_Generations : Number of generations to keep (by default 2).
24      -WCD  whereclause  : Where clause to generate databases list (egrep syntax!).
25      -AGR  Nb sec       : Nb of seconds between two runs (by default 1s).
26      -AGE  Nb sec       : Nb of seconds between two checks of end (by default 10s).
27      -FRT  return_code  : Force return code value on error.
28      -Opt  option       : Additional options for mongodump.
29      -Dist              : For distant connection to database (change $gvsqw_ConnectString to $gvsqw_DistConnectString ).
30      -AddMail email     : Email address to add at 'pmexpdba@gmail.com'.
31      -SendReport        : Send execution log report.
32      -NoMail            : Deactivate sendmail on error pmexpdba@gmail.com (by default, send on error).
33      -Tar               : Tar generated dump dir after mongodump (default : Tar).
34      -NoTar             : Don't tar generated dump dir after mongodump (default : Tar).
35      -Locale   locale   : Force Locale for help display (fr,en).
36      -Exec              : Execute commands (default, display generated commands)

Startup

Setting up cron:

1 mv $HOME/CrontabRef_SYBDBS $HOME/CrontabRef
2 vi $HOME/CrontabRef
3 crontab $HOME/CrontabRef
4 crontab -l

Update CrontabRef file:

1 crontab -l > $HOME/CrontabRef
2 cat $HOME/CrontabRef

Useful commands

interesting aliases:

e DBALIAS => source env for the instance
bin, etc, too ... => to go to the standard SQWareProduction tree
cbin, cetc, ctoo ... => to go to the custom SQWareProduction tree
log => SQWareProduction logs
dmp => go to the backup paths

Some script options:

-h => online help
-s => online examples
-Exec => when present, if not set, only outputs the commands without executing them

Examples:

MongoDB@my_syb_host:$HOME/admin/SYBDBS/logs/DumpAllDatabases (SYBDBS) $ bin
total 112
drwxr-x---  2 sybase dba 4096 Aug 16 15:50 .
drwxr-x--- 15 sybase dba 4096 Aug 16 15:50 ..
-rwxr-x---  1 sybase dba 3043 Aug 16 15:50 sqwsyb_CheckstorageAllDatabases.ksh
-rwxr-x---  1 sybase dba 2616 Aug 16 15:50 sqwsyb_CheckstorageDatabase.ksh
-rwxr-x---  1 sybase dba 4507 Aug 16 15:50 sqwsyb_CopyDumpAllDatabases.ksh
-rwxr-x---  1 sybase dba 3369 Sep  5 11:33 sqwsyb_CopyDumpDatabase.ksh
-rwxr-x---  1 sybase dba 2988 Aug 16 15:50 sqwsyb_DbccAllDatabases.ksh
-rwxr-x---  1 sybase dba 2616 Aug 16 15:50 sqwsyb_DbccDatabase.ksh
-rwxr-x---  1 sybase dba 4213 Aug 16 15:50 sqwsyb_DumpAllDatabases.ksh
-rwxr-x---  1 sybase dba 3575 Aug 16 15:50 sqwsyb_DumpDatabase.ksh
lrwxrwxrwx  1 sybase dba   36 Jul 22  2018 sqwsyb_ExecSQL.ksh -> ../../generic/bin/sqwgen_ExecSQL.ksh
-rwxr-x---  1 sybase dba 2742 Aug 16 15:50 sqwsyb_GatherDistantFsSize.ksh
-rwxr-x---  1 sybase dba 2488 Aug 16 15:50 sqwsyb_GatherIndicators.ksh
-rwxr-x---  1 sybase dba 2353 Aug 16 15:50 sqwsyb_GatherStructure.ksh
-rwxr-x---  1 sybase dba 2464 Aug 16 15:50 sqwsyb_KillSessions.ksh
-rwxr-x---  1 sybase dba 4101 Aug 16 15:50 sqwsyb_LoadAllDatabases.ksh
-rwxr-x---  1 sybase dba 4685 Aug 16 15:50 sqwsyb_LoadDatabase.ksh
lrwxrwxrwx  1 sybase dba   38 Dec  6  2015 sqwsyb_NetBackup.ksh -> ../../generic/bin/sqwgen_NetBackup.ksh
lrwxrwxrwx  1 sybase dba   40 Dec  6  2015 sqwsyb_ParallelRun.ksh -> ../../generic/bin/sqwgen_ParallelRun.ksh
-rwxr-x---  1 sybase dba 3351 Aug 16 15:50 sqwsyb_RebuildAllDatabases.ksh
-rwxr-x---  1 sybase dba 2955 Aug 16 15:50 sqwsyb_RebuildDatabase.ksh
lrwxrwxrwx  1 sybase dba   40 Dec 20  2017 sqwsyb_RsyncBackup.ksh -> ../../generic/bin/sqwgen_RsyncBackup.ksh
lrwxrwxrwx  1 sybase dba   35 Dec  6  2015 sqwsyb_RunJob.ksh -> ../../generic/bin/sqwgen_RunJob.ksh
-rwxr-x---  1 sybase dba 3112 Aug 16 15:50 sqwsyb_StatisticsAllDatabases.ksh
-rwxr-x---  1 sybase dba 2707 Aug 16 15:50 sqwsyb_StatisticsDatabase.ksh
-rwxr-x---  1 sybase dba 3798 Aug 16 15:50 sqwsyb_UpdtStatsAllDatabases.ksh
-rwxr-x---  1 sybase dba 3691 Aug 16 15:50 sqwsyb_UpdtStatsDatabase.ksh
-rwxr-x---  1 sybase dba 3966 Aug 16 15:50 sqwsyb_UpdtStatsParallelDatabase.ksh
-rwxr-x---  1 sybase dba 3366 Aug 16 15:50 sqwsyb_UpdtStatsRebuildWithFlag.ksh
sybase@my_syb_host:$HOME/SQWareProduction/sybase/bin (SYBDBS) $ 
./sqwsyb_DumpAllDatabases.ksh -h
 
Sourcing sqwsyb_Global.lib v2023.06 SQWareProduction for Sybase (dbSQWare) ...

Usage: sqwsyb_DumpAllDatabases.ksh [-h] -I <dataserver> [+ options]

DESCRIPTION
   sqwsyb_DumpAllDatabases.ksh Dump all databases in parallel
SUPPORT
   Sybase supported versions: 12.5 <= v <= 16.0

PARAMETERS
     -I  dataserver     : Target dataserver to Dump.
OPTIONS
     -P  Nb threads     : Number of threads in parallel (by default 2).
     -ID   listdb       : List of databases holding tables to analyze (by default all).
     -ED   listdb       : List of databases to exclude.
     -IL   likeclause   : Like clause to generate databases list (example: 'db%').
     -EL   likeclause   : Like clause to exclude databases (example: 'nodb%').
     -WCD  whereclause  : Where clause to generate databases list.
     -FRT  return_code  : Force return code value on error.
     -RD directory      : Directory to write dump file (default /syb_dump/$DSQUERY).
     -HI Nb             : Nb of generations to keep (by default 2).
     -CL Level          : Compression level (by default 1).
     -CR Rate           : Estimated rate of compression (by default 22).
     -AGR  Nb sec       : Nb of seconds between two runs (by default 10s).
     -AGE  Nb sec       : Nb of seconds between two checks of end (by default 30s).
     -SMS  SizeMax      : Size Max Stripe (default 4096 Mo).
     -Type type         : Dump type full,inc,stb,fstb (default full).
     -NoMail            : Deactivate sendmail on error xxx (by default, send on error).
     -OldSyntax         : Force dump old syntax (by default, 'NewSyntax').
     -NewSyntax         : Force dump new syntax (by default, 'NewSyntax').
     -NoSyslogins       : Do not backup syslogins tables.
     -AddMail email     : Email address to add at 'xxx'.
     -SendReport        : Send execution log report.
     -AddFlagName mflag : Put '.mflag' at end of dump name.
     -CrossPlatform     : Put db in 'single user' mode and execute sp_flushstats before Dump.
     -TryCum            : Try 'dump cumulative' if 'dump tran' error (need to customize lfsqw_TryCum function).
     -h  help           : Display the full usage.
     -s                 : Display samples of usage.
     -Locale   locale   : Force Locale for help display (fr,en).
     -Exec              : Execute commands (default, display generated commands)

Enjoy !