Is there an NNTP command to return the count of NewsGroups on an USENET server? (Without having to retrieving the entire list.)
No, such a command is not available in RFC 3977.
Related
Zpop command in Redis returns a single result
Is there a way for zpop more then one result in a single execution?
What version of Redis are you using? According to official documentation, Redis has ZPOPMIN and ZPOPMAX and no ZPOP command.
The ZPOPMIN and ZPOPMAX commands both accept as a second optional argument the amount of members to pop.
Since I am new to Powershell I am looking for some assistance for my problem.
What I need is to count the number of files in a network folder and use that number for a Bulk-Insert loop. Currently, the number of loop cyles is stored in a "status-table" (in SQL). I want to be able to update that status table with the actual number of files.
The powershell cmdlet to count the number of files looks like this:
$FileCount = #(Get-ChildItem -Path '\\YS001UVE\Download\MIS\MIS FactData 20??m?1.csv' -Name -File | sort Name).count
But then I need to update the existing "status-table" with the outcome of the Powershell script .
What is the correct SQL coding for this?
Thanks in advance and regards
Peter
There are many ways to do that. This Post contains an example to do this task. For some database connections you may need to install something on your computer (for MySQL you need the MySQL Connector).
I've done this myself and know, how confusing it can be at first. Under this link, you can find my script (sorry for the German comments and text). The database connection starts at about line 270 in the function Import-ToDatabase. Be aware that I am not updating one single line in my script, but a whole new table.
Let me know if you need some more help
Here are a few more links:
https://www.joseespitia.com/2016/06/03/connecting-and-writing-to-a-sql-db-with-powershell/
https://www.sqlservercentral.com/scripts/insert-data-into-a-sql-server-table-using-powershell-using-invoke-sqlc
https://www.sqlservercentral.com/blogs/performing-an-insert-from-a-powershell-script
My ldapsearch command is only returning a max of 500 entries, while I know I > have over 24,000 entries in the database. how can I increase the sizelimit, to display all my entries. Please Provided details steps
as heiglandreas mentioned, this is a server side limit.
If you are using slapd.conf, this would be the sizelimit directive.
If you are using cn=config, this would be olcSizelimit attribute.
You can change it on the client side with -E pr=nnnn but only up to the server side limit. Some language specific tools like Perl's Net::LDAP::Control::Paged (SizeLimit exceeded using Net::LDAP::Control::Paged) can provide the tools to query in those languages.
Question
Hi,
I'm trying to determine if I can query Intersystems Caché to obtain database properties and license properties. For the database, I'm mostly interested in properties like the current size, maximum size, block size, and the directory associated with the database. For the licenses, I'm total authorized, current available, minimum available, current active users, and maximum active users.
Background
I know that details about the database and licenses are available using the System Management Portal, but I'm trying to automate some actions that depend on these details.
I know that the %FREECNT utility is available to display space statistics for the database, but the only way I'll be able to use this utility to obtain the info I need is to write a script using AWK or SED (the system is on a Unix server) and I'd like to avoid that since I'm not as well-versed in Unix scripting as I'd like to be.
I know the ^DATABASE routine and the $SYSTEM.License.ShowCounts() function are available, but I will have to use AWK and SED for these too to eliminate the text returned that I don't need. In all cases, straight SQL will return a set of data that I can iterate over that will eliminate the extraneous text that's included by the routines/functions.
Additional Info
I've written queries similar to the one below and I'm hoping there are equivalent tables for database and license that will allow me the same access:
Select * From %SYS.ProcessQuery Where Namespace = 'HL7'
I don't have access to Caché Studio, so I'm forced to use the command line on the server. I know I can use the SQL.Shell to enter SQL statements and, from the documentation, it looks like I can create routines from the command line, but I haven't found any documentation that will allow me to enter multiline statements for routines from the command line. If that's not possible, then I probably can't use routines in my solution.
Thanks for the help.
In your Caché routine, you can use Query Summary for get some license information, or other queries in class %SYSTEM.License
For Databases you can use queries from SYS.Database from %SYS namespace
I was able to get something close.
From the command line, I entered the following:
%SYS>SET rs = ##Class(%Library.ResultSet).%New()
%SYS>SET rs.ClassName = "SYS.Database"
%SYS>SET rs.QueryName = "FreeSpace"
%SYS>SET sc = rs.Prepare(rs.QueryName)
%SYS>SET sc = rs.Execute($LISTBUILD("/my/database/directory"), 0)
%SYS>WHILE rs.Next(){WRITE rs.Data("DatabaseName")," "_rs.Data("Size")," "_rs.Data("MaxSize"),!}
It's not quite as clean as I would have hoped because I have to write the entire loop on a single line, but that's better than nothing. At least the statement wraps across lines.
Does anyone know of a MySQL query that returns the server's current load average?
Do you mean the actual system load average? This has nothing to do with MySQL. For example on Linux, you can get it from /proc/loadavg.
Correct me if I'm wrong, but the load average variable is a property of the machine, not the MySQL server.
So to retrieve the avg. load you should be looking for a system call, not a SQL-query.
You might want to look into this statement:
http://dev.mysql.com/doc/refman/5.1/en/show-status.html
SHOW [GLOBAL | SESSION] STATUS
[LIKE 'pattern' | WHERE expr]
SHOW STATUS provides server status information. This information also can
be obtained using the mysqladmin
extended-status command. The LIKE
clause, if present, indicates which
variable names to match. The WHERE
clause can be given to select rows
using more general conditions, as
discussed in Section 20.28,
“Extensions to SHOW Statements”. This
statement does not require any
privilege. It requires only the
ability to connect to the server.
Do you have mytop installed?
mytop is a console-based (non-gui)
tool for monitoring the threads and
overall performance of a MySQL 3.22.x,
3.23.x, and 4.x server
Mytop allows you to monitor what is happening in real time, everything from number of queries per second to key efficiency of the queries.
See Using Mytop: A MySQL Monitor