Re: FW: [openroad-users] Menubar invisible

51 views
Skip to first unread message

Maxime Richez

unread,
May 30, 2013, 9:28:01 AM5/30/13
to Matthew Rendell, openroa...@googlegroups.com
Thanks a lot for your quick answer!

Working code:

initialize()=
declare
  fullaccess=integer;
enddeclare
{  
   //Grant full access
  fullaccess=callproc P_FullAccess(typeapp='SP_ARTICLE');
  if (fullaccess=0) then
    CurFrame.StartMenu.AllBias = MB_INVISIBLE;
  else
     CurFrame.StartMenu.AllBias = MB_ENABLED;
  endif;


Le 30/05/13 15:16, Matthew Rendell a écrit :

Hi there,

 

Try:

 

CurFrame.StartMenu.AllBias = MB_INVISIBLE;

 

This should work fine in the initialise block.

 

Kind regards

Matt

 

From: openroa...@googlegroups.com [mailto:openroa...@googlegroups.com] On Behalf Of Maxime Richez
Sent: 30 May 2013 14:11
To: openroa...@googlegroups.com
Subject: [openroad-users] Menubar invisible

 

Hi everybody,

In Openroad 2006, is it possible to hide the menubar dynamically ? Don't know how to do that, here's is my non-working code:

initialize()=
declare
  fullaccess=integer;
enddeclare
{  
   //Grant full access
  fullaccess=callproc P_FullAccess(typeapp='SP_ARTICLE');

  if (fullaccess=0) then
     menufield(curframe.startmenu).allbias=fb_invisible;
  else
     menufield(curframe.startmenu).allbias=fb_changeable;
  endif;


Thanks for your help !

Maxime Richez
Saluc SA.

--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.
Visit this group at http://groups.google.com/group/openroad-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Maxime Richez

unread,
Jun 24, 2013, 8:10:57 AM6/24/13
to openroa...@googlegroups.com
Hello,

I'm looking for the best and fastest way to delete a lot of records in a table matching a simple rule like id=4

delete command is too slow because of journaling.

I found another way using "modify ... to truncated" after backing up datas in a temporary table

create temporarytable as select * from xxx where id<>4;

modify xxx to truncated;

insert into xxx select * from temporarytable;


drop table temporarytable;


My problem is "modify ... to truncated" change the table structure to heap instead of btree and i lost my indexes!

How to keep my structure and indexes or how to backup and restore them in sql ???

is there a command like copydb in sql ???

Thanks !

Allan Biggs

unread,
Jun 24, 2013, 2:21:07 PM6/24/13
to openroa...@googlegroups.com
Maxime,

You can turn journalling off. I am not on an ingres system at the moment, but look at
http://www.dbforums.com/other/911650-ingres-2-0-set-nologging.html as one way of doing this. However you can do this in an SQL command.


Allan
--
Sent from my Android phone with mail.com Mail. Please excuse my brevity.

--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.
To post to this group, send email to openroa...@googlegroups.com.
Visit this group at http://groups.google.com/group/openroad-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/51C83751.5060600%40saluc.com.

Robert Allely

unread,
Jun 24, 2013, 5:45:47 PM6/24/13
to openroa...@googlegroups.com

Turning off journaling on the database is quite dangerous isn’t it?  Unless you have a checkpoint to go back to.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

 

Confidentiality/Privilege Notice:
This communication is confidential and may be legally privileged.  If you are not the intended recipient please delete the message and notify the sender at Ports of Auckland Limited. Any use, disclosure, copying, distribution or retention of this communication is strictly prohibited.

Paul White

unread,
Jun 24, 2013, 6:55:33 PM6/24/13
to openroa...@googlegroups.com

Hi Maxime,

 

It’s not clear if you are running these commands via OpenROAD logic or externally using command line SQL.  Look at copydb, there are options for pulling out just the index definitions.  Anyway, I’ve assumed you are implementing within OpenROAD.

 

I think the best approach is to maintain the list of the indexes yourself. Keep them hardcoded in your logic, store them in a table, or better, load them from an external script.  If a site has custom indexes for performance you probably need to be aware and track them by site.  I prefer to have external scripts for rebuilding indexes from time to time.  I think rebuilding indexes in parallel is faster.

 

If you plan to use nojournaling, make sure you re-enable journaling and run checkpoint immediately after the operation.

 

Make sure your transaction log is large enough for the deleted set.  I recommend avoid disabling transaction logging. It is dangerous unless you have the entire DB to yourself and have performed full checkpoint before and after the operation. If something goes wrong, the database will be marked corrupt and you’ll need to rollback.  If you cannot change the size of your log, then try deleting in a couple of passes.

 

Make a Backup!!!!  First run a checkpoint.  if something messes up you can easily recover.

 

My suggested approach:

 

copy table bigtable() into 'archives\bigtable.ing';                               /*make a backup binary*/

or

create table bigtable_bak where id = 4;                                 /* or an online backup */

 

 

                set autocommit on;

set nojournaling on bigtable;                                                      /*Don’t forget your checkpoint before this step*/

                drop index1;

                drop index2;

                drop index3;

                modify bigtable to heap;                                                              /* sometimes this is faster */

delete from bigtable where id=4 and (some filter1);        /* small bites for small txn log*/

delete from bigtable where id=4 and (some filter2);

delete from bigtable where id=4 and (some filter3);

modify bigtable to btree on ….                                                   /* you should do this anyway */

                create index1 …;

                create index2 …;

                create index3 …;

 

                set journaling on bigtable;                                                           /*now need a checkpoint*/

 

After each step, be sure to check if the previous step was successful (with inquire_sql) take appropriate action.

 

I run regular maintenance type jobs from OpenROAD on a scheduler on a separate server.  The vnode is configured with user Ingres so it can perform schema level operations like drop, create and modify which are not normally run in the other parts of the application.   The jobs are scheduled after hours because some operations lock the entire schema for a period.  eg (create table as …).

 

Btw here is the syntax for parallel index create.  You might need exec immediate.

 

create index

(index1 on bigtable (field1) with structure = btree),

(index2 on bigtable (field2,field3) with structure = btree),

(index3 on bigtable (field4,field5) with structure = btree);

 

Paul

--

You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.

To post to this group, send email to openroa...@googlegroups.com.
Visit this group at http://groups.google.com/group/openroad-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/openroad-users/51C83751.5060600%40saluc.com.

Kim Ginnerup

unread,
Jun 25, 2013, 3:19:20 AM6/25/13
to openroa...@googlegroups.com

If then chunk you try to delete is the majority of the table,

You could try some kind of a double buffering approach.

 

Insert subselect everything that is not id=4 into another table.
then modify to truncated.

 

Kim

Maxime Richez

unread,
Jun 25, 2013, 3:35:06 AM6/25/13
to openroa...@googlegroups.com
Hi Paul,

I'm not using Openroad this time. I'm developping in C#.
So my commands will be in SQL through a C# function connecting database and executing sql commands.
I have to delete a lot of records in many tables and i'm coding a method to this with parameters: id and tablename (for instance).

I'll follow your idea to store my indexes in a table.
But is it not dangerous to disable journaling ? What about the modify ... to truncate ? What is the fastest and safest way for deleting?
On other database they use a procedure to delete x rows a time using the "limit to xxx rows" but it is not possible to use the "select first ..." in a subquery...
Thanks for your advices!

Maxx.


Le 25/06/13 00:55, Paul White a écrit :

Maxime Richez

unread,
Jun 25, 2013, 3:37:43 AM6/25/13
to openroa...@googlegroups.com
yes, that was my idea... my problem was i lost all indexes and table structure... i was looking for a way to backup my indexes and table structure in sql... 
because i've many tables to delete and i would like a unique procedure to do this... with tablename like parameter...




Le 25/06/13 09:19, Kim Ginnerup a écrit :

Kim Ginnerup

unread,
Jun 25, 2013, 3:44:37 AM6/25/13
to openroa...@googlegroups.com

Long time ago I had a similar problem.
I used copydb to give me a script that could recreate primary and secondary indexes.
The con: copydb is not a speed monster and you need to use a user with enough rights (could be the right to use –u flag).

The pro: I will always have the latest greatest syntax of the statements and my code is not dependent on any index changes that may happen.

Kim

Paul White

unread,
Jun 25, 2013, 3:52:26 AM6/25/13
to openroa...@googlegroups.com, Ingres and related product discussion forum

Hi Maxime,

 

 

It sounds as though this is a once off purge of data – it should be scheduled out of hours.

 

I think if you truncate the table it has no worse impact than disabling journaling.

 

Of course, the safest approach is to leave journaling running.

 

This approach:

create temporarytable as select * from xxx where id<>4;

has a problem if the table is in use while you are operating, also a risk of losing data if id is null.

 

I guess you can lock out other activity if you access the database in single user mode (-S).

 

Paul

ps. You’ll get knowledgeable Ingres DBA responses at info-ingres.  (comp.databases.ingres or info-...@kettleriverconsulting.com), this is afterall an OpenROAD forum. J

Paul A.

unread,
Jun 25, 2013, 3:54:56 AM6/25/13
to openroa...@googlegroups.com
This is the kind of thing we might add to daily maintenance scripts run overnight.

Besides that, I don't know why you wouldn't use modify to truncated.

There's also the question of whether you are attempting to do this with multiple users active.

Maxime Richez

unread,
Jun 25, 2013, 4:00:05 AM6/25/13
to openroa...@googlegroups.com
But copydb is only executable in command line...
there's no sql command like this, so following previous answers i'll store my indexes in a table or finding a way to recreate them dynamically using the iiindexes table


Le 25/06/13 09:44, Kim Ginnerup a écrit :

Kim Ginnerup

unread,
Jun 25, 2013, 3:59:42 AM6/25/13
to openroa...@googlegroups.com

Correct or via call system from the code

Maxime Richez

unread,
Jun 25, 2013, 4:08:21 AM6/25/13
to openroa...@googlegroups.com
Of course, this sounds to be strange... :-)
This is for a specific calculation program who needs to refresh his datas. This is done manually by a few users...

Le 25/06/13 09:54, Paul A. a écrit :

Paul White

unread,
Jun 25, 2013, 4:23:02 AM6/25/13
to openroa...@googlegroups.com

I’d be comfortable with truncate too - as long as you have a complete backup of the DB before starting.

 

fyi, here is a copy of log from earlier this month, the script failed due to disk space.  10GB gone. We needed to go back to the previous night checkpoint. Thankfully the table was journaled.

 

 

create table crm_document_doctype as select * from crm_document

Executing . . .

 

(28478 rows)

continue

* * drop table crm_document

Executing . . .

continue

* * * * * * * * * * * * * * * * * * *

Executing . . .

 

E_US1263 Error allocating file system resource or bad file specification

    given. Check disk space, disk quota, open file quota and the physical

    location.

    (Sun Jun 02 16:13:15 2013)

 

 - Terminated by Errors

Ingres Version II 9.2.0 (int.w32/143) logout

Sun Jun 02 16:13:19 2013

 

 

 

 

 

 

From: openroa...@googlegroups.com [mailto:openroa...@googlegroups.com] On Behalf Of Paul A.


Sent: Tuesday, 25 June 2013 5:55 PM
To: openroa...@googlegroups.com

Martin.B...@hse.gsi.gov.uk

unread,
Jun 25, 2013, 4:27:56 AM6/25/13
to openroa...@googlegroups.com

Maxime,

 

It is possible to obtain the primary key structure information and index information from the system catalogues.  This can then be used to reapply the table structure and any secondary indexes.  I believe the information can be retrieved as any user, however, you will need enough rights (dba / schema owner) to recreate the indexes.

 

We use this approach in a scheduled task to check for any changes to the database tables and indexes, with the last version being stored in an archive system for comparison against.

Martin Bloomfield
Application Developer & Database Administrator
IT Branch
Chemicals Regulation Directorate
Health and Safety Executive

YORK

* martin.b...@hse.gsi.gov.uk
8  www.pesticides.gov.uk   www.hse.gov.uk

P Save a tree... please don't print this e-mail unless you really need to


This email was received from the INTERNET and scanned by the Government Secure Intranet anti-virus service supplied by Vodafone in partnership with Symantec. (CCTM Certificate Number 2009/09/0052.) In case of problems, please call your organisation’s IT Helpdesk.
Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.

--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openroad-user...@googlegroups.com.
To post to this group, send email to openroa...@googlegroups.com.
Visit this group at http://groups.google.com/group/openroad-users.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

*****************************************************************************************************************

Please note : Incoming and outgoing email messages are routinely monitored for compliance with our policy on the use of electronic communications and may be automatically logged, monitored and / or recorded for lawful purposes by the GSI service provider.

 

Interested in Occupational Health and Safety information?

Please visit the HSE website at the following address to keep yourself up to date

 

www.hse.gov.uk

 

*****************************************************************************************************************

 

 


The original of this email was scanned for viruses by the Government Secure Intranet virus scanning service supplied by Vodafone in partnership with Symantec. (CCTM Certificate Number 2009/09/0052.) On leaving the GSi this email was certified virus free.
Communications via the GSi may be automatically logged, monitored and/or recorded for legal purposes.

Paul A.

unread,
Jun 25, 2013, 4:43:56 AM6/25/13
to openroa...@googlegroups.com
So how many rows are involved and how long does delete .. from currently take?

Sean Thrower

unread,
Jun 25, 2013, 4:46:39 AM6/25/13
to openroa...@googlegroups.com

Maxime,

 

If this is a onetime operation you are contemplating, you might consider using for backup:

relocatedb –new_database=newdatabasename

(issued from the command line), since that makes an exact copy of your database and contents.

 

That way, while you are working out your ultimate solution, you can use the new_database version to try things out.

Then when you are happy, you might use a relocated-created copy as your backup.

 

- this is an approach that has worked for me in the past.

 

Regards,

Sean.

Maxime Richez

unread,
Jun 25, 2013, 5:19:28 AM6/25/13
to openroa...@googlegroups.com
approximately 700000 rows in a table - 7 minutes...


Le 25/06/13 10:43, Paul A. a écrit :

Paul A.

unread,
Jun 25, 2013, 5:34:31 AM6/25/13
to openroa...@googlegroups.com
It might be better ( depending on how much data is in other tables in the database), just to reload the database from a script.

I would think you could just drop the table and recreate it and the indexes.

Depending on how often this is done, 7 minutes is a chance to get a coffee.

Roy Hann

unread,
Jun 25, 2013, 7:06:38 AM6/25/13
to Paul White, openroa...@googlegroups.com, Ingres and related product discussion forum
Tuesday, June 25, 2013, 8:52:26 AM, you wrote:

> If you plan to use nojournaling, make sure you re-enable journaling
> and run checkpoint immediately after the operation.

The misconception that journaling slows Ingres is a durable one, but a
misconception nonetheless. Journaling is a background task, carried
out by the archiver process intermittently.

There is simply no good reason ever to disable journaling on a
production table.

Logging bulk operations *can* be slow, but it would be foolish to
disable logging. Far better to use techniques that minimize logging,
like using MODIFY...TO TRUNCATED, session temporary tables, and
CREATE...AS SELECT....

(Incidentally, Ingres converts truncated tables to heaps because it
was/is faster to reload a heap.)

Parallel indexing is sometimes helpful, so I'd endorse that.

Roy

--
UK Actian User Association Conference 2014 will be on Tuesday June 10 2014.
Mark the date in your diary.

Karl Schendel

unread,
Jun 25, 2013, 8:18:38 AM6/25/13
to Ingres and related product discussion forum, openroa...@googlegroups.com
On Jun 25, 2013, at 7:06 AM, Roy Hann wrote:

> Tuesday, June 25, 2013, 8:52:26 AM, you wrote:
>
>> If you plan to use nojournaling, make sure you re-enable journaling
>> and run checkpoint immediately after the operation.
>
> The misconception that journaling slows Ingres is a durable one, but a
> misconception nonetheless. Journaling is a background task, carried
> out by the archiver process intermittently.
>
> There is simply no good reason ever to disable journaling on a
> production table.

As Roy goes on to point out, it's probably the logging involved that
is slowing things down. Logging will happen whether the table is
journaled or not. Unless you have journals on your logging disk
(which is a bad idea), journaling should have minimal impact on the
system. There might be a minor slowdown as the archiver reads prior
portions of the log, but I'd be amazed if you could measure it
reliably.

You might want to look into your logging setup. Is the transaction log
on an idle disk? If you're running a recent version of Ingres, make sure
that ii.$.rcp.log.optimize_writes is ON in your config.dat, and ideally
arrange to have exactly one logwriter in the installation (I like to have
dbms logwriter set to 1, and recovery logwriter set to zero). Note
that this setup applies to Ingres 10, but I'm not sure if it applies to
earlier versions. Make sure that you have sufficient log buffers too.

I've seen any number of Ingres installations where the transaction log
is "out there" on a disk array somewhere. Arrays are wonderful things,
but ultimately you can't hide the mechanical nature of the rotating disk.
If the array decides to stick the log on the same phsysical drive
as work or data, you'll feel the hurt.

Make sure you know exactly which physical drive(s) the log is on, and
make sure that they have as little competing activity as possible.


> (Incidentally, Ingres converts truncated tables to heaps because it
> was/is faster to reload a heap.)

I've long intended to implement a "modify to truncated with persistence"
or some such syntax, meaning truncate but preserve the existing structure.
Partition truncation needs that too. All I need is another 12 hours
in the day...

Karl

Paul White

unread,
Jun 25, 2013, 5:07:53 PM6/25/13
to openroa...@googlegroups.com, Ingres and related product discussion forum
The reason I use nojournaling is to avoid filling the transaction log for
large file operations then have to wait for rollback.
Especially in a 24x7 installation. I agree, it doesn't slow the process
unless it a single disk system.
Paul


Reply all
Reply to author
Forward
0 new messages