[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

Retrieving Database Creation date remotely using formula language ???

Hello all ,

I have a doubt regarding database modification date retrival remotely .

Suppose i have two databases on the same server.

currentdb
remotedb

now i want to show the modification/creation date of remotedb into a form/view of currentdb . But the restiction is that i can use only formula language .

Is there any solution you guys have ??

One more thing which i want to tell u that i got another solution of this , which uses "Catalog.nsf" in which we get all those databases information. But @dblookup command works only for first sorted column . While in second column (which is not sorted) is occupied by database name , which is useful for me in this case . but because of limitation of first sorted column i am not able to process that . Can u guide me in this direction also ??

Thanks in advance.
0
codeguru14
Asked:
codeguru14
3 Solutions
 
SysExpertCommented:
All you would need to do is to create a new view sorted the way you want and add the proper columns.

You should do this on the Catalog template ( not the nsf ) so that the update in design are done automaticaly each night.

I hope this helps !

0
 
Sjef BosmanGroupware ConsultantCommented:
Use the ($ReplicaID) view, it is sorted on the replica ID of the database. I assume you can get any value from a document using
    @DbLookup(""; "server":"Catalog.nsf"; "($ReplicaID)"; ReplicaID; fieldname)
0
 
codeguru14Author Commented:
@SysExpert;

I am using such a server which has restricted access and i don't have permissions to create new views / documents .. So if there is any other solution excpet creating views , please share with me.

@sjef_bosman;

I found it interesting , but the problem is that i don't have "ReplicaID" value with me . The value which i only know is the "database Name" and nothing else .
Here is the view Selection formula for "$replicaId" view :

SELECT @IsAvailable(ReplicaID)& @IsUnavailable(RepositoryType)

So it means that ReplicaID must be available . But i don't know the ReplicaID of remote database except knowing its name .
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Sjef BosmanGroupware ConsultantCommented:
Sorry, but no, that's not what it means. It means that only documents in that database are shown in the ($ReplicaID) view that match that condition: in the document there has to be a field ReplicaID and there must not be a field RepositoryType.

From your point of view, this seems irrelevant. You need to get a ReplicaID for a database. How are you planning to program this? What remotedb are you talking about? You seem to have a Domino Designer available, what are you allowed to do with it?
0
 
SysExpertCommented:
I would make a local replica of the Catalog DB, and create a view locally for the creation date.

Other options are to use soe existing agents that gather info for you.

see

http://www-10.lotus.com/ldd/sandbox.nsf/DownloadPage?OpenForm

and

http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/9290c5e7654f34ea85256a1e0050bc55?OpenDocument&Highlight=0,ACL
The ACL scanner can easily be modified to get the data you need and will work locally.


I hope this helps !
0
 
marilyngCommented:
Basically, create the two fields that you want to use to store the information in the currentdb.

I used computed fields, one for modifiedDate and another for CreatedDate.

Then I selected the remotedb, and did: File>>Database>>Properties, and copied the database name EXACTLY, and used that value in the LookupDB variable.  I used @Subset(@MaildbName;1) to get the server name, but you can also use @Subset(@DbName;1) provided that the current database is sitting on a server, else you will have to use:

LookupDB:=@if(@Subset(@dbName;1)="";"Your Server Name";@Subset(@dbName;1))


OK, this one will lookup the created date:
----------------------------------------------------
Server:=@Subset(@MailDbName;1);
Catalogdb:="catalog.nsf";
LookupDB:="Test Web";
CreatedField:="DbCreationDate";
ModifiedDate:="DbModifiedDate";
LookupView:="ByTitle";
CreatedDate:=@DbLookup("Notes":"NoCache";Server:Catalogdb;LookupView;LookupDB;CreatedField);
@If(@IsError(CreatedDate)|CreatedDate="";"Not Found";@Text(CreatedDate;"D0S0"))

-----------------------------
This one will get the modified date:

Server:=@Subset(@MailDbName;1);
Catalogdb:="catalog.nsf";
LookupDB:="Test Web";
CreatedField:="DbCreationDate";
ModifiedField:="DbModifiedDate";
LookupView:="ByTitle";
ModifiedDate:=@DbLookup("Notes":"NoCache";Server:Catalogdb;LookupView;LookupDB;ModifiedField);
@If(@IsError(ModifiedDate)|ModifiedDate="";"Not Found";@Text(ModifiedDate;"D0S0"))


------------
Also, there is a chance that there is more than one database replica stored for the database, and in that case you will get two or more answers.  

In this case, you modify the last line:
@If(@IsError(ModifiedDate)|ModifiedDate="";"Not Found";@Text(ModifiedDate;"D0S0"))

To do this:
Result:=@If(@IsError(ModifiedDate)|ModifiedDate="";"Not Found";@Text(ModifiedDate;"D0S0"))
@if(@Elements(Result)>1;@Subset(Result);Result)

As long as you get the Database Title correct, this should work.

BTW, you can also get the replica ID of the database, by looking it up in the By Title view of Catalog.nsf, or, if it's available, selecting File>>Database>>Synopsis, then clicking on "Check DB Info", and then checking "General Information" and "Replication" check boxes.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now