I can not get the name of the server in subscribers and subscription databases - replication

enter image description here
I CAN NOT GET THE NAME OF THE SERVER IN SUBSCRIBERS AND SUBSCRIPTION DATABASES
I can enter into the Sql explorer with ALIAS and IP of another SERVER 2, but when i search in Subscribers of Replication i can get NODE2\SQL2016.
I tried with IP but i have this error
You must enter a subscription database name for Subscriber 'NODE1\SQL2016' and i can't pass to the next step
Please, help me!
I am doing this 3 weeks!!!!
I need to get NODE2\SQL2016 without put the IP
enter image description here

Related

SQL code not running , getting a "permission denied for schema public" error message

CREATE TABLE student
(
student_id INT PRIMARY KEY,
nam VARCHAR (20),
major VARCHAR (20)
);
I'm just running this code and I keep getting a permission denied for schema public message. What does this mean and how can I fix it.?
I see you are asking this in reference to the freeCodeCamp's SQL course by the looks of it.
You need to create your own database and you should be good to go, see the steps below:
Open mySQL command line and create a new database CREATE DATABASE TestDB
Open PopSQL > File > Preferences > Connections > Add New Connection > MySQL
Connection name: any name
Hostname/Port: localhost | 3306 (3306 is default port number, maybe you used/have different port during MySQL installation)
Database: TestDB
Username: root | Password: (this is what you set when you installed MySQL)
Connection Type: turn this ON, you want to "Connect directly from my computer"
Test connection, if successful, save.
Also, please note this is working on MySQL Server 5.7.20, it may be different on other versions.
It means you are using POPsql sample data. Click on manage connections and add a connection to your own database.
Please make sure you are using the right database, in the popSQL the "PopSQL Sample Data" database is selected by default.
you can change it as mentioned below
You need to add your own new connection instead of running it on POPsql sample data private connection
just delete the other sample server from the list of connections and add your own.
I see you are asking this in reference to the freeCodeCamp's SQL course as the same with me, what you really need to do is make sure you follow all of his instructions and after that make sure you change the connection to MySQL after add the new connections.
enter image description here

Redis How to get current database name

Is there any command in Redis to get the database name that I am using right now?
I know select is to switch the database. I am looking for "get database name" kind of a command.
First of all, there's NO name for Redis database. Instead, it has an index.
You can use the CLIENT SETNAME and CLIENT LIST commands to get the database index dynamically:
call CLIENT SETNAME a-unique-name to set a unique name for the current connection.
call CLIENT LIST to get info of all clients that connecting to Redis.
find the connection info with the unique name that we set in step 1.
parse the client info the get the database index.
You can get the format of client info from the doc.
NOTE: If anyone has a simpler solution, please let me know :)
UPDATE: Since Redis 6.2.0, you can use CLIENT INFO to get the information of current connection. So that you don't need to run step 1 - 3 mentioned above.
Since Redis version 6.2.0 you can use the CLIENT INFO command, the response of which contains both the name and the db number of the current client connection.

What is the meaning of the -scan within a hostname (in regards to OBIEE)?

I want to connect my OBIEE to a table which is supposed to be within BI.
So what I do is examine the Connection properties inside of SQL Developer :
And I see that the hostname is "ed10-scan" - is this some special notation for SQL Developer, or some kind of metadata? I was expecting it say something something like "ed1001" or "ed2002" .
A "hostname" is the logical name of a - in this case - server.
https://en.wikipedia.org/wiki/Hostname
It can literally be anything one wants. if you "need a hostname with a number like..." then give your server a new name or at least a new alias over which it can be reached on your network.

How can I reliably track the status of a newly provisioned BareMetal server using the REST API

In SL support ticket opened last year, I was looking for assistance in working around a SoftLayer issue where when my team orders Baremetal servers through some custom scripting, sometimes, the server id associated with the new BM server changes during the provisioning process, and at that point, my tooling loses track of it, and fails. In this ticket:
https://control.softlayer.com/support/tickets/21903245
I was told that I should use the global identifier instead of the server id. I finally got around to testing that, but I am seeing an issue. It would seem that I can't query the hardware status of the new server using the global identifier when I have first submitted the request, like I can with the server id.
[chrisr#ratsy tools]$ curl -k -u chrisr1:<PW> "https://api.softlayer.com/rest/v3/SoftLayer_Hardware/320526/getHardwareStatus.json"
{"id":3,"status":"DEPLOY"}
[chrisr#ratsy tools]$ curl -k -u chrisr1:<PW> "https://api.softlayer.com/rest/v3/SoftLayer_Hardware/75302613-e55a-481a-829f-967799a41968/getHardwareStatus.json"
null
However, it does work later. I ran the same query for a server that was all ready provisioned.
[chrisr#ratsy tools]$ curl -sS -k -u chrisr1:<PW> "https://api.softlayer.com/rest/v3/SoftLayer_Hardware/1ab37f37-9373-4e10-9de4-7319fffcb4f8/getHardwareStatus.json" | json_pp
{
"status" : "ACTIVE",
"id" : 5
}
I need an identifier that I can query on that is:
a) available right away, and
b) won't change
Thanks.
The Global Identifier is assigned to the hardware until the provision is complete, for this reason the request returns "null" value. But it is the identifier that would not change if the server has been re-assigned.
Apparently there not exists any identifier that you can use to track Bare Metal Servers according your requirements.
However, I can recommend to track your server provisioning through hostname that you assigned to the server.
Getting server's information
https://$user:$apiKey#api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={"hardware":{"hostname":{"operation":"serverHostname"}}}
Method: Get
Replace: serverHostname with the server's hostname that you
defined in your order.
The response will provide information about server's identifier,
then you can check the status from server with it.
https://$user:$apiKey#api.softlayer.com/rest/v3/SoftLayer_Hardware/123123/getHardwareStatus
Method: Get
Note: You need to make sure that you don't have more than one bare metal server's with the same hostname.
You are using wrong the global identifier, the idea is you query the server repeatedly until the provisionDate is filled in, it means you call the http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/getObject method and review if the "provisionDate" field has been filled in, in case that the field is not filled in that means that the server is still in provisioning. Once the provisioning server has been completed the "provisionDate" field will be filled in and also the ID of the server and other data will be updated as well. So you do not need to call the getHardwareStatus method in order to know if the server is still in provisioning or completed.

SQL Server FQDN : Use of IP/Instance unrecognized

Can someone point me to the relevant BOL info for this (odd to me) behavior?
I had to join the prod & staging copies of the same table (same db name, diff servers), for a quick query. So I simply needed a fully-qualified join.
This one errors:
SELECT top 10 *
FROM [172.26.196.105\Staging].[DbName].[dbo].[TableName]
This one works:
SELECT top 10 *
FROM [USCASQL01\STAGING].[DbName].[dbo].[TableName]
Edit: clarification ... obviously not a join, these selects were simply me assembling the fully qualified name of my staging db/table. This is not a linked server, but the one I'm connected to.
These, of course, refer to the same instance. I used the IP address\InstanceName since that is what displays in my Object Explorer, it returned an error - "Could not find server 'IP address\InstanceName' in sys.servers." True enough, sys.servers stores the computerName\InstanceName, which works.
Why would one work and not the other? IOW, Why can't it resolve the IP/Instance name in TSQL when it resolves it just fine in the Object Explorer? BTW, we frequently are storing IP's in sys.servers, this one just happened not to be.
Also, I recall from SQL Server7 (way back in the day), a utility that would allow you to create friendly-name aliases for ip's. Can't find it now, does it still exist?
TIA
This is because the first part of a four part qualified name is a reference to a linked server by name, not by an IP or network name. So, if you don't have the linked server set up, then you get the error you encountered.
For adding linked servers, you want to be looking at sp_addlinkedserver.
This is the BOL Page that describes how the four part names work.