Once your database availability group has been created and configure the next step is to setup database
replication by adding new mail bugs database copies of existing database and this video will take a
look at how to add mailbox database copies.
You then they exchange management show so how to do it.
Use the ad mail bogus database copy command left to create a copy of an existing database.
You could type at mail box database copy your database for example to be one mailbox server for example
it changed one or in my case alone X1 and activation preference equal into two.
So when running this command a copy of the one database is created on the exchange one server or exchange
to server.
You should replace this with your particular database and server to which you want to make a copy.
When creating a copy of a database on another mailbox server unit to ensure that the server in the same
dock as the mailbox server host in the source mailbox database.
In addition a mailbox Sora can only hold one copy of a given database and the database pass must be
identical on every server in the dog.
So make sure that the disk boss exists on the server or your read and a copy too.
Of course you can remove a database copy using the remove mailbox database copy command let please run
get help remove mail box database copy full for details so when running the ad mailbox database copy
come and let you need to specify the identity of the database and the destination mailbox server that
will be hosting the database.
Copy the activation reference for a database can optionally be set when you create the database copy
the value of the activation preferences one of the criteria used by the two active manager during a
fail over event to determine the best replicated database copied to activate.
Now in order to create and mound data mailbox databases and add database corpus to multiple servers
and a dog several commands must be run from within this shell.
If you do deployments on a regular basis or if you build up and tier down lap environments frequently.
This is a process that can easily be automated with power shell.
The power shall function.
New Dark Mail Box database creates new mail bugs databases from scratch mounts them and then adds passive
copies of each database to the Romanian servers.
You specify the code for this function is as follows.
Lets type function new Dark Mail Box database parameter with set of variables active server passive
sorrow database prefix database count EDI folder press log folder press and now let's use for loop and
use an all these variables then we'll add mail box database copay for rich object.
Once you've added this function to your shell session you can run it to use on the syntax similar to
the following new dock mail box database active Server Exchange 1 passive Server Exchange 2 3 4 and
so on database count 3 database prefix D.B. or MTBE UDP folder should be on drive e in database folder
and log folders should be on drive fee in database folder as well you can specify the folders you wish
here running this function with the given parameters will do a number of things first three new databases
will be created using a prefix of DB Your MDA B for example.
This function will create a database using the same prefix and then number of them in order.
In this example the active Server Exchange 1 will have three new databases created called W1 W2 and
W3.
The passive server parameter needs to have one or more servers defined in this case you can see that
we've added database corpus to the three new databases to each of the passive server specified all databases
and log files on each server will be located in a folder under you drive database in a sub director
that matches the database name in some environments you might find that trying to mount a database immediately
after it was created will fail.
What it boils down to is that the Mount operation is happening too quickly.
If you run into this at a delay before the Mount operation by Iran and start slip down for example before
calling the Mount database command let this will pause the script for 10 seconds.
Given exchange time to catch up and realize that the database has been created before trying to mount
it and this video will take a look at how to remove a database copy using the remove mail box database
corporate command led.
So first I've logged on to the e x 1 server with power shell Direct which is very useful and handed
to available on Server 2016 and above.
So I've typed and or P assertion or it's alias it is Sam.
Then I can type the name of virtual machine to directly connect to this machine.
So I've used a parameter the M name and the name of my exchange server which is x1.
I've also used credentials parameter to specify my credentials which are control so backslash administrator
enter my password and after that I could use the power shell session on X1 server.
I then typed ADP sniping with the exchange in it to add all the snap pins connected or deal and with
exchange power shell module so I could run the commands intended for exchange management.
So first off let's check all the databases on on the exchange environment by type and get mailbox data
database.
As you can see we've got six database for now to be 1 to be 2 and 3 demo databases which we've created
in previous video.
Now we can use the get mail box database corpus status command led and we've got three mounted databases
and two dismounted.
So no let's remove a database copy for Demo 1 database by typing remove mailbox database copy and the
name of the database.
I'll use derma 1 slash e x 1 database copy name.
This will remove the database but you have to remove the files.
The physical files if you need to.
So let's check the files on the X to server and delete them.
With the help of power show for this I'll switch over to another power shall console.
So let me open the console itself and log in to exchange 2 is entropy assertion come on loud so I'll
type it here.
Sam Dash the name X to dash credential control so administrator.
I'll type in my password.
Wait a second I'm on exchange 2 so I'll change the location to the root of C drive by type in city backslash
and I can list the contents of C drive by type in a lessor dear amount or get child item whatever amount
you prefer soil type or less.
And here is a folder of my databases which is database so I'll change location to database folder by
type in city database.
Let's see what's in there.
So the directory for Demo 1 database is demo 1 and it's here as you can see removed by database copy
command just removed the object from active directory.
But no let's remove for the files itself so I'll type our Ram by the way you can always find the aliases
for different commands with get L.A. command.
For example if you don't know the aliases for remove item you could find them by type and get alias
SLAs definition and remove item and it'll reveal all that Ellis is for remove item command and as you
can see a ram is one of them.
So our Ram means to remove the item.
In my case it's derma 1.
Now let's switch over back to X1 server and take a look at some more examples by of you then get mail
box database copy status command land.
So I'm here around lets type get mailed back to the mail box database copy status demo 2 and it'll reveal
the status for damage to the database like name.
As you can see we've got demo to flashy X1 and are two bucks less shakes to the status for one is mounted
and the status for re x2 is healthy.
We've also got corporate Q lands and last inspected log time.
But if what if we want to find out some more details about this database let's return this command can
get mailbox database corporate status.
Demo too and pipe it to select all and we'll got all we'll get all the details on this database.
There are too many of them and I won't review all of them for now.
For now I just need this property active database copy so I need to know for sure which server holds
active database copy and which service called active copy.
So now I can type get mailbox database corpus status them on to select mailbox server and active database
copy properties.
Let me type mailbox server comma active database copy.
And now we know for sure which server halts active database copy and to which servers it's replicated
in this case it's x 2.
Now I know for sure which server to use if I want to remove active mail database copy so I'll type remove
mail box database copy them on to backslash X to for.
I'll run this command was whatever parameter to see what will happen.
And as you can see the result is removal and database copy for database demo 2 on Sora x 2.
Exactly what I needed.