Attempting to connect to Firebird 2.5 database, getting "-service path\database.FDB:service_mgr" is not defined - firebird

I'm trying to run a trace using
fbtracemgr -SE "localhost:C:\Users\user1\Desktop\db.FDB:service_mgr" -user SYSDBA -password masterkey -start -name "to" -config "C:\Users\user1\traceparameter.conf" > c:\Users\user1\dboutput.txt
Cannot attach to services manager
-service C:\Users\user1\Desktop\db.FDB:service_mgr is not defined
Any ideas why this might be?!
I've also tried without :service_mgr and I get the same result.
If I refer to a non existing database (used a random db.FDB filename) I get the same result, so it seems to not be related to the db itself at all?

You need to specify -SE localhost:service_mgr or - local only - -SE service_mgr. The service_mgr specifies you connect to the "Service Manager" of Firebird, not to a specific database. In other words, the database name does not belong in that connection string.
See also Audit and Trace Services in Firebird 2.5.

Related

SSAS tabular - Switch among the datasource connections

Its obvious that we need to import the data from a data source into a model of SSAS tabular.
Imagine we have two data sources connections for two different environments ENV1 and ENV2. Both environment contains same tables but with different data.
Is it possible if I want to switch to ENV2 while I am working on ENV1 in SSAS tabular. Is there any alternative available for this requirement?
Thanks in advance,
Lalith Varanasi.
It sounds like you want to have one data source, but to update the connection string based on the environment you deploy to.
I have built a CI/CD process for our tabular models which uses the TOM library in
a powershell script to read the .bim file, modify the connection strings based on the environment we are deploying to, create partitions as needed as well as the administrative roles. I can't share the full script at the moment because there are a few references specific to my company, but basically:
try{
Write-Log "loading Microsoft.AnalysisServices assemblies that we need" Debug
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices.Core") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices.Tabular") | Out-Null
}
catch{
Write-Log "Could not load the needed assemblies... TODO: Figure out and document how to install the needed assemblies. (I would start with the SQL feature pack)" Error -ErrorAction Stop
}
$modelBim = [IO.File]::ReadAllText($bimFilePath)
$db = [Microsoft.AnalysisServices.Tabular.JsonSerializer]::DeserializeDatabase($ModelBim)
#Our DEV and TEST models get deployed on the same SSAS instance. We have to modify the name of the model to reference which environment they are reading from.
$db.ID = "$($modelName)_$($TargetEnvironment)"
$db.Name = "$($modelName)_$($TargetEnvironment)"
Write-host "Updating the data source connections to use the $TargetEnvironment environment."
foreach ($ds in $db.Model.Model.DataSources){
Write-Host "Updating connection information for the $($ds.Name) connection" Debug
#I use a Powershell function called Get-DBServerFromEnvironment which we use to pull the correct server name for each of our different databases. Our database names are the same in each environment, except that they are prefixed with the environment name.
#Using this design, DB1,DB2,DB3 is the name of the data source (Say ApplicationOLAP,DataWarehouse,ThirdPartDB) and you set enviornment specific connection strings in a seperate custom function so that the logic is stored in one place
switch($ds.Name ){
"DB1"{$ds.ConnectionString = "EnvironmentSpecificConnectionStringToDB1"}
"DB2"{$ds.ConnectionString = "EnvironmentSpecificConnectionStringToDB2"}
"DB3"{$ds.ConnectionString = "EnvironmentSpecificConnectionStringToDB3"}
"DB4"{$ds.ConnectionString = "EnvironmentSpecificConnectionStringToDB4"}
default{Write-Log "Unknown Data source name" Warning}
}
}
$server = New-Object Microsoft.AnalysisServices.Tabular.Server
#$serverName is the SSAS server, I get this by calling a custom function and specifying the target enviornment.
$server.Connect($serverName)
$server.BeginTransaction()
if ($server.Databases.Contains($db.ID)){
Write-Log "Tabular database with the ID: $($db.ID) exists. Dropping and recreating"
$server.Databases.FindByName($db.Name).Drop()
$server.Databases.Remove($db.ID, [System.Boolean]::TrueString)
$server.Databases.Add($db) | Out-Null
}
else{
Write-Log "Tabular database with the ID: $($db.ID) does not exist. Creating"
$server.Databases.Add($db) | Out-Null
}
#This part is where you are actually writing your changes to the server. modify as needed.
$db.Update( "ExpandFull")
$db.Model.RequestRefresh("Automatic")
$saveOptions = New-Object Microsoft.AnalysisServices.Tabular.SaveOptions
$saveOptions.MaxParallelism = 5
Write-Log "Starting the processing at [$([DateTime]::Now)]. The script will hang while the cube is processing."
$ProcessElapsed = [system.diagnostics.stopwatch]::startnew()
$result = $db.Model.SaveChanges($saveOptions)
$impact = $result.Impact
$xmlaResult = $result.XmlaResults
#TDOD: Check the result for success/failure.
Write-Log "Processing took $($ProcessElapsed.Elapsed.ToString()). Hours:Minutes:Seconds:Milliseconds"
$server.CommitTransaction()
On your BIM model you can change your datasource connection string.
Go to Model > Existing connection > Modify
or use your Tabular Explorer and change your datasource
-> You need to process your tables after this change.
Is it what you are searching?
Have a nice day,
Arnaud
If you're using Tabular Editor, there's a simple option to prevent connection strings from being deployed, in the "Deployment Wizard" under "Model" > "Deploy..."
By default, "Deploy Connections" is unchecked, meaning that the connection strings used on the target database will be left unchanged, regardless of what you're using in your development database.

why wildfly server is asking me to add users even after adding user?

mngmt-users.properties file. The users are added in the file but when I try to run the localhost it says it's running then if I try to view the admin console it is redirecting to http://localhost:9990/error/index_win.html. That tells the server is running but I could not open admin console.
#
# Properties declaration of users for the realm 'ManagementRealm' which is the default realm
# for new installations. Further authentication mechanism can be configured
# as part of the <management /> in standalone.xml.
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# By default the properties realm expects the entries to be in the format: -
# username=HEX( MD5( username ':' realm ':' password))
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
#$REALM_NAME=ManagementRealm$ This line is used by the add-user utility to identify the realm name already used in this file.
#
# On start-up the server will also automatically add a user $local - this user is specifically
# for local tools running against this AS installation.
#
# The following illustrates how an admin user could be defined, this
# is for illustration only and does not correspond to a usable password.
#
#admin=2a0923285184943425d1f53ddd58ec7a
tejaswini=25ab658c2861b2e64783aaa9ba95c2e5
aswini#19=388ced81791ddb1760b83dc4ec8b7a61
saisana=ff39d778414ab12d84fc4fa7fdacb634
alekya=d72e9c90345ce4d9290c3a2728b3cd60
prasad=c6c7c67cf343f6862d3b77bae9f61d17
teju=28b9e55b314fd60855a7843b4455dbed
Screen shot of added user
May be u have tried to create specifically application user or management user when u ran the addUser utility,
please refer the below link for steps to register user
https://bgasparotto.com/add-user-wildfly

How to Update DNS Records Programatically

I am trying to update a DNS Record which is at (I believe) the following path on the server:
ServerName -> Forward Lookup Zones -> domain.com -> test
Where the DNS record is called test, and is of type Host(A).
I downloaded the DNSShell module from here and tried changing the 'Data' column of the DNS record (which contains an IP address) with this command:
Set-DNSRecord -Identity "test.domain.com"
But I got this error:
Cannot validate argument on parameter 'Identity'. The argument "test.domain.com" does not match the "^\\.\root\MicrosoftDNS:MicrosoftDNS_" pattern. Supply an argument that matches "^\\.\root\MicrosoftDNS:MicrosoftDNS_" and try the command again.
So I updated the Identity parameter as follows:
Set-DNSRecord -Identity "\\Servername\root\MicrosoftDNS:MicrosoftDNS_"
But now I am seeing:
Set-DNSRecord : Specified argument was out of the range of the valid values. Parameter name: Path
When I try adding a -Path, it says there is not such parameter! Does anyone know where I need to add the test.domain.com part of the DNS to tell the command which record to update? The documentation on this module is incomplete for this part of it and I can't seem to find any alternatives.
I can call Get-DNSRecord and see the record I need to update, but any attempts to Set are blocked because I have no idea how these paths are built.
Any help is much appreciated.
You can use also default PowerShell module for DNS server from Microsoft, example would then look something like this:
Add-DnsServerResourceRecordA -Name "recordname" -IPv4Address "192.168.0.0" -ZoneName "domain.com" -AllowUpdateAny -AgeRecord
In case you need removal before that something like this should work:
Remove-DnsServerResourceRecord -ZoneName "domain.com" -Name "recordname" -RRType "A" -Force
I managed to overcome this by using ye olde classic CMD command:
dnscmd /RecordAdd domain.com recordname RecordType /Aging /OpenAcl A 192.168.0.0
This adds a new record, and seems to do so even when another record with the same name (but different IP) exists.
So in my case, I will have to use dnscmd to first remove the existing record before adding a new one (as I actually just want to update the IP address of the existing record).
Command for removing dns record :
dnscmd /recorddelete domain.com recordname
More details can be found here.

Modify datasource IP addresses in WebSphere Application Server

I have nearly a hundred data sources in a WebSphere Application Server (WAS) and due to office relocation, the IP of the database servers have changed and I need to update the datasource IP addresses in my WAS too.
Considering it error-prone to update hundred IPs through admin console.
Is there any way that I can make the change by updating config files or running a script? My version of WAS is 7.0.
You should be able to use the WAS Admin Console's built-in "command assistance" to capture simple code snippets for listing datasources and changing them by just completing those operations in the UI once.
Take those snippets and create a new jython script to list and update all of them.
More info on command assistance:
http://www.ibm.com/developerworks/websphere/library/techarticles/0812_rhodes/0812_rhodes.html
wsadmin scripting library:
https://github.com/wsadminlib/wsadminlib
You can achieve this using wsadmin scripting. Covener has the right idea with using the admin console's command assistance to do the update once manually (to get the code) and then dump that into a script that you can automate.
The basic idea is that a datasource has a set of properties nested under it, one of which is the ip address. So you want to write a script that will query for the datasource, find its nested property set, and iterate over the property set looking for the 'ipAddress' property to update.
Here is a function that will update the value of the "ipAddress" property.
import sys
def updateDataSourceIP(dsName, newIP):
ds = AdminConfig.getid('/Server:myServer/JDBCProvider:myProvider/DataSource:' + dsName + '/')
propertySet = AdminConfig.showAttribute(ds, 'propertySet')
propertyList = AdminConfig.list('J2EEResourceProperty', propertySet).splitlines()
for prop in propertyList:
print AdminConfig.showAttribute(prop, 'name')
if (AdminConfig.showAttribute(prop, 'name') == 'ipAddress'):
AdminConfig.modify(prop, '[[value '" + newIP + "']]')
AdminConfig.save();
# Call the function using command line args
updateDataSourceIP(sys.argv[0], sys.argv[1])
To run this script you would invoke the following from the command line:
$WAS_HOME/bin/wsadmin.sh -lang jython -f /path/to/script.py myDataSource 127.0.0.1
**Disclaimer: untested script. I don't know the name of the "ipAddress" property off the top of my head, but if you run this once it will print out all the properties on your ds, so you can get it there
Some useful links:
Basics about jython scripting
Modifying config objects using wsadmin
As an improvement to aguibert's script, to avoid having to provide all 100 datasource names and to update it to correct the containment path of the configuration id, consider this script which will update all datasources, regardless of the scope at which they're defined. As always, backup your configuration before beginning and once you're satisified the script is working as expected, replace the AdminConfig.reset() with save(). Note, these scripts will likely not work properly if you're using connection URLs in your configuration.
import sys
def updateDataSourceIP(newIP):
datasources = AdminConfig.getid('/DataSource:/').splitlines()
for datasource in datasources:
propertySet = AdminConfig.showAttribute(datasource, 'propertySet')
propertyList = AdminConfig.list('J2EEResourceProperty', propertySet).splitlines()
for prop in propertyList:
if (AdminConfig.showAttribute(prop, 'name') == 'serverName'):
oldip = AdminConfig.showAttribute(prop, 'value')
print "Updating serverName attribute of datasource '" + datasource + "' from " + oldip + " to " + sys.argv[0]
AdminConfig.modify(prop, '[[value ' + newIP + ']]')
AdminConfig.reset();
# Call the function using command line arg
updateDataSourceIP(sys.argv[0])
The script should be invoked similarly to the above, but without the datasource parameter, the only parameter is the new hostname or ip address:
$WAS_HOME/bin/wsadmin.sh -lang jython -f /path/to/script.py 127.0.0.1

Use AppCmd to LIST CONFIG in APPHOST only

I have a requirement to use powershell to configure IIS7.5 on WebApplications that have not yet had code deployed (possibly at all, possibly old/broken web.configs exist) to the file system. I would like to be able to do this all at the APPHOST level. (Note at the bottom about use of Powershell > AppCmd).
I can SET all the values properly, however, being somewhat diligent, I like to also validate the values were set properly by retrieving them after setting.
Here's the scenario:
I can set this value using AppCmd so the setting is applied at the APPHOST level using the /Commit:APPHOST flag. However, I havent found a way to READ the values exclusively at the APPHOST level.
Setting the Code is successful:
C:\Windows\System32\inetsrv\appcmd.exe set config "webSiteName/webAppName" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"True" /commit:apphost
However, I cant find a way to read the values using AppCmd (or Powershell):
Running the following AppCmd returns an error due to the broken pre-existing web.config in the folder (the specific error is unimportant, as it is reading the WebApp's web.config instead of the ApplicationHost.config/APPHOST):
C:\Windows\System32\inetsrv\appcmd.exe list config "MACHINE/WEBROOT/APPHOST/webSiteName/webAppName" -section:system.webServer/security/authentication/anonymousAuthentication
ERROR ( message:Configuration error
Filename: \\?\c:\inetpub\wwwroot\webSiteName\webAppName\web.config
Line Number: 254
Description: The configuration section 'system.runtime.caching' cannot be read because it is missing a section declaration
. )
Note: I would prefer to do this all in Powershell instead of using AppCmd, so if anyone has the syntax for modifying the APPHOST settings for anonymousAuthentication section of a WebApplication, that lives under a Website, from inside Powershell (Get-WebConfiguration seems to only use the WebApp web.config), that would be totally awesome and much appreciated!
Here's how to do this in PowerShell:
[Reflection.Assembly]::Load(
"Microsoft.Web.Administration, Version=7.0.0.0,
Culture=Neutral, PublicKeyToken=31bf3856ad364e35") > $null
$serverManager = New-Object Microsoft.Web.Administration.ServerManager
$config = $serverManager.GetApplicationHostConfiguration()
$anonymousAuthenticationSection = $config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "simpleasp.net")
Write-Host "Current value: " $anonymousAuthenticationSection["enabled"]
# Now set new value
$anonymousAuthenticationSection["enabled"] = $true
$serverManager.CommitChanges()