sql server: when sys.dm_db_index_usage_stats is deleted in Azure SQL Database

In my solution, I need to verify when there was any last change in the table / index to determine the update of the data.

I'm using Azure SQL Database and the best option (and perhaps the only one without additional tracking / triggers, etc.) was to verify last_user_update in:

sys.dm_db_index_usage_stats

I know that in SQL Server this data is cached and not stored in a physical table, so the information there is lost when restarting SQL Server.

But I'm not sure how it behaves for Azure SQL DB, and I couldn't find that information in the documentation.

I noticed that in one of my Azure SQL DB & # 39; s after a few days of outdated data, that is, the indexes did not change (I am not sure exactly for how many days, trying to search for it at this time). last_update_date was empty. While I still have rows for some objects, since they were queried and last_user_scan had value, tables that were not used at all are not present at all.

I have some theories to verify if, for example, Scaling DB or health events are cleaning that DMV, but maybe someone has any idea or reference to the documentation about that behavior in Azure SQL DB?

To solve that problem, I will "materialize" this DMV with the procedure and program it in ADF, but I would like to understand the logic of this "cache clearing" for that DMV in Azure SQL, to know when to expect to lose information from that.

Change PHP on MacOS server, High Sierra

I am using MacOS Server 5.6.1 running on a Mac Mini with High Sierra (10.13.6.
It works completely well and I have been hosting few WordPress websites without major problems for a couple of years.

I wanted to try and install the Magento e-commerce platform, but it requires some specific PHP extensions, hence my question.

I know how to install PHP and the extensions (via Homebrew) but I can't seem to understand how Apache is configured on the MacOS server as httpd.conf that server seems to be using (in /private/etc/apach2) does not load any PHP module at all.

I think a while ago I saw an article about that on the web, but I can't find it anymore …

ssl: Apache reverse proxy server to kestrel server

The situation is that I am using two servers, a Kestrel server that is used to host a Blazor server-side application and Apache 2.4 to forward requests to the Kestrel server.

The site I am trying to host is an .app domain, which imposes the use of https. Using certbot I installed a certificate of Let & # 39; s Encrypt.

The kestrel server listens 127.0.0.1 on port 5001.
The Apache server has a virtual configuration set that uses a reverse proxy, which forwards all incoming requests on port 443 to 127.0.0.1:5001.

However, the request is not passed to the Kestrel server. When I search the Apache registry, I find the following:

(Mon Dec 16 06:25:01.822334 2019) (ssl:info) (pid 25339:tid 140090755514432) AH01914: Configuring server privateinfo.app:443 for SSL protocol
(Mon Dec 16 06:25:01.822510 2019) (ssl:debug) (pid 25339:tid 140090755514432) ssl_engine_init.c(413): AH01893: Configuring TLS extension handling
(Mon Dec 16 06:25:01.822705 2019) (ssl:debug) (pid 25339:tid 140090755514432) ssl_util_ssl.c(443): AH02412: (privateinfo.app:443) Cert matches for name 'privateinfo.app' (subject: CN=privateinfo.app / issuer: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US / serial: 000
(Mon Dec 16 06:25:01.822712 2019) (ssl:info) (pid 25339:tid 140090755514432) AH02568: Certificate and private key privateinfo:443:0 configured from /etc/letsencrypt/live/privateinfo.app/fullchain.pem and /etc/letsencrypt/live/privateinfo.app/privkey.pem
(Mon Dec 16 06:25:01.823631 2019) (proxy:debug) (pid 6894:tid 140090755514432) proxy_util.c(1776): AH00925: initializing worker https://127.0.0.1:5001 shared
(Mon Dec 16 06:25:01.823648 2019) (proxy:debug) (pid 6894:tid 140090755514432) proxy_util.c(1818): AH00927: initializing worker https://127.0.0.1:5001 local
(Mon Dec 16 06:25:01.823660 2019) (proxy:debug) (pid 6894:tid 140090755514432) proxy_util.c(1853): AH00930: initialized pool in child 6894 for (127.0.0.1) min=0 max=25 smax=25
(Mon Dec 16 06:25:01.823972 2019) (proxy:debug) (pid 6893:tid 140090755514432) proxy_util.c(1776): AH00925: initializing worker https://127.0.0.1:5001 shared
(Mon Dec 16 06:25:01.823985 2019) (proxy:debug) (pid 6893:tid 140090755514432) proxy_util.c(1818): AH00927: initializing worker https://127.0.0.1:5001 local
(Mon Dec 16 06:25:01.823996 2019) (proxy:debug) (pid 6893:tid 140090755514432) proxy_util.c(1853): AH00930: initialized pool in child 6893 for (127.0.0.1) min=0 max=25 smax=25

which allows me to believe that the reverse proxy is configured correctly.

When I try to load the website, the following error code appears: ERR_SSL_PROTOCOL_ERROR

What could be the problem?

sql server: migrate MySQL to MSSQL with views

I have a MySQL database and I want to migrate it with data to MSSQL. I've tried some tools, including the MS SQL server import and export wizard, DataLoader, ESF database migration toolkit, mysqldump with –compatible = mssql.

All these tools are working, but you are migrating views as tables.

Do you have any experience with the tool that can also migrate views?

networks – How to connect my home network to my OpenVPN server? (No port forwarding)

Let me start this question by saying that my knowledge of networks is minimal to say the least, but I managed to configure route tables and troubleshoot OpenVPN servers before, so I think what I want to achieve is not far from my capabilities.

Here is my scenario:

I have a gigabit connection at home, which is fantastic, and I want to use it to host things. However, my provider (Vodafone Kabel) has given me a cable modem that does not support port forwarding. It allows me to view local IPv6 addresses from the Internet if the firewall is disabled, but automatically re-enable it after 24h (meh). I don't know if my IP is static, but I think it isn't. I can solve that with a dynamic DNS configuration.

I also have a dedicated VPS with an OpenVPN server and a static IP. I currently use it mainly for when I need to connect to unreliable networks. Currently it is just a tun server that I use to tunnel all customer traffic to its own local network, and then access the Internet from there.

My current design:

                 Home                  +          Cloud Provider
                                       |
        +--------------------+         |      +---------------------+
        |                    |         |      |                     |
        |    Cable Modem     |         |      |    VPS - OpenVPN    |
        | (home.example.com) |         |      | (cloud.example.com) |
        |                    |         |      |                     |
        +--+-------------+---+         |      +---+-------------+---+
           ^             ^             |          ^             ^
           |             |             |          |             |
           v             v             |          v             v
+----------+-----+    +--+--------+    |     +----+---+    +----+----+
|                |    |           |    |     |        |    |         |
|  Raspberry Pi  |    |    NAS    |    |     | iPhone |    | MacBook |
| OpenVPN Server |    | NextCloud |    |     |        |    |         |
|                |    |           |    |     +--------+    +---------+
+----------------+    +-----------+    |
                                       |
                                       +

This is what I want to achieve:

My Cable modem is the least configurable of the devices in this list. Therefore, I would like to use it as the DHCP server for the entire network. Since RaspberryPi cannot be accessed on my home network from the Internet, I want it to connect to my VPS and expose the home network to the VPS. In this way, when devices like my iPhone connect to the VPS, they communicate directly with my home modem to obtain an IP address.

If I make the correct configuration, the VPS OpenVPN server (cloud.example.com) would simply forward all traffic to the RaspberryPi OpenVPN server and retransmit the traffic. So, should I use a development configuration for that? But on what server, the VPS? Or the RaspberryPi? What OpenVPN servers get what client / server configuration files?

In other words, is this a "standard" pattern that I could look for somewhere? I don't think this is an unorthodox configuration, however, I don't know what to look for to find a better explanation of how to configure it.

Thanks for your help!

java – Loop to continue solving equations by server

Good evening, who can help me, I can't tie a loop to continue solving the equation using the calculation servers.
Who can help, I'm grateful.

import java.net.URL;
import java.util.;
import org.apache.xmlrpc.client.
;

public class ClientCalculatorRPC {

public static void main(String() args) throws Exception {
    int contador = 0;
    String exp = "";
    String c = "((321+42)-(25*5)/123)";
    System.out.println(c);
    ClientCalculadoraRPC calc = new ClientCalculadoraRPC();
    String operacao = "";

String newExpression = "";
int number1 = 0;
int number2 = 0;
// int number3 = 0;

    int j = 0;
    String textoNumero = "0";
    // calc.encontraParenteses(c);
    int() auxiliar = new int(c.length());
    int v = 0;

    System.out.println("( )");


    for (int i = 0; i < c.length(); i++) {

        if (c.charAt(i) == '(') {
            auxiliar(v) = i; //salva a posicao do parenteses de abertura no array auxiliar. v controla as posições neste array

            v++;
        }
        if (c.charAt(i) == ')') {

            //System.out.println(auxiliar(v-1) + "t" + i);
            exp = c.substring(auxiliar(v - 1) + 1, i);
            v--;
            System.out.println(exp);
            while (calc.ehNumero(exp.charAt(j))) {
                textoNumero += exp.charAt(j);
                j++;
            }

            numero1 = Integer.parseInt(textoNumero);

            if ((exp.charAt(j) == '+')
                    || (exp.charAt(j) == '-')
                    || (exp.charAt(j) == '*')
                    || (exp.charAt(j) == '/')) {
                operacao = exp.charAt(j) + "";
            }

            textoNumero = "";
            j++;
            while ((j < exp.length())
                    && (calc.ehNumero(exp.charAt(j)))) {
                textoNumero += exp.charAt(j);
                j++;
            }
            numero2 = Integer.parseInt(textoNumero);

            System.out.println("numero1:" + numero1);
            System.out.println("numero2:" + numero2);
            System.out.println("operacao:" + operacao);

            XmlRpcClient server = new XmlRpcClient();
            XmlRpcClientConfigImpl configuracaoCliente = new XmlRpcClientConfigImpl();

            String metodoServidor = "";
            switch (operacao.charAt(0)) {
                case '+':
                    URL servidorSoma = new URL("https://localhost:9000");
                    configuracaoCliente.setServerURL(servidorSoma);
                    metodoServidor = "Somador.soma";
                    break;
                case '-':
                    URL servidorSubtracao = new URL("https://localhost:51549");
                    configuracaoCliente.setServerURL(servidorSubtracao);
                    metodoServidor = "Subtrador.subtracao";
                    break;
                case '*':
                    URL servidorMultiplicacao = new URL("https://localhost:3400");
                    configuracaoCliente.setServerURL(servidorMultiplicacao);
                    metodoServidor = "Multiplicador.multiplicacao";
                    break;
                case '/':
                    URL servidorDivisao = new URL("https://localhost:8000");
                    configuracaoCliente.setServerURL(servidorDivisao);
                    metodoServidor = "Divisor.divisao";
                    break;
            }
       server.setConfig(configuracaoCliente);
            Vector params = new Vector();

            params.addElement(new Integer(numero1));
            params.addElement(new Integer(numero2));

            Object result = server.execute(metodoServidor, params);

               System.out.println("O resultado é: " + (int) result);

            System.out.println("resultado final:");
             novaExpressao = c.replace("(" + exp + ")", result + "");
            System.out.println(novaExpressao);
            j--;
            break;

            //java unboxing e boxing 
        }

    } 



       c = novaExpressao;

}


// String expressao ="232*13";
private boolean ehNumero(char valor) {
    if ((valor == '0') || (valor == '1') || (valor == '2')
            || (valor == '3') || (valor == '4') || (valor == '5')
            || (valor == '6') || (valor == '7') || (valor == '8')
            || (valor == '9')) {
        return true;
    }
    return false;
}

}

import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver. *;

ServerDivisionRPC public class {

public ServerDivisaoRPC() {
}


public Integer divisao(int x, int y) {
    return new Integer(x / y);
}

public static void main(String() args) {

    try {

        System.out.println("Tentando iniciar o Servidor XML-RPC...");

        WebServer server = new WebServer(8000);
        XmlRpcServer servidor = server.getXmlRpcServer(); // Pega o servidor XmlRpc

        PropertyHandlerMapping phm = new PropertyHandlerMapping();           
        phm.addHandler("Divisor", ServerDivisaoRPC.class); // Adiciona um novo "handler" ao PHM
        servidor.setHandlerMapping(phm); // Define o handler no servidor

        server.start(); // inicia o servidor.

        System.out.println("Iniciado com Sucesso.");
        System.out.println("Aceitando requisições. (Finalize o programa para parar.)");

    } catch (Exception exception) {
        System.err.println("JavaServer: " + exception);
    }
}

}
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver. *;

public class ServerMultiplicacaoRPC {

public ServerMultiplicacaoRPC() {
}


public Integer multiplicacao(int x, int y) {
    return new Integer(x * y);
}

public static void main(String() args) {

    try {

        System.out.println("Tentando iniciar o Servidor XML-RPC...");

        WebServer server = new WebServer(3400);
        XmlRpcServer servidor = server.getXmlRpcServer(); // Pega o servidor XmlRpc

        PropertyHandlerMapping phm = new PropertyHandlerMapping();           
        phm.addHandler("Multiplicador", ServerMultiplicacaoRPC.class); // Adiciona um novo "handler" ao PHM
        servidor.setHandlerMapping(phm); // Define o handler no servidor

        server.start(); // inicia o servidor.

        System.out.println("Iniciado com Sucesso.");
        System.out.println("Aceitando requisições. (Finalize o programa para parar.)");

    } catch (Exception exception) {
        System.err.println("JavaServer: " + exception);
    }
}

}

import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver. *;

public class ServerSomaRPC {

public ServerSomaRPC() {
}


public Integer soma(int x, int y) {
    return new Integer(x + y);
}

public static void main(String() args) {

    try {

        System.out.println("Tentando iniciar o Servidor XML-RPC...");

        WebServer server = new WebServer(9000);
        XmlRpcServer servidor = server.getXmlRpcServer(); // Pega o servidor XmlRpc

        PropertyHandlerMapping phm = new PropertyHandlerMapping();           
        phm.addHandler("Somador", ServerSomaRPC.class); // Adiciona um novo "handler" ao PHM
        servidor.setHandlerMapping(phm); // Define o handler no servidor

        server.start(); // inicia o servidor.

        System.out.println("Iniciado com Sucesso.");
        System.out.println("Aceitando requisições. (Finalize o programa para parar.)");

    } catch (Exception exception) {
        System.err.println("JavaServer: " + exception);
    }
}

}

import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.webserver. *;

public class ServerSubtracaoRPC {

public ServerSubtracaoRPC() {
}


public Integer subtracao(int x, int y) {
    return new Integer(x - y);
}

public static void main(String() args) {

    try {

        System.out.println("Tentando iniciar o Servidor XML-RPC...");

        WebServer server = new WebServer(51549);
        XmlRpcServer servidor = server.getXmlRpcServer(); // Pega o servidor XmlRpc

        PropertyHandlerMapping phm = new PropertyHandlerMapping();           
        phm.addHandler("Subtrador", ServerSubtracaoRPC.class); // Adiciona um novo "handler" ao PHM
        servidor.setHandlerMapping(phm); // Define o handler no servidor

        server.start(); // inicia o servidor.

        System.out.println("Iniciado com Sucesso.");
        System.out.println("Aceitando requisições. (Finalize o programa para parar.)");

    } catch (Exception exception) {
        System.err.println("JavaServer: " + exception);
    }
}

}

sql server: string or separate table

I am creating the database for a system and in it there is an alert system, where, when a certain action occurs, or when certain information is present, an alert is activated (by email). I am allowing users to customize their own alerts so they can receive alerts whenever they want, not when I, as a product engineer, think they should receive them. I am also allowing account administrators to create alerts on behalf of other users, that is, Boss can create alerts to send to employees who have the responsibility to handle the alert.

Therefore, there are three different ways in which a user can subscribe to an alert: 1) all employees 2) all administrators 3) manually decide which users receive it.

I have decided that having an is_all_users and is_admin column as Booleans is the right approach to handle those scenarios, but the question is, when it comes to "manually deciding users", is it okay to be a user ID string that is then analyzed (I do not expect there to be more than 5 recipients in this scenario), or should a separate table do it?

The two schemes are as follows:

alerts

  • customer_id (int)
  • alert_id (int)
  • etcetera etcetera.
  • recipients (string)
  • recipients_is_admin (boolean)
  • recipients_is_all (boolean)

OR

alerts

  • customer_id (int)
  • alert_id (int)
  • etcetera etcetera.

alert_recipients

  • alert_id (int)
  • user_id (int)
  • recipients_is_admin (boolean)
  • recipients_is_all (boolean)

In scenario 1, there could be a speed and / or analysis problem, but scenario 2 seems difficult to handle and unnecessary. Of course, in the second scenario, you could also put recipients_is_admin and recipients_is_all in the first table, but then you would be dealing with two different tables for a single purpose that just seems wrong.

sql server – Move database files from one drive to another

Check out those 2 blog posts on how to move DB data and log files

How to move SQL database files (MDF and LDF) to another location

How to Move SQL Server MDF and LDF Files? – Interview Question of the Week #189

The basic steps are:

  • alter the paths of the logical files in the database to point to a new address (if any, D: or E 🙂
  • take the database offline
  • move physical database files to a new location (D: or E 🙂
  • put the database online

As you can see, it is not complex, but it implies some downtime

You need a 3G server with 3Gbps without a meter

Hi,

We have servers in OVH and we need servers in Miami that connect to our CA OVH servers.

Looking for the server in Miami with a 3Gbps network without parameters.
Hardware: 1 CPU, 32GB, 2x1TB SSD.
No management required, using Debian 10.x

Budget ~ 800USD

Starting with 1 server and if that works well, we will get more.

Thank you.

Microsoft SQL Server 14

I'm running out of space in unit C and I have a lot in unit D or E.
How do I move the data in the database from C to D or E?