Setup connectivity to Run (optional)
This section provides information to help you configure your SAP ASE database to work with the Run dashboard.
This section is only required for Run. If you don't want to use Run, you can skip this section.
Create a database user for the agent
Follow these steps to create a database user for the Agent to use to launch backups and restores on your SAP ASE database and grant access to the agent:
-
Sign in to the database using the SSO role user.
-
Create a new role.
-
Grant operator role to the new role.
-
Enable granular permissions.
-
Sign in to the database using the SA role user.
-
Switch to the master database.
-
Grant map external file privilege to the new role.
-
Sign in again using the SSO role user.
-
Create a new user.
-
Add the new user to the new role.
-
Set the custom role as the default for the user.
-
Grant own any database privilege to the custom role as SA user.
-
Sign in to the database as SA user again.
-
Enable file access.
-
Enable differential backup on the database.
-
Enable trunc log on chkpt on the database.
Add credentials to the agent
- Search for agent you want to add credentials to:
_10cxbagent@lnksap22:~> /opt/cxbagent/cxbagent list_10List of database administrators on cxbagent catalog:_101 - sybase_agent_10 User: sybd04_10 Group: sapsys_10 OrgUUID: XXXXXXXX-YYYY-YYYY-YYYY-XXXXXXXXXXXX_10 Apikey: 012345678901234567890123456789
For the following example we will use sybase_agent
Add database credentials to access the database command line (isql ) tool:
_10cxbagent@lnksap22:~> /opt/cxbagent/cxbagent credentials sybase_agent_10Enter your database username: sapsa_10Enter your database password:_10Database administrator credentials saved to cxbagent catalog_10cxbagent@lnksap22:~>
This credential will never leave the server and will be stored on Agent configuration in Agents catalog
You can check credentials in the config file:
_19cxbagent@lnksap22:~> ls /opt/cxbagent/conf/catalog.yaml_19/opt/cxbagent/conf/catalog.yaml_19cxbagent@lnksap22:~> cat /opt/cxbagent/conf/catalog.yaml _19version: "1.0"_19dbsadmins:_19- agentuuid: XXXXXXXX-YYYY-YYYY-YYYY-XXXXXXXXXXXX_19 agent_name: sybase_agent_19 user: sybd04_19 group: sapsys_19 orguuid: XXXXXXXX-YYYY-YYYY-YYYY-XXXXXXXXXXXX_19 apikey: 012345678901234567890123456789_19 tags:_19 - name: Owner_19 value: i.guinea@syntax.com_19 - name: Project_19 value: CxRun_19 dbuser: sapsa_19 dbpass: 9fae748c55261096336be98d11e2725e08a423daa8257e68b2d29c14430dde021fec8ab4c6687ce67dd352aa5463abe0649802a9bbd3e4f7bbf1b15b2afa73af7e9094b813b5dc81ee013595526f5453ade37fe54e94e67d572bd926b07b4e0a2a76a78c3cae9bc7de4a70194b06eb9206c67f401e371c5de41980943a9225849115fef622f98aa89ac8f22881c3b631b06668d92011b9a359a561176fcca8568e59f744230b87829353ba7798cbc9232cb6b9b48c3200cd600ccee7b5fbe7fe95588e8ee2269de0e319f7a6af7a57a93ff915d21398cdb81ddb2a56dcd137758e189c9a3561fe9b598caff4ab30463e621867261f0d205268d47e6547815875_19cxbagent@lnksap22:~>
Credentials will be encrypted using the autogenerated keys. You can found them in the following directory (change sybd04 for your ASE os user):
_10cxbagent@lnksap22:~> ls -rlta /opt/cxbagent/sybd04/*.pem_10-rw------- 1 cxbagent cxbagent 459 Apr 16 12:56 /opt/cxbagent/sybd04/public.pem_10-rw------- 1 cxbagent cxbagent 1679 Apr 16 12:56 /opt/cxbagent/sybd04/private.pem_10cxbagent@lnksap22:~>
Grant minimal sudo permissions to cxbagent OS user
As Agent is installed on your system to be used by cxbagent os user, we have to grant permissions on sudoers files so this OS user will be able to launch command as Database administrator. We do this with root user:
This configuration must be performed using the root user. Follow these steps to update the sudoers file securely and ensure the Agent functions as intended:
-
Log in as the root user.
-
Edit the sudoers file by running:
_10visudo -f /etc/sudoers.d/cxbagent -
Add the following lines to the sudoers file:
Where:
- sybase_os_username is the OS username for Sybase database
- hostname is the hostname of the current Sybase server
Check your configuration
If you have followed the previous steps correctly, the following output should be displayed:
-
Check the sudoers file for the cxbagent OS user:
-
Check that the cxbagent OS user has the required permissions for the Sybase database user: