Progress 4GL how to see th Before image file size in progress DB server - progress-4gl

How to see the before image file size in progress DB server?

ls -l
Or, if you're running Windows:
DIR
Or you can get some info from VSTs (Virtual System Tables) like _Logging._Logging-BiLogSize.

The Virtual System Tables are your best bet when checking from within a Progress program.
If you're checking the BI size from the command prompt:
fire up ProMon on the database
Choose the option R&D
Choose option 1, Status displays
Choose option 9, BI Log
This will show you the size of all the bi logs for this database.

Related

DB2 (version:11.5.0.1077) Command LIST ACTIVE DATABASES is not working

I downloaded trail version of DB2 (by following steps here:https://www.db2tutorial.com... some steps didn't come when i installed)and i opened Administrator:DB2 CLP - DB2COPY1 -db2, then i have given the cmd as
db2 => LIST ACTIVE DATABASES
output(error):
SQL1096N The command is not valid for this node type.
db2 =>
it's not working, here version of DB2 is:11.5.0.1077,Please advice how to proceed further.In fact not only this command, so many commands are not working.
The message:
"SQL1096N The command is not valid for this node type."
as a response to "list active databases" command
usually means that you did not install a Db2-server product, or you have multiple Db2-products installed and you chose to act on a client instance instead of a server instance.
You might have installed a full Db2-client product by accident, by clicking the wrong button on the setup program gui page for Install a product, or the installable image that you downloaded was not a server image (but instead a client image).
Different ways to see the node type:
You can see which Db2 product(s) you installed if you run
appwiz.cpl from the Windows Start menu and examine the list.
You can also see what you installed if you examine the log file created by the setup program during installation.
open a db2cmd.exe window (from Windows Start > Run) and in there run the command db2 get dbm cfg | more and near the start you will see Node type = ..... If your db2cmd.exe window is addressing a server installation, then the node type will be something like ...Server edition with local and remote clients. If you see Node type = Client, then you are not addressing a server installation. So in this case, you can either uninstall the client image and install a server image, or configure your db2cmd.exe window to address a server installation.
If you have multiple Db2 products installed then run the Default DB2 and Database Client Interface Selection wizard which should appear in your Windows Start menu under the IBM Db2 group. This lets you choose which instance to make the default, so that when you run a db2cwadmin/db2cmd window, then the correct product gets addressed.
If you installed a Db2-server product, then you can run db2cwadmin.bat (from the Windows Start Menu) and in that window the commands db2start and db2stop will be available, and the command-line db2 list active databases will report (by default) one local database called SAMPLE assuming you created the default database in the First Steps that runs after installation.
If you installed a Db2-server product, with all the default settings on a Microsoft Windows operating-system, then you will also see a process called db2sysc.exe in the Task List when the Db2-instance is running.
Verify that you downloaded the server image from IBM, and then re-run the setup program and ensure you choose to install a server product.

SQL2059W A device full warning - when trying to bring tablespace online

Trying to do a DB2 import as part of a system copy and the transaction logs filled up. Import was cancelled, transaction log backup ran, and number of logs were increased to approximately 90% of the available disk (previously 70%).
Restarted DB and kicked off DB but now that errors due to the tablespace state - running db2 list tablespaces show detail shows I have 4 tablespaces in Backup Pending state.
So I tried db2 backup database <SID> tablespace <SID>#BTABI online but I get the error:
SQL2059W A device full warning was encountered on device "/db2/db2". Do you want to continue(c), terminate this device only(d), abort the utility(t) ? (c/d/t) t
No option works but to terminate.
The thing is, the device isn't full. There's no activities on the DB, running db2 list applications gives:
SQL1611W No data was returned by Database System Monitor.
Running db2 "select log_utilization_percent,dbpartitionnum from sysibmadm.log_utilization order by 2" to show the log utilization returns 0.
There's no logs in use. The filesystem has space free. I even tried reducing the number of logs again to make sure but get the same issue.
I tried db2 "alter tablespace <SID>#BTABI switch online" instead and although this returns a 'success' statement it doesn't actually do anything - my tablespaces are still in Backup pending?
Any ideas please
You're trying to write the backup images to the /db2/db2 file system, which doesn't have enough space to hold the backup image(s).
Note: When you execute BACKUP DATABASE as in your example above without specifying where to send the backup (i.e. you don't use the to /dir/ectory or another option like use TSM), DB2 will write the backup image to the current directory. Make sure you specify where to store the backup image (and that it has enough free space to hold the backup image). If you don't care about recoverability and are just trying to get the table space out of backup pending state, you can specify /dev/null as your location as #mustaccio suggests in the comments above.
Also: You may want to look at the COMMITCOUNT option for the import utility so you're not trying to insert all data in a single massive transaction.
As per above comments - just kept running the import, resetting the 'pending load' status each time with:
load from /dev/null of del terminate into SAPECD.
A few packages fail each time but the rest process. Letting finish, resetting again and restarting the import gets through a little more each time.

How can I check what time was the process core dump taken on windows?

I have a full memory dump of a process taken through Task Manager.
Can I determine what the time was on the machine at that moment?
It's displayed in the Command window of WinDbg after you open the dump, as 'Debug session time'.
You can have it printed again with the .time meta-command.

How to determine in PgAdmnin if a database is completely restored?

When PgAdmin III displays a list of databases, a database in the middle of restoring looks just like any other one. How can I determine if the restore has completed or not?
If by restore you mean pg_restore command in progress you cannot see that directly from pgAdmin. What pg_restore does in fact is execute simple CREATE TABLE, INSERT or COPY commands that differ in no way from normal commands. What you can do is you can open the Server status window. If you know where the command is executed (IP address) or if there is nothing else connecting to the database you can check if there are open connections to the database. If there are no open connections the restore has finished. If you can't deduce the info from connections you could look if there are any transactions (no transactions for some time = restore finished).
It would be simpler to get this information if you had access to the place where the command is executed.

How can I run PostgreSQL DB service under Local System account?

I'm using PostgreSQL DB in my application, I used to create special windows user account to run the DB service.
Now I need to run PostgreSQL service under Local System account! Is there a configuration in PostgreSQL to specify the user account which the service runs under?
Thanks,
Computer Management -> Services -> select the Postgres server service -> right click -> Properties -> check the Log on tab, just like any other Windows service.
(Might be a bit off with the naming, I don't have access to a Windows machine at home, but I'm sure you can improvise.)
Download the zip archived binaries from PostgreSQL site. Extract the contents. Create a folder, say 'data', for storing the db files etc. Open Windows Advanced System Configuration -> Environment Variables.
Create a new System Variable called PGDATA and set its value to the complete path of data folder, as in - 'C:\PostgreSQL\data'(without the single quotes).
Next in Path variable include the complete path to bin folder, as in - 'C:\PostgreSQL\bin;....' .
Once done, do the following...
Open command prompt(as Admin in Vista and Win 7 systems). Type: 'initdb' and press Enter. This will do the initial setup.
In the same command prompt window, type in: 'pg_ctl register -N PostgreSQL -U LocalSystem' and press enter.
Open run and type services.msc and check if the process 'PostgreSQL' has been created and that you can actually start it.
I don't believe that you need to do anything special to run this under a local system account. We use PostgreSQL databases here and we install them on local system accounts all the time. I have never seen a configuration setting in the installation that allows you to indicate a system account for the service.