[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::dbintegrator_public_public

Title:DB Integrator Public Conference
Notice:Database Integration - today! Kit/Doc info see note 36
Moderator:BROKE::ABUGOV
Created:Mon Sep 21 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1171
Total number of notes:5187

1088.0. "DBI GW/DBMS Table name length" by ORAREP::GIDDAY::REINHOLD (Skippy) Wed Aug 14 1996 03:36

    Gidday,
    
    	I have a customer whom has some problems with DBI GW for DBMS,
    
    Apparently they use it in it's NSDS configuration,
    
    VMS  6.2
    DBMS 6.0-1
    SQL  6.1-0
    
    SQLSRV$API 6.0-1 on VAX7000, not on VAX4000.
    
    There is no difference in behaviour between the 2 configurations.
    
    
    	Apparently they are having 2 problems. The first is that when 
    DBI accesses the database it locks it for everyone else (I am awaiting
    the customer trace file).
    
    	The second problem is that it apears that there is a problem with
    tablename length,
    
    
    The attach command used:
    "attach 'filename
    /type=nsds/path=disk$ramdb1:[cmos_database]cgrdatabase
     /dictionary_driver= dbmsql$shr"
    In the log-in scripts this is always followed with
    "set trans read only"
    
    
    An example of the problem (i.e. assuming there is ONE problem).
    
    The record 'circuit' connects to the records 'channel_x50' and
    'channel_64k' with the set 'circuit_owns_channel'. DBI provides tables 
    for SQL with names 'circuit_owns_channel_channel_x5' and
    'circuit_owns_channel_channel_64', dropping the last character of the 
    original name. SQL queries using these above result in a "no metadata" 
    error, but "show table" gives the right structure.
    
    The problem does not happen with other long names, e.g.
    x50_trans_band_carries_chan_x50, which is 31 chars, obviously the max
    allowed. But because these set-simulation names are internally generated, 
    you have no power over the length.
    
    	I've copied the database structure to orarep::1088.txt
    
    	Any ideas/comments/suggestions greatly apreciated.
    
    
    
    						Dave Reinhold
    						CSC, Sydney, Australia.
    
    
    
T.RTitleUserPersonal
Name
DateLines
1088.1Try the ALIAS clauseSCARY::PCHARLANORACLE CODASYL DBMS EngineeringWed Aug 14 1996 11:3375
Dave,

I can take a shot at the second problem.

If the generated tables names are too long you can create a new DBMS subschema
with short aliases for record and set names.

Here an example schema/subschema that I've used to test this problem:

-------------------------------------------------------------------------------
SCHEMA NAME IS DSQLLNAM

AREA IS AREA1

RECORD NAME IS REC1
    WITHIN AREA1
    ITEM NAME IS ITEM1
        TYPE IS CHARACTER 10

RECORD NAME IS THISISAMIGHTYLONGRECNAME1
    WITHIN AREA1
    ITEM NAME IS ITEM2
        TYPE IS CHARACTER 10

RECORD NAME IS THISISAMIGHTYLONGRECNAME2
    WITHIN AREA1
    ITEM NAME IS ITEM3
        TYPE IS CHARACTER 10

SET NAME IS THISISAMIGHTYLONGSETNAME
    OWNER IS REC1
    MEMBER IS THISISAMIGHTYLONGRECNAME1
        INSERTION IS AUTOMATIC
            RETENTION IS FIXED
        ORDER IS FIRST

    MEMBER IS THISISAMIGHTYLONGRECNAME2
        INSERTION IS AUTOMATIC
            RETENTION IS FIXED
        ORDER IS FIRST

-------------------------------------------------------------------------------

Queries on a database with this this schema and a default subschema would have
the problems that you described.

A solution would be to create a new subschema with the ALIAS clause and then use
the alias names in your queries:

--------------------------------------------------------------------------------
SUBSCHEMA NAME IS SHORT FOR DSQLLNAM SCHEMA

ALIAS RECORD THISISAMIGHTYLONGRECNAME1 IS REC2

ALIAS RECORD THISISAMIGHTYLONGRECNAME2 IS REC3

ALIAS SET    THISISAMIGHTYLONGSETNAME  IS FSET

REALM AREA1
    IS AREA1

RECORD NAME IS REC1
    ITEM ITEM1 TYPE IS CHARACTER 10

RECORD NAME IS REC2
    ITEM ITEM2 TYPE IS CHARACTER 10

RECORD NAME IS REC3
    ITEM ITEM3 TYPE IS CHARACTER 10

SET NAME IS FSET

-------------------------------------------------------------------------------

Paul
1088.2try set txn read only/BROKE::ABUGOVWed Aug 14 1996 12:109
    
    Hi Dave,
    
    Regarding problem 1, what is being traced?  Did the customer try doing
    a set transaction read only or some such?
    
    Thanks,
    
    dan
1088.3DBMSQL$ALLOW_MODE logicalNOVA::MJOHNSONMark Johnson, Oracle Rdb/SQL Group, Nashua, N.H.Wed Aug 14 1996 16:0115
re: problem #1

at some point (not sure of the version number) support for DBMS
Access and Allow Mode logicals was added to the DBMS Gateway.

  DBMSQL$ACCESS_MODE [ RETRIEVAL ]

  DBMSQL$ALLOW_MODE [ EXCLUSIVE | PROTECTED | CONCURRENT | BATCH ]

when defined, these logicals override what was specified by a
SET TRANSACTION statement.

DBMSQL$ALLOW_MODE BATCH may help.

/mark
1088.4updateORAREP::GIDDAY::REINHOLDSkippyFri Aug 16 1996 00:2946
    Thanks All,
    
    Thanks .3 Mark, the customer is trying that, and will let us know if
    	it doesn't fix the problem.
    
    Thanks .2 Dan, thanks, I asked them to turn in tracing for problem 2 
    		long names in the hope that it might capture the problem,
    		but the customer didn't know how to turn on tracing anyway.
    
    Thanks .1 The customer claimes not to use CDD legally (whatever that means!)
    
    		Any other ideas?
    		
    	 
    	Thanks for the ongoing assistance and support.
    
    					Cheers,
    						Dave
    
    
    	The following is from the customer
    
    ------------------------------------------------------------------------
    
    Thanks very much for your information.
    
    We have entered the suggested logicals, and are now just waiting for
    the lock-up to happen again (or not).
    
    As for the suggested solution for the long names problem:
    We happen to have a member of the design team here (from Italy), who
    says that this solution would work if the database used the schemas 
    through CDD.
    Unfortunately, this application does not. And to rebuild (and maintain!) 
    this product in a different way in Italy, and re-install here, does not
    appear to be an attractive solution.
    
    So can the engineers think of another way of using these aliases?
    
    Notes:
    1. We don't even have CDD legally installed on our platfor.
    2. This SQL-DBI access is a specific solution for a Telecom need, not
       directly related to what the (Italian) DBMS application provides.
    
    Hopefully you can find an "enhanced" solution.
    ------------------------------------------------------------------------
1088.5exitORAREP::GIDDAY::REINHOLDSkippyFri Aug 16 1996 01:2326
    Gidday,
    
    	Here's also more information about the customers use of CDD,
    
    --------------------------------------------------------------------
    
    In Italy (the development system) they have the schemas in CDD and the
    files in the DBMS directory structures. These files are backed up on 
    copied to an installation tape. From this tape the database files are 
    restored in NZ, and structured to the right sizes; CDD remains empty.
    
    If we would have to install CDD as part of solving this problem, we face:
    - quite a bit of time investment here and overseas,
    - changing instalation procedures,
    - the problems of copying CDD,
    - disruption of the system, which after a few delays will DEFINITELY go
      live to control Telecom's NZ data network on 24-AUG.
    
    Both my Italian colleague and myself (on test databases last year) have
    experienced major problems in correctly backing up and restoring CDD
    files, specifically across systems. We would definitely need specific
    assistance on how exactly to go about this.
    
    -----------------------------------------------------------------------
    
    
1088.6UKVMS3::PJACKSONOracle UK Rdb SupportFri Aug 16 1996 07:1326
>    In Italy (the development system) they have the schemas in CDD and the
>    files in the DBMS directory structures. These files are backed up on 
>    copied to an installation tape. From this tape the database files are 
>    restored in NZ, and structured to the right sizes; CDD remains empty.
 
    Sounds OK. You only need CDD for development.
       
>    If we would have to install CDD as part of solving this problem, we face:
>    - quite a bit of time investment here and overseas,
>    - changing instalation procedures,
>    - the problems of copying CDD,
>    - disruption of the system, which after a few delays will DEFINITELY go
>      live to control Telecom's NZ data network on 24-AUG.
    
>    Both my Italian colleague and myself (on test databases last year) have
>    experienced major problems in correctly backing up and restoring CDD
>    files, specifically across systems. We would definitely need specific
>    assistance on how exactly to go about this.
    
    I don't think there is any 'correct' way to backup and restore CDD
    repositories across systems. However it is not necessary.
    
    You can use dbo/export and dbo/modify/import to transfer a subschema to a
    database on a system without CDD.
    
    Peter
1088.7Thanks.ORAREP::GIDDAY::REINHOLDSkippySun Aug 18 1996 20:5341
    Hi Peter,
    
    	Thanks for the suggestions, to me they sound great, very concise,
    and quite elegant.
    
    	Though the customer doesn't want to do them, I think that they
    'hope' that there is a magical logical that will extend the tablename
    length for them.
    
    	I am recomending that they get some consulting from ORACLE.
    
    				Thanks for your help,
    
    							Dave.
    
    ------------------ from the customer -----------------------------
    
    
    We have studied the suggested DBO/export /import suggestion.
    These tools are completely new to everybody on either side of the
    world. "Export" produces a metadata file; "Modify/import" uses a
    metadata file. The one remaining problem lies inbetween: changing this 
    file, which is more than a matter of simple editing, it seems.
    
    The procedure as we have analysed it:
    1. create a new subschema using ALIAS.
    2. Compile this into CDD using DDL/compile at the development site.
    3. Integrate the new subschema using DBO/modify/subschema=new_subschema
       into the root file.
    4. Extract the metadata from the root file using DBO/export.
    5. Transfer the metadata to the production site.
    6. Integrate the metadata into the local root file using
    DBO/modify/import.
    
    You see the "nuisance factor": step 2, 3, 4 have to be performed in
    Italy, which probably has to go through some bureaucracy as well to obtain
    permisssion. So hopefully you can tell us that we are mistaken, and
    that there is a more direct way of doing it.
    
    
               
1088.8worked,... but how to use it?ORAREP::GIDDAY::REINHOLDSkippyWed Aug 21 1996 01:2033
    Gidday,
    
    	   I have an update from the customer, with the most wonderful
    assistance of the Sydney Team (working from the most helpfull notere on
    this note), apparently the customer has successfully made the alias in 
    DBMS, and proved that it works from DBMS. However they can't find anywhere 
    in the documentation how to now use this from DBI/SQL, hence they still 
    have the origional problem.
    
    	   Any ideas where to go from here,?
    
    					
    					Cheers,
    						Dave
    
    
    ---------------- From the customer -------------------------
    
    We have succeeded in getting the (alias) subschema into the DBMS root.
    Using DBQ and an enhanced bind statement we can actually use the alias
    names.
    
    Unfortunately we have sofar not been able to find a way to have SQL use
    these aliases, i.e. tell DBI to use the subschema.
    
    The DBQ bind we use is
    > bind dbint_subschema for cgr_database_files
    
    I have not been able to find anywhere in DBI or SQL something that
    mentions alternative subschemas. Seems like a simple question for your 
    team; I hope they agree.
    
    -------------------------------------------------------------------------
1088.9use a "." between the database name and subschema nameSCARY::PCHARLANORACLE CODASYL DBMS EngineeringWed Aug 21 1996 10:5113
Dave,

The Accessing DEC DBMS Data with SQL guide talks about how to do this in section
2.1, Attaching to a Database.

Basically, you can use: '/PATHNAME=<database-name>.<subschema-name>' in the
attach string for interactive SQL or in the definition of the SQL$DATABASE
logical.  If you don't specify a subschema name, the DEFAULT_SUBSCHEMA will be
used.
	
ie: $ DEFINE SQL$DATABASE "/TYPE=NSDS/PATH=cgr_database_files.dbint_subschema"

paul
1088.10and the dictionary thingyBROKE::GREENWed Aug 21 1996 16:115
    Will also need /dictionary_driver=dbmsql$shr  in the attach spec 
    unless you define the logical nsds$default_dictionary_driver to be 
    dbmsql$shr
    
    Don
1088.11thanks - now the locking problem...ORAREP::RIPPER::REINHOLDSkippyThu Aug 22 1996 21:0957
    Hi,
    
    	Thanks for all the help with the long names issue, it seems to be
    working now.
    
    	Meanwhile they have come back (this morning) with the following
    about the locking issue. They claim to have done what is mentioned in
    note .2
    
    	Any comments? assistance? help?
    
    						Dave.
    
    
    -----------------------------------------------------------------------
    First we thought it's ODBC, then the network, or the server. Probably
    there are at least 2 separate issues. There clearly was a problem with the
    SQLserver that now seems to have been solved with assistance from a local 
    VMS expertise company who have experienced similar problems themselves for 
    the last 3 years.
    However, we still have occasional lock-ups, whether or not going over the
    network, ODBC, or direct SQL. Usually it is less than a minute, and just a
    nuisance (although unacceptable to the customer's criteria). But sometimes 
    it goes for minutes, and we have to kill the SQL user. There can be no
    doubt that it is the DBI product/process that is the cause, as no problems
    have ever been experienced using DBQ in whatever mode or multitude of 
    users.
    
    Yesterday I have been experimenting to gather "facts" but the behaviour
    seems rather random. Doing the same things repeatedly, sometimes it locks,
    sometimes it doesn't. What I did:
    1. start SQL
    2. attach (always read only)
    3. harmless query
    4. dangerous query
    5. exit
    
    "harmless" means not directly working on an area used by most application 
    		users
    "dangerous" works on an area continuously used by most users.
    
    Out of 10 times: 3 times there was no problem at all; 3 times the
    lock-up occured immediately at step 2 (!), 3 times at step 4, once at step 
    3. Always the lock-up only resolves at exit from SQL (step 5). That is:
    once it hangs, it hangs. And this was running SQL on the node itself.
    
    I have again (today) tried to activate the trace as per your original
    request:
                $define dbi_trace_flags "errors,exceptions"
                $define dbi_trace_output "trace.out"
    
    if it gives any result, I'll send it of course, but sofar no sign of a
    file "trace.out". I must do something wrong.