IT Questions and Answers :)

Friday, December 6, 2019

You've been asked to move from IPv4 to IPv6. What is a valid reason for adopting IPv6 over IPv4?

You've been asked to move from IPv4 to IPv6. What is a valid reason for adopting IPv6 over IPv4?

  • Telnet access does not require a password
  • Change of destination address in the IPv6 header
  • No broadcast
  • Change of source address in the IPv6 header 

EXPLANATION

IPv6 does not implement traditional IP broadcast, and therefore does not define broadcast addresses. In IPv6, the same result can be achieved by sending a packet to the link-local all nodes multicast group which is analogous to IPv4 broadcast.

An IP address serves the purpose of identifying an individual network interface of a host, locating it on the network, and thus permitting the routing of IP packets between hosts. ... In contrast to IPv4, which defined an IP address as a 32-bit value, IPv6 addresses have a size of 128 bits.

 


Share:

In SQL, what does the MULTI_USER option do?

In SQL, what does the MULTI_USER option do?

  • Allows one user at a time to connect to the DB
  • Allows some members to access the DB
  • Allows users with correct permissions to connect
  • Allows only the system admins to connect 
In SQL, what does the MULTI_USER option do?

EXPLANATION

 A multiuser environment is one in which other users can connect and make changes to the same database that you are working with. As a result, several users might be working with the same database objects at the same time. ... A key issue when working with databases in a multiuser environment is access permissions.

Share:

In SQL Server, A database is in single-user mode and ready to be repaired or restored when it is in which of the following states?

In SQL Server, A database is in single-user mode and ready to be repaired or restored when it is in which of the following states?

  • EMERGENCY
  • OFFLINE
  • RECOVERY PENDING
  • SUSPECT

In SQL Server, A database is in single-user mode and ready to be repaired or restored when it is in which of the following states?

EXPLANATION

Database State Definitions

The following table defines the database states.
State Definition
ONLINE Database is available for access. The primary filegroup is online, although the undo phase of recovery may not have been completed.
OFFLINE Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.
RESTORING One or more files of the primary filegroup are being restored, or one or more secondary files are being restored offline. The database is unavailable.
RECOVERING Database is being recovered. The recovering process is a transient state; the database will automatically become online if the recovery succeeds. If the recovery fails, the database will become suspect. The database is unavailable.
RECOVERY PENDING SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.
SUSPECT At least the primary filegroup is suspect and may be damaged. The database cannot be recovered during startup of SQL Server. The database is unavailable. Additional action by the user is required to resolve the problem.
EMERGENCY User has changed the database and set the status to EMERGENCY. The database is in single-user mode and may be repaired or restored. The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect can be set to the EMERGENCY state. This could permit the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.

Database State Definitions

The following table defines the database states.
State Definition
ONLINE Database is available for access. The primary filegroup is online, although the undo phase of recovery may not have been completed.
OFFLINE Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.
RESTORING One or more files of the primary filegroup are being restored, or one or more secondary files are being restored offline. The database is unavailable.
RECOVERING Database is being recovered. The recovering process is a transient state; the database will automatically become online if the recovery succeeds. If the recovery fails, the database will become suspect. The database is unavailable.
RECOVERY PENDING SQL Server has encountered a resource-related error during recovery. The database is not damaged, but files may be missing or system resource limitations may be preventing it from starting. The database is unavailable. Additional action by the user is required to resolve the error and let the recovery process be completed.
SUSPECT At least the primary filegroup is suspect and may be damaged. The database cannot be recovered during startup of SQL Server. The database is unavailable. Additional action by the user is required to resolve the problem.
EMERGENCY User has changed the database and set the status to EMERGENCY. The database is in single-user mode and may be repaired or restored. The database is marked READ_ONLY, logging is disabled, and access is limited to members of the sysadmin fixed server role. EMERGENCY is primarily used for troubleshooting purposes. For example, a database marked as suspect can be set to the EMERGENCY state. This could permit the system administrator read-only access to the database. Only members of the sysadmin fixed server role can set a database to the EMERGENCY state.
  The database can be changed to the EMERGENCY state by a sysadmin user action, in order to safely perform database maintenance or for troubleshooting purposes. In this state, the database will be in single-user mode to be repaired or restored, marked as READ_ONLY where you can export the data out of the database, logging is disabled and the access is restricted only to the sysadmin role members.
Let us get back again to the previous SuspectDBDemo corrupted database that is marked as SUSPECT. In order to troubleshoot its problem and resolve it, we will change the database state to EMERGENCY, permitting the sysadmin users read-only access to that database. The below ALTER DATABASE statement is used to set the database state to EMERGENCY:
ALTER DATABASE SuspectDBDemo SET EMERGENCY
GO
Share:

In networking, what does the acronym STP refer to?

In networking, what does the acronym STP refer to?

  • Secure Telephony Procedure
  • Stacked Terminal Policy
  • Standard Topology Practice
  • Spanning Tree Protocol 
In networking, what does the acronym STP refer to?


EXPLANATION

The Spanning Tree Protocol (STP) is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them.
Spanning-Tree Protocol (STP) is a link management protocol that provides path redundancy while preventing undesirable loops in the network. ... In a STP environment, the switches exchange information amongst themselves using bridge protocol data units (BPDU) and will then listen in on all ports for this BPDU message. 
Share:

In SQL, what does the ON UPDATE CASCADE command ensure?

In SQL, what does the ON UPDATE CASCADE command ensure?

  • Encryption
  • Data integrity
  • Normalization
  • Materialized views 
 In SQL, what does the ON UPDATE CASCADE command ensure?

EXPLANATION

In the SQL 2003 standard there are 5 different referential actions:
  1. CASCADE
  2. RESTRICT
  3. NO ACTION
  4. SET NULL
  5. SET DEFAULT
To answer the question:
  1. CASCADE
    • ON DELETE CASCADE means that if the parent record is deleted, any child records are also deleted. This is not a good idea in my opinion. You should keep track of all data that's ever been in a database, although this can be done using TRIGGERs. (However, see caveat in comments below).
    • ON UPDATE CASCADE means that if the parent primary key is changed, the child value will also change to reflect that. Again in my opinion, not a great idea. If you're changing PRIMARY KEYs with any regularity (or even at all!), there is something wrong with your design. Again, see comments.
    • ON UPDATE CASCADE ON DELETE CASCADE means that if you UPDATE OR DELETE the parent, the change is cascaded to the child. This is the equivalent of ANDing the outcomes of first two statements.
  2. RESTRICT
    • RESTRICT means that any attempt to delete and/or update the parent will fail throwing an error. This is the default behaviour in the event that a referential action is not explicitly specified.
      For an ON DELETE or ON UPDATE that is not specified, the default action is always RESTRICT`.
  3. NO ACTION
    • NO ACTION: From the manual. A keyword from standard SQL. In MySQL, equivalent to RESTRICT. The MySQL Server rejects the delete or update operation for the parent table if there is a related foreign key value in the referenced table. Some database systems have deferred checks, and NO ACTION is a deferred check. In MySQL, foreign key constraints are checked immediately, so NO ACTION is the same as RESTRICT.
  4. SET NULL
    • SET NULL - again from the manual. Delete or update the row from the parent table, and set the foreign key column or columns in the child table to NULL. This is not the best of ideas IMHO, primarily because there is no way of "time-travelling" - i.e. looking back into the child tables and associating records with NULLs with the relevant parent record - either CASCADE or use TRIGGERs to populate logging tables to track changes (but, see comments).
  5. SET DEFAULT
    • SET DEFAULT. Yet another (potentially very useful) part of the SQL standard that MySQL hasn't bothered implementing! Allows the developer to specify a value to which to set the foreign key column(s) on an UPDATE or a DELETE. InnoDB and NDB will reject table definitions with a SET DEFAULT clause.
As mentioned above, you should spend some time looking at the documentation, here.


Share:

Popular Posts