Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to cycle request-level logging filenames

6 posts in General Discussion Last posting was on 2005-05-24 17:43:24.0Z
Victor ORear Posted on 2005-05-23 23:51:23.0Z
From: "Victor ORear" <victoro@mailinator.com>
Newsgroups: ianywhere.public.general
Subject: How to cycle request-level logging filenames
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: fw134.pyxis.com
X-Original-NNTP-Posting-Host: fw134.pyxis.com
Message-ID: <42926c7b$1@forums-1-dub>
Date: 23 May 2005 16:51:23 -0700
X-Trace: forums-1-dub 1116892283 207.114.139.134 (23 May 2005 16:51:23 -0700)
X-Original-Trace: 23 May 2005 16:51:23 -0700, fw134.pyxis.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4490
Article PK: 8297

I'd like to keep my request-level logging file down to a reasonable size so
we can retrieve the file, so I'd like to run a SQL script to stop the
logging, change the file name and restart the logging.

It works under ASA 9.02, but not in 7.04 (of course, the customer can't
upgrade yet..)

call sa_server_option('request_level_logging','NONE');
CREATE VARIABLE @LOGNAME CHAR(36);
SET A = 'D:\Logging\'+DATEFORMAT(Now(),'YYMMDDHHMMSS') ;
call sa_server_option('request_level_log_file',@LOGNAME);
call sa_server_option('request_level_logging','SQL');
DROP VARIABLE @LOGNAME

With this I get the error:

Error in file 'logging.sql' in line 5:
Invalid option 'request_level_log_file' -- no PUBLIC setting exists
on the line: call sa_server_option('request_level_log_file',@LOGNAME);

Is there a way I can create a public setting? The option is not mis-spelled.
I've replaced the variable with a fixed value and I've checked the 7.0
documentation. What information I can find online about "no public setting"
is not adaquate. Does not work with the DB running or being started by this
request..

Help? Did someone cover this in a troubleshooting faq?


Victor ORear Posted on 2005-05-23 23:56:30.0Z
From: "Victor ORear" <victoro@mailinator.com>
Newsgroups: ianywhere.public.general
References: <42926c7b$1@forums-1-dub>
Subject: Re: How to cycle request-level logging filenames
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: fw134.pyxis.com
X-Original-NNTP-Posting-Host: fw134.pyxis.com
Message-ID: <42926dae$1@forums-1-dub>
Date: 23 May 2005 16:56:30 -0700
X-Trace: forums-1-dub 1116892590 207.114.139.134 (23 May 2005 16:56:30 -0700)
X-Original-Trace: 23 May 2005 16:56:30 -0700, fw134.pyxis.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4491
Article PK: 8294

I forgot to add that I've tried starting the DB up with logging enabled
using switches (recording a -200 error for the below event) and both the
application and this external script use the same DBA level login.

"Victor ORear" <victoro@mailinator.com> wrote in message
news:42926c7b$1@forums-1-dub...
> I'd like to keep my request-level logging file down to a reasonable size
so
> we can retrieve the file, so I'd like to run a SQL script to stop the
> logging, change the file name and restart the logging.
>
> It works under ASA 9.02, but not in 7.04 (of course, the customer can't
> upgrade yet..)
>
> call sa_server_option('request_level_logging','NONE');
> CREATE VARIABLE @LOGNAME CHAR(36);
> SET A = 'D:\Logging\'+DATEFORMAT(Now(),'YYMMDDHHMMSS') ;
> call sa_server_option('request_level_log_file',@LOGNAME);
> call sa_server_option('request_level_logging','SQL');
> DROP VARIABLE @LOGNAME
>
> With this I get the error:
>
> Error in file 'logging.sql' in line 5:
> Invalid option 'request_level_log_file' -- no PUBLIC setting exists
> on the line: call sa_server_option('request_level_log_file',@LOGNAME);
>
> Is there a way I can create a public setting? The option is not
mis-spelled.
> I've replaced the variable with a fixed value and I've checked the 7.0
> documentation. What information I can find online about "no public
setting"
> is not adaquate. Does not work with the DB running or being started by
this
> request..
>
> Help? Did someone cover this in a troubleshooting faq?
>
>


Greg Fenton Posted on 2005-05-24 01:33:22.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: How to cycle request-level logging filenames
References: <42926c7b$1@forums-1-dub>
In-Reply-To: <42926c7b$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-concord-085.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-085.sybase.com
Message-ID: <42928462@forums-1-dub>
Date: 23 May 2005 18:33:22 -0700
X-Trace: forums-1-dub 1116898402 158.159.8.85 (23 May 2005 18:33:22 -0700)
X-Original-Trace: 23 May 2005 18:33:22 -0700, vpn-concord-085.sybase.com
Lines: 29
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4493
Article PK: 8301


Victor ORear wrote:
> call sa_server_option('request_level_logging','NONE');
> CREATE VARIABLE @LOGNAME CHAR(36);
> SET A = 'D:\Logging\'+DATEFORMAT(Now(),'YYMMDDHHMMSS') ;
> call sa_server_option('request_level_log_file',@LOGNAME);
> call sa_server_option('request_level_logging','SQL');
> DROP VARIABLE @LOGNAME
>

How about changing the the call for setting the log file name to using
EXECUTE IMMEDIATE:

SET @cmd = 'call sa_server_option(''request_level_log_file'', ' ||
'''d:\\logging\\' || dateformat(now(), 'YYMMDDHHMMSS') ||
''');' ;
EXECUTE IMMEDIATE @cmd;


[Note: this has not been tested...there's a chance I've messed up the
quoting above :-) ]

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/


Victor ORear Posted on 2005-05-24 16:36:56.0Z
From: "Victor ORear" <victoro@mailinator.com>
Newsgroups: ianywhere.public.general
References: <42926c7b$1@forums-1-dub> <42928462@forums-1-dub>
Subject: Re: How to cycle request-level logging filenames
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: fw134.pyxis.com
X-Original-NNTP-Posting-Host: fw134.pyxis.com
Message-ID: <42935828@forums-1-dub>
Date: 24 May 2005 09:36:56 -0700
X-Trace: forums-1-dub 1116952616 207.114.139.134 (24 May 2005 09:36:56 -0700)
X-Original-Trace: 24 May 2005 09:36:56 -0700, fw134.pyxis.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4501
Article PK: 8310

Very creative quoting, thanks. But I couldn't get it to work so perhaps I'm
missing a quote. I get the error COLUMN 'D:\LOGGING\' not found

I added a double quote after the last single quote to enclose the );' text,
but if I use exactly as presented I get the error:

Missing closing quote
' ");'; EXECUTE IMMEDIATE @CMD

"Greg Fenton" <greg.fenton_NOSPAM_@ianywhere.com> wrote in message
news:42928462@forums-1-dub...
> Victor ORear wrote:
> > call sa_server_option('request_level_logging','NONE');
> > CREATE VARIABLE @LOGNAME CHAR(36);
> > SET A = 'D:\Logging\'+DATEFORMAT(Now(),'YYMMDDHHMMSS') ;
> > call sa_server_option('request_level_log_file',@LOGNAME);
> > call sa_server_option('request_level_logging','SQL');
> > DROP VARIABLE @LOGNAME
> >
>
> How about changing the the call for setting the log file name to using
> EXECUTE IMMEDIATE:
>
> SET @cmd = 'call sa_server_option(''request_level_log_file'', ' ||
> '''d:\\logging\\' || dateformat(now(), 'YYMMDDHHMMSS') ||
> ''');' ;
> EXECUTE IMMEDIATE @cmd;
>
>
> [Note: this has not been tested...there's a chance I've messed up the
> quoting above :-) ]
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/


Victor ORear Posted on 2005-05-24 16:46:17.0Z
From: "Victor ORear" <victoro@mailinator.com>
Newsgroups: ianywhere.public.general
References: <42926c7b$1@forums-1-dub> <42928462@forums-1-dub> <42935828@forums-1-dub>
Subject: Re: How to cycle request-level logging filenames
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: fw134.pyxis.com
X-Original-NNTP-Posting-Host: fw134.pyxis.com
Message-ID: <42935a59$1@forums-1-dub>
Date: 24 May 2005 09:46:17 -0700
X-Trace: forums-1-dub 1116953177 207.114.139.134 (24 May 2005 09:46:17 -0700)
X-Original-Trace: 24 May 2005 09:46:17 -0700, fw134.pyxis.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4502
Article PK: 8309

Correction, I missed a quote..

Now I get the error
Syntax error near ');'
;'

Here's the new script:
call sa_server_option('request_level_logging','NONE');
CREATE VARIABLE @CMD CHAR(60);
call sa_server_option('request_level_logging','SQL');
SET @CMD = 'call
sa_server_option("request_level_log_file",'||"'c:\\logging\\'||dateformat(no
w(),'YYMMDDHHMMSS')||"');';
EXECUTE IMMEDIATE @cmd;
DROP VARIABLE @CMD

Same error in 9.02 and 7.04

"Victor ORear" <victoro@mailinator.com> wrote in message
news:42935828@forums-1-dub...
> Very creative quoting, thanks. But I couldn't get it to work so perhaps
I'm
> missing a quote. I get the error COLUMN 'D:\LOGGING\' not found
>
> I added a double quote after the last single quote to enclose the );'
text,
> but if I use exactly as presented I get the error:
>
> Missing closing quote
> ' ");'; EXECUTE IMMEDIATE @CMD
>
>
>
> "Greg Fenton" <greg.fenton_NOSPAM_@ianywhere.com> wrote in message
> news:42928462@forums-1-dub...
> > Victor ORear wrote:
> > > call sa_server_option('request_level_logging','NONE');
> > > CREATE VARIABLE @LOGNAME CHAR(36);
> > > SET A = 'D:\Logging\'+DATEFORMAT(Now(),'YYMMDDHHMMSS') ;
> > > call sa_server_option('request_level_log_file',@LOGNAME);
> > > call sa_server_option('request_level_logging','SQL');
> > > DROP VARIABLE @LOGNAME
> > >
> >
> > How about changing the the call for setting the log file name to using
> > EXECUTE IMMEDIATE:
> >
> > SET @cmd = 'call sa_server_option(''request_level_log_file'', ' ||
> > '''d:\\logging\\' || dateformat(now(), 'YYMMDDHHMMSS') ||
> > ''');' ;
> > EXECUTE IMMEDIATE @cmd;
> >
> >
> > [Note: this has not been tested...there's a chance I've messed up the
> > quoting above :-) ]
> >
> > greg.fenton
> > --
> > Greg Fenton
> > Consultant, Solution Services, iAnywhere Solutions
> > --------
> > Visit the iAnywhere Solutions Developer Community
> > Whitepapers, TechDocs, Downloads
> > http://www.ianywhere.com/developer/
>
>


Greg Fenton Posted on 2005-05-24 17:43:24.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: How to cycle request-level logging filenames
References: <42926c7b$1@forums-1-dub> <42928462@forums-1-dub> <42935828@forums-1-dub> <42935a59$1@forums-1-dub>
In-Reply-To: <42935a59$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: gfenton-t30.sybase.com
X-Original-NNTP-Posting-Host: gfenton-t30.sybase.com
Message-ID: <429367bc$1@forums-1-dub>
Date: 24 May 2005 10:43:24 -0700
X-Trace: forums-1-dub 1116956604 10.25.98.243 (24 May 2005 10:43:24 -0700)
X-Original-Trace: 24 May 2005 10:43:24 -0700, gfenton-t30.sybase.com
Lines: 26
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4503
Article PK: 8311


Victor ORear wrote:
> SET @CMD = 'call
> sa_server_option("request_level_log_file",'||"'c:\\logging\\'||dateformat(no
> w(),'YYMMDDHHMMSS')||"');';

You do NOT want to use double-quotes ("), but double single-quotes(''):

SET @CMD = 'call
sa_server_option(''request_level_log_file'','||'''c:\\logging\\'''||dateformat(now(),'YYMMDDHHMMSS')||''');';


Double-quotes (") are used to delimit database identifiers.
Single-quotes (') are used to delimit strings. To put a single-quote
into a string, you must double them up:

SELECT 'this is Victor''s string'

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/