Showing posts with label Progress. Show all posts
Showing posts with label Progress. Show all posts

Thursday, June 30, 2011

Applying a delta in Progress

If you want to apply a delta to a Progress database, that is, a file that contains information to update objects of a Progress database in order to be equal to other Progress database's objects (like to a production database from a development one), then you could do this with mpro utility:

RHPRGPR1:/mnt0/new:> mpro /mydatabase/mydb.db









@@@@@@ @@@@@@ @@@@@@@ @@@@@ @@@@@@ @@@@@@@ @@@@@ @@@@@
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @
@@@@@@ @@@@@@ @ @ @ @@@@ @@@@@@ @@@@@ @@@@@ @@@@@
@ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @ @ @@@@@@@ @@@@@ @ @ @@@@@@@ @@@@@ @@@@@

Progress Software Corporation
14 Oak Park
Bedford, Massachusetts 01730
781-280-4000

PROGRESS is a registered trademark of Progress Software Corporation
Copyright 1984-2004
by Progress Software Corporation
All Rights Reserved

After this screen you will be prompted for an user and password; you have to login with an user with enough privileges:

PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004

┌─────────────────── Login ───────────────────┐
│ │
│ Please enter a User Id and Password for │
│ database: mydb │
│ │
│ User Id: DBAUSER │
│ Password: │
│ │
│ (OK) (Cancel) │
└─────────────────────────────────────────────┘












Enter data or press F4 to end.

Then in the next screen you have to press F3 and select the Tools menu, Data Dictionary option:

PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004
File Edit Search Buffer Compile Tools Help
────────────────────────────────┌──────────────────────┐────────────────────────
│ Data Dictionary │
│ OS Shell │
│ Application Compiler │
└──────────────────────┘














─ File: Untitled:1 ─────────────────────────────────────────────────────────────


F1=RUN F3=MENUS F5=OPEN F6=SAVE F8=CLOSE Insert

The next screen will be the Data Dictionary tool:

Database Schema Admin DataServer Utilities PRO/SQL Tools





┌──────────── Welcome to the PROGRESS Data Dictionary ─────────────┐
│ │
│ You may use these facilities to set up or alter the structure of │
│ your database(s) or to perform various administrative functions. │
│ │
└──────────────────────────────────────────────────────────────────┘







Main Menu Data Dictionary
Database: mydb (PROGRESS) Table:

In the Data Dictionary screen you have to select the Admin menu, Load Data and Definitions submenu, Data Definitions (.df file) option:

Database Schema Admin DataServer Utilities PRO/SQL Tools
┌────────────────────────────────────────┐
│ Dump Data and Definitions -> │
│ Load Data and Definitions -> │
│ ┌─────────────────────────────────┐ │
│ │ Data Definitions (.df file)... │ │
┌─────────│ │ Table Contents (.d file)... │ │y ─────────────┐
│ │ │ SQL Views... │... │ │
│ You may └─│ User Table Contents... │────┘e structure of │
│ your datab│ Sequences Current Values... │strative functions. │
│ │ Reconstruct Bad Load Records... │ │
└───────────└─────────────────────────────────┘────────────────────┘







Main Menu Data Dictionary
Database: mydb (PROGRESS) Table:

In order to apply a delta file the database must not be locked by any user, but if so you will get an error message like this:

Database Schema Admin DataServer Utilities PRO/SQL Tools


















Data Definitions (.df file) Data Dictionary
Database: mydb (PROGRESS) Table:


Database in use by SOMEUSER on w1c3xpr3. Wait or press CTRL-C to stop. (388)

If you have to apply this delta and you can safely restart your database or kill the users locking the database then do that, preferably in other terminal; if there are no users locking the database then you will get a screen where you have to select the delta file and a lot of other options that you can keep unchanged.

Finally, after selecting OK, if again there are no users locking the database the delta will be applied very fast and you will go back to the Data Dictionary menu.

Wednesday, June 22, 2011

How to kill a user in Progress

If you need to kill a user connected to a Progress database (because locking issues for example), you can get a list and then kill a user with the proshut command:

myserver:/myprogressdb:> proshut mydb -C list

usr pid time of login user id tty Limbo?

165 20352 Tue Jun 21 08:35:32 2009 SOMEUSER w1c3xpr3 no


myserver:/myprogressdb:> proshut mydb -C disconnect 165

User 165 disconnect initiated. (6796)

You can also disconnect users and shutdown databases with the promon menu, selecting the option 8:

myserver:/myprogressdb:> promon mydb.db

PROGRESS MONITOR Version 9

Database: /myprogressdb/mydb

1. User Control
2. Locking and Waiting Statistics
3. Block Access
4. Record Locking Table
5. Activity
6. Shared Resources
7. Database Status
8. Shut Down Database

T. Transactions Control
L. Resolve Limbo Transactions
C. Coordinator Information

M. Modify Defaults
Q. Quit

Enter your selection: 8
usr pid time of login user id tty Limbo?
11 24122 Sat May 21 10:23:29 2009 biw no
12 24247 Sat May 21 10:23:30 2009 wdog no
13 14898 Wed Jun 29 08:25:08 2009 MYUSER0001 /dev/pts/1 no
100 18648 Tue Jun 28 11:30:09 2009 MYUSER0002 w1c3xpr3 no
104 15128 Fri Jun 24 11:51:34 2009 MYUSER0003 w1c3xpr4 no
106 13556 Fri Jun 24 11:52:02 2009 MYUSER0004 w1c3xpr4 no
115 20344 Tue Jun 21 13:30:10 2009 MYUSER0003 w1c3xpr4 no
122 16948 Tue Jun 28 10:18:10 2009 MYUSER0005 w1c3xpr3 no
131 11128 Tue Jun 28 09:09:33 2009 MYUSER0006 w1c3xpr3 no
138 13252 Tue Jun 28 09:45:05 2009 MYUSER0007 w1c3xpr3 no
139 9828 Tue Jun 28 09:00:06 2009 MYUSER0008 w1c3xpr4 no
146 11708 Tue Jun 28 08:51:51 2009 MYUSER0009 w1c3xpr3 no
150 10640 Tue Jun 28 08:48:59 2009 MYUSER0010 w1c3xpr3 no
151 15464 Tue Jun 28 08:48:44 2009 MYUSER0001 w1c3xpr4 no

RETURN - show remaining, Q - quit:
usr pid time of login user id tty Limbo?
190 10708 Wed Jun 29 07:21:35 2009 MYUSER0011 w1c3xpr4 no

1 Disconnect a User
2 Unconditional Shutdown
3 Emergency Shutdown (Kill All)
x Exit

Enter choice>

If there is a lot of users you can see all pressing RETURN, and after showing all users you can choose to shutdown the database (option 2), or kill some user with his usr number (option 1).

Wednesday, June 8, 2011

Progress instances dying and read-only filesystems

Some day a user tells you one (or a lot) of your Progress database instances is down so you check first if it is running with ps and proutil commands. The instance is in fact down, therefore you check the database log just to find nothing. You try to start up the instance with proserve, and you finally realize why the instance died: the database's filesystem changed to read-only mode.

This might be usual if you have a misconfigured remote filesystem or if you use it heavily, for example iSCSI, and it has to be solved by the sysadmin in charge of that server.

[root@myserver]# ps ax|grep mydb
18187 pts/2 S+ 0:00 grep mydb
[root@myserver]# proutil /progdbs/mydb.db -C holder
PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004

** Cannot find or open file /progdbs/mydb.lk, errno = 17. (43)
[root@myserver]# cd /progdbs
[root@myserver]# tail --lines=10 mydb.lg
14:59:09 SRV 1: Previous message sent on behalf of user 183. (5512)
14:59:10 SRV 1: User is SOMEUSER. (708)
14:59:10 SRV 1: Previous message sent on behalf of user 183. (5512)
14:59:16 SRV 1: Logout usernum 183, userid SOMEUSER, on W1C3XDV1. (739)
14:59:44 SRV 1: Login usernum 183, userid ANUSER, on W1C3XDV1. (742)
14:59:44 SRV 1: User is OTHERUSER. (708)
14:59:44 SRV 1: Previous message sent on behalf of user 183. (5512)
14:59:44 SRV 1: User is OTHERUSER. (708)
14:59:44 SRV 1: Previous message sent on behalf of user 183. (5512)
14:59:44 SRV 1: User is OTHERUSER. (708)
14:59:44 SR
[root@myserver]# proserve /progdbs/mydb -pf /progdbs/mydb.pf
PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004
10:23:38 BROKER : ** Cannot find or open file /progdbs/mydb.lk, errno = 17. (43)
10:23:38 BROKER : ** This process terminated with exit code 2. (8619)
[root@myserver]# ls -la /progdbs/mydb.lk
-r--r--r-- 1 root root 38 Dec 21 11:44 /progdbs/mydb.lk
[root@myserver]# touch /progdbs/hello.txt
touch: cannot touch `/progdbs/hello.txt': Read-only file system

Wednesday, April 27, 2011

Checking application server's state

If you work as a Progress DBA (no, really?) and you need to check the status of an application server, you can do that in this way:

MYSERVER:/home/progress:> asbman -i myasb -q
PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004


Connecting to Progress AdminServer using rmi://localhost:20931/Chimera (8280)
Searching for myasb (8288)
Connecting to myasb (8276)

Broker Name : myasb
Operating Mode : State-reset
Broker Status : ACTIVE
Broker Port : 3058
Broker PID : 25482
Active Servers : 15
Busy Servers : 15
Locked Servers : 0
Available Servers : 0
Active Clients (now, peak) : (0, 3)
Client Queue Depth (cur, max) : (0, 3)
Total Requests : 186
Rq Wait (max, avg) : (18006 ms, 9276 ms)
Rq Duration (max, avg) : (18007 ms, 9277 ms)

PID State Port nRq nRcvd nSent Started Last Change
25577 CONNECTED 03502 000003 000003 000003 Jan 26, 2011 13:14 Jan 26, 2011 13:14
25714 CONNECTED 03503 000003 000003 000003 Jan 26, 2011 13:14 Jan 26, 2011 13:14
25718 CONNECTED 03504 000015 000015 000015 Jan 26, 2011 13:14 Jan 26, 2011 14:24
25722 CONNECTED 03505 000013 000013 000013 Jan 26, 2011 13:14 Jan 26, 2011 14:24
27113 CONNECTED 03506 000014 000014 000014 Jan 26, 2011 13:16 Jan 26, 2011 13:21
29966 CONNECTED 03507 000002 000002 000002 Jan 26, 2011 13:21 Jan 26, 2011 13:21
30012 CONNECTED 03508 000006 000006 000006 Jan 26, 2011 13:21 Jan 26, 2011 13:22
31236 CONNECTED 03509 000003 000003 000003 Jan 26, 2011 13:22 Jan 26, 2011 13:22
31291 CONNECTED 03510 000010 000010 000010 Jan 26, 2011 13:22 Jan 26, 2011 13:24
31295 CONNECTED 03511 000005 000005 000005 Jan 26, 2011 13:22 Jan 26, 2011 13:24
31299 CONNECTED 03512 000004 000004 000004 Jan 26, 2011 13:22 Jan 26, 2011 13:24
31646 CONNECTED 03513 000002 000002 000002 Jan 26, 2011 13:24 Jan 26, 2011 13:24
31650 CONNECTED 03514 000008 000008 000008 Jan 26, 2011 13:24 Jan 26, 2011 13:26
00439 CONNECTED 03515 000002 000002 000002 Jan 26, 2011 13:26 Jan 26, 2011 13:26
00443 CONNECTED 03516 000007 000007 000007 Jan 26, 2011 13:26 Jan 26, 2011 13:31

As you can see, this apps has 15 active servers and a long request wait, and because the limit of connections in the license of this application server is indeed 15 and the connections are not being closed, there is no way a new connection can be created. In this case, you can kill some connections or stop and start the application server to get rid of all connections at the same time. With asbman -i myasb -k you stop the myasb application server and with asbman -i myasb -x you start it.

After restarting this apps, you can see that the number of active servers is just one and the request wait is zero:

MYSERVER:/home/progress:> asbman -i myasb -q
PROGRESS Version 9.1E as of Tue Oct 12 14:40:19 EDT 2004


Connecting to Progress AdminServer using rmi://localhost:20931/Chimera (8280)
Searching for myasb (8288)
Connecting to myasb (8276)

Broker Name : myasb
Operating Mode : State-reset
Broker Status : ACTIVE
Broker Port : 3058
Broker PID : 7034
Active Servers : 1
Busy Servers : 0
Locked Servers : 0
Available Servers : 1
Active Clients (now, peak) : (0, 0)
Client Queue Depth (cur, max) : (0, 0)
Total Requests : 0
Rq Wait (max, avg) : (0 ms, 0 ms)
Rq Duration (max, avg) : (0 ms, 0 ms)

PID State Port nRq nRcvd nSent Started Last Change
07082 AVAILABLE 03502 000000 000000 000000 Jan 26, 2011 15:19 Jan 26, 2011 15:19

You can check the license for your Progress installation with showcfg command.