0% found this document useful (0 votes)
778 views167 pages

AMOS 22.12 Installation Guide

Uploaded by

Danny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
778 views167 pages

AMOS 22.12 Installation Guide

Uploaded by

Danny
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 167

AMOS Installation Guide

Version: 22.12
Date: 01.12.2022
© 2022 Swiss Aviation Software Ltd.
1. AMOS Installation Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Installation Guide Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Preparation of the Operation System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Preparing Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.1.1 Application Server Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1.2 SAP ASE Database Server Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.1.3 PostgreSQL Database Server Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.2 Preparing Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.2.1 Application Server Preparation (Windows) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.2.2 SAP ASE Database Server Preparation (Windows) . . . . . . . . . . . . . . . . . . . . . . . 21
1.2.2.3 PostgreSQL Database Server Preparation (Windows) . . . . . . . . . . . . . . . . . . . . . 23
1.3 Database Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.3.1 Installing SAP ASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.3.1.1 ASE Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3.1.2 ASE Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.3.1.3 ASE Backup & Recovery for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.3.1.4 ASE Backup & Recovery for Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
1.3.2 Installing Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
1.3.2.1 Oracle DBMS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.3.3 Installing PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.3.3.1 PostgreSQL Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.3.3.2 PostgreSQL Backup & Recovery Scripts for Linux . . . . . . . . . . . . . . . . . . . . . . . . 80
1.3.3.3 PostgreSQL Backup & Recovery Scripts for Windows . . . . . . . . . . . . . . . . . . . . . 92
1.4 AMOS Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
1.4.1 AMOS Server Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
1.4.1.1 AMOS Config Server tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
1.4.1.1.1 AMOS Server Installation with Oracle on Linux . . . . . . . . . . . . . . . . . . . . . . 108
1.4.1.1.2 AMOS Server Installation with Oracle on Windows . . . . . . . . . . . . . . . . . . . 121
1.4.1.1.3 AMOS Server Installation with PostgreSQL on Linux . . . . . . . . . . . . . . . . . . 134
1.4.1.1.4 AMOS Server Installation with PostgreSQL on Windows . . . . . . . . . . . . . . . 136
1.4.1.1.5 AMOS Server Installation with SAP ASE on Linux . . . . . . . . . . . . . . . . . . . . 138
1.4.1.1.6 AMOS Server Installation with SAP ASE on Windows . . . . . . . . . . . . . . . . . 140
1.4.1.2 AMOS Server start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
1.4.2 AMOS Client Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
1.4.3 Basic AMOS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
1.4.4 System Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.4.4.1 Linux boot scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
1.4.4.2 Microsoft Windows Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
1.4.4.2.1 Installing the AMOS Windows Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.4.4.2.2 Maintaining the AMOS Windows Service . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
1.5 Document Information Installation Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
3/167

AMOS Installation Guide

SWISS-AS.COM
4/167

Installation Guide Overview

What's new in the AMOS 22.12 Installation Guide


Changes Chapter

New required "at" package for Linux Application Server Preparation

New pg_restore script parameters: PostgreSQL Backup & Recovery Scripts for Linux

SYNC_WEBDRIVE_EXCLUDE_FILE (only Linux) PostgreSQL Backup & Recovery Scripts for Windows
IGNORE_INDEX_TABLESPACE

Overview
This document contains information on how to install a new AMOS environment and how to perform the basic
configuration. This includes the operating system preparation, the installation and configuration of a database
server and the installation of the application server and client. The following picture illustrates a typical productive
AMOS installation.

System Requirements

SWISS-AS.COM
5/167

Please refer to the AMOS Software Version & Hardware Guidelines (PDF) for details regarding the currently
supported platforms. The support of server platforms is mainly driven by the availability of Sybase, Oracle or
PostgreSQL for a particular operating system.

SWISS-AS.COM
6/167

Preparation of the Operation System

SWISS-AS.COM
7/167

Preparing Linux
Please take the following considerations into account when preparing the guest operating system:

the instructions regarding the database server preparation described hereafter are only valid for servers that
run SAP ASE (formerly know as Sybase ASE) and PostgreSQL.
if the application and the database server run on the same host, the system needs to meet both
requirements.
if multiple servers are used, the user/group names and IDs should be the same on all host.
requirements of additional interfaces (e.g. flightlog / financial interfaces) are not included.

SWISS-AS.COM
8/167

Application Server Preparation


Application Server Hardware Requirements
The specification is valid for a single AMOS application server in a production environment. Please take the
following notes into account:

for multiple AMOS servers running on the same host, the corresponding parameters have to be cumulated
systems used for release change tests should have similar setup as the production in order to provide
comparable performance
we recommend to keep the free space on applic drive always greater than twice the java memory allocated
to AMOS. This is to avoid the drive to be full in case of a Java heap dump creation.
AMOS uses /tmp as default temporary folder on Linux, it is recommended to allocate enough space on that
folder accordingly depending on the AMOS usage. Having a separate mount point should be considered.

Type XS S M L XL XXL

Number of Aircrafts <10 10-20 20-70 70-300 300-500 >500

Number of online users <50 50-100 100-200 200-300 300-600 600-1500

Hardware Requirements

CPUs (physical or virtual cores) 2 6 8 12 16 16

Memory 6 GB 8 GB 10 GB 10 GB 18 GB 24 GB

Hard Disk Space:

/applic (Linux) or D:\applic (Windows) 50 GB 50 GB 50 GB 50 GB 100 GB 100 GB

/webdrive (Linux) or E:\webdrive (Windows) 100 GB 100 GB 300 GB 300 GB 500 GB 500 GB

Operating System Users and Groups


The AMOS application server is installed and run by a dedicated user, usually called amos which is a member of
group amos. The following table shows the recommended user and group definition.

Type Name Initial Login Group Description

group amos - Group of users related to AMOS

user amos amos The user that runs the application server

Partitions and Directories


The following table shows the partitions, the ownership and the permissions of the directories used by the AMOS
environment:

SWISS-AS.COM
9/167

Partition / Directory Owner Permissions Description

/applic amos:amos 770 AMOS and DBMS executables

/webdrive amos:amos 700 The AMOS webdrive location (if local)

Networking
The following list shows all relevant network parameters:

enable access and register to DNS


enable NTP synchronization
allow access to www.swiss-as.com using http
allow external access via SSH
allow access to this host via application server ports (by default AMOS uses ports 5080+, reserve two per
AMOS server)
allow access to mail server via SMTP
allow access to LDAP server

Miscellany
The following Linux settings need to be configured additionally:

timezone UTC
disable SELinux
RedHat: register in RHN
install package fontconfig.x86_64
install package p7zip.x86_64
install package at.x86_64
install cups to make server printers available from AMOS
configure open files in /etc/security/limits.conf (ulimit -n) to 65536 for user amos
amos soft nofile 65536
amos hard nofile 65536

configure number of user processes in /etc/security/limits.conf (ulimit -u)to 4096 for user am
os

SWISS-AS.COM
10/167

SAP ASE Database Server Preparation


Kernel Parameter Settings
Parameter Value Description

kernel. min. physical memory Linux default, on 64 bits systems, is 16'777'216 TB


shmmax

kernel.exec- 0 only RHEL 6


shield

kernel. 0
randomize_va
_space

vm. ['max memory' in MB] / Huge page memory used by the database server, see
nr_hugepages [Hugepages size in MB] + 5 below for more information

vm. ID of amos or sybase group as used in /etc/group


hugetlb_shm_
group

fs.aio-max-nr (disk i/o structures + max async i Total number of system-wide reservable I/O descriptors.
/os per engine) * max online The relation to ASE parameters is as follows:
engines
fs.aio-max-nr=(disk i/o structures + max
async i/os per engine) * max online engines
Linux default 1048576

net.ipv4. 60
tcp_keepalive
_intvl TCP Keepalive settings to avoid database connection to
be closed unexpectedly
net.ipv4. 5
tcp_keepalive
_probes

net.ipv4. 60
tcp_keepalive
_time

Operating System Users and Groups


The SAP ASE database servers are installed and run by a dedicated user, usually called sybase which is a member
of group amos (or sybase if ASE is running on a dedicated host). The following table shows the recommended user
and group definition.

Type Name Initial Login Group Description

SWISS-AS.COM
11/167

AMOS and AMOS and AMOS and AMOS and


ASE are ASE are ASE are ASE are

on the same on different on the same on different


host hosts host hosts

group amos sybase - Group of users related to AMOS

user sybase amos sybase The user that runs the database server
and backup scripts

If multiple servers are used, the user/group names and IDs should be the same on all host.

Partitions and Directories


The following table shows the partitions, the ownership and the permissions of the directories used by the AMOS
environment:

Partition / Owner Permissions Description


Directory
AMOS and AMOS and AMOS and AMOS and
ASE are ASE are ASE are ASE are
on the same on different on the same on different
host hosts host hosts

/applic amos:amos sybase:sybase 770 700 AMOS and ASE


(partition) executables

/data (partition) sybase:sybase 700 Data devices

/log (partition) sybase:sybase 700 Transaction log


devices

/backup sybase:amos sybase:sybase 770 700 Backup scripts


(partition)

For performance reasons, please make sure to:

use a separate disk controller per disk/partition


align disk blocks on file system, virtualization and storage level
use the ext4 or xfs file systems for DBMS data, transaction log and backup storage. Disable the journal via
tune2fs ^has_journal on data and log partitions and use the noatime,nodiratime mount options.

Networking
The following list shows all relevant network parameters:

open firewall for port 5000 (database server default port)


enable access and register to DNS
enable NTP synchronization
allow access to www.swiss-as.com using https

SWISS-AS.COM
12/167

allow external access via SSH. SSH access between hosts is also recommended in order to transfer files
(backups, etc...)

Miscellany
The following Linux settings need to be configured additionally:

timezone UTC
disable SELinux
RedHat: register in RHN

Linux Memory Settings

Explicit Huge Pages

Memory settings in Linux depend on how the Sybase database server allocates shared memory: either with Huge
Pages or not. By default ASE tries to allocate memory using Huge Pages but falls back to normal memory pages if
Huge Pages are not available. For database instances with high memory (> 3 GB), Huge Pages are recommended.

To define Huge Pages in Linux, change the following parameters:

Calculate the number of Huge Pages that can be used by ASE:


#Huge pages=(size of ASE 'max memory' in MB / Huge Page size in MB) + 5

In Linux, the Huge Page size is 2 MB per default (see: cat /proc/meminfo | grep Hugepagesize). Set the
kernel parameter vm.nr_hugepages to the calculated number of Huge Pages. For example, if the ASE
parameter 'max memory' is set to 10'000 MB the corresponding kernel parameter in /etc/sysctl.conf will be
set to:
vm.nr_hugepages=5005

Calculate the amount of memory that the sybase Linux user can lock into its address space. The memlock
setting is specified in KB and must match the memory size of the number of Huge Pages that ASE should be
able to allocate.
lockable memory=(#Huge Pages * Huge Page size in KB)

Verify that the soft and hard values in KB of memlock that are configured in /etc/security/limits.
conf are set to the calculated value. For example, if the ASE parameter 'max memory' is set to 10'000 MB
the memlock parameters need to be configured as:
sybase soft memlock 10250240
sybase hard memlock 10250240

Transparent Huge Pages (THP)

According RedHat, THP is not recommended for database workloads (see https://access.redhat.com/documentation
/en-us/red_hat_enterprise_linux/6/html/performance_tuning_guide/s-memory-transhuge).

SWISS-AS.COM
13/167

In order to disable THP permanently, follow the steps below as root:

1. add string "transparent_hugepage=never" to parameter GRUB_CMDLINE_LINUX in grub.conf /etc/default


/grub (see example below).
2. Run (BIOS): grub2-mkconfig -o /boot/grub2/grub.cfg
or (UEFI): grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
3. Reboot

Example of /etc/default/grub:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg_root/lv_root rd.lvm.lv=vg_root/swap rhgb quiet
transparent_hugepage=never"

Use the following command to verify if THP is disabled ( [ never ] selected ).


[root@srv-amos ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

SWISS-AS.COM
14/167

PostgreSQL Database Server Preparation


Kernel Parameter Settings
Parameter Value Description

kernel. min. physical memory Linux default, on 64 bits systems, is 16'777'216 To


shmmax

vm. grep ^VmPeak /proc/$(head -1 Huge page memory used by the database server, to be
nr_hugepages $PGDATA/postmaster.pid)/status configured once PostgreSQL is running and had some load

A reasonable starting value is the shared_buffer size + 10%

vm. ID of postgres group as used in /etc/group


hugetlb_shm_
group

net.ipv4. 60
tcp_keepalive_
intvl TCP Keepalive settings to avoid database connection to be
closed unexpectedly
net.ipv4. 5
tcp_keepalive_
probes

net.ipv4. 60
tcp_keepalive_
time

Operating System Users and Groups


The PostgreSQL database server is installed and run by a dedicated user called postgres which is a member of
group amos (or postgres if PostgreSQL is running on a dedicated host). The following table shows the
recommended user and group definition.

Type Name Initial Login Group Description

AMOS and AMOS and AMOS and AMOS and


PostgreSQL PostgreSQL PostgreSQL PostgreSQL
are on the are on are on the are on
same host different hosts same host different hosts

group amos postgres - Group of users related to AMOS

user postgres amos postgres The user that runs the database
server and backup scripts. Make
sure to create a system user
account.

SWISS-AS.COM
15/167

If multiple servers are used, the user/group names and IDs should be the same on all host.

Syntax example:

useradd -r -G amos,users -s /bin/bash -d /home/postgres -m postgres

passwd postgres

Partitions and Directories


The following table shows the partitions, the ownership and the permissions of the directories used by the AMOS
environment:

Partition / Owner Permissions Description


Directory
AMOS and AMOS and AMOS and AMOS and
PostgreSQL are PostgreSQL are PostgreSQL are PostgreSQL are
on the same host on different hosts on the same host on different hosts

/applic (par amos:amos postgres:postgres 770 700 AMOS and


tition) PostgreSQL
executables

/data postgres:postgres 700 PostgreSQL


/postgres instance
(partition) directory

/data postgres:postgres 700 AMOS


/<db_name environment
1> data
(partition)

/data postgres:postgres 700 AMOS


/<db_name environment
2> data
(partition)

/backup postgres:amos postgres:postgres 770 700 Backup


(partition) partition

For each AMOS environment hosted on the server, one partition must be created.

For example for a server with training, acceptance and migration, the following partitions are needed:

/data/training, owned by postgres:postgres


/data/acceptance, owned by postgres:postgres
/data/migration, owned by postgres:postgres

For performance reasons, please make sure to:

use a separate disk controller per disk/partition


align disk blocks on file system, virtualization and storage level

SWISS-AS.COM
16/167

use the ext4 or xfs file systems for DBMS data, transaction log and backup storage.

Networking
The following list shows all relevant network parameters:

open firewall for port 5432 (database server default port)


enable access and register to DNS
enable NTP synchronization
allow access to www.swiss-as.com using https
allow external access via SSH. SSH access between hosts is also recommended in order to transfer files
(backups, etc...)

Miscellany
The following Linux settings need to be configured additionally:

timezone UTC
disable SELinux
Install pigz and bc packages to have all Swiss AS backup scripts features
RedHat: register in RHN

SWISS-AS.COM
17/167

Preparing Windows
Please take the following considerations into account when preparing the guest operating system:

the instructions regarding the database server preparation described hereafter are only valid for servers that
run SAP ASE (formerly know as Sybase ASE) and PostgreSQL.
if the application and the database server run on the same host, the system needs to meet both
requirements.
if multiple servers are used, the user/group names and IDs should be the same on all host.
requirements of additional interfaces (e.g. flightlog / financial interfaces) are not included.

SWISS-AS.COM
18/167

Application Server Preparation (Windows)


Application Server Hardware Requirements
The specification is valid for a single AMOS application server in a production environment. Please take the
following notes into account:

for multiple AMOS servers running on the same host, the corresponding parameters have to be cumulated
systems used for release change tests should have similar setup as the production in order to provide
comparable performance
we recommend to keep the free space on applic drive always greater than twice the java memory allocated
to AMOS. This is to avoid the drive to be full in case of a Java heap dump creation.
AMOS uses /tmp as default temporary folder on Linux, it is recommended to allocate enough space on that
folder accordingly depending on the AMOS usage. Having a separate mount point should be considered.

Type XS S M L XL XXL

Number of Aircrafts <10 10-20 20-70 70-300 300-500 >500

Number of online users <50 50-100 100-200 200-300 300-600 600-1500

Hardware Requirements

CPUs (physical or virtual cores) 2 6 8 12 16 16

Memory 6 GB 8 GB 10 GB 10 GB 18 GB 24 GB

Hard Disk Space:

/applic (Linux) or D:\applic (Windows) 50 GB 50 GB 50 GB 50 GB 100 GB 100 GB

/webdrive (Linux) or E:\webdrive (Windows) 100 GB 100 GB 300 GB 300 GB 500 GB 500 GB

Operating System Users and Groups


User Description

SWISS-AS.COM
19/167

amos This is the user that runs the service of the AMOS application server and related Windows scheduled
_servi tasks.
ce
The administrator permissions are not required, however the user must have full control on parent folder
of AMOS application folder (e.g: D:\applic) and the webdrive location (e.g. E:\webdrive).

This service user must have the right ‘Log on as a service’ on the local machine. This logon right strictly
applies only to the local computer and must be granted in the Local Security Policy.

In case it does not have administrator permissions, this user must be a member of the Windows local
groups "Performance Log Users" and "Performance Monitor Users".

The password for this user must not expire. Having separate application server and database server the
use of domain user is recommended to fully operate the Swiss-AS backup & recovery scripts.

amos This user is required for installation and support. This user needs temporary administrator right during
_sys the inital installation and whenever the service needs to be re-installed.

Partitions and Directories


Mount Point Description Size

C:\ OS installation According Windows Requirements (min. 50 GB)

D:\applic This is the application server's parent directory AMOS and ASE executables

E:\webdrive The AMOS webdrive directory The AMOS webdrive location (if local)

Networking
The following list shows all relevant network parameters:

enable access and register to DNS


enable NTP synchronization
allow access to www.swiss-as.com using http
allow external access via RDP
allow access to this host via application server ports (by default AMOS uses ports 5080+, reserve two per
AMOS server)
allow access to mail server via SMTP

Miscellany
Size of Pagefile.sys should be set to half of the physical memory and minimum 4GB.
Disable UAC (user account control)
Disable antivirus check for the AMOS application folder
Install 7Zip
Install Visual C++ Redistributable Packages for Visual Studio 2015. Note that this package is language
specific.
Install or update .NET Framework runtime to version 4.7 or newer

SWISS-AS.COM
20/167

SWISS-AS.COM
21/167

SAP ASE Database Server Preparation (Windows)


Operating System
Windows Server 2012 R2
Windows Server 2016 LTSB
Windows Server 2019
Windows Server 2022

Operating System Users and Groups


During the installation of ASE, several services will be installed that run as local system user. Therefore there is
nothing specific to be prepared in this regard.

To operate the Swiss-AS backup & recovery scripts the following user is required:

User Description

amos This is the user that runs Windows scheduled tasks.


_servi
ce This service user must have the right ‘Log on as a service’ on the local machine. This logon right strictly
applies only to the local computer and must be granted in the Local Security Policy.

In case it does not have administrator permissions, this user must be a member of the Windows local
groups "Performance Log Users" and "Performance Monitor Users".

The password for this user must not expire. Having separate application server and database server the
use of domain user is recommended to fully operate the Swiss-AS backup & recovery scripts.

Partitions and Directories


Mount Point Description

Mount Point Description

C:\ OS installation

D:\applic Database server installation directory. Contains DBMS binaries

E:\data directory to store data devices

F:\log directory to store transaction log devices

G:\backup to store database backups locally

Networking
The following list shows all relevant network parameters:

SWISS-AS.COM
22/167

allow access on port 5000 (database server port)


enable access and register to DNS
provide NTP synchronization
allow access to www.swiss-as.com using http
allow external access via RDP

Miscellany
Size of Pagefile.sys should be set to half of the physical memory and minimum 4GB.
Disable UAC (user account control)
Disable antivirus check for the database backup folder
Install 7Zip
One of the following packages is required depending on the Windows Server version you are operating

Windows Server 2022


Microsoft Visual C++ 2010 Redistributable Package (x64)
Microsoft Visual C++ 2012 Redistributable Package (x64)
Microsoft Visual C++ 2013 Redistributable Package (x64)
Microsoft Visual C++ 2015 Redistributable Package (x64)

Windows Server 2019


Microsoft Visual C++ 2012 Redistributable Package (x64)
Microsoft Visual C++ 2013 Redistributable Package (x64)

Windows Server 2016


Microsoft Visual C++ 2012 Redistributable Package (x64)
Microsoft Visual C++ 2013 Redistributable Package (x64)

Windows 2012 Server R2


Microsoft Visual C++ 2012 Redistributable Package (x64)
Microsoft Visual C++ 2013 Redistributable Package (x64)

SWISS-AS.COM
23/167

PostgreSQL Database Server Preparation (Windows)


Operating System Users and Groups
On Windows, PostgreSQL service is installed and executed as "Network service". This means that the "NETWORK
SERVICE" user must be granted full control on the tablespaces directories mentioned below.

To operate the Swiss-AS backup & recovery scripts the following user is required:

User Description

amos This is the user that runs Windows scheduled tasks.


_servi
ce This service user must have the right ‘Log on as a service’ on the local machine. This logon right strictly
applies only to the local computer and must be granted in the Local Security Policy.

In case it does not have administrator permissions, this user must be a member of the Windows local
groups "Performance Log Users" and "Performance Monitor Users".

The password for this user must not expire. Having separate application server and database server the
use of domain user is recommended to fully operate the Swiss-AS backup & recovery scripts.

Partitions and Directories


The following table shows the partitions and directories used by the PostgreSQL environment for AMOS (please
refer to the customized hardware recommendation to have the full details):

Partition / Directory Description

D:\applic AMOS and PostgreSQL executables

D:\applic\install Installation files

D:\applic\PostgreSQL PostgreSQL installation directory

E:\data\postgres PostgreSQL instance directory

Note: "Modify" permissions need to be granted to local system user "Network Service"

F:\data\<dbname> AMOS data directory

Note: "Modify" permissions need to be granted to local system user "Network Service"

G:\backup Backup directory

Networking
The following list shows all relevant network parameters:

SWISS-AS.COM
24/167

allow access on port 5432 (database server port)


enable access and register to DNS
provide NTP synchronization
allow access to www.swiss-as.com using http
allow external access via RDP

Miscellany
Size of Pagefile.sys should be set to half of the physical memory and minimum 4GB.
Disable UAC (user account control)
Disable antivirus check for the database backup folder

SWISS-AS.COM
25/167

Database Installation

SWISS-AS.COM
26/167

Installing SAP ASE

Installation Requirements
The SAP ASE installation files can be downloaded from the customer portal on www.swiss-as.com.

Before the server installation can actually start, several parameters need to be defined:

the operating system time zone: the database server and the application server use the operating system
time. Swiss AS recommends to run all servers on UTC time. If the time or timezone is changed after the
installation, data inconsistencies are likely to occur.
the host name, domain name and IP address: for all servers, a static IP and DNS entry need to be defined.

The installation file required to set up the ASE servers should be located in a temporary directory, e.g. /applic/install
for Linux and D:\applic\install for Windows. This file is a compressed archive of the directory of the setup tool. To
install ASE follow these steps:

in Linux log in as user 'sybase'. In Windows use a local admin user.


in Linux extract the installation file in /applic/install. In Windows extract in D:\applic\install.
in Linux change to the setup directory that has been extracted and run the setup tool in console mode:
cd /applic/install/ebf*
setup.bin -i console

Then follow the instructions of setup tool.


in Windows change to the setup directory that has been extracted and run the setup executable setup.exe in
GUI mode

SWISS-AS.COM
27/167

ASE Installation
The installation file required to set up the ASE servers should be located in a temporary directory, e.g. /applic/install
for Linux and D:\applic\install for Windows. This file is a compressed archive of the directory of the setup tool. To
install ASE follow these steps:

in Linux log in as user 'sybase'. In Windows use a local admin user.


in Linux extract the installation file in /applic/install. In Windows extract in D:\applic\install.
in Linux change to the setup directory that has been extracted and run the setup tool in console mode:
cd /applic/install/ebf*
setup.bin -i console

Then follow the instructions of setup tool.


in Windows change to the setup diretory that has been extracted and run the setup executable setup.exe in
GUI mode.

In console and GUI mode, the following information has to be entered in the setup tool.

Choose Product Features: select Adaptive Server Enterprise, Open Client, DB-Library and SySAM License
Utilities. For Windows only : install also Interactive SQL
Software License Type Selection: Install licensed copy of Sybase Adaptive Server Enterprise Suite
End-user License Agreement: Europe,Middle East, and Africa – General. Type 'back' and press ENTER to
skip the LICENSE AGREEMENT.
Sybase Software Asset Management License: Continue installation without a license key
Product Licenses:
Product Edition is Enterprise Edition
License type is: AR : OEM Application Deployment Server License
Sybase Software Asset Management Notification: No
Pre-Installation Summary:

Pre-Installation Summary
Please Review the Following Before Continuing:
Product Name:
Sybase Adaptive Server Enterprise Suite Install
Folder:
/applic/sap_ase
Product Features:
Adaptive Server Enterprise,
Open Client,
DB-Library,
SySAM License Utilities,
Disk Space Information (for Installation Target):
Required: 1,596,898,051 Bytes
Available: 16,057,884,672 Bytes

After the installation of the ASE software, the setup tool allows you to create new instances of ASE servers:
Adaptive Server, Backup Server, XP Server

SWISS-AS.COM
28/167

Configure New Adaptive Server

Adaptive Server Name: AMOS

System Administrator's Password: xxxxxxxxx

Port Number: default 5000

Error Log: default

Application Type: Online Transaction Processing (OLTP)

Page Size: 4K

Default Language: us_english

Default Character Set: utf8

Default Sort Order: binary

Optimize ASE Configuration: No

Create sample databases: No

Master Device: /data/master.dat

Master Device Size: 200 MB

Master Database Size: 100 MB

System Procedure Device: /data/sysprocs.dat

System Procedure Device Size: 250 M

System Procedure Database Size: 250 M

System Device: /data/sybsysdb.dat

System Device Size: 10 M

System Database Size: 10 M

Tempdb Device: /data/tempdb_data1.dat

AMOS Standard in MB AMOS Enterprise in MB

Tempdb Device Size 1000 2000

Tempdb Database Size 1000 2000

Enable PCI: no

SWISS-AS.COM
29/167

Configure New Backup Server

Backup server name : AMOS_BS

Port Number: default 5001


Error Log: default

Configure New XP Server


Port Number: default 5002

Error Log: default

New Server Configuration Summary


Adaptive Server
Adaptive Server Name AMOS
Port Number 5000
Application Type Online Transaction Proccessing (OLTP)
Create sample databases false
Page Size 4k
Error Log /applic/sap_ase/ASE-16_0/install/AMOS.log
Master Device /data/master.dat
Master Device Size (MB) 200
Master Database Size (MB) 100
System Procedure Device /data/sysprocs.dat
System Procedure Device Size (MB) 250
System Procedure Database Size (MB) 250
System Device /data/sybsysdb.dat
System Device Size (MB) 10
System Database Size (MB) 10
Tempdb Device /data/tempdb_data1.dat
Tempdb Device Size (MB) 1000
Tempdb Database Size (MB) 1000
Default Language us_english
Default Character Set utf8
Default Sort Order binary
Backup Server
Backup Server Name AMOS_BS
Port Number 5001
Error Log /applic/sap_ase/ASE-16_0/install/AMOS_XP Server
XP Server Name AMOS_XP
Port Number 5002

SWISS-AS.COM
30/167

ASE Configuration

ASE Environment Variables

Windows Environments
All required environment variables related to database tools like isql and the database server are set globally upon
the installation of the SAP ASE software. No further configuration is required.

Linux Environments
In Linux, the required environment variables related to database tools like isql and the database server needs to be
set for the Linux user 'sybase'. By sourcing script SYBASE.sh from the ASE installation directory all environment
variables will be set. The environment variable DSQUERY that defines the default SAP ASE instance name needs
to added this script.
export DSQUERY=<ASE instance name>

For example, append following line to SYBASE.sh for ASE instance AMOS:
export DSQUERY=AMOS

Include this script in the sybase Linux user's /home/sybase/.bashrc to make sure the environment variables are set
upon login:
source /applic/sap_ase/SYBASE.sh

ASE Parameters and Caches


The ASE configuration needs to be adjusted to meet the requirements of the AMOS application server. Refer to the
ASE Configuration documentation for details. The procedure to change the ASE settings is described hereafter.
Note that a reboot of the database server is required after changing static parameters.

1. static and independent parameters


2. parameters depending on other parameters
3. advanced parameters
4. from Sybase version 15.7 on: thread pools
5. tempdb cache
6. default data cache

The following picture illustrates how ASE allocates memory.

SWISS-AS.COM
31/167

After the configuration of the tempdb cache in step 5, the remaining memory can be used for the default data
cache. Use the following statement to determine the remaining memory:
sp_configure "memory"

The result of this command shows how much memory is left for configuration, for example:
itAn additional 3895942 K bytes of memory is available for reconfiguration. This is the difference
between 'max memory' and 'total logical memory'.

ASE Database Setup

Device Naming Convention


AMOS uses a naming convention to ease the recognition of devices and provide a better overview which device
belongs to a particular database. The convention for database device names recommended by Swiss AS is:

<DBName>_<DeviceType><DeviceNumber>

For a database named prod this would result in the following device names:

prod_data1.dat for a data device


prod_log1.dat for a transaction log device

If you need to add new data devices to the database, just increase the device number. In this case the second data
device would be called:

prod_data2.dat for the second data device

SWISS-AS.COM
32/167

General Sizing and Structural Considerations


Usually, backups of the production database are loaded into other databases for testing or troubleshooting
purposes. The possibility to load a database backup into another database depends on several factors:

the database size of the target database needs to be at least the same size as the source database
the device structure (the sequence of data and log devices in a database) of the target database must be
identical to the structure of the source

So this needs to be taken into consideration when creating any new database. It is best practice to enlarge all other
databases as well after you enlarged the prod database to keep the structure similar. As a recommendation, the
device size should not exceed 20 GB to increase disk I/O performance. Please refer to the Sybase Standards
document for default device sizing : ASE Configuration

General Database Setup


Each user database consists of data and log segment. Usually, each segment is located in a separate database
device represented by a physical device file. For best performance, usage of log and data space should not be
mixed in a database.

To create (data or log) devices, the following SQL command is used:


disk init name="<device name>", physname="<device location>", size="<size in MB>M"

For example:
disk init name="prod_data1", physname="/data/prod_data1.dat", size="5000M"

The SQL command to create a database is:


create database <dbname> on <data device name> = "<size in MB>M" log on <log device name> = "<size in MB>M"

For example:
create database prod on prod_data1 = "20000M" log on prod_log1 = "2000M"

SWISS-AS.COM
33/167

To increase the database size, a data or log device needs to be added (appended) to the database using the
following SQL command:
alter database <dbname> on <additional data device name> = "<size in MB>M" log on <additional log device
name> = "<size in MB>M"

Note that usually only data devices will be appended as the transaction log is purged regularly. The corresponding
SQL command looks like this:
alter database <dbname> on <additional data device name> = "<size in MB>M"

For example:
alter database prod on prod_data2 = "20000M" log on prod_log1 = "2000M"

Note that it is also possible to increase an existing device and alter the database to use the additional space.
Please refer to the ASE documentation regarding the SQL syntax.

Tempdb Database
During the creation of a ASE instance, a temporary database called tempdb is created automatically. The tempdb
uses the same device for both data and transaction log. For better performance, device options dsync and directio
need to be switched off for tempdb devices and a separate log device needs to be added:
disk init name="tempdb_log1",physname="/log/tempdb_log1.dat",size="1000M",dsync=false,directio=false
go
sp_deviceattr tempdbdev,"directio",false
go

and data and transaction log space needs to be separated afterwards.


alter database tempdb log on tempdb_log1="1000M"
go
sp_logdevice tempdb,tempdb_log1
go

Please refer to the ASE Configuration document for details. Tempdb fragments referencing the master database
need to be removed for best performance
use tempdb
go
sp_dropsegment "system", tempdb, master
go
sp_dropsegment "default", tempdb, master
go
sp_dropsegment "logsegment", tempdb, master
go

AMOS User Database


From AMOS 19.6 on a wizard is available in AMOS config server tool to ease the creation of the database objects.
More information can be found in AMOS Server Installation.

SWISS-AS.COM
34/167

Regarding device size, device naming and database options please refer to ASE Configuration Database Standards
document.

Test Database Configuration


The "trunc log on chkpt" option enables the database server to free (truncate) the log segment automatically without
backup to file. This is useful for test databases where no incremental backups will be created. Don't use this option
on production databases as it prevents the creation of incremental backups !
sp_dboption test, "trunc log on chkpt", true

ASE Users and Roles

Database Logins Overview


From AMOS 10.20 on, every AMOS instance is using only two database logins for all database connections:

1. a privileged user for AMOS server connections.


2. an unprivileged user for common AMOS user connections. This login and the corresponding database user
have to be created on database level and registered in the amos_config_server command line tool (Menu
Home > Configuration > Database configuration). During the registration all the required permissions will be
granted to that user.

The following picture illustrates the usage of server logins and database users in AMOS.

SWISS-AS.COM
35/167

Naming Convention
It is recommended to include the database name in the login name as every AMOS instance (ergo every database)
uses a separate set of server login and database user. For example, 'amosuser_prod' for the production
environment or 'amosuser_test'.for a test environment. Additionally, AMOS requires the login name to be equal to
the database user name.

Creating Server Logins and Database Users


The SQL command to create a database login is:
sp_addlogin <login name>,<password>

In the AMOS user database, the corresponding database user needs to be added using the following SQL
commands:
use <database name>
go
sp_adduser <login name>,<database user name>
go

For example:

SWISS-AS.COM
36/167

sp_addlogin amosuser_prod, pwd123


go
use prod
go
sp_adduser amosuser_prod, amosuser_prod
go

The database users can be created as part as the database wizard available from AMOS 19.6. More
information can be found in AMOS Server Installation.

ASE License Installation


The ASE server license is installed by copying the license file provided by Swiss AS to [installation directory]/SYSA
M-2_0/licenses and allowing read permission to the Linux user sybase. The database server checks the license
once a day and during the boot process. Without a license key the database server will stop working after a 30-day
grace period. To check if a ASE instance is licensed correctly, use the following SQL command:
sp_lmconfig
go

which should display the following (relevant information highlighted in red):


Parameter Name Config Value

----------------- ------------

edition EE

license type AR

smtp host smtp

email recipients sybase

email severity NONE

smtp port 25

email sender sybase


License Name Version Quantity Status Expiry Date

--------------- ---------- -------- ------------ --------------------

ASE_HA null 0 not used null

ASE_ASM null 0 not used null

ASE_EFTS null 0 not used null

ASE_DIRS null 0 not used null

SWISS-AS.COM
37/167

ASE_XRAY null 0 not used null

ASE_ENCRYPTION null 0 not used null

ASE_CORE 2013.04240 1 OK Permanent

ASE_PARTITIONS null 0 not used null

ASE_RLAC null 0 not used null

ASE_MESSAGING_TIBJMS null 0 not used null

ASE_MESSAGING_IBMMQ null 0 not used null

ASE_MESSAGING_EASJMS null 0 not used null


Property Name Property Value

------------- --------------

PE EE

LT AR

ME null

MC null

MS null

MM null

CP null

AS A

Changing the System Administrator's Password


The ASE system administrator's password ('sa' login) has to be set initially during installation. The password has to
be registered in the amos_config_server command line tool of every application server that requires access to the
database server. Additionally, the password might have to be provided to any existing database backup and
recovery scripts and boot scripts.

The SQL syntax to change a server login's password is:


sp_password <caller password>,<new password>

For example, to initially set the 'sa' login's password (which is empty after installation) to 'myNewPassword' use the
following SQL command:
sp_password null,myNewPassword
go

SWISS-AS.COM
38/167

Note: From SAP ASE 15.7 and higher, the 'sa' login's password is already set during installation so that this step
might not be required.

Password File .syb_passwd


This file is used to provide the Sybase sa login password to backup and recovery scripts and boot scripts. It should
be defined with the user access rights “400” owned by Linux user 'sybase'. The file should be stored in the ASE
server installation directory (/applic/sap_ase/) that can be accessed using environment variable $SYBASE which
was defined in the file SYBASE.sh. The .syb_passwd file should contain only the password itself. It is read by both
the backup scripts, syb_backup.sh and syb_dump_trans.sh, with the command:
DSPASS=$(cat $SYBASE/.syb_passwd)

Database Server Character Set


To be able to use a different character set than ISO 8859-1 Latin-1 (ASE character set name 'iso_1' or 'roman8' or
'cp850') you have to change both the character set of ASE and of the AMOS server. In most installations of ASE
12.5 and higher, 'iso_1' is used as the default character set. The same sort orders are supported for most other
character sets. To change the default character set, you will have to:

install the new character set


configure Sybase to use it
also configure AMOS server to use it

After that, you must reboot the Sybase server twice for character conversion to take effect ! Please use the
following instructions and log every step you make. Don't forget to backup your databases and the ASE directory.

Identify the default character set in use


Using isql or Interactive SQL run the following statement as user 'sa' to see which character sets are available:
select id,csid,name,description from master..syscharsets
go

the query result looks similar to this:

id csid name description

0 0 ascii_8 ASCII, for use with unspecified 8-bit data.

1 0 iso_1 ISO 8859-1 (Latin-1) - Western European 8-bit character set.

2 0 cp850 Code Page 850 (Multilingual) character set.

3 0 cp437 Code Page 437, (United States) character set.

4 0 roman8 Hewlett-Packard proprietary character set for European locales.

5 0 Mac Macintosh default character set for Western European locales.

SWISS-AS.COM
39/167

50 4 bin_roman8 Binary ordering, for use with the HP Roman8 character set (roman8).

Character sets not displayed here need to be installed before they can be used in the database server's
configuration. The default character set currently used by the database server is configured with parameter 'default
character set id'. To display the current setting use the followin SQL command:
sp_configure 'default character set id'
go

the result might be:

Parameter Name Default Memory Used Config Value Run Value Unit Type

default character set id 1 0 1 1 Id static

In this example the default id is 1 which corresponds to the iso_1 character set.

Installing the new character set


Additional character sets can be found in subdirectory of the ASE server's character set directory (by default $SYBA
SE/charsets/ in Linux and %SYBASE%\charsets in Windows). To install the desired character set, a tool called char
set needs to be used. For example, to install the utf8 character set and the corresponding binary sort order in the
database server, run the follwing command on the command prompt (in Linux as user 'sybase'):
> charset -Usa binary.srt utf8
Please enter sa's Password:
Loading file 'binary.srt'.
Found a [sortorder] section.
This is Class-1 sort order.
Finished loading the Character Set Definition.
Finished loading file 'binary.srt'.
1 sort order loaded successfully

Character set 'utf8' is now installed in the ASE instance.

Changing the default character set


Run the following SQL command again to display the newly installed character set.
select id,csid,name,description from master..syscharsets
go

Compared to the previous result of this query, two more rows should be visible now. E.g. for character set 'utf8':

id csid name description

0 0 ascii_8 ASCII, for use with unspecified 8-bit data.

1 0 iso_1 ISO 8859-1 (Latin-1) - Western European 8-bit character set.

2 0 cp850 Code Page 850 (Multilingual) character set.

SWISS-AS.COM
40/167

3 0 cp437 Code Page 437, (United States) character set.

4 0 roman8 Hewlett-Packard proprietary character set for European locales.

5 0 Mac Macintosh default character set for Western European locales.

50 4 bin_roman8 Binary ordering, for use with the HP Roman8 character set (roman8).

190 0 utf8 Unicode 3.1 UTF-8 Character Set

50 190 bin_utf8 Binary sort order for the ISO 10646-1, UTF-8 multibyte encoding character set (utf8).

Run the following SQL commands to change the default character set. 190 is the id of the new character set 'utf8' to
be used.
sp_configure 'enableunicode conversions', 1
go
sp_configure 'default character set id', 190
go

Note: the ASE instance has to be rebooted twice for this change to take effect ! The first time the ASE
instance is rebooted after changing the default character set, all the system indexes will be verified automatically
and the database server will shut down automatically.

Running dbcc fix_text on all tables containing text columns


If you have changed a database server's character set to a multibyte character set, use SQL command dbcc
fix_text to adjust values in text columns. The syntax is:
dbccfix_text ({table_name | table_id})

Changing to a multibyte character set makes the management of text data more complicated. A text value can be
large enough to cover several pages; therefore, ASE must be able to handle characters that span page boundaries.
To do so, ASE requires additional information on each of the text pages. The database administrator or table owner
must run dbccfix_text on each table that has text data to calculate the new values needed. To see the names of all
tables that contain text data in a particular database, use SQL command:
select sysobjects.name from sysobjects, syscolumns where syscolumns.type = 35 and sysobjects.id = syscolumns.
id
go

The database administrator or table owner must run SQL command dbccfix_text to calculate the new values
needed. The table named must be in the current database. dbccfix_text opens the specified table, calculates the
character statistics required for each text value, and adds the statistics to the appropriate page header fields. This
process can take a long time, depending on the number and size of the text values in a table. dbccfix_text can
generate a large number of log records, which may fill up the transaction log. dbccfix_text performs updates in a
series of small transactions so that if a log becomes full, only a small amount of work is lost. If you run out of log
space, clear out your log. Then restart dbccfix_text, using the same table that was being upgraded when the
original dbccfix_text halted. Each multibyte text value contains information that indicates whether it has been
upgraded, so dbccfix_text upgrades only the text values that were not processed in earlier passes.

SWISS-AS.COM
41/167

Changing the AMOS server's character set


After changing the database server's character set, the AMOS server needs to be changed to use the new
character set. Use the amos_config_server command line tool to change the application server's character set.
From the main menu, open Configuration and then Server Configuration to enter the new character set. For
example, to enter utf8:

Database Boot Scripts


Please refer to chapter System Integration for the setup of boot scripts.

Remove XP Server
ASE XP Server should be disabled as it can be a security breach. Once you have access to the database SA user
you can run any command on that server and therefore run arbitrary commands to manipulate it.

Steps to be followed in order to disable the XP Server:


1. Connect to ASE and drop the XP server from the server list
1> sp_dropserver AMOS_XP
2> go
1> sp_configure 'start xp server', 0
2> go

SWISS-AS.COM
42/167

2. Edit interfaces file and remove the corresponding XP server lines


vi $SYBASE/interfaces

On Windows only, open command prompt as Administrator:

Delete corresponding XP server WIndows service


sc delete SYBXPS_AMOS_XP

SWISS-AS.COM
43/167

ASE Backup & Recovery for Linux

Introduction
Swiss-AS provides linux bash scripts for the backup and recovery of ASE databases used by AMOS. The script's
configuration need to be adapted to the customer's AMOS environment so that they can be used either manually or
scheduled via cron. All scripts make use of a configuration file that stores all required parameters and a so called
toolboxes which are files that define particular functions. Usually, only the configuration files need to be changed by
the customer in order to get the script running.

The latest version of the backup and recovery scripts can be downloaded via the Swiss AS customer portal.

This document describes the script's usage and the configuration.

General Notes
Predefined Configuration files : each script requires a specific set of parameters stored in a configuration file.
A template of each of the three configuration files (backup.cfg, recovery.cfg and logship.cfg) is provided
together with the backup, recovery and logshipping scripts and the toolbox files.
General Toolbox : the toolbox file toolbox.sh defines generic functions used in the backup and recovery
scripts. By default the toolbox file is located in the same directory as the corresponding script.
ASE Toolbox : the toolbox file sybase.toolbox.sh defines ASE specific functions used in the backup and
recovery scripts. By default the toolbox file is located in the same directory as the corresponding script.

Introduction
General Notes
Backup Scripts
Functions
Usage
Configuration Parameters
System Requirements
Recovery Script
Functions
Usage
Configuration Parameters
System Requirements
Logshipping Scripts
Functions
Usage
Configuration Parameters
System Requirements

Backup Scripts
The scripts to create database backups are called syb_backup.sh and syb_dump_trans.sh :

SWISS-AS.COM
44/167

syb_backup.sh : creates a set of backup files of one or more user databases and all system databases of a
given ASE instance.
syb_dump_trans.sh : creates an incremental backup file of one or more user database and truncates the
transaction log of all system databases of a given ASE instance. The backup file is added to the current
backup set

A configuration file (by default etc/backup.cfg) and the toolbox files toolbox.sh and sybase_toolbox.sh are
required by those scripts.

Functions
Full backup script provides the following features:

each database's backup can be compressed and striped to multiple files


outdated backup sets can be automatically removed from the backup directory
each backup set consists of the current full backup files and the incremental backup files that have been
created since the last full backup
creates a backup of all system databases
the script prevents multiple simultaneous executions of a full backup. It queues up a full backup in case an
incremental backup is still running.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files
encrypt the backup files with customized password
parses sybase log for errors in order to monitor them in AMOS Monitoring

Incremental backup script provides the following features:

the backup file is added to the current backup set and is identified by a sequence number and a process ID
by default all databases that are part of the full backup (see syb_backup.ps1) are included, but particular
databases can be omitted
truncates the transaction log of all system databases instead of an incremental backup
the script prevents multiple simultaneous executions
performs check of the configuration parameters before creating backup sets
creates entries in AMOS table in order to monitor the backup via AMOS control center
creates and archives a log file for each run
parses sybase log for errors in order to monitor them in AMOS Monitoring

Usage
The scripts syntax is:
syb_backup.sh [-c | -h | -i| -f <config file> ]
syb_dump_trans.sh [-c | -h | -f <config file> ]

Without the option –f the script uses the configuration file etc/backup.cfg.
Options:

-c : let the script check the configuration only. No backup set is created.
-h : shows the usage
-i : force logshipping script to reload the remote database

SWISS-AS.COM
45/167

-f file : the script uses file as configuration file. Without this option the file etc/backup.cfg is used
by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.
By default the configuration file is etc/backup.cfg or it can be provided using option -f.

Parameter Description

SYBASE_DIR The path of the ASE server folder

SYBASE_ENV The script to set the ASE environment variable

DSPASS The sa login's password file (a restricted access to this file is strongly recommended)

DSQUERY The ASE instance's name

BACKUP_SERVER The ASE backup server instance's name

DATABASES Names of the user databases to be backed up (space separated)

NO_TRAN_DATABAS Names ot the user databases you do not want to backup (space separated)
ES

SYS_DATABASES Names of the system databases to be backed up (space separated)

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

TRAN_BACKUP_PATH Path to the transaction log backup directory

RETENTION_DAYS Amount of days (n * 24h) backup sets shall be stored prior to deletion.

If set to 0, only the last backup set is kept (see PREVIOUS_SET)

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_STRIP The dump can be split into "stripes" to accelerate the backup process. DEFAULT: 2
ES

COMPRESSED Dumps can be compressed to save disk space. [ Y / N ], DEFAULT: Y

COMPR_LEVEL If compression is active (Y), a compression level (0 - 9) must be provided. DEFAULT: 3

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FU Name of the full backup log file


LL

SWISS-AS.COM
46/167

LOGFILE_NAME_TR Name of the incremental backup log file


AN

USE_SESSION_LOG Use session log. [ Y / N ], DEFAULT: N


_TRAN
If enabled, generate one log file per execution. If disabled, use one single file and
append results to it.

LOG_RETENTION_D Amount of days (n * 24h) log files shall be stored prior to deletion.
AYS
If set to 0, all log files will be kept

LOCKFILE Name of the lock file (to avoid simultaneous executions)

RECOVER_LOCKFILE Name of the recovery lockfile (to check if a load of the database is processing).

Must be the same as defined in recover.cfg

SHIP_ACTIVE Log shipping active. [ Y / N ], DEFAULT: N

SHIP_FULLSCRIPT Name of full log shipping script. DEFAULT: logship_full.sh

SHIP_INCSCRIPT Name of incremental log shipping script. DEFAULT: logship_inc.sh

INFORMATION_FOL Folder where the AMOS information files are located. See "server1.info.cfg" config file
DER for further information

DUMP_WITH_SA Defines if the target database has to be onlined with standby access. This parameter
needs to

be enabled if you use the report connection in AMOS. [ Y / N ], DEFAULT: N

DUMP_WITH_SA_REC The transaction log dumped with standby access does not contain the non-commited
transactions, therefore it is

possible to reduce the number of such dumps.

Default: 4

DUMP_PASSWORD Defines the password used to encrypt the dump. If empty the dump is not encrypted.

PARSE_SYB_LOG parses sybase log during the FULL or TRAN backup

PARSE_SYB_LOG_DB defines in which database sybase errors will be written.

System Requirements
The Linux user that runs the backup script needs to have the correct permissions on the required files and
directories.

Recovery Script

SWISS-AS.COM
47/167

The script to recover a database from a full backup is called syb_recover.sh. It loads a set of full database backup
files into a user database of a given ASE instance. Additionally it remaps AMOS users to ASE logins and restarts
the corresponding AMOS server to enforce the reactivation of the AMOS maintenance key. This requires a
password-less SSH login to the host of the AMOS server. A configuration file (by default etc/recovery.cfg) and the
toolbox files toolbox.sh and sybase_toolbox.sh are required by this script.

Functions
The script provides the following features:

it loads a full backup from one or more backup files and onlines the database. It can also load transaction
dumps located in a specific folder.
AMOS users are remapped to Sybase logins
AMOS parameters for the client title and background image can be customized
AMOS workflows and AIM config can be disabled
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS server is previously stopped and restarted at the end to enforce the recovery of the AMOS
maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
allows to save the printer settings and the keystore after the reload of the database
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The script's syntax is:
syb_recover.sh [-c | -h | -f <config file> ]

Without the option –f the script uses the configuration file etc/recovery.cfg.
Options:

-c : let the script check the configuration only. No backup is loaded.


-h : shows the usage
-f file : the script uses file as configuration file. Without this option the file etc/recovery.cfg is used
by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
Parameter Description

RECOVER The path of the ASE server folder


_SYBASE_
DIR

RECOVER The script to set the ASE environment variables


_SYBASE_

SWISS-AS.COM
48/167

ENV

RECOVER The sa login's password file (a restricted access to this file is strongly recommended)
_DSPASS

RECOVER The ASE instance's name


_DSQUERY

RECOVER The ASE backup server instance's name


_BACKUP
_SERVER

RECOVER Name of the user database to be recovered


_DATABA
SE

RECOVER Name of the session log file


_LOGFILE
_NAME

OVERWRI Overwrites last session log file or keep it and appends. DEFAULT: Y
TE_LOGFI
LE

RECOVER Name of the lock file


_LOCKFILE

TITLE_TE AMOS title text


XT

BACKGRO AMOS background image [test,prod,training]


UND_IMG

SOURCE_ Host of source AMOS server


USER
SOURCE_
SRV
SOURCE_
HOST

SOURCE_ Path of source AMOS server


AMOS

MASTERK The source AMOS server's masterkey file


EY

RECOVER Host of target AMOS server


_USER
RECOVER
_SRV
RECOVER
_HOST

Path of target AMOS server

SWISS-AS.COM
49/167

RECOVER
_AMOS

RECOVER The target AMOS server's masterkey file


_MASTER
KEY

RECOVER The main backup directory


_DIR

RECOVER The directory where are located the incremental backups to be loaded after the full dump
_DIR_TRA
NS

RECOVER Backup files of a backup set (Windows powershell: comma separated, Linux bash: space
_FILES separated)

LOG_DIRE This is the directory for logging


CTORY

DISABLE_ Defines if AMOS workflows need to be disabled. [ Y / N ]. DEFAULT : Y


WORKFLO
WS

DISABLE_ Defines if AIM configuration needs to be disabled. [ Y / N ], DEFAULT : Y


AIM_CON
FIG

KEEP_KE Defines if the environment which is recovered will keep its kexytore. [ Y / N ]. DEFAULT: N
YSTORE
This feature shall not be used in case the source and target AMOS environment are on different
versions

Deprecated from AMOS 21.6. Ignored if KEEP_CONFIG is enabled.

KEEP_CO Keep config settings. [ Y / N ] DEFAULT : Y


NFIG
If it is set to "Y", the environment which is recovered will keep its configuration, you can specify
which part of the configuration with KEEP_CONFIG_PARAMETERS.

Remark: configuration will always be exported and stored in <applic>/scripts/keep_config_data.

There will be one file per version and environment. Each time the script is executed it will export
the configuration of the environment for the environment version. If the file already exists it will be
overwritten. Filename: <db_name>_<version>_export_config.zip

The initial export for an environment and a version will be archived/persisted to another filename
(to prevent it from being overwritten). Filename: initial_save_<db_name>_<version>_export_config.
zip

Available from AMOS 19.12 onwards

KEEP_CO Keep config parameters settings. Default: "KEYSTORE"


NFIG_PAR

SWISS-AS.COM
50/167

AMETERS Define which configuration will not be overwritten by the restore. If you don't specify any
configurations, everything gets imported.

Be sure to put the configs in quotation marks and separate them with only a comma (e.g.,
"KEYSTORE,WEBSERVICE_CONFIG").

The options are:

USER_AND_LICENCES
PARAMETERS
KEYSTORE
CUSTOMIZE_APPLICATIONS
WEBSERVICE_CONFIG
FORM_CONFIGURATION
CLEANUP_JOBS
AIM_CONFIGURATION
WORKFLOW_CONFIGURATION
SCHEDULED_TASKS

Available from AMOS 19.12 onwards

PRE_SCRI A script that will be triggered before the backup is loaded


PT

POST_SC A script that will be triggered after the database has been loaded, before AMOS is restarted
RIPT

BACKUP_ Name of the backup lockfile (to check if a backup of the database is processing).
LOCKFILE
Must be the same as defined in backup.cfg.

RECOVER Defines the password used to decrypt the dump. If empty, assuming the dump is not encrypted.
_DUMP_P
ASSWORD

System Requirements
The Linux user that runs the recovery script needs to have the correct permissions on the required files and
directories. Additionally, a password-less SSH login is required between the user running the recovery script and
the user running the target AMOS server (see ssh-keygen for details). The AMOS maintenance key on the target
AMOS instance has to be backed up previously in order to allow automatic maintenance key recovery.

Logshipping Scripts
The scripts used for log shipping are called logship_full.sh and logship_inc.sh. They are usually called
automatically by the full and incremental backup scripts but can also be used manually. They copy a set of backup
files to a remote server and load them into the target database. A configuration file (by default etc/logship.cfg) and
the toolbox files toolbox.sh and sybase_toolbox.sh are required by these scripts.

SWISS-AS.COM
51/167

Functions
The script logship_full provides the following features:

it copies and loads a set of full backup files from a local directory into a remote database. The remote server
is usually used as a standby system.
removes old backup files on the remote server
the script prevents multiple simultaneous executions
performs check of the configuration parameters
synchronizes the AMOS application server and webdrive directories with the remote server
creates and archives a log file for each run
archives logship scripts old log files

The script logship_inc provides the following features:

it copies and loads a set of incremental backup files into the remote database
the backup file of an incremental backup that has been loaded successfully is archived
the script prevents multiple simultaneous executions
performs check of the configuration parameters
creates and archives a log file for each run
archives logship scripts old log files

Usage
The scripts syntax is:
logship_full.sh <logship init [Y/N]> [-c | -h | -f <config file> ] <backup file1> <backup
file2> ...
logship_inc.sh [-c | -h | -f <config file> ]

Without the option –f the script uses the configuration file etc/logship.cfg.
Options:

logship init : force to reload the remote database


-c : let the script check the configuration only. No file is transferred.
-h : shows the usage
-f file : the script uses file as configuration file. Without this option the file etc/logship.cfg is used
by default.
backup file X : all backup files names to be loaded in the remote database

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
Parameter Description

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

SWISS-AS.COM
52/167

TRAN_BACKUP_PATH Path to the transaction log backup directory

SHIP_LOCKFILE Name of the lock file

LOG_DIRECTORY This is the directory for logging

SHIP_LOGFILE_NAME Name of the session log file

SHIP_LOG_RETENTION_D Amount of days (n * 24h) log files shall be stored prior to deletion.
AYS
If set to 0, all log files will be kept

SHIPDB The target database

SHIP_DSQUERY The target Sybase instance (defined in local interfaces file)

SHIP_DSPASS The target Sybase instance's sa password

REMOTE_SHIP_PATH Path of remote backup directory

REMOTE_SHIP_PATH_LOG Path of remote transaction log backup directory

REMOTE_SHIP_PATH_ARC Path of remote transaction log archive directory


HIVE

SHIP_SRV User and Hostname of target database server

SHIP_PATH The remote backup directory including user and host

SHIP_TRANS_LOG_PATH Path to the tran log folder on the remote server

SHIP_TRANS_ARCHIVE_P Path to the archive log folder on the remote server


ATH

SHIP_FROM_AMOS_USER Host of source AMOS server


SHIP_FROM_AMOS_SRV
SHIP_FROM_AMOS_HOST

SHIP_FROM_AMOS_DIR The source AMOS directory

SHIP_FROM_AMOS_WEBD The source AMOS webdrive directory (derived)


RIVE

SHIP_TO_AMOS_USER Host of target AMOS server


SHIP_TO_AMOS_SRV
SHIP_TO_AMOS_HOST

SHIP_TO_AMOS_DIR The target AMOS directory

SHIP_TO_AMOS_WEBDRIVE The target AMOS webdrive directory

SHIP_DUMP_PASSWORD Defines the password used to decrypt the dump. If empty, assuming the dump is
not encrypted.

SWISS-AS.COM
53/167

System Requirements
The Linux user that runs the recovery script needs to have the correct permissions on the required files and
directories. Additionally, a password-less SSH login is required between the user running the logship scripts and the
user running the target AMOS and DB servers (see ssh-keygen for details).

SWISS-AS.COM
54/167

ASE Backup & Recovery for Windows

Introduction
Swiss-AS provides powershell for the backup and recovery of ASE databases used by AMOS. The script's
configuration need to be adapted to the customer's AMOS environment so that they can be used either manually or
scheduled via the task scheduler. All scripts make use of a configuration file that stores all required parameters and
a so called toolboxes which are files that define particular functions. Usually, only the configuration files need to be
changed by the customer in order to get the script running.

The latest version of the backup and recovery scripts can be downloaded via the Swiss AS customer portal.

This document describes the script's usage and the configuration.

General Notes
Predefined Configuration files : each script requires a specific set of parameters stored in a configuration file.
A template of each of the three configuration files (backup.cfg.ps1, recovery.cfg.ps1 and logship.cfg.ps1) is
provided together with the backup, recovery and logshipping scripts and the toolbox files.
General Toolbox : the toolbox file toolbox.ps1 defines generic functions used in the backup and recovery
scripts. By default the toolbox file is located in the same directory as the corresponding script.
ASE Toolbox : the toolbox file sybase_toolbox.ps1 defines ASE specific functions used in the backup and
recovery scripts. By default the toolbox file is located in the same directory as the corresponding script.
Powershell execution policy : to be able to run powershell scripts on a host, the execution policy needs to be
adjusted (see Set-ExecutionPolicy command). It is possible the change the policy to the whole server or only
for one script execution (see ByPass execution policy)

Introduction
General Notes
Backup Scripts
Functions
Usage
System Requirements
Recovery Script
Functions
Usage
Configuration Parameters
System Requirements
Logshipping Scripts
Usage
Configuration Parameters
System Requirements
Introduction
General Notes
Backup Scripts
Functions
Usage
System Requirements
Recovery Script

SWISS-AS.COM
55/167

Functions
Usage
Configuration Parameters
System Requirements
Logshipping Scripts
Usage
Configuration Parameters
System Requirements

Backup Scripts
The scripts to create database backups are called syb_backup.ps1 and syb_dump_trans.ps1 :

syb_backup.ps1 : creates a set of backup files of one or more user databases and all system databases of
a given ASE instance.
syb_dump_trans.ps1 : creates an incremental backup file of one or more user database and truncates the
transaction log of all system databases of a given ASE instance. The backup file is added to the current
backup set

A configuration file (by default etc/backup.cfg.ps1) and the toolbox files toolbox.ps1 and sybase_toolbox.ps1
are required by those scripts.

Functions
Full backup script provides the following features:

each database's backup can be compressed and striped to multiple files


outdated backup sets can be automatically removed from the backup directory
each backup set consists of the current full backup files and the incremental backup files that have been
created since the last full backup
creates a backup of all system databases
the script prevents multiple simultaneous executions of a full backup. It queues up a full backup in case an
incremental backup is still running.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files
encrypt the backup files with customized password
parses sybase log for errors in order to monitor them in AMOS Monitoring

Incremental backup script provides the following features:

the backup file is added to the current backup set and is identified by a sequence number and a process ID
by default all databases that are part of the full backup (see syb_backup.ps1) are included, but particular
databases can be omitted
truncates the transaction log of all system databases instead of an incremental backup
the script prevents multiple simultaneous executions
performs check of the configuration parameters before creating backup sets
creates entries in AMOS table in order to monitor the backup via AMOS control center
creates and archives a log file for each run
parses sybase log for errors in order to monitor them in AMOS Monitoring

SWISS-AS.COM
56/167

Usage
The scripts syntax is:
syb_backup.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -LogshipInit [$true|$false]
| -ConfigFile <config file> ]
syb_dump_trans.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config
file> ]

Without the option –ConfigFile the script uses the configuration file etc/backup.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-LogshipInit : force logshipping script to reload the remote database
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/backup.cfg.
ps1 is used by default.

The required toolbox files need to be located in the same directory as the script itself.

Parameter Description

SYBASE_DIR The path of the ASE server folder

SYBASE_ENV The script to set the ASE environment variable

DSPASS The sa login's password file (a restricted access to this file is strongly recommended)

DSQUERY The ASE instance's name

BACKUP_SERVER The ASE backup server instance's name

DATABASES Names of the user databases to be backed up (comma separated)

NO_TRAN_DATABAS Names ot the user databases you do not want to backup (comma separated)
ES

SYS_DATABASES Names of the system databases to be backed up (comma separated)

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

TRAN_BACKUP_PATH Path to the transaction log backup directory

RETENTION_DAYS Amount of days (n * 24h) backup sets shall be stored prior to deletion.

If set to 0, only the last backup set is kept (see PREVIOUS_SET)

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_STRIP The dump can be split into "stripes" to accelerate the backup process. DEFAULT: 2
ES

SWISS-AS.COM
57/167

COMPRESSED Dumps can be compressed to save disk space. [ $true / $false ], DEFAULT: $true

COMPR_LEVEL If compression is active ($true), a compression level (0 - 9) must be provided.


DEFAULT: 3

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FU Name of the full backup log file


LL

LOGFILE_NAME_TR Name of the incremental backup log file


AN

USE_SESSION_LOG Use session log. [ $true / $false ], DEFAULT: $false


_TRAN
If enabled, generate one log file per execution. If disabled, use one single file and
append results to it.

LOG_RETENTION_D Amount of days (n * 24h) log files shall be stored prior to deletion.
AYS
If set to 0, all log files will be kept

LOCKFILE Name of the lock file (to avoid simultaneous executions)

RECOVER_LOCKFILE Name of the recovery lockfile (to check if a load of the database is processing).

Must be the same as defined in recover.cfg.ps1

SHIP_ACTIVE Log shipping active. [ $true / $false ], DEFAULT: $false

SHIP_FULLSCRIPT Name of full log shipping script. DEFAULT: logship_full.ps1

SHIP_INCSCRIPT Name of incremental log shipping script. DEFAULT: logship_inc.ps1

INFORMATION_FOL Folder where the AMOS information files are located. See "server1.info.cfg" config file
DER for further information

DUMP_WITH_SA Defines if the target database has to be onlined with standby access. This parameter
needs to

be enabled if you use the report connection in AMOS. [ $true / $false ], DEFAULT:
$false

DUMP_WITH_SA_REC The transaction log dumped with standby access does not contain the non-commited
transactions, therefore it is

possible to reduce the number of such dumps.

Default: 4

DUMP_PASSWORD Defines the password used to encrypt the dump. If empty the dump is not encrypted.

SWISS-AS.COM
58/167

System Requirements
The Windows user that runs the backup script needs to have the correct permissions on the required files and
directories.

Recovery Script
The script to recover a database from a full backup is called syb_recover.ps1. It loads a set of full database
backup files into a user database of a given ASE instance. Additionally it remaps AMOS users to ASE logins and
restarts the corresponding AMOS server to enforce the reactivation of the AMOS maintenance key. A configuration
file (by default etc/recovery.cfg.ps1) and the toolbox files toolbox.ps1 and sybase_toolbox.ps1 are required by
this script.

Functions
The script provides the following features:

it loads a full backup from one or more backup files and onlines the database. It can also load transaction
dumps located in a specific folder.
AMOS users are remapped to Sybase logins
AMOS parameters for the client title and background image can be customized
AMOS workflows and AIM config can be disabled
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS server is previously stopped and restarted at the end to enforce the recovery of the AMOS
maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
allows to save the printer settings and the keystore after the reload of the database
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The script's syntax is:
syb_recover.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>
]

Without the option –ConfigFile the script uses the configuration file etc/recovery.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup is loaded.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/recovery.
cfg.ps1 is used by default.

The required toolbox files need to be located in the same directory as the script itself.

SWISS-AS.COM
59/167

Configuration Parameters
Parameter Description

RECOVER The path of the ASE server folder


_SYBASE_
DIR

RECOVER The script to set the ASE environment variables


_SYBASE_
ENV

RECOVER The sa login's password file (a restricted access to this file is strongly recommended)
_DSPASS

RECOVER The ASE instance's name


_DSQUERY

RECOVER The ASE backup server instance's name


_BACKUP
_SERVER

RECOVER Name of the user database to be recovered


_DATABA
SE

RECOVER Name of the session log file


_LOGFILE
_NAME

OVERWRI Overwrites last session log file or keep it and appends. DEFAULT: $true
TE_LOGFI
LE

RECOVER Name of the lock file


_LOCKFILE

TITLE_TE AMOS title text


XT

BACKGRO AMOS background image [test,prod,training]


UND_IMG

SOURCE_ Host of source AMOS server


HOST

SOURCE_ Path of source AMOS server


AMOS

MASTERK The source AMOS server's masterkey file


EY

RECOVER Host of target AMOS server (derived)


_HOST

SWISS-AS.COM
60/167

RECOVER Target AMOS server (could be the same if AMOS and Sybase are on the same host)
_AMOS_L
OCAL
RECOVER
_AMOS

RECOVER The target AMOS server's masterkey file


_MASTER
KEY

RECOVER The target AMOS server's service name


_SERVICE

RECOVER The main backup directory


_DIR

RECOVER The directory where are located the incremental backups to be loaded after the full dump. Default :
_DIR_TRA $null
NS

RECOVER Backup files of a backup set (Windows powershell: comma separated, Linux bash: space
_FILES separated)

LOG_DIRE This is the directory for logging


CTORY

DISABLE_ Defines if AMOS workflows need to be disabled. [$true / $false]. DEFAULT : $true
WORKFLO
WS

DISABLE_ Defines if AIM configuration needs to be deleted. [$true / $false], DEFAULT : $true
AIM_CON
FIG

KEEP_KE Defines if the environment which is recovered will keep its keystore. [$true / $false]. DEFAULT:
YSTORE $false

Deprecated from AMOS 21.6. Ignored if KEEP_CONFIG is enabled.

This feature shall not be used in case the source and target AMOS environment are on different
versions

KEEP_CO Keep config settings. [$true / $false]. DEFAULT: $true


NFIG
If it is set to "$true", the environment which is recovered will keep its configuration, you can specify
which part of the configuration with KEEP_CONFIG_PARAMETERS.

Remark: configuration will always be exported and stored in <applic>/scripts/keep_config_data.

There will be one file per version and environment. Each time the script is executed it will export
the configuration of the environment for the environment version. If the file already exists it will be
overwritten. Filename: <db_name>_<version>_export_config.zip

SWISS-AS.COM
61/167

The initial export for an environment and a version will be archived/persisted to another filename
(to prevent it from being overwritten). Filename: initial_save_<db_name>_<version>_export_config.
zip

Available from AMOS 19.12 onwards

KEEP_CO Keep config parameters settings. Default: "KEYSTORE"


NFIG_PAR
AMETERS Define which configuration will not be overwritten by the restore. If you don't specify any
configurations, everything gets imported.

Be sure to put the configs in quotation marks and separate them with only a comma (e.g.,
"KEYSTORE,WEBSERVICE_CONFIG").

The options are:

USER_AND_LICENCES
PARAMETERS
KEYSTORE
CUSTOMIZE_APPLICATIONS
WEBSERVICE_CONFIG
FORM_CONFIGURATION
CLEANUP_JOBS
AIM_CONFIGURATION
WORKFLOW_CONFIGURATION
SCHEDULED_TASKS

Available from AMOS 19.12 onwards

PRE_SCRI A script that will be triggered before the backup is loaded


PT

POST_SC A script that will be triggered after the database has been loaded, before AMOS is restarted
RIPT

BACKUP_ Name of the backup lockfile (to check if a backup of the database is processing).
LOCKFILE
Must be the same as defined in backup.cfg.ps1

RECOVER Defines the password used to decrypt the dump. If empty, assuming the dump is not encrypted.
_DUMP_P
ASSWORD

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files
and directories (including remote ones).
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.
AMOS Config server tool is remotely executed on the target AMOS host, so make sure WinRM is well
configured regarding Java Memory consumption.

SWISS-AS.COM
62/167

Logshipping Scripts
The scripts used for log shipping are called logship_full.ps1 and logship_inc.ps1. They are usually called
automatically by the full and incremental backup scripts but can also be used manually. They copy a set of backup
files to a remote server and load them into the target database. A configuration file (by default etc/logship.cfg.ps1)
and the toolbox files toolbox.ps1 and sybase_toolbox.ps1 are required by these scripts.

Usage
The scripts syntax is:
logship_full.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config
file> ] | -LogshipInit [$true|$false] | -FileNames "<backup file1>","<backup file2>",...
logship_inc.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>
]

Without the option –ConfigFile the script uses the configuration file etc/logship.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No file is transferred.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/logship.cfg
is used by default.
-LogshipInit: force to reload the remote database
-FileNames "<backup file1>","<backup file2>" : all database backup files to be reloaded in the
remote database.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
Parameter Description

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

TRAN_BACKUP_PATH Path to the transaction log backup directory

SHIP_LOCKFILE Name of the lock file

LOG_DIRECTORY This is the directory for logging

SHIP_LOGFILE_NAME Name of the session log file

SHIP_LOG_RETENTION_DAYS Amount of days (n * 24h) log files shall be stored prior to deletion.

If set to 0, all log files will be kept

SHIPDB The target database

SWISS-AS.COM
63/167

SHIP_DSQUERY The target Sybase instance (defined in local interfaces file)

SHIP_DSPASS The target Sybase instance's sa password

REMOTE_SHIP_PATH Path of remote backup directory

REMOTE_SHIP_PATH_LOCAL Local path of remote backup directory

REMOTE_SHIP_PATH_LOG Path of remote transaction log backup directory

REMOTE_SHIP_PATH_LOG_ Local path of remote transaction log backup directory


LOCAL

REMOTE_SHIP_PATH_ARCH Path of remote transaction log archive directory


IVE

SHIP_SRV Hostname of target database server

SHIP_FROM_AMOS_HOST Host of source AMOS server

SHIP_FROM_AMOS_DIR The source AMOS directory

SHIP_FROM_AMOS_WEBDRI The source AMOS webdrive directory (derived)


VE

SHIP_TO_AMOS_HOST Host of target AMOS server

SHIP_TO_AMOS_DIR The target AMOS directory

SHIP_TO_AMOS_WEBDRIVE The target AMOS webdrive directory

SHIP_DUMP_PASSWORD Defines the password used to decrypt the dump. If empty, assuming the dump
is not encrypted.

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files and
directories (including remote ones).

Introduction
Swiss-AS provides powershell for the backup and recovery of ASE databases used by AMOS. The script's
configuration need to be adapted to the customer's AMOS environment so that they can be used either manually or
scheduled via the task scheduler. All scripts make use of a configuration file that stores all required parameters and
a so called toolboxes which are files that define particular functions. Usually, only the configuration files need to be
changed by the customer in order to get the script running.

The latest version of the backup and recovery scripts can be downloaded via the Swiss AS customer portal.

This document describes the script's usage and the configuration.

SWISS-AS.COM
64/167

General Notes
Predefined Configuration files : each script requires a specific set of parameters stored in a configuration file.
A template of each of the three configuration files (backup.cfg.ps1, recovery.cfg.ps1 and logship.cfg.ps1) is
provided together with the backup, recovery and logshipping scripts and the toolbox files.
General Toolbox : the toolbox file toolbox.ps1 defines generic functions used in the backup and recovery
scripts. By default the toolbox file is located in the same directory as the corresponding script.
ASE Toolbox : the toolbox file sybase_toolbox.ps1 defines ASE specific functions used in the backup and
recovery scripts. By default the toolbox file is located in the same directory as the corresponding script.
Powershell execution policy : to be able to run powershell scripts on a host, the execution policy needs to be
adjusted (see Set-ExecutionPolicy command). It is possible the change the policy to the whole server or only
for one script execution (see ByPass execution policy)

Introduction
General Notes
Backup Scripts
Functions
Usage
System Requirements
Recovery Script
Functions
Usage
Configuration Parameters
System Requirements
Logshipping Scripts
Usage
Configuration Parameters
System Requirements
Introduction
General Notes
Backup Scripts
Functions
Usage
System Requirements
Recovery Script
Functions
Usage
Configuration Parameters
System Requirements
Logshipping Scripts
Usage
Configuration Parameters
System Requirements

Backup Scripts
The scripts to create database backups are called syb_backup.ps1 and syb_dump_trans.ps1 :

syb_backup.ps1 : creates a set of backup files of one or more user databases and all system databases of
a given ASE instance.

SWISS-AS.COM
65/167

syb_dump_trans.ps1 : creates an incremental backup file of one or more user database and truncates the
transaction log of all system databases of a given ASE instance. The backup file is added to the current
backup set

A configuration file (by default etc/backup.cfg.ps1) and the toolbox files toolbox.ps1 and sybase_toolbox.ps1
are required by those scripts.

Functions
Full backup script provides the following features:

each database's backup can be compressed and striped to multiple files


outdated backup sets can be automatically removed from the backup directory
each backup set consists of the current full backup files and the incremental backup files that have been
created since the last full backup
creates a backup of all system databases
the script prevents multiple simultaneous executions of a full backup. It queues up a full backup in case an
incremental backup is still running.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files
encrypt the backup files with customized password
parses sybase log for errors in order to monitor them in AMOS Monitoring

Incremental backup script provides the following features:

the backup file is added to the current backup set and is identified by a sequence number and a process ID
by default all databases that are part of the full backup (see syb_backup.ps1) are included, but particular
databases can be omitted
truncates the transaction log of all system databases instead of an incremental backup
the script prevents multiple simultaneous executions
performs check of the configuration parameters before creating backup sets
creates entries in AMOS table in order to monitor the backup via AMOS control center
creates and archives a log file for each run
parses sybase log for errors in order to monitor them in AMOS Monitoring

Usage
The scripts syntax is:
syb_backup.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -LogshipInit [$true|$false]
| -ConfigFile <config file> ]
syb_dump_trans.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config
file> ]

Without the option –ConfigFile the script uses the configuration file etc/backup.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-LogshipInit : force logshipping script to reload the remote database

SWISS-AS.COM
66/167

-ConfigFile file : the script uses file as configuration file. Without this option the file etc/backup.cfg.
ps1 is used by default.

The required toolbox files need to be located in the same directory as the script itself.

Parameter Description

SYBASE_DIR The path of the ASE server folder

SYBASE_ENV The script to set the ASE environment variable

DSPASS The sa login's password file (a restricted access to this file is strongly recommended)

DSQUERY The ASE instance's name

BACKUP_SERVER The ASE backup server instance's name

DATABASES Names of the user databases to be backed up (comma separated)

NO_TRAN_DATABAS Names ot the user databases you do not want to backup (comma separated)
ES

SYS_DATABASES Names of the system databases to be backed up (comma separated)

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

TRAN_BACKUP_PATH Path to the transaction log backup directory

RETENTION_DAYS Amount of days (n * 24h) backup sets shall be stored prior to deletion.

If set to 0, only the last backup set is kept (see PREVIOUS_SET)

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_STRIP The dump can be split into "stripes" to accelerate the backup process. DEFAULT: 2
ES

COMPRESSED Dumps can be compressed to save disk space. [ $true / $false ], DEFAULT: $true

COMPR_LEVEL If compression is active ($true), a compression level (0 - 9) must be provided.


DEFAULT: 3

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FU Name of the full backup log file


LL

LOGFILE_NAME_TR Name of the incremental backup log file


AN

USE_SESSION_LOG Use session log. [ $true / $false ], DEFAULT: $false


_TRAN

SWISS-AS.COM
67/167

If enabled, generate one log file per execution. If disabled, use one single file and
append results to it.

LOG_RETENTION_D Amount of days (n * 24h) log files shall be stored prior to deletion.
AYS
If set to 0, all log files will be kept

LOCKFILE Name of the lock file (to avoid simultaneous executions)

RECOVER_LOCKFILE Name of the recovery lockfile (to check if a load of the database is processing).

Must be the same as defined in recover.cfg.ps1

SHIP_ACTIVE Log shipping active. [ $true / $false ], DEFAULT: $false

SHIP_FULLSCRIPT Name of full log shipping script. DEFAULT: logship_full.ps1

SHIP_INCSCRIPT Name of incremental log shipping script. DEFAULT: logship_inc.ps1

INFORMATION_FOL Folder where the AMOS information files are located. See "server1.info.cfg" config file
DER for further information

DUMP_WITH_SA Defines if the target database has to be onlined with standby access. This parameter
needs to

be enabled if you use the report connection in AMOS. [ $true / $false ], DEFAULT:
$false

DUMP_WITH_SA_REC The transaction log dumped with standby access does not contain the non-commited
transactions, therefore it is

possible to reduce the number of such dumps.

Default: 4

DUMP_PASSWORD Defines the password used to encrypt the dump. If empty the dump is not encrypted.

System Requirements
The Windows user that runs the backup script needs to have the correct permissions on the required files and
directories.

Recovery Script
The script to recover a database from a full backup is called syb_recover.ps1. It loads a set of full database
backup files into a user database of a given ASE instance. Additionally it remaps AMOS users to ASE logins and
restarts the corresponding AMOS server to enforce the reactivation of the AMOS maintenance key. A configuration
file (by default etc/recovery.cfg.ps1) and the toolbox files toolbox.ps1 and sybase_toolbox.ps1 are required by
this script.

SWISS-AS.COM
68/167

Functions
The script provides the following features:

it loads a full backup from one or more backup files and onlines the database. It can also load transaction
dumps located in a specific folder.
AMOS users are remapped to Sybase logins
AMOS parameters for the client title and background image can be customized
AMOS workflows and AIM config can be disabled
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS server is previously stopped and restarted at the end to enforce the recovery of the AMOS
maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
allows to save the printer settings and the keystore after the reload of the database
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The script's syntax is:
syb_recover.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>
]

Without the option –ConfigFile the script uses the configuration file etc/recovery.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup is loaded.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/recovery.
cfg.ps1 is used by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
Parameter Description

RECOVER_SYBASE_DIR The path of the ASE server folder

RECOVER_SYBASE_ENV The script to set the ASE environment variables

RECOVER_DSPASS The sa login's password file (a restricted access to this file is strongly recommended)

RECOVER_DSQUERY The ASE instance's name

RECOVER_BACKUP_S The ASE backup server instance's name


ERVER

RECOVER_DATABASE Name of the user database to be recovered

SWISS-AS.COM
69/167

RECOVER_LOGFILE_N Name of the session log file


AME

OVERWRITE_LOGFILE Overwrites last session log file or keep it and appends. DEFAULT: $true

RECOVER_LOCKFILE Name of the lock file

TITLE_TEXT AMOS title text

BACKGROUND_IMG AMOS background image [test,prod,training]

SOURCE_HOST Host of source AMOS server

SOURCE_AMOS Path of source AMOS server

MASTERKEY The source AMOS server's masterkey file

RECOVER_HOST Host of target AMOS server (derived)

RECOVER_AMOS_LOC Target AMOS server (could be the same if AMOS and Sybase are on the same host)
AL
RECOVER_AMOS

RECOVER_MASTERKEY The target AMOS server's masterkey file

RECOVER_SERVICE The target AMOS server's service name

RECOVER_DIR The main backup directory

RECOVER_DIR_TRANS The directory where are located the incremental backups to be loaded after the full
dump. Default : $null

RECOVER_FILES Backup files of a backup set (Windows powershell: comma separated, Linux bash:
space separated)

LOG_DIRECTORY This is the directory for logging

DISABLE_WORKFLOWS Defines if AMOS workflows need to be disabled. [$true / $false]. DEFAULT : $true

DISABLE_AIM_CONFIG Defines if AIM configuration needs to be deleted. [$true / $false], DEFAULT : $true

KEEP_KEYSTORE Defines if the environment which is recovered will keep its keystore. [$true / $false].
DEFAULT: $true

This feature shall not be used in case the source and target AMOS environment are
on different versions

KEEP_PRINTERS_SETT Defines if the environment which is recovered will keep its printers settings. [$true /
INGS $false]. DEFAULT: $false

PRE_SCRIPT A script that will be triggered before the backup is loaded

POST_SCRIPT A script that will be triggered after the database has been loaded, before AMOS is
restarted

SWISS-AS.COM
70/167

BACKUP_LOCKFILE Name of the backup lockfile (to check if a backup of the database is processing).

Must be the same as defined in backup.cfg.ps1

RECOVER_DUMP_PAS Defines the password used to decrypt the dump. If empty, assuming the dump is not
SWORD encrypted.

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files
and directories (including remote ones).
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.
AMOS Config server tool is remotely executed on the target AMOS host, so make sure WinRM is well
configured regarding Java Memory consumption.

Logshipping Scripts
The scripts used for log shipping are called logship_full.ps1 and logship_inc.ps1. They are usually called
automatically by the full and incremental backup scripts but can also be used manually. They copy a set of backup
files to a remote server and load them into the target database. A configuration file (by default etc/logship.cfg.ps1)
and the toolbox files toolbox.ps1 and sybase_toolbox.ps1 are required by these scripts.

Usage
The scripts syntax is:
logship_full.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config
file> ] | -LogshipInit [$true|$false] | -FileNames "<backup file1>","<backup file2>",...
logship_inc.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>
]

Without the option –ConfigFile the script uses the configuration file etc/logship.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No file is transferred.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/logship.cfg
is used by default.
-LogshipInit: force to reload the remote database
-FileNames "<backup file1>","<backup file2>" : all database backup files to be reloaded in the
remote database.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
Parameter Description

SWISS-AS.COM
71/167

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

TRAN_BACKUP_PATH Path to the transaction log backup directory

SHIP_LOCKFILE Name of the lock file

LOG_DIRECTORY This is the directory for logging

SHIP_LOGFILE_NAME Name of the session log file

SHIP_LOG_RETENTION_DAYS Amount of days (n * 24h) log files shall be stored prior to deletion.

If set to 0, all log files will be kept

SHIPDB The target database

SHIP_DSQUERY The target Sybase instance (defined in local interfaces file)

SHIP_DSPASS The target Sybase instance's sa password

REMOTE_SHIP_PATH Path of remote backup directory

REMOTE_SHIP_PATH_LOCAL Local path of remote backup directory

REMOTE_SHIP_PATH_LOG Path of remote transaction log backup directory

REMOTE_SHIP_PATH_LOG_ Local path of remote transaction log backup directory


LOCAL

REMOTE_SHIP_PATH_ARCH Path of remote transaction log archive directory


IVE

SHIP_SRV Hostname of target database server

SHIP_FROM_AMOS_HOST Host of source AMOS server

SHIP_FROM_AMOS_DIR The source AMOS directory

SHIP_FROM_AMOS_WEBDRI The source AMOS webdrive directory (derived)


VE

SHIP_TO_AMOS_HOST Host of target AMOS server

SHIP_TO_AMOS_DIR The target AMOS directory

SHIP_TO_AMOS_WEBDRIVE The target AMOS webdrive directory

SHIP_DUMP_PASSWORD Defines the password used to decrypt the dump. If empty, assuming the dump
is not encrypted.

SWISS-AS.COM
72/167

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files and
directories (including remote ones).

SWISS-AS.COM
73/167

Installing Oracle

General Note
Generally, the responsibility of the technical database support lies with the customer. Support within the following
areas of Oracle database administration will not be provided by Swiss-AS on standard support services, but can be
requested on an individual basis via RfS:

Database installation, configuration and interfacing


Backup & recovery, database replication, business continuity
DBMS release upgrade and patches
Monitoring and tuning
Licensing and service requests
AMOS Operational Support (AOS), database tasks related to the AMOS release change

Please refer to the Oracle installation Guides regarding installation details.

SWISS-AS.COM
74/167

Oracle DBMS Configuration

Oracle Users and Roles


From AMOS 10.20 on, every AMOS instance is using two database users for all database connections:

1. a privileged user for AMOS server connections. This user's schema will be used to store AMOS tables.
Privileges are defined in a database role that will be granted to
this user. When using multiple AMOS instances, all privileged database users can be granted the same role.
2. an unprivileged user for common AMOS user connection.

The database role and the users have to be created on the database level. Both users have to be registered
afterwards in the amos_config_server command line tool (Menu 7 – Set database user for AMOS server). During
the registration all the required table permissions will be granted to the unprivileged user. Do not grant rights directly
to a user, but always to the appropriate role. Compare the following scripts.

Create the Privileged User


The following commands have to be executed in the database. A role, containing all permissions, and a database
user will be created. It is recommended to create a separate default tablespace per privileged user in the Oracle
instance. The default tablespace of the privileged user will contain all the AMOS tables. Do not use the default
"Users" Tablespace.

Create AMOS Roles


--Create the AMOS server role
CREATE ROLE "AMOS_SERVER_R";
--Create the AMOS user role
CREATE ROLE "AMOS_USER_R";
--Create the AMOS monitor role
CREATE ROLE "AMOS_MONITOR_R";

--AMOS_SERVER_R
--Grant user operations
GRANT CREATE USER TO "AMOS_SERVER_R";
GRANT ALTER USER TO "AMOS_SERVER_R";
GRANT DROP USER TO "AMOS_SERVER_R";
GRANT ALTER SESSION TO "AMOS_SERVER_R" WITH ADMIN OPTION;
GRANT CREATE SESSION TO "AMOS_SERVER_R" WITH ADMIN OPTION;
GRANT ANALYZE ANY TO "AMOS_SERVER_R";
--Grant create database objects
GRANT CREATE TABLE TO "AMOS_SERVER_R";
GRANT CREATE TRIGGER TO "AMOS_SERVER_R";
GRANT CREATE ROLE TO "AMOS_SERVER_R";
GRANT CREATE PROCEDURE TO "AMOS_SERVER_R";
GRANT CREATE SEQUENCE TO "AMOS_SERVER_R";
GRANT CREATE JOB TO "AMOS_SERVER_R";
--GRANT tuning information
GRANT ADVISOR TO "AMOS_SERVER_R";
GRANT ADMINISTER SQL TUNING SET TO "AMOS_SERVER_R";
GRANT SELECT ANY DICTIONARY TO "AMOS_SERVER_R";
GRANT MANAGE SCHEDULER TO "AMOS_SERVER_R";
GRANT MANAGE ANY QUEUE TO "AMOS_SERVER_R";
GRANT GATHER_SYSTEM_STATISTICS TO "AMOS_SERVER_R";

SWISS-AS.COM
75/167

GRANT SELECT ON DBA_ADVISOR_FINDINGS TO "AMOS_SERVER_R";


--Grant specific selects
GRANT SELECT ON DBA_USERS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_ROLES TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_OBJECTS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_ROLE_PRIVS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_DATA_FILES TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_FREE_SPACE TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_SEGMENTS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_EXTENTS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_TABLESPACES TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_LOBS TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_RSRC_IO_CALIBRATE TO "AMOS_SERVER_R";
GRANT SELECT ON DBA_OUTSTANDING_ALERTS TO "AMOS_SERVER_R";
--RAC
GRANT SELECT ON GV_$SESSION TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$SESSTAT TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$CONTROLFILE TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$LOG TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$LOGFILE TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$SQL TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$PROCESS TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$LOCKED_OBJECT TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$INSTANCE TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$FILESTAT TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$PARAMETER TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$SYSTEM_PARAMETER TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$STATNAME TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$DATABASE TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$SGASTAT TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$RESERVED_WORDS TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$TEMPFILE TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$DATAFILE TO "AMOS_SERVER_R";
--Single Instance
GRANT SELECT ON V_$SESSION TO "AMOS_SERVER_R";
GRANT SELECT ON V_$SESSTAT TO "AMOS_SERVER_R";
GRANT SELECT ON V_$CONTROLFILE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$LOG TO "AMOS_SERVER_R";
GRANT SELECT ON V_$LOGFILE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$SQL TO "AMOS_SERVER_R";
GRANT SELECT ON V_$PROCESS TO "AMOS_SERVER_R";
GRANT SELECT ON V_$LOCKED_OBJECT TO "AMOS_SERVER_R";
GRANT SELECT ON V_$INSTANCE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$FILESTAT TO "AMOS_SERVER_R";
GRANT SELECT ON V_$PARAMETER TO "AMOS_SERVER_R";
GRANT SELECT ON V_$SYSTEM_PARAMETER TO "AMOS_SERVER_R";
GRANT SELECT ON V_$STATNAME TO "AMOS_SERVER_R";
GRANT SELECT ON V_$DATABASE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$SGASTAT TO "AMOS_SERVER_R";
GRANT SELECT ON V_$RESERVED_WORDS TO "AMOS_SERVER_R";
GRANT SELECT ON V_$TEMPFILE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$DATAFILE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$IO_CALIBRATION_STATUS TO "AMOS_SERVER_R";
GRANT SELECT ON V_$RECOVERY_FILE_DEST TO "AMOS_SERVER_R";
GRANT SELECT ON V_$RECOVERY_AREA_USAGE TO "AMOS_SERVER_R";
--ASM Views (only if ASM is in use)
GRANT SELECT ON V_$ASM_ATTRIBUTE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$ASM_CLIENT TO "AMOS_SERVER_R";
GRANT SELECT ON V_$ASM_DISK TO "AMOS_SERVER_R";
GRANT SELECT ON V_$ASM_DISKGROUP TO "AMOS_SERVER_R";
GRANT SELECT ON V_$ASM_FILE TO "AMOS_SERVER_R";
GRANT SELECT ON V_$ASM_TEMPLATE TO "AMOS_SERVER_R";
--ASM RAC Views (only if ASM and RAC is in use)
GRANT SELECT ON GV_$ASM_DISK TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$ASM_DISKGROUP TO "AMOS_SERVER_R";
--Backup
GRANT SELECT ON V_$RMAN_BACKUP_JOB_DETAILS TO "AMOS_SERVER_R";

SWISS-AS.COM
76/167

GRANT SELECT ON V_$RMAN_STATUS TO "AMOS_SERVER_R";


GRANT SELECT ON V_$RMAN_CONFIGURATION TO "AMOS_SERVER_R";
GRANT SELECT ON V_$BACKUP_FILES TO "AMOS_SERVER_R";
--Dataguard
GRANT SELECT ON GV_$DATAGUARD_STATUS TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$DATAGUARD_STATS TO "AMOS_SERVER_R";
GRANT SELECT ON GV_$ARCHIVE_GAP TO "AMOS_SERVER_R";
--Statistics collection settings
exec DBMS_STATS.SET_GLOBAL_PREFS('CONCURRENT','TRUE');
--AMOS_USER_R
GRANT CREATE SYNONYM TO "AMOS_USER_R";
--system procedure
CREATE OR REPLACE PROCEDURE AMOS_FLUSH_SHARED_POOL AS
BEGIN EXECUTE IMMEDIATE 'ALTER SYSTEM FLUSH SHARED_POOL';
end;
/
GRANT EXECUTE ON SYS.AMOS_FLUSH_SHARED_POOL TO "AMOS_SERVER_R";

Create Privileged User


CREATE USER "<PRIVILEGED_USER>" IDENTIFIED BY "<PASSWORD>" DEFAULT TABLESPACE "<TABLESPACE>" TEMPORARY
TABLESPACE "TEMP";
GRANT UNLIMITED TABLESPACE TO "<PRIVILEGED_USER>";
GRANT "AMOS_SERVER_R" TO "<PRIVILEGED_USER>";
GRANT CONNECT TO "<PRIVILEGED_USER>";

--Example:
CREATE USER "AMOS_PRIV_U" IDENTIFIED BY "AMOS_PRIV_PW" DEFAULT TABLESPACE "AMOSDAT" TEMPORARY TABLESPACE
"TEMP";
GRANT UNLIMITED TABLESPACE TO "AMOS_PRIV_U";
GRANT "AMOS_SERVER_R" TO "AMOS_PRIV_U";
GRANT CONNECT TO "AMOS_PRIV_U";

Create the Unprivileged User


The unprivileged user has SELECT, INSERT, UPDATE and DELETE permissions on AMOS tables only. Beside
that this user has no permissions.

Create Unprivileged User


CREATE USER "<UNPRIVILEGED_USER>" IDENTIFIED BY "<PASSWORD>" DEFAULT TABLESPACE
"<PRIVILEGED_USER_TABLESPACE>" TEMPORARY TABLESPACE "TEMP";
GRANT CONNECT TO "<UNPRIVILEGED_USER>";
GRANT "AMOS_USER_R" TO "<UNPRIVILEGED_USER>";

--Example:
CREATE USER "AMOS_UNPRIV_U" IDENTIFIED BY "AMOS_UNPRIV_PW" DEFAULT TABLESPACE "AMOSDAT" TEMPORARY TABLESPACE
"TEMP";
GRANT CONNECT TO "AMOS_UNPRIV_U";
GRANT "AMOS_USER_R" TO "AMOS_UNPRIV_U";

One option could be to include the AMOS environment name in the database user's name as every AMOS instance
uses separate database users. Another would be to give each DB Service name an environment distinguisher.

Oracle Parameters

SWISS-AS.COM
77/167

Refer to the AMOS & Database Standards documentation for details.

SWISS-AS.COM
78/167

Installing PostgreSQL

General Note
Generally, the responsibility of the technical database support lies with the customer. Support within the following
areas of PostgreSQL database administration will not be provided by Swiss-AS on standard support services, but
can be requested on an individual basis via RfS:

Database installation, configuration and interfacing


Backup & recovery, database replication, business continuity
DBMS release upgrade and patches
Monitoring and tuning
Licensing and service requests
AMOS Operational Support (AOS), database tasks related to the AMOS release change

SWISS-AS.COM
79/167

PostgreSQL Configuration

PostgreSQL Users and Roles


Every AMOS instance is using two database users for all database connections:

1. a privileged user for AMOS server connections. This user will own all AMOS database objects.
2. an unprivileged user for common AMOS user connection.

The database users can be created as part as the database wizard available from AMOS 19.6. More information
can be found in AMOS Server Installation.

PostgreSQL Parameters
Refer to the Database Standards documentation for details.

SWISS-AS.COM
80/167

PostgreSQL Backup & Recovery Scripts for Linux

SWISS-AS.COM
81/167

Introduction
Swiss-AS provides shell scripts for the backup and recovery of PostgreSQL databases used by AMOS. The scripts
configuration needs to be adapted to the customer's AMOS environment so that they can be used either manually
or scheduled via the task scheduler. All scripts make use of a configuration file that stores all required parameters
and a so called toolboxes which are files that define particular functions. Usually, only the configuration files need to
be changed by the customer in order to get the script running.

The latest version of the backup and recovery scripts can be downloaded via the Swiss AS customer portal.

This document describes the script's usage and the configuration.

General Notes
Predefined Configuration files : each script requires a specific set of parameters stored in a configuration file.
A template of each of the four configuration files (basebackup.cfg, recovery.cfg, dump.cfg and restore.cfg) is
provided together with the basebackup, recovery, dump and restore scripts and the toolbox files.
General Toolbox : the toolbox file pg_toolbox.sh defines generic functions used in the backup and recovery
scripts. By default the toolbox file is located in the same directory as the corresponding script.
PostgreSQL Toolbox : the toolbox file pg_toolbox_postgres.sh defines PostgreSQL specific functions used in
the backup and recovery scripts. By default the toolbox file is located in the same directory as the
corresponding script.

Introduction
General Notes
Dump script
Function
Usage
Configuration Parameters
System Requirements
Restore script
Function
Usage
Configuration Parameters
System Requirements
Basebackup script
Function
Usage
Configuration Parameters
System Requirements
Recovery script
Function
Usage
Configuration Parameters
System Requirements

SWISS-AS.COM
82/167

Dump script
The script to create database dump is called pg_dump.sh. It creates a set of backup files of one or more user
databases and all system databases of a given PostgreSQL instance.

A configuration file (by default etc/dump.cfg) and the toolbox files pg_toolbox.sh and pg_toolbox_postgres.sh
are required by those scripts.

Function
Dump script provides the following features:

each database's backup is compressed


the script can run with one or more parallel threads
outdated backup sets can be automatically removed from the dumps directory
creates a backup of all system databases
the script prevents multiple simultaneous executions of a dump.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files

Usage
The scripts syntax is:
pg_dump.sh [-c | -h | -f <config file>]

Without the option -f the script uses the configuration file etc/dump.cfg.
Options:

-c : let the script check the configuration only. No backup set is created.
-h : shows the usage
-f <config file> : the script uses <config file> as configuration file. Without this option the file etc/dump.cfg is
used by default.

The required toolbox files (pg_toolbox.sh and pg_toolbox_postgres.sh) need to be located in the same directory as
the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

SERVER The Postgres server

USER The Postgres user

SWISS-AS.COM
83/167

DATABASES Names of the user databases to be backed up, space separated

SYS_DATABASES Names of the system databases to be backed up, space separated

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

RETENTION_DAYS Amount of days (n * 24h) backup sets shall be stored prior to deletion.

If set to 0, only the last backup set is kept (see PREVIOUS_SET)

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_PARALLEL_JOBS The dump can be performed using parallel processes. DEFAULT: 1

ATTENTION : increasing this value will cause more load on the server.

GLOBALS_BACKUP Dump only global objects (roles and tablespaces), no databases [ Y / N ].


DEFAULT: Y

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FULL Name of the session log files

VERBOSE All backup information are displayed [ Y / N ]. Default: N

LOG_RETENTION_DAYS Log retention

LOCKFILE Name of the lock file (to avoid simultaneous executions)

RECOVER_LOCKFILE Name of the recovery lockfile (to check if a load of the database is being
processed).

Must be the same as defined in restore.cfg

INFORMATION_FOLDER Folder where the AMOS information files are located.


See "<env>.info.cfg" config file for further information
(where <env> = production, acceptance, playground, ...)

DATABASE_BACKUP_MONITO Enable the backup monitoring in AMOS Control Centre (APN2137 ) [ Y / N ].


RING Default: Y

System Requirements
The user that runs the backup script needs to have the correct permissions on the required files and directories.
You should execute the script using the postgres login.

Restore script

SWISS-AS.COM
84/167

The script to restore a database from a database backup is called pg_restore.sh. The backup can be either a
dump created by pg_dump.sh, or a backup stored in a pgBackRest repository.
It loads a database backup into a user database of a given PostgreSQL instance.
Additionally it remaps the AMOS users and restarts the corresponding AMOS server to enforce the reactivation of
the AMOS maintenance key.
A configuration file (by default etc/restore.cfg) and the toolbox files pg_toolbox.sh and pg_toolbox_postgres.sh
are required by this script.

Function
The script provides the following features:

it loads a dump from a dump directory (typically created by pg_dump script).


Database users are remapped as per AMOS configuration.
AMOS parameters for the client title and background image can be customized
AMOS workflows are disabled and AIM config is deleted
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS server is previously stopped and restarted at the end to enforce the recovery of the AMOS
maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
allows to save the printer settings from the reload of the database
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The scripts syntax is:
pg_restore.sh [-c | -h | -f <config file> ]

Without the option -f the script uses the configuration file etc/restore.cfg.
Options:

-c : let the script check the configuration only. No dump is restored.


-h : shows the usage
-f <config file> : the script uses <config file> as configuration file. Without this option the file etc/restore.cfg is
used by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

The script to set the Postgres environment variables

SWISS-AS.COM
85/167

RECOVER_
POSTGRES
_ENV

SERVER The Postgres server

USER The Postgres user

RECOVER_ Name of the user database to be restored.


DATABASE

RECOVER_ Name of the session log file


LOGFILE_N
AME

OVERWRIT Overwrite log file and append : Y


E_LOGFILE Keep log file and append: N
Default : Y

RECOVER_ Name of the lock file


LOCKFILE

TITLE_TEXT AMOS title text

BACKGROU AMOS background image [test,prod,training]


ND_IMG

SOURCE_H Host of source AMOS server


OST

SOURCE_A Path of source AMOS server


MOS

MASTERKEY The source AMOS server's masterkey file

RECOVER_ Host of target AMOS server


HOST

RECOVER_ Target AMOS server


AMOS

RECOVER_ The target AMOS server's masterkey file


MASTERKEY

LOG_DIRE This is the directory for logging


CTORY DEFAULT: /backup/scripts/log (CAUTION: Make sure it is writable to the Postgres user)

RESTORE_ The main backup directory


DIR
Note: this parameter is ignored if STANZA parameter is set

NUMBER_O The dump can be restored using parallel processes.


F_PARALLE DEFAULT: 1
L_JOBS
ATTENTION : increasing this value will cause more load on the server.

SWISS-AS.COM
86/167

Note: this parameter is ignored if STANZA parameter is set

VERBOSE All restore information are displayed. [ Y / N ] Default : N

Note: this parameter is ignored if STANZA parameter is set

STANZA to restore the instance from a pgBackRest backup

SOURCE_D the source database name in the pgBackRest backup


ATABASE

RECOVER_ Recovery target, possible values are:


TARGET
immediate: stops whenever a consistent status has been reached
'' (empty string): continue until end of archive stream

DISABLE_W Defines if AMOS workflows need to be disabled. [ Y / N ] DEFAULT : Y


ORKFLOWS

DELETE_AI Defines if AIM configuration needs to be disabled. [ Y / N ] DEFAULT : N


M_CONFIG

KEEP_KEY If it is set to "Y", the environment which is recovered will keep its keystore. [ Y / N ] DEFAULT : N
STORE
Deprecated from AMOS 21.6. Ignored if KEEP_CONFIG is enabled.

KEEP_CON Keep config settings. [ Y / N ] DEFAULT : Y


FIG
If it is set to "Y", the environment which is recovered will keep its configuration, you can specify
which part of the configuration with KEEP_CONFIG_PARAMETERS.

Remark: configuration will always be exported and stored in <applic>/scripts/keep_config_data.

There will be one file per version and environment. Each time the script is executed it will export
the configuration of the environment for the environment version. If the file already exists it will be
overwritten. Filename: <db_name>_<version>_export_config.zip

The initial export for an environment and a version will be archived/persisted to another filename
(to prevent it from being overwritten). Filename:
initial_save_<db_name>_<version>_export_config.zip

Available from AMOS 19.12 onwards

KEEP_CON Keep config parameters settings. Default: "KEYSTORE"


FIG_PARA
METERS Define which configuration will not be overwritten by the restore. If you don't specify any
configurations, everything gets imported.

Be sure to put the configs in quotation marks and separate them with only a comma (e.g.,
"KEYSTORE,WEBSERVICE_CONFIG").

The options are:

SWISS-AS.COM
87/167

USER_AND_LICENCES
PARAMETERS
KEYSTORE
CUSTOMIZE_APPLICATIONS
WEBSERVICE_CONFIG
FORM_CONFIGURATION
CLEANUP_JOBS
AIM_CONFIGURATION
WORKFLOW_CONFIGURATION
SCHEDULED_TASKS

Available from AMOS 19.12 onwards

KEEP_PRIN Defines if the environment which is recovered will keep its printers settings. [ Y / N ] DEFAULT: N
TERS_SET
TINGS

PRE_SCRIPT A script that will be triggered before the backup is loaded

POST_SCRI A script that will be triggered after the database has been loaded, before AMOS is restarted
PT

SYNC_WEB Defines if AMOS webdrive will be copied from source to target. [ Y / N ] DEFAULT : N
DRIVE
ATTENTION : this will cause the target webdrive to be overwritten

SYNC_WEB Defines files to be excluded from the webdrive copy


DRIVE_EXC
LUDE_FILE DEFAULT: /backup/pg_scripts/etc/sync_webdrive_exclude.txt

IGNORE_IN Defines whether the indexes must be restored in the dedicated tablespace [Y / N]. DEFAULT: N
DEX_TABL
ESPACE

BACKUP_L Name of the backup lockfile (to check if a backup of the database is processing).
OCKFILE
Must be the same as defined in dump.cfg

System Requirements
The user that runs the recovery script needs to have the correct permissions on the required files and
directories (including remote ones, see ssh-keygen for details).
You should execute the script using the postgres login.
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.

Basebackup script
The script to create database basebackups is called pg_basebackup.sh. This full backup is used to take base
backups of a running PostgreSQL database cluster. These are taken without affecting other clients to the database,
and can be used both for point-in-time recovery and as the starting point for a log shipping or streaming replication

SWISS-AS.COM
88/167

standby servers. For more information about such PostgreSQL features, please refer to the official documentation ht
tps://www.postgresql.org/docs/current/continuous-archiving.html and https://www.postgresql.org/docs/current/warm-
standby.html.

pg_basebackup makes a binary copy of the database cluster files, while making sure the system is put in and out of
backup mode automatically. Backups are always taken of the entire database cluster; it is not possible to back up
individual databases or database objects. For individual database backups, a tool such as pg_dump must be used.

A configuration file (by default etc/basebackup.cfg) and the toolbox files pg_toolbox.sh and pg_toolbox_postgre
s.sh are required by those scripts.

Function
Basebackup script provides the following features:

binary backup files of the whole PostgreSQL instance


compressed backup files
On Linux and from PostgreSQL 10 onwards the script can run with one or more parallel threads
outdated backup sets can be automatically removed from the basebackup directory
the script prevents multiple simultaneous executions of a basebackup.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files

Usage
The scripts syntax is:
pg_basebackup.sh [-c | -h | -f <config file>]

Without the option -f the script uses the configuration file etc/basebackup.cfg.
Options:

-c : let the script check the configuration only. No backup set is created.
-h : shows the usage
-f <config file> : the script uses <config file> as configuration file. Without this option the file etc/basebackup.
cfg is used by default.

The required toolbox files (pg_toolbox.sh and pg_toolbox_postgres.sh) need to be located in the same directory as
the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

SERVER The Postgres server

SWISS-AS.COM
89/167

USER The Postgres user

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

WAL_BACKUP_PATH Path to the archived WAL

RETENTION_DAYS amount of days (n * 24h) backup sets shall be stored prior to deletion.
Must be greater than 0

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_PARALLEL_JOBS The dump can be performed using parallel processes.


DEFAULT: 1
(PostgreSQL 10 onwards)
ATTENTION : increasing this value will cause more load on the server.

pigz and bc commands must be installed to use this feature

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FULL Name of the session log files

LOG_RETENTION_DAYS Log retention

LOCKFILE Name of the lock files


RECOVER_LOCKFILE

INFORMATION_FOLDER Folder where the AMOS information files are located.


See "<env>.info.cfg" config file for further information
(where <env> = production, acceptance, playground, ...)

System Requirements
The user that runs the backup script needs to have the correct permissions on the required files and directories.
You should execute the script using the postgres login.

pigz and bc commands must be installed to use the parallelized backup, from PostgreSQL 10 onwards.

Recovery script
The script to restore a database from a basebackup is called pg_recover.sh. It recreates a complete PostgreSQL
instance from a backup taken with pg_basebackup.

This script has 2 main goals:

Recover a PostgreSQL instance from a backup with PITR


Copy a PostgreSQL instance from one server to another.

SWISS-AS.COM
90/167

Depending on the use case, it also remaps the AMOS users and restarts the corresponding AMOS server to
enforce the reactivation of the AMOS maintenance key

A configuration file (by default etc/recovery.cfg) and the toolbox files pg_toolbox.sh and pg_toolbox_postgres.
sh are required by this script.

Function
The script provides the following features:

it recreates a complete PostgreSQL instance from a basebackup (typically created by pg_basebackup script)
Replay WAL until a specified time given as a parameter
Database users are remapped as per AMOS configuration.
AMOS workflows are disabled and AIM config is deleted
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS servers are previously stopped and restarted at the end to enforce the recovery of the
AMOS maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The scripts syntax is:
pg_recover.sh [-c | -h | -f <config file> ]

Without the option –f the script uses the configuration file etc/recovery.cfg.
Options:

-c : let the script check the configuration only. No dump is restored.


-h : shows the usage
-f <config file> : the script uses <config file> as configuration file. Without this option the file etc/recovery.cfg
is used by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

SERVER The Postgres server

USER The Postgres user

RECOVER_LOGFILE_NAME Name of the session log file

SWISS-AS.COM
91/167

OVERWRITE_LOGFILE Overwrite log file of keep it and append. [ Y / N ] Default : Y

RECOVER_LOCKFILE Name of the lock file

RECOVER_HOST Host of target AMOS server

RECOVER_DB The database name on the recovered instance

RECOVER_TARGET The recovery target.


Accepted value are ' ', 'immediate' or a valid timestamp (UTC).
(timestamp syntax : https://www.postgresql.org/docs/11/datatype-datetime.
html).

RECOVER_DIR The main backup directory

RECOVER_DIR_WAL The directory where are located the incremental backups to be loaded after
the full dump

RECOVER_SAVE_DIR The save directory where to backup the postgres instance (to recover in
case of problem)

RECOVER_COPYFROM The server you want to recover from. Default : empty

RECOVER_COPYFROM_AMOS_ The path to the AMOS folder on the source server


BASE

RECOVER_COPYFROM_DATAB The original name of the database, will be renamed by RECOVER_DB


ASE variable

Only valid if the PostgreSQL instance contains one database.

LOG_DIRECTORY This is the directory for logging

PRE_SCRIPT A script that is executed before the recovery

POST_SCRIPT A script that is executed after the recovery

BACKUP_LOCKFILE Lock file of backup scripts

System Requirements
The user that runs the recovery script needs to have the correct permissions on the required files and
directories (including remote ones
see ssh-keygen for details).
You should execute the script using the postgres login.
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.

SWISS-AS.COM
92/167

PostgreSQL Backup & Recovery Scripts for Windows

SWISS-AS.COM
93/167

Introduction
Swiss-AS provides powershell scripts for the backup and recovery of PostgreSQL databases used by AMOS. The
scripts configuration needs to be adapted to the customer's AMOS environment so that they can be used either
manually or scheduled via the task scheduler. All scripts make use of a configuration file that stores all required
parameters and a so called toolboxes which are files that define particular functions. Usually, only the configuration
files need to be changed by the customer in order to get the script running.

The latest version of the backup and recovery scripts can be downloaded via the Swiss AS customer portal.

This document describes the script's usage and the configuration.

General Notes
Predefined Configuration files : each script requires a specific set of parameters stored in a configuration file.
A template of each of the four configuration files (basebackup.cfg.ps1, recovery.cfg.ps1, dump.cfg.ps1 and
restore.cfg.ps1) is provided together with the basebackup, recovery, dump and restore scripts and the
toolbox files.
General Toolbox : the toolbox file pg_toolbox.ps1 defines generic functions used in the backup and recovery
scripts. By default the toolbox file is located in the same directory as the corresponding script.
PostgreSQL Toolbox : the toolbox file pg_toolbox_postgres.ps1 defines PostgreSQL specific functions used
in the backup and recovery scripts. By default the toolbox file is located in the same directory as the
corresponding script.
Powershell execution policy : to be able to run powershell scripts on a host, the execution policy needs to be
adjusted (see Set-ExecutionPolicy command). It is possible the change the policy to the whole server or only
for one script execution (see ByPass execution policy)

Introduction
General Notes
Dump script
Function
Usage
Configuration Parameters
System Requirements
Restore script
Function
Usage
Configuration Parameters
System Requirements
Basebackup script
Function
Usage
Configuration Parameters
System Requirements
Recovery script (Beta only)
Function
Usage
Configuration Parameters
System Requirements

SWISS-AS.COM
94/167

Dump script
The script to create database dump is called pg_dump.ps1. It creates a set of backup files of one or more user
databases and all system databases of a given PostgreSQL instance.

A configuration file (by default etc/dump.cfg.ps1) and the toolbox files pg_toolbox.ps1 and pg_toolbox_postgres.
ps1 are required by those scripts.

Function
Dump script provides the following features:

each database's backup is compressed


the script can run with one or more parallel threads
outdated backup sets can be automatically removed from the dumps directory
creates a backup of all system databases
the script prevents multiple simultaneous executions of a dump.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files

Usage
The scripts syntax is:
pg_dump.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>]

Without the option –ConfigFile the script uses the configuration file etc/dump.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/dump.cfg.ps1 is used
by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

PGPASSFILE Path to the password file. Needs to be readable by the user who executes the
script.

SWISS-AS.COM
95/167

See https://www.postgresql.org/docs/current/libpq-pgpass.html for more


information

SERVER The Postgres server

USER The Postgres user

DATABASES Names of the user databases to be backed up, space separated

SYS_DATABASES Names of the system databases to be backed up, space separated

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

RETENTION_DAYS Amount of days (n * 24h) backup sets shall be stored prior to deletion.

If set to 0, only the last backup set is kept (see PREVIOUS_SET)

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

NUMBER_OF_PARALLEL_ The dump can be performed using parallel processes. DEFAULT: 1


JOBS
ATTENTION : increasing this value will cause more load on the server.

GLOBALS_BACKUP Perform also a dump of global objects (roles and tablespaces), no databases.
DEFAULT: $true

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FULL Name of the full backup log file

VERBOSE All backup information are displayed. Default : $false

LOG_RETENTION_DAYS Log retention

LOCKFILE Name of the lock file (to avoid simultaneous executions)

RECOVER_LOCKFILE Name of the recovery lockfile (to check if a load of the database is processing).

Must be the same as defined in restore.cfg.ps1

INFORMATION_FOLDER Folder where the AMOS information files are located. See "server1.info.cfg"
config file for further information

DATABASE_BACKUP_MO Enable the backup monitoring in AMOS Control Centre (APN2137 ). Default: $true
NITORING

System Requirements
The Windows user that runs the backup script needs to have the correct permissions on the required files and
directories.

SWISS-AS.COM
96/167

Restore script
The script to recover a database from a full backup is called pg_restore.ps1. It loads a database dump into a user
database of a given PostgreSQL instance. Additionally it remaps the AMOS users and restarts the corresponding
AMOS server to enforce the reactivation of the AMOS maintenance key. A configuration file (by default etc/restore.
cfg.ps1) and the toolbox files pg_toolbox.ps1 and pg_toolbox_sybase.ps1 are required by this script.

Function
The script provides the following features:

it loads a dump from a dump directory (typically created by pg_dump script).


Database users are remapped as per AMOS configuration.
AMOS parameters for the client title and background image can be customized
AMOS workflows are disabled and AIM config is deleted
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS server is previously stopped and restarted at the end to enforce the recovery of the AMOS
maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
allows to save the printer settings from the reload of the database
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The scripts syntax is:
pg_restore.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file> ]

Without the option –ConfigFile the script uses the configuration file etc/restore.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/restore.cfg.ps1 is used
by default.

The required toolbox files need to be located in the same directory as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

RECOVER The script to set the Postgres environment variables


_POSTGR
ES_ENV

SWISS-AS.COM
97/167

PGPASSFI Path to the password file. Needs to be readable by the user who executes the script.
LE
See https://www.postgresql.org/docs/current/libpq-pgpass.html for more information

SERVER The Postgres server

USER The Postgres user

RECOVER Name of the user database to be restored


_DATABA
SE

RECOVER Name of the session log file


_LOGFILE
_NAME

OVERWRI Overwrites last session log file or keep it and appends. DEFAULT: $true
TE_LOGFI
LE

RECOVER Name of the lock file


_LOCKFILE

TITLE_TE AMOS title text


XT

BACKGRO AMOS background image [test,prod,training]


UND_IMG

SOURCE_ Host of source AMOS server


HOST

SOURCE_ Path of source AMOS server


AMOS

MASTERK The source AMOS server's masterkey file


EY

RECOVER Host of target AMOS server (derived)


_HOST

RECOVER Target AMOS server


_AMOS_L
OCAL

RECOVER
_AMOS

RECOVER The target AMOS server's masterkey file


_MASTER
KEY

RECOVER The target AMOS server's service name


_SERVICE

SWISS-AS.COM
98/167

RECOVER The main backup directory


_DIR

LOG_DIRE This is the directory for logging


CTORY

NUMBER_ The dump can be restored using parallel processes. DEFAULT: 1


OF_PARAL
LEL_JOBS ATTENTION : increasing this value will cause more load on the server.

VERBOSE All restore information are displayed. [$true / $false]. DEFAULT : $false

DISABLE_ Defines if AMOS workflows need to be disabled. [$true / $false]. DEFAULT : $true
WORKFLO
WS

DISABLE_ Defines if AIM configuration needs to be disabled. [$true / $false], DEFAULT : $true
AIM_CONF
IG

KEEP_KE Defines if the environment which is recovered will keep its keystore. [$true / $false]. DEFAULT:
YSTORE $false

This feature shall not be used in case the source and target AMOS environment are on different
versions

Deprecated from AMOS 21.6. Ignored if KEEP_CONFIG is enabled.

KEEP_CO Keep config settings. [$true / $false]. DEFAULT: $true


NFIG
If it is set to "$true", the environment which is recovered will keep its configuration, you can specify
which part of the configuration with KEEP_CONFIG_PARAMETERS.

Remark: configuration will always be exported and stored in <applic>/scripts/keep_config_data.

There will be one file per version and environment. Each time the script is executed it will export
the configuration of the environment for the environment version. If the file already exists it will be
overwritten. Filename: <db_name>_<version>_export_config.zip

The initial export for an environment and a version will be archived/persisted to another filename
(to prevent it from being overwritten). Filename: initial_save_<db_name>_<version>_export_config.
zip

Available from AMOS 19.12 onwards

KEEP_CO Keep config parameters settings. Default: "KEYSTORE"


NFIG_PAR
AMETERS Define which configuration will not be overwritten by the restore. If you don't specify any
configurations, everything gets imported.

Be sure to put the configs in quotation marks and separate them with only a comma (e.g.,
"KEYSTORE,WEBSERVICE_CONFIG").

SWISS-AS.COM
99/167

The options are:

USER_AND_LICENCES
PARAMETERS
KEYSTORE
CUSTOMIZE_APPLICATIONS
WEBSERVICE_CONFIG
FORM_CONFIGURATION
CLEANUP_JOBS
AIM_CONFIGURATION
WORKFLOW_CONFIGURATION
SCHEDULED_TASKS

Available from AMOS 19.12 onwards

PRE_SCRI A script that will be triggered before the backup is loaded


PT

POST_SC A script that will be triggered after the database has been loaded, before AMOS is restarted
RIPT

IGNORE_I Defines whether the indexes must be restored in the dedicated tablespace [$true/$false].
NDEX_TA DEFAULT: $false
BLESPACE

BACKUP_L Name of the backup lockfile (to check if a backup of the database is processing).
OCKFILE
Must be the same as defined in dump.cfg.ps1

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files
and directories (including remote ones).
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.

Basebackup script
The script to create database basebackups is called pg_basebackup.sh. This full backup is used to take base
backups of a running PostgreSQL database cluster. These are taken without affecting other clients to the database,
and can be used both for point-in-time recovery and as the starting point for a log shipping or streaming replication
standby servers. For more information about such PostgreSQL features, please refer to the official documentation ht
tps://www.postgresql.org/docs/current/continuous-archiving.html and https://www.postgresql.org/docs/current/warm-
standby.html.

pg_basebackup makes a binary copy of the database cluster files, while making sure the system is put in and out of
backup mode automatically. Backups are always taken of the entire database cluster; it is not possible to back up
individual databases or database objects. For individual database backups, a tool such as pg_dump must be used.

A configuration file (by default etc/basebackup.cfg.ps1) and the toolbox files pg_toolbox.ps1 and pg_toolbox_po
stgres.ps1 are required by those scripts.

SWISS-AS.COM
100/167

Function
Basebackup script provides the following features:

binary backup files of the whole PostgreSQL instance


compressed backup files
On Linux and from PostgreSQL 10 onwards the script can run with one or more parallel threads
outdated backup sets can be automatically removed from the basebackup directory
the script prevents multiple simultaneous executions of a basebackup.
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run
creates entries in AMOS table in order to monitor the backup via AMOS control center
archives backup scripts old log files

Usage
The scripts syntax is:
pg_basebackup.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>]

Without the option -ConfigFile the script uses the configuration file etc/basebackup.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/basebackup.cfg.ps1 is
used by default.

The required toolbox files (pg_toolbox.ps1 and pg_toolbox_postgres.ps1) need to be located in the same directory
as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

PGPASSFILE Path to the password file. Needs to be readable by the user who executes the script.

See https://www.postgresql.org/docs/current/libpq-pgpass.html for more information

SERVER The Postgres server

USER The Postgres user

BACKUP_BASE The main backup directory

CURRENT_SET Path to the latest backup set

SWISS-AS.COM
101/167

WAL_BACKUP_PATH Path to the archived WAL

RETENTION_DAYS amount of days (n * 24h) backup sets shall be stored prior to deletion.
Must be greater than 0

MAX_BACKUPSETS Max number of backupsets to be kept (including current)

LOG_DIRECTORY This is the directory for logging

LOGFILE_NAME_FULL Name of the session log files

LOG_RETENTION_DAYS Log retention

LOCKFILE Name of the lock files


RECOVER_LOCKFILE

INFORMATION_FOLDER Folder where the AMOS information files are located.


See "<env>.info.cfg" config file for further information
(where <env> = production, acceptance, playground, ...)

System Requirements
The Windows user that runs the backup script needs to have the correct permissions on the required files and
directories.

Recovery script (Beta only)


The script to restore a database from a basebackup is called pg_recover.ps1. It recreates a complete PostgreSQL
instance from a backup taken with pg_basebackup.

This script has 2 main goals:

Recover a PostgreSQL instance from a backup with PITR


Copy a PostgreSQL instance from one server to another.

Depending on the use case, it also remaps the AMOS users and restarts the corresponding AMOS server to
enforce the reactivation of the AMOS maintenance key.

Check the official documentation for more information about PostgreSQL recovery https://www.postgresql.org/docs
/current/continuous-archiving.html

A configuration file (by default etc/recovery.cfg.ps1) and the toolbox files pg_toolbox.ps1 and pg_toolbox_postg
res.ps1 are required by this script.

Function
The script provides the following features:

it recreates a complete PostgreSQL instance from a basebackup (typically created by pg_basebackup script)
Replay WAL until a specified time given as a parameter

SWISS-AS.COM
102/167

Database users are remapped as per AMOS configuration.


AMOS workflows are disabled and AIM config is deleted
the AMOS masterkey file is copied from the source to the target AMOS server
the target AMOS servers are previously stopped and restarted at the end to enforce the recovery of the
AMOS maintenance key from local maintenance key backup
allows to trigger pre- and post-scripts for further customization
the script prevents multiple simultaneous executions
performs check of the configuration parameters before creating backup sets
creates and archives a log file for each run

Usage
The scripts syntax is:
pg_recover.ps1 [-CheckConfig [$true|$false] | -Help [$true|$false] | -ConfigFile <config file>]

Without the option -ConfigFile the script uses the configuration file etc/basebackup.cfg.ps1.
Options:

-CheckConfig : let the script check the configuration only. No backup set is created.
-Help : shows the usage
-ConfigFile file : the script uses file as configuration file. Without this option the file etc/basebackup.cfg.ps1 is
used by default.

The required toolbox files (pg_toolbox.ps1 and pg_toolbox_postgres.ps1) need to be located in the same directory
as the script itself.

Configuration Parameters
The script requires the following configuration parameters that need to be defined in the script's configuration file.

Parameter Description

POSTGRES_ENV The script to set the Postgres environment variables

PGPASSFILE Path to the password file. Needs to be readable by the user who
executes the script.

See https://www.postgresql.org/docs/current/libpq-pgpass.html for


more information

SERVER The Postgres server

USER The Postgres user

RECOVER_LOGFILE_NAME Name of the session log file

OVERWRITE_LOGFILE Overwrite log file of keep it and append. Default : $true

RECOVER_LOCKFILE Name of the lock file

RECOVER_HOST Host of target AMOS server

SWISS-AS.COM
103/167

RECOVER_TARGET The recovery target.


Accepted value are ' ', 'immediate' or a valid timestamp (UTC).
(timestamp syntax : https://www.postgresql.org/docs/current/datatype-
datetime.html).

RECOVER_DIR The main backup directory

RECOVER_DIR_WAL The directory where are located the incremental backups to be loaded
after the full dump

RECOVER_SAVE_DIR The save directory where to backup the postgres instance (to recover
in case of problem)

RECOVER_COPYFROM The server you want to recover from. Default : empty

RECOVER_COPYFROM_AMOS_BASE The path to the AMOS folder on the source server

RECOVER_COPYFROM_AMOS_BAS
E_LOCAL

LOG_DIRECTORY This is the directory for logging

PRE_SCRIPT A script that is executed before the recovery

POST_SCRIPT A script that is executed after the recovery

BACKUP_LOCKFILE Lock file of backup scripts

System Requirements
The Windows user that runs the recovery script needs to have the correct permissions on the required files
and directories (including remote ones).
The AMOS maintenance key on the target AMOS instance has to be backed up previously in order to allow
automatic maintenance key recovery.

SWISS-AS.COM
104/167

AMOS Installation

SWISS-AS.COM
105/167

AMOS Server Installation

Prepare AMOS Server Directory

Unix/Linux
The installation of the AMOS application server needs to be performed as Operating System user 'amos', not as
user 'root'. First, download the stable release file from the customer portal on www.swiss-as.com to the AMOS base
directory /applic. Extract the release file to a new release directory using the command:
cd /<amos base>
tar –xzf <release file>

For example:
cd /applic
tar –xzf amos-stable_19.12.1.tgz

Then rename the newly created release directory to an AMOS server directory. The recommended name
convention for AMOS server directories is: amos_<environment name>. To rename, use command:
mv <release directory> <server directory>

For example:
mv amos-stable_19.12.1 amos_prod

Windows
The installation of the AMOS application server needs to be performed by a member of the local administrator
group. The username is free configurable, e.g. 'amos'. First download the stable release file from the customer
portal on www.swiss-as.com to the AMOS base directory e.g. D:\applic. There extract the release file to a new
release directory using 7-zip. Then run the following provided script, to extract the file(s) automatically on the
command line (cmd.exe):

This example is for a 64-Bit version of 7-zip:


"C:\Program Files\7-Zip\7z.exe" e <release file> -so | "C:\Program Files\7-Zip\7z.exe" x -si -ttar

For example:
"C:\Program Files\7-Zip\7z.exe" e amos-stable_19.12.1.tgz -so | "C:\Program Files\7-Zip\7z.exe" x -si -ttar

Then rename the newly created release directory to an AMOS server directory. The recommended name
convention for AMOS server directories is: amos_<environment name>. To rename, use command:
move <release directory> <server directory>

SWISS-AS.COM
106/167

For example:
move amos-stable_19.12.1 amos_prod

SWISS-AS.COM
107/167

AMOS Config Server tool

The amos_config_server Command Line Tool


The amos_config_server command line tool can be found in the AMOS application folder scripts subdirectory.

If no configuration exists yet for the AMOS server (e.g. during an installation from scratch), the installation wizard is
started automatically:

From this screen 2 options are possible:

Start the Installation Wizard: if the database is already created and only the AMOS Application server needs
to be installed.
Start the database Wizard: this wizard will install both the database objects and AMOS afterwards. This
wizard is available for ASE , PostgreSQL and Oracle . The steps are described more in details in the
following sections, depending on the DBMS and platform used.

AMOS Installation includes the following steps:

Database configuration: setup the database connections


Server configuration: define the basics settings of Amos server
Client configuration: setup the connection between the client and the server
Review: review all defined settings
Database initialization: initialize the database structure and fill it with required system data
Generate SSL Certificate: create a self-signed SSL certificate for the client/server connection
Create admin user: create an initial Amos user to connect to the client
Windows service: install Amos Windows service (only available for Windows OS)

You can press “Insert” at any time to display the help pop-up in order to find more information about all fields.

SWISS-AS.COM
108/167

AMOS Server Installation with Oracle on Linux


Start the AMOS Setup
The initial database configuration needs to be carried out first. If the database wizard is not yet started (see above
chapter).

cd <server directory>/scripts
./amos_config_server

For example:

cd /applic/amos_prod/scripts
./amos_config_server

The following is the step by step demonstration of how set up is done using automatic execution of sql script :

Amos config server home:

Database setup:

SWISS-AS.COM
109/167

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in Oracle:

the privileged and unprivileged database roles


data and index tablespaces
a database owned by the privileged role
a schema owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server wizard or using a separate SQL*Plus
session.

Note that when executing the script using SQL*Plus, the directories of the tablespaces need to exist and their
permissions need be set correctly before executing the SQL script.

The script can be executed using SQL*Plus as user sys like in the following example:
SQL > @{path}{file}(setupDb.sql)

SWISS-AS.COM
110/167

Logical Configuration Database support: Oracle 19c - 19.x.0.0 Database Single Instance :

SWISS-AS.COM
111/167

Database hostname: <DB server hostname>(Fully qualified domain name)

Database port: 1521(select appropriate port number as per your customization)

Container Service Name: CDB_service_name

Pluggable Database name: New PDB name for Amos(To be created)

PDB Admin User : PDB Admin

PDB Admin PW: Password for PDB Admin

Database Owner: SYS AS SYSDBA

Password : SYS PASSWORD

SWISS-AS.COM
112/167

Physical configuration

Choose filesystem and press enter

DB_CREATE_FILE_DEST: +DATA (Displayed from your database parameter set up)

ONLINE_LOG_DEST_1 : +REDO (Displayed from your database parameter set up)

Tablespace type : Data

Tablespace name : AMOSDAT

Diskgroup : +DATA

Tablespace type : Index

Tablespace name : AMOSIDX

AMOSIDX Diskgroup : +DATA

Tablespace type : LOB

SWISS-AS.COM
113/167

Lob Tablespace name : AMOSLOB

Diskgroup : +DATA

SWISS-AS.COM
114/167

User Configuration

Privileged user: AMOS_PRIV_U_<ENV>

Privileged password: <your password>

Unprivileged user: AMOS_UNPRIV_U_<ENV>

Unprivileged password: <your password>

Confoguration validation :

SWISS-AS.COM
115/167

Script Generation

Script destination: <location of the SQL script> :

SWISS-AS.COM
116/167

Script execution automatically :

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Time Zone validation:

SWISS-AS.COM
117/167

Database Initialisation:

SWISS-AS.COM
118/167

Create amos admin user and password :

Generate SSL certificate :

SWISS-AS.COM
119/167

Finish the set up:

SWISS-AS.COM
120/167

Handling Multiple AMOS Environments


After the setup of the Oracle instance and the installation of the primary AMOS server, additional AMOS servers
can be installed. Please bear in mind for every new AMOS environment a new PDB has to be created. Please use
the amos_config_server command line tool as described earlier to set up a new database and dedicated database
users for each AMOS server

SWISS-AS.COM
121/167

AMOS Server Installation with Oracle on Windows


Start the AMOS Setup

The initial database configuration needs to be carried out first. This is done using the amos_config_server
command line tool located in AMOS server's scripts subdirectory. Change to that directory and run the
amos_config_server.bat administrator's permission.

Run the amos_config_server command line tool on Windows as administrator. If this requirement is not
met, the installation of the AMOS windows service will fail.

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in Oracle:

the privileged and unprivileged database roles


data and index tablespaces
a database owned by the privileged role
a schema owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server command line tool or using a
separate SQLplus session.

SWISS-AS.COM
122/167

Note that when executing the script using Sqlplus, the directories of the tablespaces need to exist and their
permissions need be set correctly before executing the SQL script.

The script can be executed using SQLplus as user sys as sysdba like in the following example:
SQL > @{path}{file}(setupDb.sql)

The following is the step by step demonstration of how set up is done using automatic execution of sql script :

Amos config server home:

Database setup:

SWISS-AS.COM
123/167

Logical Configuration Database support: Oracle 19c - 19.x.0.0 Database Single Instance :

SWISS-AS.COM
124/167

Database hostname: <DB server hostname>(Fully qualified domain name)

Database port: 1521(select appropriate port number as per your customization)

SWISS-AS.COM
125/167

Container Service Name: CDB_service_name

Pluggable Database name: New PDB name for Amos(To be created)

PDB Admin User : PDB Admin

PDB Admin PW: Password for PDB Admin

Database Owner: SYS AS SYSDBA

Password : SYS PASSWORD

SWISS-AS.COM
126/167

Physical configuration

Choose filesystem and press enter

DB_CREATE_FILE_DEST: (Displayed from your database parameter set up)

ONLINE_LOG_DEST_1 : (Displayed from your database parameter set up)

Tablespace type : Data

Tablespace name : AMOSDAT

Diskgroup : (remove anything and keep it blank)

Tablespace type : Index

Tablespace name : AMOSIDX

AMOSIDX Diskgroup : (remove anything and keep it blank)

Tablespace type : LOB

Lob Tablespace name : AMOSLOB

SWISS-AS.COM
127/167

Diskgroup : (remove anything and keep it blank)

User Configuration

SWISS-AS.COM
128/167

Privileged user: AMOS_PRIV_U_<ENV>

Privileged password: <your password>

Unprivileged user: AMOS_UNPRIV_U_<ENV>

Unprivileged password: <your password>

Confoguration validation :

SWISS-AS.COM
129/167

Script Generation

Script destination: <location of the SQL script> :

Script execution automatically :

SWISS-AS.COM
130/167

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Time Zone validation:

SWISS-AS.COM
131/167

Database Initialisation:

Create amos admin user and password :

SWISS-AS.COM
132/167

Generate SSL certificate :

SWISS-AS.COM
133/167

Finish the set up:

Handling Multiple AMOS Environments


After the setup of the Oracle instance and the installation of the primary AMOS server, additional AMOS servers
can be installed. Please bear in mind for every new AMOS environment a new PDB has to be created. Please use
the amos_config_server command line tool as described earlier to set up a new database and dedicated database
users for each AMOS server.

SWISS-AS.COM
134/167

AMOS Server Installation with PostgreSQL on Linux


Start the Database and AMOS Setup
The initial database configuration needs to be carried out first. If the database wizard is not yet started (see above
chapter), this can be done using the amos_config_server command line tool located in <server directory>/scripts
and using the --setupDatabase parameter.

cd <server directory>/scripts
./amos_config_server --setupDatabase

For example:

cd /applic/amos_prod/scripts
./amos_config_server --setupDatabase

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in PostgreSQL:

the privileged and unprivileged database roles


data and index tablespaces
a database owned by the privileged role
a schema owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server command line tool or using a
separate psql session.

Note that when executing the script using psql, the directories of the tablespaces need to exist and their
permissions need be set correctly before executing the SQL script.

The script can be executed using psql as user postgres like in the following example:
psql -U postgres -f setupDb.sql

The following parameters need to be entered during the set up process:


Logical Configuration
Database support: PostgreSQL 10
Database hostname: localhost, <DB server IP> or <DB server hostname>
Database port: 5432
Database name: prod

Database Owner Password


Password: <password of the postgres DB role>

Physical configuration
Data tablespace type: Data
Data tablespace name: amos_prod_data
Data tablespace location: /data/pg_amos_prod_data

SWISS-AS.COM
135/167

Index tablespace type: Index


Index tablespace name: amos_prod_index
Index tablespace location: /data/pg_amos_prod_index

User Configuration
Privileged user: amosserver_prod
Privileged password: <your password>
Unprivileged user: amosuser_prod
Unprivileged password: <your password>

Script Generation
Script destination: <location of the SQL script>

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Handling Multiple AMOS Environments


After the setup of the PostgreSQL instance and the installation of the primary AMOS server, additional AMOS
servers can use the same PostgreSQL instance. Please use the amos_config_server command line tool as
described earlier to set up a new database and dedicated database users for each AMOS server.

SWISS-AS.COM
136/167

AMOS Server Installation with PostgreSQL on Windows


Start the AMOS Setup

The initial database configuration needs to be carried out first. This is done using the amos_config_server
command line tool located in AMOS server's scripts subdirectory. Change to that directory and run the
amos_config_server.bat administrator's permission.

Run the amos_config_server command line tool on Windows as administrator. If this requirement is not
met, the installation of the AMOS windows service will fail.

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in PostgreSQL:

the privileged and unprivileged database roles


data and index tablespaces
a database owned by the privileged role
a schema owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server command line tool or using a
separate psql session.

SWISS-AS.COM
137/167

Note that when executing the script using psql, the directories of the tablespaces need to exist and their
permissions need be set correctly before executing the SQL script.

The script can be executed using psql as user postgres like in the following example:
psql -U postgres -f setupDb.sql

The following parameters need to be entered during the set up process:


Logical Configuration
Database support: PostgreSQL 13
Database hostname: localhost, <DB server IP> or <DB server hostname>
Database port: 5432
Database name: prod

Database Owner Password


Password: <password of the postgres DB role>

Physical configuration
Data tablespace type: Data
Data tablespace name: amos_prod_data
Data tablespace location: E:\data\pg_amos_prod_data
Index tablespace type: Index
Index tablespace name: amos_prod_index
Index tablespace location: E:\data\pg_amos_prod_index

User Configuration
Privileged user: amosserver_prod
Privileged password: <your password>
Unprivileged user: amosuser_prod
Unprivileged password: <your password>

Script Generation
Script destination: <location of the SQL script>

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Handling Multiple AMOS Environments


After the setup of the PostgreSQL instance and the installation of the primary AMOS server, additional AMOS
servers can use the same PostgreSQL instance. Please use the amos_config_server command line tool as
described earlier to set up a new database and dedicated database users for each AMOS server.

SWISS-AS.COM
138/167

AMOS Server Installation with SAP ASE on Linux


Start the Database and AMOS Setup
The initial database configuration needs to be carried out first. If the database wizard is not yet started (see above
chapter), this can be done using the amos_config_server command line tool located in <server directory>/scripts
and using the --setupDatabase parameter.
cd <server directory>/scripts
./amos_config_server --setupDatabase

For example:
cd /applic/amos_prod/scripts
./amos_config_server --setupDatabase

It is not allowed to start amos_config_server as user 'root'.

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in SAP ASE:

the privileged and unprivileged database roles


data and log devices
a database owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server command line tool or using a
separate psql session.

The script can be executed using psql as user sybase like in the following example:
isql -Usa -i setupDb_prod.sql

The following parameters need to be entered during the set up process:

Logical Configuration
Database support: SAP ASE 16.0
Database hostname: localhost, <DB server IP> or <DB server hostname>
Database port: 5000
Database name: prod

Database Owner Password


Password: <password of sa>

SWISS-AS.COM
139/167

Physical configuration
Device type: Data
Device name: prod_data1
Device location: /data/amos/prod_data1.dat
Device size: 20000M

Device type: Log


Device name: prod_log1
Device location: /log/amos/prod_log1.dat
Device size: 2000M

User Configuration
Privileged user: amosserver_prod
Privileged password: <your password>
Unprivileged user: amosuser_prod
Unprivileged password: <your password>

Script Generation
Script destination: <location of the SQL script>

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Handling Multiple AMOS Environments


After the setup of the SAP ASE instance and the installation of the primary AMOS server, additional AMOS servers
can use the same SAP ASE instance. Please use the amos_config_server command line tool as described earlier
to set up a new database and dedicated database users for each AMOS server.

SWISS-AS.COM
140/167

AMOS Server Installation with SAP ASE on Windows


Start the AMOS Setup

The initial database configuration needs to be carried out first. This is done using the amos_config_server
command line tool located in AMOS server's scripts subdiretory. Change to that directory and run the
amos_config_server.bat administrator's permission.

Run the amos_config_server command line tool on Windows as administrator. If this requirement is not
met, the installation of the AMOS windows service will fail.

This starts a wizard which generates an SQL script. This script can be used to set up the following database objects
in SAP ASE:

the privileged and unprivileged database roles


data and log devices
a database owned by the privileged role
grant database and tablespace privileges to the privileged role

The script can be either executed directly from within the amos_config_server command line tool or using a
separate psql session.

The script can be executed using psql as user sybase like in the following example:

SWISS-AS.COM
141/167

isql -Usa -i setupDb_prod.sql

The following parameters need to be entered during the set up process:

Logical Configuration
Database support: SAP ASE 16.0
Database hostname: localhost, <DB server IP> or <DB server hostname>
Database port: 5000
Database name: prod

Database Owner Password


Password: <password of sa>

Physical configuration
Device type: Data
Device name: prod_data1
Device location: E:\data\amos\prod_data1.dat
Device size: 20000M

Device type: Log


Device name: prod_log1
Device location: F:\log\amos\prod_log1.dat
Device size: 2000M

User Configuration
Privileged user: amosserver_prod
Privileged password: <your password>
Unprivileged user: amosuser_prod
Unprivileged password: <your password>

Script Generation
Script destination: <location of the SQL script>

After successful set up of the AMOS database, the wizard allows you to set up the table structure required by
AMOS using the database initialisation procedure.

Handling Multiple AMOS Environments


After the setup of the SAP ASE instance and the installation of the primary AMOS server, additional AMOS servers
can use the same SAP ASE instance. Please use the amos_config_server command line tool as described earlier
to set up a new database and dedicated database users for each AMOS server.

SWISS-AS.COM
142/167

AMOS Server start


Once the basic configuration of the AMOS server is completed and the AMOS server is ready to be started.

Linux

Start the application server in Linux using the following commands as Linux user 'amos'.
cd <server directory>
./start_amos

For example:
cd /applic/amos_prod
./start_amos

Windows

Start the application server in Windows using the corresponding service.

SWISS-AS.COM
143/167

AMOS Client Installation


The preferred way to install an AMOS client on a user's PC is to use the Client Deployment Package. This allows
the provisioning of clients with minimal intervention by the administrator and AMOS users. It also provides the
lowest network load when installing large amount of clients. AMOS client settings used by these installation like the
default installation directory, shortcut name or SSL/TLS can be predefined in AMOS. All installation options are
available in the amos_config_server command line tool and in the Configure Server APN 10 tabsheet Generate
Client Installer in AMOS. The client deployment allows creating an installer package (Windows executable or Linux
script) that contains the complete AMOS client including the required Java runtime. This installer package can be
distributed via the built-in web server or a network drive and then be executed on the user's PC.

Specific Windows Requirements

AMOS is using the Java and JavaFX technology. Those frameworks are built using Microsoft Visual C++ and they
have dependencies on runtime libraries which must be installed on every PC.

Please make sure that the following Windows packages are installed:

AMOS Package Name Where to get this package


Version

All Visual C++ Redistributable Packages for https://www.microsoft.com/en-us/download/details.


Visual Studio 2015 aspx?id=48145

Please note that the above listed packages are language specific and you must download and install the
language matching your Windows installation language.

AMOS Client Silent Installation

1. Its two things necessary here. First the extraction that is done via SFX. See here for parameters: https://olegs
cherbakov.github.io/7zSFX/
2. Then the installer is launched. That one has again own parameters: "https://jrsoftware.org/ishelp/"
3. Finally when the installation is done the AMOS client is started automatically to update itself and download
the files.

So to fully suppress any dialogs you first have to tell 7Zip to be silent and then the Inno Setup to be silent.

This can be done with a command like this:


.\amos_client_win64_21.6.1.exe -y -gm2 /SP- /VERYSILENT /SUPPRESSMSGBOXES /NOCANCEL /NORESTART /DIR="E:
\AMOS_TEST"

-y -gm2 are interpreted by 7Zip everything after that one is then for the Inno installer.

Unfortunately this is still not 100% "silent" as the installer will start the AMOS client once it is finished but this is as
far as you can get with this. At least the user does not need to interact with anything.

SWISS-AS.COM
144/167

Basic AMOS Configuration


The following chapters describe some basic settings that are recommended for every AMOS customer.

Customer Code
The AMOS customer code greatly impacts the AMOS behavior:

AMOS program customizations


the AMOS maintenance key
the AMOS support tool
AMOS reports
etc.

To change it, open AMOS program Parameter Setup (APN 1442) and choose parameter number 914 "AMOS
CUSTOMER CODE". Enter a valid customer code in the string value, then save and publish the changes. The
customer logo on the AMOS desktop will change automatically.

Keystore
Every AMOS server uses the AMOS key store to store confidential data and certificates. The key store is physically
located in tables in the database: kst_area, kst_cert and kst_key. The key store is encrypted using a master key file
in the application server's cfg directory: e.g. amos_masterkey_prod.cfg (for database prod). The master key file
needs to be backed up together with the database. Without a valid master key file the key store cannot be
opened.

The key store stores data related to:

electronic signature
web service authentication
SSL connection for client-server communication
AMOS maintenance key exchange

To reset the key store, truncate the key store tables, remove the master key file and restart the application server
once. This will automatically reinitialize the key store using the master key.

Maintenance Key
Every AMOS instance requires a maintenance key to run in maintained mode. Without a maintenance key, only
admin programs in AMOS are accessible. This maintenance key needs to be requested from Swiss-AS via www.
swiss-as.com either via web service or request file in program Maintenance Key Admin (APN 1500). When
requesting the key from Swiss-AS, the following details regarding the AMOS instance are collected so that the
maintenance key is only valid on this environment:

host name and IP address


database name
AMOS client port
AMOS customer code

SWISS-AS.COM
145/167

productive or non-productive environment

The AMOS maintenance key expires after 6 months. This means, the administrator regularly needs to request a
new key. If the maintenance key is expired, all programs remain accessible but the AMOS client title text, the
AMOS desktop and AMOS printouts will show the unmaintained mode. AMOS keystore and AMOS maintenance
key need special handling when restoring a database from a backup ! The keystore needs to be accessible in
order to apply the maintenance key, therefore the master key file might have to be copied to the target environment
and renamed to fit the target database name. To reuse a maintenance key of a test environment that has been
overwritten with a production database please make sure to create a backup of the test key once. The
corresponding backup file is stored in the AMOS server's cfg directory and is loaded automatically after a restart of
the application server. This will overwrite the (production) maintenance key that came with the database backup.

SMTP Server
The SMTP server needs to be configured in AMOS APN 10, tabsheet Other Servers. You can enter the IP address
or hostname of your email server and additional parameters if required. The SMTP server will be used for sending
warnings, notifications of certain events or reports directly to the administrator even if the AMOS client is not open
at the moment.

LDAP Authentication

To allow the AMOS user authentication to be performed by an LDAP server, AMOS parameter 1000 needs to be
configured correctly. Please use AMOS APN 1442 to change the authentication path.

SWISS-AS.COM
146/167

After the LDAP server has been configured there, the authentication authority (AMOS server or LDAP) can
configured on a user level in APN 14.

Proxy Settings

SWISS-AS.COM
147/167

The proxy settings of the AMOS server or of the AMOS client need to be configured in AMOS APN 10, tabsheet Oth
er Servers. Dependent on if the connection to the Swiss AS support database is initiated by the application server
or the AMOS client, the corresponding proxy settings can be entered there.

Communication over internet is necessary for the use of the

Online Support Tool: URL Swiss AS support database is https://services.swiss-as.com/support-tool-


request
the AMOS maintenance key webservice: URL Swiss AS maintenance key webservice is https://services.
swiss-as.com/maintenance-key-request
the interface to market places

Statistics Module
The collection of statistical data by the AMOS server can be configured in APN 10 in AMOS (Configure Server) on
tabsheet Statistics. This tab is divided into two sections:

Tracking Information: here you can restrict the types of statistical data to be tracked
Warning Levels: here you can advise the statistics programs to send a message if certain warning levels are
reached or a specific event occurs

Statistical values greatly improves the monitoring of the AMOS environment with minimum overhead. APN 156 in
AMOS (Statistic-Analyzer) can be used to view the statistical data.

SWISS-AS.COM
148/167

AMOS Executors
The AMOS executors can be configured in APN 10 in AMOS (Configure Server) on tabsheet AMOS Executors.
This describes the maximum number of parallel worker threads that are used by the AMOS server to perform
background tasks. This number is not per job, but the thread limit is a total for all such jobs. The behaviour can be
monitored on the AMOS Executors tab in APN:10 Configure Server and AMOS Monitoring Executors in APN:2137
AMOS Control Centre.

The Thread limit needs to be adapted according the following settings, depending on the DBMS:

SAP ASE: max online engines

PostgreSQL: Database host CPU count -1

Oracle: AMOS CPU count

The Thread buffer is used to adapt the maximum amount of update threads depending on the number of online
users. The value should be adapted according the sizing classification (XS, S, M: 50 - L, XL, XXL: 100)

Remark: This settings are not stored in the database but have to be adjusted on each application server.

SWISS-AS.COM
149/167

Support Tool Setup


To be able to connect to the Swiss AS support database using the AMOS support tool, please follow the below
steps. Note that the connection requires direct access to http://www.swiss-as.com/supportTool/custRequest either
from the server or an AMOS client. Therefore the configuration of a proxy might be required in AMOS (see Proxy
Settings).

1. Set up of the webservice URL


Enter APN 1442 in AMOS (Parameter Setup) and edit parameter 1473 (Support Webservice). The string
parameter should contain the Swiss AS support database URL https://services.swiss-as.com/support-tool-
request.
2. Create a dedicated web user
Enter APN 10 in AMOS (Configure Server) and browse to the tab sheet Webserver. Change to the tab sheet
"Web User Administration" tab sheet and create a web user if not already existent. You may use the
following data as a template:

Web User Sign: SUPPORT


Status: Active: Yes
Outgoing Services: Yes
Incoming Services: Yes
Remarks: This user is required to communicate with Swiss-AS' Support Webservice (see APN
1635).
Login: Fill this page with the credentials of a VALID user on the www.swiss-as.com page. Please
let us know should you need further assistance with this.

SWISS-AS.COM
150/167

3. Configure Support Tool


Enter APN 1635 in AMOS (Support Tool) and press button "Configure " in the bottom left corner of the main
screen of that program. Set the user previously created.

Anonymous Web Access


Per default, the AMOS web server is protected by username and password. If you want to provide the web server
access without entering password credentials, you have to create a user called WWWGUEST in AdminLogins (APN
14). It doesn't matter if the login is activated or not - it just has to exist. Per default, access to the AMOS webdrive
and the client download web pages is limited to AMOS administrators only.

If you additionally want to enable anonymous access to the client download page you need to configure the access
rights via Admin Roles (APN 15). To implement this, you will need to create a role, grant the appropriate licenses,
and assign this role to WWWGUEST.

SWISS-AS.COM
151/167

Scheduler Tasks, Daemons and User Triggered Actions


Use program AMOS Scheduler (APN 2606) to configure and monitor daemons, background tasks and user
triggered actions. A predefined Forecast Sequence is available to cover the most important forecast calculations.

Please find the latest list of AMOS scheduler tasks here: http://www.swiss-as.com/amos/taskinfo/TaskOverview.html

Web Drive
In the AMOS web drive huge amounts of binary data like pictures, PDFs and documents can be stored and linked
to data in the database. Therefore it is strongly recommended to provide a dedicated operating system partition for
the web drive. In AMOS APN 10, the administrator can change the location of the web drive directory to an absolute
path in the file system (provided that permissions are correct). It is even possible to use UNC path of a remote file
server. From 21.12 it is not possible to change the webdrive path in APN10 unless the critical_features.cfg file has
been configured. Refer to the AMOS Security Handbook.

Protect AMOS Web Services


The AMOS application server offers various default web services and new web services can be configured in the
AIM context. The complete list of web services can be seen in program Configure Server (APN 10) on tabsheet
Webserver. Without further configuration, all web services are unprotected which means that they are accessible
from outside AMOS by simply querying the corresponding URL from a browser. Therefore it is recommended to
protect all sensitive web services by adding a web user in program Configure Server APN 10:

SWISS-AS.COM
152/167

SWISS-AS.COM
153/167

System Integration

SWISS-AS.COM
154/167

Linux boot scripts

Introduction
Installation
Example
Options
Templates
Usage
Amos instances
SAP ASE Server
SAP ASE Backup Server
FAQ

Introduction
Swiss-AS provides Linux boot scripts for AMOS (all environments), SAP ASE and ASE backup server. These
scripts can be added to the boot process of the operating system to allow an automatic startup.
They can easily be setup with the setup script setup_boot_scripts.sh.

Note that this solution is based on systemd and therefore is only supported on Linux distributions including this
daemon.

Installation
To install the boot scripts, you need to use the setup script setup_boot_scripts.sh as user root. The whole package
can be downloaded here: http://www.swiss-as.com/amos/download/tools/amos/setup_boot_scripts.tar or as part of
the AMOS release package, under scripts/linux/start_stop.

Parameters can be given to the setup script, by default it will scan the /applic directory and check installed AMOS
and ASE instances.

Example
In the below example, the setup script found two AMOS instances (prod and test), SAP ASE and ASE backup
server.
[root@sas-srv-opslinase02 start_stop]# ./setup_boot_scripts.sh
|
SYBASE
|-- ASE installation found in:
| /applic/sap_ase
| Please choose one (default /applic/sap_ase):
|-- Password file for ASE (default /applic/sap_ase/.syb_passwd):
|-- SAP ASE
| Install unit file for ASE? [Y/N] (N): Y
| Unit file for ASE installed.
|-- SAP ASE BS
| Install unit file for ASE BS? [Y/N] (N): Y
| Unit file for ASE BS installed.
|-- Sudoers
| sybase user added in sudoers.

SWISS-AS.COM
155/167

|-- Start ase.service? [Y/N] (N): Y


| ase.service enabled
|-- Start ase_bs.service? [Y/N] (N): Y
| ase_bs.service enabled

AMOS
|-- amos_preview instance found
| Install unit file for amos_preview? [Y/N] (N): Y
| Unit file for amos_preview installed.
|-- amos_prod instance found
| Install unit file for amos_prod? [Y/N] (N): Y
| Unit file for amos_prod installed.
|-- Sudoers
| amos user added in sudoers.
|-- Start amos_preview instance? [Y/N] (N): Y
| amos_preview.service started
|-- Start amos_prod instance? [Y/N] (N): Y
| amos_prod.service started
|
BYE BYE...
[root@sas-srv-opslinase02 start_stop]#

Options
Usage: setup_boot_scripts.sh [-c|-d <dir>|-f|-h|-s] -- Installs AMOS and ASE boot scripts

Without the -d option the default application folder (where the script will check the installations) is /applic.

Options:

-c : Erases installed boot scripts and exits


-d <directory> : Uses the specified directory as application directory. Without this option /applic is used.
-f : Replaces the installed boot scripts
-h : Prints this help
-s : Shows installed boot scripts and exits

Templates
The script setup_boot_scripts.sh uses three templates files that need to be present in the same directory as
itself.

amos.service.template: template file for AMOS


ase.service.template: template file for SAP ASE
bs.service.template: template file for SAP ASE backup server

The template files are automatically copied and modified by the script setup_boot_scripts.sh.

Usage

Amos instances
Start amos_prod

SWISS-AS.COM
156/167

[amos@sas-srv-opslinase02 ~]$ sudo systemctl start amos_prod.service

Stop amos_prod

[amos@sas-srv-opslinase02 ~]$ sudo systemctl stop amos_prod.service

Check the status of amos_prod

[amos@sas-srv-opslinase02 ~]$ sudo systemctl status amos_prod.service


amos_prod.service - AMOS application server /applic/amos_prod
Loaded: loaded (/etc/systemd/system/amos_prod.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-05-23 20:31:12 UTC; 1s ago
Process: 18997 ExecStart=/tmp/start_amos_prod.sh (code=exited, status=0/SUCCESS)
Process: 18981 ExecStartPre=/bin/bash -l -c echo -e "#!/bin/bash" > /tmp/start_amos_prod.sh; echo -e "
/applic/amos_prod/start_amos" >> /tmp/start_amos_prod.sh; echo -e "ps -ef | grep '/applic/amos_prod' | grep
run_server | awk '{ print \$2 }' > /tmp/amos_prod.pid" >> /tmp/start_amos_prod.sh; echo -e "exit 0" >> /tmp
/start_amos_prod.sh; chmod u+x /tmp/start_amos_prod.sh (code=exited, status=0/SUCCESS)
Main PID: 19015 (run_server)
CGroup: /system.slice/amos_prod.service
19015 /bin/sh /applic/amos_prod//scripts/run_server
19053 ./software/runtime_linux_x64/bin/java -Djava.awt.headless=true -Dnashorn.option.global.per.
engine=true -Djava.awt.headless=true -javaagent:stdclasses/byteman.jar -Djava.lang.Integer....

May 23 20:31:07 sas-srv-opslinase02.swiss-as.com systemd[1]: Starting AMOS application server /applic


/amos_prod...
May 23 20:31:07 sas-srv-opslinase02.swiss-as.com start_amos_prod.sh[18997]: Trying to start application
server ...
May 23 20:31:12 sas-srv-opslinase02.swiss-as.com start_amos_prod.sh[18997]: Application server started (pid
19015)!
May 23 20:31:12 sas-srv-opslinase02.swiss-as.com systemd[1]: Started AMOS application server /applic
/amos_prod.
[amos@sas-srv-opslinase02 ~]$ sudo systemctl stop amos_prod.service

SAP ASE Server


Start SAP ASE

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl start ase.service

Stop SAP ASE

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl stop ase.service

Check the status of SAP ASE

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl status ase.service


ase.service - SAP ASE 16 database server AMOS
Loaded: loaded (/etc/systemd/system/ase.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-05-23 20:36:00 UTC; 58s ago
Process: 19424 ExecStopPost=/tmp/stop_ase.sh (code=exited, status=0/SUCCESS)
Process: 19409 ExecStop=/bin/bash -l -c echo -e "shutdown with wait='00:02:00'
go" > /tmp/shutdown_ase.sql; echo -e "#!/bin/bash" > /tmp/stop_ase.sh; echo -e "source /applic/sap_ase
/SYBASE.sh" >> /tmp/stop_ase.sh; echo -e "isql -Usa -P \$(cat \$SYBASE/.syb_passwd) -SAMOS -i/tmp
/shutdown_ase.sql" >> /tmp/stop_ase.sh; echo -e "rm -f /tmp/ase.pid" >> /tmp/stop_ase.sh; echo -e "exit 0"
>> /tmp/stop_ase.sh; chmod u+x /tmp/stop_ase.sh (code=exited, status=0/SUCCESS)
Process: 19569 ExecStart=/tmp/start_ase.sh (code=exited, status=0/SUCCESS)
Process: 19554 ExecStartPre=/bin/bash -l -c echo -e "#!/bin/bash" > /tmp/start_ase.sh; echo -e "source

SWISS-AS.COM
157/167

/applic/sap_ase/SYBASE.sh" >> /tmp/start_ase.sh; echo -e "startserver -f /applic/sap_ase/ASE-16_0/install


/RUN_AMOS" >> /tmp/start_ase.sh; echo -e "sleep 5" >> /tmp/start_ase.sh; echo -e "ps -ef | grep -e '/applic
/sap_ase/ASE-16_0/install/RUN_AMOS\$' | awk '{ print \$2 }' > /tmp/ase.pid" >> /tmp/start_ase.sh; echo -e
"exit 0" >> /tmp/start_ase.sh; chmod u+x /tmp/start_ase.sh (code=exited, status=0/SUCCESS)
Main PID: 19573 (RUN_AMOS)
CGroup: /system.slice/ase.service
19573 /bin/sh /applic/sap_ase/ASE-16_0/install/RUN_AMOS
19575 /applic/sap_ase/ASE-16_0/bin/dataserver -d/data/master.dat -e/applic/sap_ase/ASE-16_0
/install/AMOS.log -c/applic/sap_ase/ASE-16_0/AMOS.cfg -M/applic/sap_ase/ASE-16_0 -N/applic/sap_as...

May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: 00:0006:00000:00002:2019/05/23 20:36:


00.13 server on top of default character set:
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: 00:0006:00000:00002:2019/05/23 20:36:
00.13 server 'utf8' (ID = 190).
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: 00:0006:00000:00002:2019/05/23 20:36:
00.13 server Master device size: 200 megabytes, or 102400 virtual pages. (A virtua...048 bytes.)
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: 00:0006:00000:00002:2019/05/23 20:36:
00.14 kernel Warning: Cannot set console to nonblocking mode, switching to blocking mode.
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: 00:0006:00000:00002:2019/05/23 20:36:
00.14 kernel Console logging is disabled. This is controlled via the 'enable conso... parameter.
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com start_ase.sh[19569]: No server log file open; Using stderr
for log.
May 23 20:36:00 sas-srv-opslinase02.swiss-as.com systemd[1]: Started SAP ASE 16 database server AMOS.
Hint: Some lines were ellipsized, use -l to show in full.

SAP ASE Backup Server


Start SAP ASE backup server

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl start ase_bs.service

Stop SAP ASE backup server

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl stop ase_bs.service

Check the status of SAP ASE backup server

[sybase@sas-srv-opslinase02 ~]$ sudo systemctl status ase_bs.service


ase_bs.service - SAP ASE 16 backup server AMOS_BS
Loaded: loaded (/etc/systemd/system/ase_bs.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-05-23 20:37:40 UTC; 1min 0s ago
Process: 19463 ExecStopPost=/tmp/stop_ase_bs.sh (code=exited, status=0/SUCCESS)
Process: 19448 ExecStop=/bin/bash -l -c echo -e "shutdown SYB_BACKUP with wait='00:02:00'
go" > /tmp/shutdown_ase_bs.sql; echo -e "#!/bin/bash" > /tmp/stop_ase_bs.sh; echo -e "source /applic
/sap_ase/SYBASE.sh" >> /tmp/stop_ase_bs.sh; echo -e "isql -Usa -P \$(cat \$SYBASE/.syb_passwd) -SAMOS_BS -i
/tmp/shutdown_ase_bs.sql" >> /tmp/stop_ase_bs.sh; echo -e "rm -f /tmp/ase_bs.pid" >> /tmp/stop_ase_bs.sh;
echo -e "exit 0" >> /tmp/stop_ase_bs.sh; chmod u+x /tmp/stop_ase_bs.sh (code=exited, status=0/SUCCESS)
Process: 19708 ExecStart=/tmp/start_ase_bs.sh (code=exited, status=0/SUCCESS)
Process: 19693 ExecStartPre=/bin/bash -l -c echo -e "#!/bin/bash" > /tmp/start_ase_bs.sh; echo -e
"source /applic/sap_ase/SYBASE.sh" >> /tmp/start_ase_bs.sh; echo -e "startserver -f /applic/sap_ase/ASE-16_0
/install/RUN_AMOS_BS" >> /tmp/start_ase_bs.sh; echo -e "ps -ef| grep '/applic/sap_ase/ASE-16_0/install
/RUN_AMOS_BS\$'| awk '{ print \$2 }' > /tmp/ase_bs.pid" >> /tmp/start_ase_bs.sh; echo -e "exit 0" >> /tmp
/start_ase_bs.sh; chmod u+x /tmp/start_ase_bs.sh (code=exited, status=0/SUCCESS)
Main PID: 19712 (RUN_AMOS_BS)
CGroup: /system.slice/ase_bs.service
19712 /bin/sh /applic/sap_ase/ASE-16_0/install/RUN_AMOS_BS
19716 /applic/sap_ase/ASE-16_0/bin/backupserver -e/applic/sap_ase/ASE-16_0/install/AMOS_BS.log -
N25 -C20 -I/applic/sap_ase/interfaces -M/applic/sap_ase/ASE-16_0/bin/sybmultbuf -SAMOS_BS

SWISS-AS.COM
158/167

May 23 20:37:40 sas-srv-opslinase02.swiss-as.com systemd[1]: Starting SAP ASE 16 backup server AMOS_BS...
May 23 20:37:40 sas-srv-opslinase02.swiss-as.com systemd[1]: Started SAP ASE 16 backup server AMOS_BS.

FAQ
Where can I download these scripts? http://www.swiss-as.com/amos/download/tools/amos
/setup_boot_scripts.tar
How can I remove the installed boot scripts? setup_boot_scripts.sh -c
How can I force the setup script to reinstall the boot scripts? setup_boot_scripts.sh -f
How can I show the installed boot scripts? setup_boot_scripts.sh -s
Am I obligated to use "sudo" before the commands? Yes, the boot scripts add/remove locks on the system.
Only root is allowed to do this.
Is there a minimal AMOS version to use these boot scripts? Yes, AMOS 10.80.
The Sybase and AMOS users are added to the sudoers. Can they run other commands as root? No, they
can only run there specific boot scripts. See /etc/sudoers.d/amos and /etc/sudoers.d/sybase for details.

SWISS-AS.COM
159/167

Microsoft Windows Integration


To run the AMOS application server in Windows, the installation of a Windows service is required for every AMOS
instance. This is done in the amos_config_server command line tool by choosing menu Home > Configuration >
Server Configuration > Windows service. Note that the installation of a Windows service requires to run the tool
using Administrator permissions.

SWISS-AS.COM
160/167

Installing the AMOS Windows Service


In all following explanations a default value is used for both, the service's user and the service's name.

The service's user used in this document is: 'Service User'.


The default value of 'Log On As Local Service' is: 'true'. This means that the service is installed as Local System
service by default. If you want the service to log on with user credentials, this must be set to 'false'.
The default value of the 'Service User' name is: 'AMOSServiceUser'
The service's name is used in this document is: 'Service Name'.
The default value of the 'Service Name' is built dynamically by the folder name of the AMOS Server directory itself:
For example if the directory of the AMOS Server installation is 'D:\applic\amos_prod', the default value will be 'AMO
S_prod', if it is 'D:\applic\amos_test' it will be 'AMOS_test'.

SWISS-AS.COM
161/167

Windows Service Requirements


To be able to install the AMOS Windows service there are some requirements which have to be done prior installing
the service:

Setting up a valid Windows user account


Giving this account the required rights on the AMOS server parent folder (e.g. 'D:\applic')

Creating a valid user account


A Windows service is able to run as a certain operating system or domain user with the corresponding permissions.
If no user gets assigned to the service, the service runs under the 'local system' and its rights. Out of security
reasons it is much better to let the AMOS Server run as a specific operating system or domain user, therefore the
rights of this user can be configured with the respective permissions. This 'Service User' must have the rights to
start and stop Windows services in general and to log on as a service. Common users in the 'Users' group don't
have these rights. If the right to start Windows services is missing, the AMOS Windows service will not be
automatically started at the end of release changes.

Generate a user called 'AMOSServiceUser' with the rights to start and stop Windows services and to log on
as a service. If choosing a different 'Service User' name as the default value 'AMOSServiceUser', a user
must be generated with this name instead.

This 'Service User' can be used, and it is strongly recommended to do so, for all installed services. Otherwise it can
become complex to install and uninstall different AMOS Windows services under different 'Service Users'.

SWISS-AS.COM
162/167

Setting the file and folder permissions


During the AMOS update process, the AMOS application must be able to generate log and batch files and execute
them. These files are automatically generated under the user rights the AMOS Server is started with. In this case
this means that the files get generated by the user the AMOS Windows service is started with, speaking the 'Service
User'. That the AMOS application is able to generate the batch and log files, the 'Service User' must have access
rights to the parent directory of the AMOS installation. In the most cases this should be 'D:\applic'.

Give to the 'AMOSServiceUser' user 'full control' rights on the folder 'D:\applic'.

If there was generated a different ''Service User' than the 'AMOSServiceUser' user, the rights on the 'D:\applic'
folder must be given to this user. If AMOS was installed into a different directory than 'D:\applic', the 'full control'
rights must be given to that directory.

Service Name and Service User Defaults


The default value of the service user name is: 'AMOSServiceUser'
The default service name is built dynamically using the folder name of the AMOS Server directory itself:
For example if the directory of the AMOS Server installation is 'D:\applic\amos_prod', the default service name will
be 'AMOS_prod', if it is 'D:\applic\amos_test' it will be 'AMOS_test'.

SWISS-AS.COM
163/167

Service Configuration
After the requirements are made, the usage of the AMOS Windows service is very easy. By a right-click on the file '
%AMOS_INSTALLDIR%\scripts\amos_config_server.bat' and run as administrator the general configuration utility
for the corresponding AMOS Server is starting. Note that the administrator permission is only required in order to
install or uninstall the service. Patch and release upgrades from 19.12 on will not required highest privileges
anymore.
By choosing submenu 'Home > Configuration > Server configuration > Windows service' the general menu for using
the AMOS Windows service is opened.

Install the Windows Service

SWISS-AS.COM
164/167

The 'Service User' name, domain and its password must be provided. If a local 'Service User' is used, in the prompt
for the domain a dot '.' must be used (local is the default value).

Uninstall the Windows Service


In this menu the AMOS Windows Service can be uninstalled.
No additional information is required for the uninstallation. Only a confirmation that the service shall be uninstalled
is required.

SWISS-AS.COM
165/167

Maintaining the AMOS Windows Service

Changing the password and user manually in the service


If the 'Service User' name or password must be changed by any reason, it must be changed in the installed service
too. This can be necessary if for example the password must be changed or a different user must be used as a 'Serv
ice User'.
In this case it can be changed either with the server configuration program explained in detail in chapter '2.3.3 Menu
option: '3 - Change installed Windows Service'' or it can be done manually without uninstalling and installing the
service again explained in this chapter.
The 'Service User' name and password of the installed service can be changed directly in the 'Computer
Management' window.
Right click on the installed 'Service Name' and choose 'Properties':

Then the properties of the service appear. Change to the tab sheet 'Log On'. Here the new 'Service User' name and
password can be entered manually:

SWISS-AS.COM
166/167

SWISS-AS.COM
167/167

Document Information Installation Guide


Swiss AviationSoftware Ltd.
BSLSAS/CS
P.O.Box, CH-4002 Basel, Switzerland
Tel.: +41 61 582 72 94
Fax: +41 61 582 70 17

©2022 Swiss Aviation Software Ltd.

SWISS-AS.COM

You might also like