OdinTree
OdinTree
  • 17
  • 167 493
SQL Server Clusterless Read Scale Availability Group Setup
Learn how to setup an SQL Server Clusterless Read Scale Availability group. Use the listener for client connections and see how to fail over the availability group. See the redirection in action for read only requests on the primary being redirected automatically to the secondary.
TSQL to return the read-only routing configuration
SELECT AVGSrc.replica_server_name AS SourceReplica
, AVGRepl.replica_server_name AS ReadOnlyReplica
, AVGRepl.read_only_routing_url AS RoutingURL
, AVGRL.routing_priority AS RoutingPriority
FROM sys.availability_read_only_routing_lists AVGRL
INNER JOIN sys.availability_replicas AVGSrc ON AVGRL.replica_id = AVGSrc.replica_id
INNER JOIN sys.availability_replicas AVGRepl ON AVGRL.read_only_replica_id = AVGRepl.replica_id
INNER JOIN sys.availability_groups AV ON AV.group_id = AVGSrc.group_id
ORDER BY SourceReplica
มุมมอง: 2 329

วีดีโอ

Setup and Configure Transactional Replication with a Remote Distributor SQL Server - Step by Step
มุมมอง 30K4 ปีที่แล้ว
Best to watch this at 1080p or 720p minimum How to properly setup/configure transactional replication with a remote distributor for SQL Server. This video shows how to do it on a real Windows Domain with active directory. Three servers are used - one for the Publisher, one for the Distributor, and one for the Subscriber. It also uses proper user security to lockdown the privileges of the replic...
Protect your database data - Activate Transparent Data Encryption TDE - SQL Server - Step by Step
มุมมอง 14K4 ปีที่แล้ว
How to implement/activate/setup Transparent Data Encryption (TDE) on a database in SQL Server. This video shows how to activate TDE and how to Restore a TDE encrypted database, and how to remove TDE and its components from an SQL Server and database. Hide your data from hackers. At some point in time there is a good chance your database will be accessed by un-authorized external or internal sou...
SQL Server BI Tools Install - Step by Step
มุมมอง 3.8K4 ปีที่แล้ว
How to install SQL Server with the Business Intelligence (BI) Tools - SQL Server Analysis Services (SSAS), SQL Server Integration Services (SSIS), SQL Server Management Studios (SSMS) and Visual Studios 2019 (VS2019) Links: SQL Server (on premises) - www.microsoft.com/en-ca/sql-server/sql-server-downloads# SSMS - docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=...
12 Learn SQL Creating SQL Triggers
มุมมอง 5154 ปีที่แล้ว
How to create SQL Triggers. Before/After Update, Delete and Insert triggers. Using Row level triggers in SQL.
11 Learn SQL Sub Queries
มุมมอง 1.2K4 ปีที่แล้ว
Tutorial on creating and using SQL Sub Queries. Regular sub query and correlated sub query. Examples of sub queries.
10 Learn SQL Using Outer Joins
มุมมอง 4424 ปีที่แล้ว
Tutorial on Using SQL Outer Joins. Examples of using SQL Outer Joins. SQL Script drop database joins; create database joins; use joins; CREATE TABLE continent (continentID char(3) PRIMARY KEY, continentName char(20)); CREATE TABLE country (countryID char(3) PRIMARY KEY, countryName char(20), continentID char(3), FOREIGN KEY (continentID) REFERENCES continent(continentID)); INSERT INTO continent...
09 Learn SQL Outer Join Concepts
มุมมอง 4994 ปีที่แล้ว
Tutorial on SQL Outer Join concepts. Learn how and when you should use SQL Outer Joins.
08 Learn SQL Using INNER JOINS
มุมมอง 6934 ปีที่แล้ว
Learn how to use SQL Inner Joins to link 2 or more tables together. Examples of using inner joins to link 2 or more tables together in an SQL SELECT statement. SQL Script drop database joins; create database joins; use joins; CREATE TABLE continent (continentID char(3) PRIMARY KEY, continentName char(20)); CREATE TABLE country (countryID char(3) PRIMARY KEY, countryName char(20), continentID ch...
07 Learn SQL INNER JOIN Concepts
มุมมอง 8114 ปีที่แล้ว
Easy explanation of the concept of inner joins for SQL. How and when we use INNER JOINS. Join 2 tables together in an SQL statement.
06 Learn SQL Aggregations - Using COUNT, MAX, MIN, SUM, AVG
มุมมอง 5564 ปีที่แล้ว
Learn how to use SQL aggregations such as COUNT, MAX, MIN, SUM, and AVG. Easy lesson to learn how to use SQL aggregations SQL Script to build database /* sample database to demonstrate aggregations */ CREATE DATABASE IF NOT EXISTS myLesson; USE myLesson DROP TABLE IF EXISTS product; CREATE TABLE product ( productID INT PRIMARY KEY, productCode CHAR(5), productName VARCHAR(25), productCategory V...
05 Learn SQL Simple SELECT
มุมมอง 4975 ปีที่แล้ว
SQL Creating a simple SELECT statement - Easy SQL tutorial How to create a simple select statement and how to use column alias, the CONCAT function to join columns and text together for column headings, the WHERE clause, and the ORDER BY clause.
04 Learn SQL UPDATE DELETE
มุมมอง 3375 ปีที่แล้ว
SQL Update and Delete existing data. Easy SQL tutorial How to update existing data in a table. How to delete data from a table. How to use the WHERE clause when updating or deleting.
03 Learn SQL INSERT INTO
มุมมอง 4955 ปีที่แล้ว
Lesson 3 - Learn SQL - INSERT INTO This video shows how to insert data into existing tables. Learn how to insert data into tables that have auto incrementing (auto number) columns. How to insert more than one row (record) at a time.
02 Learn SQL ALTER TABLE
มุมมอง 5755 ปีที่แล้ว
Lesson 2 - SQL Alter Table statement. This video shows how to add columns, delete (remove) columns, change names of columns after a table has been created.
01 Learn SQL CREATE TABLE
มุมมอง 2.1K5 ปีที่แล้ว
01 Learn SQL CREATE TABLE
Easy explanation of Normalization Relational Database Design for Beginners - 1NF, 2NF, 3NF
มุมมอง 109K5 ปีที่แล้ว
Easy explanation of Normalization Relational Database Design for Beginners - 1NF, 2NF, 3NF

ความคิดเห็น

  • @yiwang-s9u
    @yiwang-s9u 10 วันที่ผ่านมา

    distributor password you setup at 12:26, when and how this password used in next? I didnot find when to use this password and how to user this password ? any idea about this password, thank you

  • @lirusme2461
    @lirusme2461 หลายเดือนก่อน

    thanks for sharing, but how if SQL server instance using custom port? please advice

    • @odintree5704
      @odintree5704 หลายเดือนก่อน

      Just use the public IP and the port number

    • @lirusme2461
      @lirusme2461 หลายเดือนก่อน

      @@odintree5704 all node server SQL using port custom, create distributor, publisher and subscriber sucess, but while job subscriber running there was error subscriber can not connect Distributor. please advice

  • @saccamadiqeu2600
    @saccamadiqeu2600 หลายเดือนก่อน

    soooo, what are the repeating columns?

  • @user-uv1jh7zd2c
    @user-uv1jh7zd2c 3 หลายเดือนก่อน

    Excellent video.please provide any document for this explanation

  • @moabbas5525
    @moabbas5525 3 หลายเดือนก่อน

    okay so I just did your exercise prior to watching how you solved it , not sure if i did it right. But I used the entity approach and created 4 tables below. I then used foreign keys to connect them together Room Payment Guest Reservation

    • @odintree5704
      @odintree5704 3 หลายเดือนก่อน

      Almost. You are missing the bridge table. Card table - based on my rules. Honestly you could get away without the card table if you wish. Should also have a room type.

    • @moabbas5525
      @moabbas5525 3 หลายเดือนก่อน

      ⁠ ​​ i captured the card info under the Payment table and the room type under Room table . I wish if there is a way I could send you what I created

    • @odintree5704
      @odintree5704 3 หลายเดือนก่อน

      @@moabbas5525 It is actually very easy to represent your design by using a dependency notation. It goes like this. Assume you have a table called product and a table called supplier. This is how you would represent the design using dependency notation: Product : productID --> productName, productCost, productSell, supplierID Supplier: supplierID --> supplierName, supplierPhone As you can see we have indicated the name of the table. The primary key for the product table is productID (usually we would underline it but I cannot here). But that is not important because the arrow ( -->) after it means that the column productID DETERMINES all the other columns. That is a definition of a PK. In the product table I have a column called supplierID and in the supplier table we have the PK as supplierID so I can infer that supplierID in the product table is a foreign key to the supplier table and is related to the supplierID column in said table. So you can represent your design like this.

    • @moabbas5525
      @moabbas5525 3 หลายเดือนก่อน

      @@odintree5704 I’ll try that thank you so much for taking the time to reply back to me .

  • @moabbas5525
    @moabbas5525 3 หลายเดือนก่อน

    This is awesome!!! Why did you stop making videos ?😊??

    • @odintree5704
      @odintree5704 3 หลายเดือนก่อน

      Maybe I will do some more. Thanks for the positive feedback. Glad it was helpful.

  • @dsharma8198
    @dsharma8198 3 หลายเดือนก่อน

    Excellent video. Thanks for sharing.

    • @odintree5704
      @odintree5704 3 หลายเดือนก่อน

      Glad you liked it. Nice GIF

  • @weneedheros
    @weneedheros 3 หลายเดือนก่อน

    Really useful and a very good description. Thank you for taking the time to make this video.

    • @odintree5704
      @odintree5704 3 หลายเดือนก่อน

      Glad it was helpful!

  • @sikendongol4208
    @sikendongol4208 4 หลายเดือนก่อน

    48:33 not normalized, 1:05:00 normalized

  • @badrslaoui
    @badrslaoui 4 หลายเดือนก่อน

    very nice explanation helped me a lot thanks

  • @mt-nu6lj
    @mt-nu6lj 5 หลายเดือนก่อน

    Great tutorial. It is real life scenario. A lot of tutorials are running on AgentAccount and lector doesn't show and explain AD users topic

    • @odintree5704
      @odintree5704 4 หลายเดือนก่อน

      Glad you found it useful.

  • @pjmclenon
    @pjmclenon 5 หลายเดือนก่อน

    hello are your 3 servers on 1 machine? how can we do on seperate physical machineaz? also how do we get the domain local name? how do we add sql agent? some have some dont for my servers thxz

    • @pjmclenon
      @pjmclenon 5 หลายเดือนก่อน

      there is a lot of steps cant we make a batch file?

    • @odintree5704
      @odintree5704 5 หลายเดือนก่อน

      These are 3VM's so yes technically they are separate servers. You would have to talk to your IT department to get an idea of the network configuration - for domains and AD's. SQL Server Agent is installed during server install but not on express. If you need to you can do a repair and it should fix it for you.

    • @pjmclenon
      @pjmclenon 5 หลายเดือนก่อน

      hello so how exactly do we do repair sql installtion? maybe in the sql installtion software link i think its in the main menu--also i just doing local self testing not in an actually work it setting--Lisa thxz alot for the replies---PS also so we need to disable firewall for servers to ping each other and exchange merge shard sync data info? i stil cant ping seperate physical machines

    • @odintree5704
      @odintree5704 5 หลายเดือนก่อน

      @@pjmclenon I would not disable the firewall, I would just open a port - default port is 1433 but if you use named instances you should use static ports and open the ports you specify.

    • @pjmclenon
      @pjmclenon 5 หลายเดือนก่อน

      hello--okay i will try this

  • @RyazantsevNikolay
    @RyazantsevNikolay 5 หลายเดือนก่อน

    On 18:42 you add a local server IP address as a listener IP. Shouldn't it be a separate IP instead? This IP certainly should not match with a cluster IP if it would be a cluster. Overall, this IP is VIP (virtual IP) but I'm not sure how it works in read-scale.

  • @NaaneVinu
    @NaaneVinu 7 หลายเดือนก่อน

    Thank you so much for the video. Hope you doing great. I have a production database that is maintained by vendor and we have restrictions to use tables but only views. Vendor has provided one-to-one indexed views to access those tables. Now I would like to have replica of the database in another accesble network, where also I have no restrictions on the database. 1. Is it possible to do transactional replication on indexed views? ([Source]Indexed views -> [Destination]Indexed views)? 2. In the above case, is it also possible to convert [Destination]Indexed views to a table instead of views? If possible can you also please create a video on this as well? Thank you. Have great holidays. 😊

    • @odintree5704
      @odintree5704 6 หลายเดือนก่อน

      Great question. I am happy to say that what I think you want to do is possible. I know most people say that you need to create the table structure first on the subscriber but this is not required. You can replicate just the data from the view without creating the underlying data structure first. Currently I do not have the time to make the video but I googled and found this link. It should get you what you want, Keep in mind you will not be doing everything mentioned in the article. For instance you are not adding new columns to the underlying data. Take a look at the link and give it a try and if you have any issues let me know and I will see if I can help. virtual-dba.com/blog/replicating-indexed-views-as-tables/

  • @mohammadedalatfard2094
    @mohammadedalatfard2094 7 หลายเดือนก่อน

    excellent video, thank you for your complete explanation.

  • @stevenrogersfineart4224
    @stevenrogersfineart4224 7 หลายเดือนก่อน

    EXCELLENT video ! Thanks!!

  • @harsahbajsinghsaini8841
    @harsahbajsinghsaini8841 7 หลายเดือนก่อน

    Professor Im gonna see you at exam in just 4 hours and this video is the only thing that's gonna save me. Love you a lot man thanks for a wonderful semester I wish more professors were like you 💓💓

  • @darnellmcgavocksr.5152
    @darnellmcgavocksr.5152 7 หลายเดือนก่อน

    Masterful job!!! And thank you.

  • @ayoubelhioui2205
    @ayoubelhioui2205 7 หลายเดือนก่อน

    thank you so much for this amazing explanation, just one thing with cardType, i guess it's better to put it in a new table, [id, cardType] and put the id in cardType, because imaging The "MC" has a new name "AB" for example, in this case you will go to every row in the card table and change "MC" to "AB", if it's in a separate table, it will update just one time, correct me if i'm wrong, thank you.

    • @odintree5704
      @odintree5704 5 หลายเดือนก่อน

      You are correct. Sorry for the late response but youtube sometimes does not show comments. So the only way I find some comments is to scroll through them.

  • @qqq2001pk
    @qqq2001pk 7 หลายเดือนก่อน

    Implementing TDE wont affect the application ?

    • @odintree5704
      @odintree5704 6 หลายเดือนก่อน

      Sorry qqq - for some reason TH-cam did not display your comment to me. You are correct that TDE does not affect the app. Keep in mind there is a small performance hit since data needs to be constantly encrypted and decrypted. You could get up to a 3% performance hit, but depending on what is in the cache this could be reduced.

  • @Supernyv
    @Supernyv 8 หลายเดือนก่อน

    Magic ! Saved for future references

  • @felixcain
    @felixcain 8 หลายเดือนก่อน

    Thank you for this tutorial!!

  • @ollicron7397
    @ollicron7397 8 หลายเดือนก่อน

    Bravo! Everything connects! Thank you for making this.

  • @jcalvarezg
    @jcalvarezg 9 หลายเดือนก่อน

    Well explained. Thanks a lot

  • @ashs3326
    @ashs3326 10 หลายเดือนก่อน

    What Ports need open between server 1,2,3 ? Does all 3 servers need to talk to each other?

    • @odintree5704
      @odintree5704 10 หลายเดือนก่อน

      The publisher needs to talk to the distributor. The distributor needs to talk to the subscriber. As for the ports it depends on your network setup. How many routers (firewalls) are being traversed? Port 1433 (default instance) - standard database engine - Port 80 if connecting over HTTP (if the standard HTTP has not been changed) FTP if you are using the web sync - Port 21 or UDP Port 137,138 possibly TCP 139 and possibly port 445 Need to know your network configuration - I would just try it first with port 1433 and see what happens.

    • @ashs3326
      @ashs3326 9 หลายเดือนก่อน

      @@odintree5704 if publisher -> distributor -> subscriber is one way port 1433, then why we need to create shared folder for repldata? I think we need publisher <-> distributor ports open both ways.

    • @ashs3326
      @ashs3326 9 หลายเดือนก่อน

      Also can publisher have it's own subscriber for different replication/subscriber, so kinda one to many replication. to me it looks like publisher has to start clean and shouldn't have any existing publication.

  • @mohamedsaid1833
    @mohamedsaid1833 11 หลายเดือนก่อน

    Very Good

  • @eapradius
    @eapradius ปีที่แล้ว

    This is excellent!

  • @parko1965
    @parko1965 ปีที่แล้ว

    Took me 4 years to find this, but what an absolute gem. The man has nailed it.

  • @okhosting
    @okhosting ปีที่แล้ว

    Great video man thank you!

  • @aakashlko92
    @aakashlko92 ปีที่แล้ว

    Voice is too low

  • @salvadorpinedacarrillo1467
    @salvadorpinedacarrillo1467 ปีที่แล้ว

    Will this encription need an access key to read / update data from an application? Or this encryption is only for just in case someone gets a copy so they can't restore it???

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      TDE is transparent to the front end application. You do NOT need to make any changes what-so-ever to your front end application to interact with a TDE enabled database.

  • @muhammadzaakirmungrue3146
    @muhammadzaakirmungrue3146 ปีที่แล้ว

    Remove the partial dependency by ensuring that no columns can be a primary key for another.

  • @muhammadzaakirmungrue3146
    @muhammadzaakirmungrue3146 ปีที่แล้ว

    Thanks, awesome video to prepare for my Database Support interview.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      You're welcome and good luck with your interview.

  • @jvofficial5838
    @jvofficial5838 ปีที่แล้ว

    Good Day sir your video is interesting ., i would like to ask if which of the 3 servers mention can handle multiple end user that are connected in the database.? if either the distributor server and subscription server have a direct changes in data , it can affect the Publisher server data also ?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Hello JV, Could you rephrase your question please. I am not sure what you are asking.

    • @jvofficial5838
      @jvofficial5838 ปีที่แล้ว

      @@odintree5704 aw sorry ., the situation is like this., i have a 2 servers that needs to be replicated like if the other server have a changes the other server will also be updated ., what process of replication should i do ?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      @@jvofficial5838 Sounds like you want Merge Replication

    • @jvofficial5838
      @jvofficial5838 ปีที่แล้ว

      @@odintree5704 both server's receive transactions still merge replication ?

    • @jvofficial5838
      @jvofficial5838 ปีที่แล้ว

      @@odintree5704 sir question.., if the publisher(server1) runs Off., the distrution and subscriber can proceed ? and if yes. then when the publisher wakes.,. would it be the subscribers data be copied or prioritize?

  • @user-zt4wm3oe2m
    @user-zt4wm3oe2m ปีที่แล้ว

    okey but how can i connect btween two sql ?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Do you mean between two different RDBMS.You can do a simple google search and get the following instructions for an oracle publisher learn.microsoft.com/en-us/sql/relational-databases/replication/publish/create-a-publication-from-an-oracle-database?view=sql-server-ver16 Or you can try Goldengate which has been purchased by Oracle.

  • @poem-saxophoneTV
    @poem-saxophoneTV ปีที่แล้ว

    Believe in Jesus, you and your family will be saved.

  • @amaurygermano3575
    @amaurygermano3575 ปีที่แล้ว

    Hi, I have the same scenario and it's working fine. Could you help me how can I move the distributor to another new server? I have 8 groups with 5 thousand tables replicated and I don't like to lose the data has replicated. Thanks

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Hello Amaury, That procedure is not straight forward and impossible for me to explain here. I have found this link and it is pretty thorough for moving the distributor. As you may or not be aware tthere is no mechanism for just moving the distributor. You must drop it and recreate it. But as I said the following link has very good step by steps instructions. Good luck. www.sqlshack.com/sql-server-transactional-replication-moving-distribution-database-step-by-step-guide/

  • @kidistshewarega624
    @kidistshewarega624 ปีที่แล้ว

    I have a question when we normalize tables to a third normal form shouldn't we check if the non key attributes determine the primary key? The email attribute seem to determine the reservation number in this case.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Hello Kidist, Good question. I have not looked at the sample database I used for this video in awhile but I will guess that the email does not determine the reservation number since the same person could have multiple reservations with the same email. As to whether a non key attribute could determine the PK it is possible. For instance if a table is in 3NF but has 2 candidate keys then the alternate key could determine the PK. For instance assume an employee table: EmplID --> EmpFname, EmpLname, SSN As you can see we have 2 candidate keys. EmpID and SSN. SSN is the alternate and will also be unique. Hope that helps.

  • @sqljobs8548
    @sqljobs8548 ปีที่แล้ว

    Why not use a different Ip address for the Listener in RSAG other than primary to avoid changing DNS entries time and again after every failover . Does that not work ? sorry I have only set availability groups in FCI and not in RSAG.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Good question - unlike a cluster enviro where you point to the cluster ip the Listener always has to be pointed to the primary replica. SQL Server is cluster aware and can switch automatically with a cluster but not without a cluster so we have to manual identify the primary since the primary always owns the listener in an AG.

  • @Earningwithbasatti
    @Earningwithbasatti ปีที่แล้ว

    very nice explanation

  • @Bullbluegill
    @Bullbluegill ปีที่แล้ว

    Ok, so my Sys and User database moves went fine on both servers. I setup AG on the two test servers, however I didn't use a listener or read-only routing. I also left the primary database setting for readable as NO. I'm not sure how the testing will go but it seems to return data i select on the secondary and DB's are "synchronized" with no data loss. My thought was I'll never fail over manually. Just the secondary needs to be readable in the AG. I also have no need for a listener or read-only routing. Correct me if I'm wrong in my assumptions above. As long as the DB is replicating and reporting team can select the data they need on the secondary, that's all i need. I set the primary as readable "no" because i never want the reporting team reading or selecting from that Prod db (primary). Thus the reason for this AG setup. I've yet to hand this over to the reporting team so I don't know if my settings are sufficient.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Hello CS, I am at home right now and do not have access to an AG configuration but you could verify. I assume you set the primary to R/W and the connection intent to ReadONly. This I believe will stop any connection string that has application intent = readonly. Check if they can directly connect to your primary without an intent string and see if they can query. If they cannot then you are good but if they can then you may need to remove some database level SELECT privileges (on the Primary only) for users that have only read access. This will force them to only read from the secondary whether the connection string contains intent = readonly or not. Let me know if that makes sense and if you can directly connect to your primary without the intent string in your connection string and still run a Select statement be fore applying the database level restrictions I mentioned.

    • @Bullbluegill
      @Bullbluegill ปีที่แล้ว

      @@odintree5704 I guess I should have been more specific, I have one data warehouse developer, he's the only one touching this. he creates the reports and they are published out on the sharepoint server. His access is from a Data Warehouse server via a linked server. So really there would be no accidental way to be pulling from the primary. I'll test what I have and see if it works, that's all I can do at this point. I'll post up the configs i used once I work with him on the setup. I'm not sure if I'm making any sense here, but I've not set anything for application intent as I didn't think i would need to.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      @@Bullbluegill Thanks CS. I do not know if you know the answer but do you know if your DW is multi-dimensional or tabular. Also do you use cubes. How large is the DW. I really like working with DW and I really like the multi-dimensional approach with cubes. If you could give a description of your setup I would appreciate it. I am just curious because I read different things but I really want to know what people are actually using not what sales/marketing people are trying to push. If you use tabular I would be curious how large the data is and how much memory on your servers.

    • @Bullbluegill
      @Bullbluegill ปีที่แล้ว

      @@odintree5704 I'll find out for you. I'm still waiting on the DW folks to test...they are super busy with implementing a new ERP system...2 years into it, about 18 months to go. I do know this....they use cubes. It's big as I back up the data, about 800GB big comprised of about 6 DB's. They basically do extracts from our PeopleSoft system, load them into the DW daily. All of our reporting is done via the DW and reports are housed in sharepoint. Outside of that, I don't know too much. The read scale AG is for something totally different. It's for reporting off a different set of applications. The DB servers are not super power houses, 4 core, 16 GB and I allocate 12 to SQL. The extract and loading process takes about 5 hours, from midnight to approx 4:30 to 5 am.

  • @Bullbluegill
    @Bullbluegill ปีที่แล้ว

    I apologize in advance for this question as it's somewhat unrelated to this video for the most part. From my understanding, when going to AG you need to have the same file paths. One server was new and is 2019 and the old was 16 until i did an in-place upgrade. Correct me if I'm wrong, but I do not believe the upgrade gave me an option to set the path to the 15 MSSQLSERVER folder (old path was 13). If it did, i missed the ball there. I doubt it though because an installer isn't going to physically move the mdf and ldf (I was thinking out loud there) I need to move the user DB's from the 13 to the 15 folder, I would also like to move the system DBs as well. So now my question is, is there an order in which i should move these? User DB's first, System first, Master First then the rest of system?? I can find a lot on the web about all of this except order in which it should be doner. So this is kind of an off the cuff question but maybe someone else down the line would have this same issue. I figured i'd move the system as well simply for consistency moving forward.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Wow - loaded question. As far as I know there is no specific order. But my preferred order and it is mine and I don't say it is right or wrong or the best or that my logic makes any sense. I move the user databases first and then the system and master. My thinking (right or wrong) is that the master database contains the locations of all user databases and files (just in case the location is corrupted in the user databases) and as you move the databases the locations get updated in the master. Then I move Master last and I feel more secure that the Master has the proper locations. Obviously to move the system databases you need to follow some very specific rules even after they have been moved - such as manually changing the registery entry, certain service account privileges, etc. See the full instructions here learn.microsoft.com/en-us/sql/relational-databases/databases/move-system-databases?source=recommendations&view=sql-server-ver16 Good luck - let me know how you made out and if you ran into any problems.

    • @Bullbluegill
      @Bullbluegill ปีที่แล้ว

      @@odintree5704 That is exactly how i was going to do it as I found one guy have a 2 part post. he did the user, then the system in which master was last. I do understand the process of moving everything, the reg, agent job stuff, default paths and such...so I'll let you know how it goes. Thanks again for the reply. Very helpful. Sorry for the loaded question, but I'm sure i'm not the only one that will run into this.

  • @josephwamae5351
    @josephwamae5351 ปีที่แล้ว

    This video is very helpful... You walked us through the steps of normalization in a more practical manner. Thanks man more your efforts🙏

  • @Bullbluegill
    @Bullbluegill ปีที่แล้ว

    Hello Sir, I'm back again with another question. I know when the DB is created it has the same name. Is there any way to change the secondary to a different name and still replicate properly? I know that doesn't make a ton of sense to have different names but it's how the report writers want it. for example, AdventureWorks (primary) and the secondary name AdvertureWorks_Prod?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Hello CS, Good to hear from you. Unfortunately Availability groups as far as I know the replicated database MUST have the same name as the primary. Just to be sure I did look that up in the documentation and that is a requirement. It does make sense. Not sure why the report writers want that but just thinking out loud here I believe you have you backups done using a 3rd party software on the primary replica. Could you try just creating an SQL Server Agent Job to do a copy_only backup on the secondary replica and then rename the copy_only and use that for the report writers. I know it seems clunking but not sure what else to do. Maybe someone else may have a suggestion. Not even sure you can do a copy_only backup on the secondary replica without a cluster. I know we can do it when it is in a cluster. Be curious if you can.

    • @Bullbluegill
      @Bullbluegill ปีที่แล้ว

      @@odintree5704 Thanks for the reply. Yes, I think the same names make total sense, but when it comes to others, they have different ideas usually based off what's easier for them. I think all their code, and it can't be much to change a DB name, was done for transactional replication and a naming scheme of DB_PD and DB_TS (their idea). We are going away from that because it seems way too hands on. Agent always stopping for no reason and not logged. there are constant changes to the DB so almost real time changes to be replicated and moved are essential. I'll just tell them the names are going to be the same, live with it, change your code. I know you are thinking, how can an agent stop running and not be logged anywhere....believe it. Nothing in history, nothing in a log of any type. I believe it's because it's not failing to start so it's not logged. Something the network or server team is doing at night is stopping it but no one seems to want to find it. Yes, we use a 3rd party app for backups. That is also one reason we went away from Native Sql backups because agent jobs seemed so unreliable and visibility was somewhat limited even with alerts. We bought Idera SQL Safe, it was cheap, very easy and has been fantastic. Visibility is great, it's super fast too if you don't have encryption enabled using TDE.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      @@Bullbluegill Exactly. Developer just needs to do a search and replace. Since the server name is different and probably even the instance name there should be no problem. Easy change. One thing I have noticed and was thinking of doing a video on was SQL Server agent jobs and a situation I have noticed. When I create jobs each command gets its own job step. For instance if you wanted to backup 3 databases and issue the backup command 3 times for the 3 databases and put all 3 backup statements in the same jobstep command, if the first backup fails you get a notification, but if the 1st backup succeeds but the next backup fails, no notification is sent - it appears that the job step was successful. But if you put all backup statements in 3 job steps any one that fails you get a notification. When new people who come in and create a job with multiple commands in one step I get them to change it when I find it. I just do not have the time to trouble shoot issues that can be easily rectified in the first place with a little extra effort. I have never dug too deeply into why this happens I just create job steps for each command and I do not get the problem of step failures for these types of problems. I assume you checked the sysjobstepslog and sysjobhistory tables in the msdb database.

    • @Bullbluegill
      @Bullbluegill ปีที่แล้ว

      @@odintree5704 my reasons for gong away from Transactional replication was made well before the whole stopping of the agent jobs. When you have DB part of replication, when there are changes you have to remove the articles (tables) from replication, then add them back in. To me, that technology was just too hands on. We have a process, when followed correctly it was fine. When I wasn't notified or they didn't check articles back in we had report discrepancies. So it was not a set it and forget it type of process. So our minds were already made up to move to AG. The agent jobs were just a aftermath basically. I spent time, but didn't spin those wheels too long as I don't have it and going away from it anyway. I just need to make all file paths and instance names the same and we'll be set. Those tables did log something but a generic MS error, something to the effect "job was canceled by user blah blah". There is a process that runs nightly, but again, not worth the time at this point. Until I get to AG, i just have the log reader agent status open and peek at it a few times a day.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      @@Bullbluegill I agree - AG is a lot more friendly than replication for a lot of cases.

  • @LamNguyen-qb4ic
    @LamNguyen-qb4ic ปีที่แล้ว

    Thank you so much. It's very good explanation and right to the points. I keep watching over and over to refresh my memory from time to time.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Thank you. Glad it is helpful.

  • @nirnayjain2277
    @nirnayjain2277 ปีที่แล้ว

    Can't we just create column as Id and auto increment it and make it as primary key?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Yes you can and that is what I always do. That is what I do at the end with the surrogate keys. I make all my primary keys a surrogate key with auto numbers or sequences. I also never call my surrogate PK's just "ID" because that gets confusing when you start creating the queries and any code. I use my naming convention so I would call it something like EmployeeID, CustomerID, etc. rather than just id for all the tables.

  • @eluatopula
    @eluatopula ปีที่แล้ว

    was the name not supposed to be displayed as atomic value for 1NF?

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Yes. But as indicated in the video I did say I would do it at the end because a lack of screen space. I wanted all the columns to show on the screen. I indicated that I would just have to remember to do it in the last step. But you are correct that it is supposed to be done in the 1st step.

  • @rainerausdemspring894
    @rainerausdemspring894 ปีที่แล้ว

    Why on earth do you like those artificial primary keys? A DB with artificial keys is no longer a relational DB.

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Since when is a DB with surrogate keys not considered a relational database? That is one of the most ridiculous statements I have ever heard. Now if you said it violates 3NF I would 100% agree. But that is perfectly acceptable and is common practice. As a matter of fact a lot of databases violate 3NF. Depending on the use of the DB most DBs would be violating 3NF by not breaking out tables for city, state, country, zip/postal. But who is going to create a table with every know city in say just the USA in every state and create a table for the many ZIP codes. You would only see that for an application for the P.O.. I honestly would not want to ever work on one of your DBs since I can picture the complete mess they would be in.

  • @rainerausdemspring894
    @rainerausdemspring894 ปีที่แล้ว

    Of course, the problem with your hotel reservation DB is that some people have no e-mail address 😛

    • @odintree5704
      @odintree5704 ปีที่แล้ว

      Obviously, you have missed the point of the video. It was a primer on normalization and the example has limited rules to keep it as simple as possible but still show the concept of normalization. The example also does not take into account renovations to existing rooms and many other things. Where do we end and how complicated would you recommend making it for beginners? But if you point me to your video on normalization I may learn something.

  • @rainerausdemspring894
    @rainerausdemspring894 ปีที่แล้ว

    You cannot recommend using 0-9 and a-z only and to use "_".