# Checking Adabas DB status

**URL:** <https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-Basics-on-Linux-Unix-Windows, Adabas-on-Windows-UNIX, Adabas-on-Linux\
**Created:** [April 16, 2012, 10:58pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170 "2012-04-16T22:58:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd\_Beckwith](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/todd_beckwith/32/388_2.png) [@Todd\_Beckwith](https://techcommunity.softwareag.com/u/Todd_Beckwith)\
**Post date:** [April 16, 2012, 10:58pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/1 "2012-04-16T22:58:44Z")

</div>

Adabas 6.3.0  
Natural 6.3.11  
HP UX

Is there an easy way to check if a database is up from the OS prompt? At a previous shop, there was a testdb.exe available in the Adabas version directory on OpenVMS. I don’t know if this was developed in-house or SAG provided but I cannot find the same thing in our Adabas directory on HP UX. Basically, I need to ensure the database is available before running a SYSOBJH session in Natural. I’m sure I can develop a workable solution in Natural but I was hoping there was already a way using Adabas utilities or a SAG provided means.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 16, 2012, 11:20pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/2 "2012-04-16T23:20:41Z")

</div>

```auto
adashow nnn
```

where nnn is the dbid will print a bit of environmental information plus the  
status (active / inactive)

```auto
adaopr db=nnn,di=act
```

(or any other command) will either print the requested information or return

%ADAOPR-E-ADA148, \* ADABAS is not active or nucleus cannot be contacted

---

<div class="post-metadata">

**Author:** ![Todd\_Beckwith](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/todd_beckwith/32/388_2.png) [@Todd\_Beckwith](https://techcommunity.softwareag.com/u/Todd_Beckwith)\
**Post date:** [April 17, 2012, 12:52am UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/3 "2012-04-17T00:52:48Z")

</div>

Thanks Wolfgang. I’ll check out each of these. I was using “adaopr db=1” but that alone returns a success code long before the database starts responding well for SYSOBJH. I’ll see if actually displaying data changes anything or parse the active from adashow to get my answer. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 18, 2012, 12:47pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/4 "2012-04-18T12:47:19Z")

</div>

You can also use getdbinfo under …\Adabas Client Package\opt\tstprg.

This one can be used both locally and remote to check if a database is active and accessible.

getdbinfo 199

```auto
get platform and version info of database 199

Database 199 is active, V6.1.10.4 , Platforms = 21 ,opsys=UNIX/Windows, local access
```

Result if used remote:

```auto
get platform and version info of database 199

Database 199 is active, V6.1.10.4 , Platforms = 21 ,opsys=UNIX/Windows, remote access
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 18, 2012, 1:02pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/5 "2012-04-18T13:02:30Z")

</div>

On linux this is

```auto
/$ACLDIR/$ACLVERS/tstprg/bin/getdbinfo <dbid>
```

and will give either

```auto
 get platform and version info of database 222

 Database 222 is active, V6.3.0.4 , Platforms = 21 ,opsys=UNIX/Windows, local access
```

for an active database.

For an inactive database it will give

```auto
 get platform and version info of database 221

 Database 221 -- ** Response code 148 from ADABAS for Open call
```

---

<div class="post-metadata">

**Author:** ![Todd\_Beckwith](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/todd_beckwith/32/388_2.png) [@Todd\_Beckwith](https://techcommunity.softwareag.com/u/Todd_Beckwith)\
**Post date:** [April 18, 2012, 2:51pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/6 "2012-04-18T14:51:57Z")

</div>

> [@Mogens](#):
>
> You can also use getdbinfo under …\Adabas Client Package\opt\tstprg.
> 
> This one can be used both locally and remote to check if a database is active and accessible.
> 
> getdbinfo 199

I am still getting a 3148 in SYSOBJH despite parsing " active" using the adashow option and when checking the return code from the adaopr option. I implemented the solution simply giving 5 minutes for the database to come up, which I’m sure is excessive. I’ll give detdbinfo a try as time permits and report back.

Thanks Mogens and Wolfgang.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 18, 2012, 3:09pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/7 "2012-04-18T15:09:51Z")

</div>

If getdbinfo replies ‘ok’ I would definitely expect the database to be ready.

Are you sure your SYSOBJH does not access another database that is not ready yet? It could be the FSEC file or similar(?).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 18, 2012, 3:30pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/8 "2012-04-18T15:30:30Z")

</div>

Or FDIC ?

SYSOBJH by itself does not require any database access on OpenSystems.

---

<div class="post-metadata">

**Author:** ![Todd\_Beckwith](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/todd_beckwith/32/388_2.png) [@Todd\_Beckwith](https://techcommunity.softwareag.com/u/Todd_Beckwith)\
**Post date:** [April 18, 2012, 3:52pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/9 "2012-04-18T15:52:15Z")

</div>

Below is the error I am getting. It is specifically reporting db1 as the problem. This is the only db I stop and start as part of the prod to dev restore. I’m running a test now using getdbinfo and will report on the results. Thanks.

```auto
SYSOBJH LOAD * LIB RN2 WHERE WORK /SAG/temp/rn2-natural-source.sag REPLACE ALL
LOAD * LIB SYSTEM WHERE WORK /SAG/temp/rn2-natural-source-ddm.sag REPLACE ALL
DISPLAY STATISTICS
STOP
LOGON SYSTEM
CATALL * ALL
LOGON RN2
CATALL * ALL
FIN

Error: -3148
Natural error 3148 occurred in line 660 of program OLNLNAT
Processing stopped!
Error detected in OLNLNAT.
Database 1 is not active or not accessible

SYSOBJH terminates with condition code 99
TERM

NAT9987 Natural session terminated abnormally - RC=99.
```

---

<div class="post-metadata">

**Author:** ![Todd\_Beckwith](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/todd_beckwith/32/388_2.png) [@Todd\_Beckwith](https://techcommunity.softwareag.com/u/Todd_Beckwith)\
**Post date:** [April 18, 2012, 4:09pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/10 "2012-04-18T16:09:59Z")

</div>

getdbinfo works perfectly. Thanks gentleman. Your help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:01pm UTC](https://techcommunity.softwareag.com/t/checking-adabas-db-status/100170/11 "2021-04-02T15:01:46Z")

</div>


