Re: how to find database names for OnLine v5.01
Posted in 1997
Michal Hajek wrote:
>
> Is there any way how to find the names of databases which
> OnLine work with ? I mean for example
>
> echo "THE RIGHT SELECT"| isql "THE RIGHT PARAMETERS"
> (for UNIX)
>
> or so. Thanks.
Hi Michal,
I'm sure there is s.o. out there, who did s.th. like the following:
!!! PLEASE, NEVER TRY THE FOLLOWING IN A PRODUCTION ENVIRONMENT !!!
The OnLine 5.x has an internal table like "sysdatabases".
Unfortunately this table cannot be directly used, because there
is no entry in your data dictionary. But it's possible to first
create an admin database and create a table called "sysdatabases".
This "sysdatabases" table must be created in exactly the same
way as the internal table ( this will be the trouble ).
( Have a look at your manual: "database tablespace" documentation )
Afterwards you must update the "partnum" entry of the
"sysdatabases" table ( "partnum" is a column of systables table )
with the partnum 0x1000002 ( 16777218 decimal ).
DATABASE yourdatabase;
SELECT partnum FROM systables WHERE tabname = "sysdatabases";{
Note down the result ! You might need the old partnum later !
}
UPDATE systables set partnum = 16777218 WHERE tabname = "sysdatabases";
SELECT * FROM sysdatabases;
If the above SELECT will not show the correct result, please
UPDATE systables again with the old partnum value, before you
do anything else. If you would try to alter your "sysdatabases"
table without the re-update, you will loose your OnLine instance !!!
Any comments ???
Bye
Stefan