Setup Physical Standby via OEM 13c

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back guys by now you guys might have experienced oem to its full potential we have seen lot of activities and the power of oracle enterprise manager as to how to manage a complete environment but you know guys the oracle enterprise manager can also help you configure a physical standby where you don't have to worry about the manual method and the steps of configuring the standby you and i personally know how much it costs when it comes to configuring a physical standby in a normal environment via manual method think about it what if oem automates the physical standby configuration for you it becomes so simple oem is so powerful that it can actually configure a physical standby for you in this project we will be looking at configuring a physical standby for one server from linux to linux let's go on to the system we are back on to the system guys i am logged into the oracle enterprise manager this is a completely new setup now over here i have only one target if you look at like i have this oem server i have this dev database that is running on a dev server let us look at the database status pimon we can see that dev database is up and running and also guys this dev database is already added as a target to this oracle enterprise manager there are no other targets onto this oem setup i can just type dev hit enter you can see the dev server the agent listener oracle home i mean the database instance all are already added as target to this oem setup our goal is to create a standby database for this dev server on this standby server so this is a new standby server that we are going to configure as a physical standby to the dev database running on the dev server even before we can configure the standby there are some prerequisites that we need to follow the first thing is we need to add the standby server to our oracle enterprise manager because oracle enterprise manager does not recognize that server in order for us to perform the physical standby configuration using oracle enterprise manager we got to have the server on this oracle enterprise manager target list if we don't have that server on this target list we cannot configure the physical standby pretty straightforward our first step in order to configure physical standby for the dev server would be to add this standby server as a target to the oracle enterprise manager so to start with the first thing is we need to edit the atc host file on all the servers so that all the three servers know about each other i'll start with the oem server i'll exit from the oracle user let's open the etc host file let's go to the end of the file and we'll add this standby server 168 1.175 that's the ip address of the standby server stb.dbageness.com stb and guys as i mentioned earlier you don't need to add these details in case if you have a dns server configured already these things will be taken care by the dns server in our environment like in our practice we don't have a dns server so we are doing it by ourselves let's get over here now i can see that dev server and oem details are already added i need to just add the details of the standby server 168 1.175 this is the sdb ebaygenesis.com stp save and close that's done on the standby server open the etc host file i think over here we need to add the details of both the oem server and the dev server so for oem server 192 168 1.171 oem dot dba genesis.com oem and then 192 168 1.172 that is the dev server tbh genesis i think that's correct spelling dev save and close first step is done the next step is we need to install some binaries on this standby server even before we can add this server as a target into the oem server so let us go to our support website and what you can do is let's go to oracle enterprise manager add linux target select this article in this one we can see that add oem server details to edc host file which is already done we don't need to perform this pre-install because guys what i've done is on this standby server we already have the oracle installed and what i've done is the oracle home is same as the dev server so on the dev server where we have this dev database up and running the oracle home is exactly same on the server but the only difference is on the server there is no database running you can see sorry psiphon ef gripmon no database has been configured we have only installed the oracle software the oracle 12c software so we have the oracle 12c software and database running on the dev server but over here we have only installed the oracle home no database configured we will be configuring a physical standby from oracle enterprise manager so we don't need to run this one because i have already done it and these packages are important i mean you've got to install them on any server that you want to add as a target to the oracle enterprise manager awesome guys the packages are installed next what we need to do we need to create this agent directory that will host or that will yes that will host the oem agent so what i'll do is i'll switch to the oracle user and create this directory via the oracle user also what i'll do is i'll just add this directory to the batch profile so that it's available whenever we need it i think i'll just copy it from the batch profile over here export agent home this is the agent home location i'll save this batch profile will execute this once and that's it now we are ready to add the standby server to oracle enterprise manager let's get into setup at target add targets manually we'll go with install agent on host all right we need to add the target server so we'll give the dev server detail sorry the standby server details stb.dbagenesis.com and platform would be linux 8664. click on next now give the installation based directory as the agent directory delete this one not required i'll just delete all this so u01 app oracle agent is what our agent directory is if you want to cross verify you can see we just created the same directory so that would be agent based directory this instance directory would be populating automatically name credentials we know that it is the credentials for the user that owns the oracle software so oracle user is the one that owns the oracle installation give the oracle user password this is for the standby server and run privilege i think nothing for now save as always give a meaningful name so this is stb that's standby underscore oracle underscore user right click on ok also what i'll do is i'll add the root user because i know the credentials so give the root user id and password root all right run privilege i think it won't be applicable save as stb underscore root underscore user click on ok done this one privilege delegation not required deleted port number default click on next make sure everything is fine click on deploy agent so what we are doing right now is guys we are adding the standby server to oracle enterprise manager if you don't add the standby server to oem you cannot configure the physical stand by via oem you will have to configure it manually though we are done the standby server agent deployment is done let's click on done now guys if we go to targets let's go to all targets i'll show you something important let's delete this one all right yeah we have the stb server right we can see that the oracle home discovered over here is the agent home right and the host is discovered the agent software is discovered now if we want to discover an existing oracle database or listener what we used to do we used to go to setup add target add targets manually and then we used to use this ad using guided process now the biggest problem over here is on this particular server the standby server we don't have a database or a listener running so even if you go via this method you won't be able to add or identify the oracle home which is installed on this server so let me show you so we have this oracle home right so dollar oracle underscore homes sorry cd dollar oracle underscore home and just to ls can you see oracle 12c software is already installed but in our enterprise manager if we look at the discovered targets we can only see that the host the agent and the agent home are discovered by the oracle enterprise manager also if i want to discover the oracle home which is already installed we cannot do it via this method because there is no listener or database running that means if we cannot discover the oracle home which is already installed you cannot perform the standby setup now the challenge that we have is how do you tell oem that oracle home already exists on the particular standby server what we do is we go to setup go to add targets and we click this option called as configure auto discovery now when you're under this auto discovery click on this option advanced discovery modules we want to discover an oracle home which is already installed on a target server click on this option oracle home discovery now this will allow you to select on which server do you want to discover i want to discover on the standby server select the standby server and this should be listed over here click on this option stb server click on ok now what oem will do is it will try to discover the oracle home which is installed on the standby server so we'll have to go to setup go to add target and we have to choose this option auto discovery results because right now we have started the auto discovery or we configured the auto discovery but to see the results we have to go into auto discovery results and next we have to come to this option called as targets on the hosts now you won't see any result then just refresh and wait for some time and oem will be able to discover the oracle home on the standby server so guys we waited for a long time but we still don't see that oem is able to discover the oracle home on the standby server that's perfectly normal and it does happen in real time also that oem is not able to identify the oracle home that is installed on the standby server what can you do well try to click on refresh once again just in case it is able to identify but we still see that oem is not able to identify the oracle home what is the next step how do we tell oem that we have an oracle home installed on the standby server let us go to setup click on add target let's go to add targets manually and then at this point you select the third option we want to declare that there is oracle software that is installed click on this option it will allow you to check on which host do you want to discover we want to discover on the standby host select and target type just type oracle and then you should be able to find oracle home we want to discover oracle home right click on add now oem will ask you a couple of questions what name do you want to give to this target so oracle 12c underscore home you can type any name and then i will give the standby server details stb.dbajns.com so this is oracle 12c home on the standby server next i mean guys there are a lot of options but you focus only on the star ones over here it is saying that for oracle home type o i'll just type o path to oracle home i will go to the standby server and then over here we have the oracle home location i'll just copy it that's it you need to provide only three details click on ok and now oem knows that there is one oracle home can you see added oracle home oracle 12c home on the standby server click on close and let's go to all targets over here if you search with stb can you see we have now two oracle homes one is for the agent home and the other one is the actual oracle home that means on the standby server we have discovered the host the agent the host home and the oracle home that is already installed so our standby server is ready but even before we can continue to configure the standby for our dev server there is one step that is important so guys whenever you discover a target which is like not having a database instance or a listener the problem is the agent software that is installed on this particular host will not have a important plug-in if you don't have that plug-in installed for the respective agent on this particular target so we won't be able to configure the standby what we need to do is because while discovering this target we did not have an oracle instance we did not have a listener so oem is smart enough what oem thought that this particular host the standby will not be used for installing oracle so what it did is it installed the agent software without database plugin our next step is to first install the database plugin on this particular agent so that in future when we are creating the standby on the server the database plugin will pick up the database instance and that will allow oem to manage the database instance via the agent so how do we add the plugin go to setup go to extensibility click on plugins now from the list of plugins we want to deploy the database plugin click on this option select this oracle database plugin all right go to deploy on and we need to deploy it onto an agent because the agent that we have installed oem did not add this plugin the reason is there was no database instance running there was no listener running so oem thought that we will never be installing the oracle database on this standby target but we have to add this plugin otherwise we won't be able to manage or create the standby click on management agent now this will just tell you deploy plugin on management agent so go with the latest plugin version whichever it is click on continue this will ask you where do you want to deploy now by default it has selected the standby host because on this i mean the agent that is installed on this server it is not having the database plugin so we'll just continue and this will just tell you prerequisite check click on next and then just select deploy now you can click on show status to look at the deployment status it will take a little time guys you can click on refresh to look at the status over here also you can check the status over here it says running i think sorry deploying done guys so this took a while but you can see all these statuses are green this one is green so we have deployed the database plugin onto the standby server let us recap guys what all we have done so we had this dev server where dev database is running and for this database we are about to configure a physical standby onto a new server that is stb.dbgenesis.com that is acting as our standby server on this standby server we have the same oracle home location where oracle 12c binaries are already installed but no database has been created what we have done is we have added the standby server to oem for monitoring purpose by deploying the agent after deploying the agent we had to discover the oracle 12c home manually because in the auto discovery results it was not able to discover this oracle home that's perfectly fine after discovering the oracle 12c home we had to deploy the database plug-in onto this agent so that in future like whenever we are configuring the physical standby we want the agent to be able to monitor the database so to monitor a database we got to install the database plugin this database plugin deployment this one step we had to do because while we were installing the agent software on this particular host there was no database or no listener up and running so that's why oem thought that we are not going to host any database that being said we are now ready to set up the physical standby for our dev database let us move on we will search for the dev database the database instance dev is up and running let us click on dev alright so now go to availability and choose this option add standby database we are going to add the physical standby to the dev database which will be running on the standby server now first we have to give the database login credentials i will give the login credentials for the dev database says dba user right so let me give the sis password the role would be cisdba save as definitely we want to save it as dev underscore cis underscore user so that defines that it is the sys user we will save it as preferred credentials this dba click on login awesome so we are in the create standby wizard we have to select the first option create a new physical standby database click on continue over here the wizard will allow you to choose whether you want to create the standby from the active database that is currently up and running or do you want to use an existing backup i don't have backup for the dev database i'll be using the live database that is i mean i want oem to perform cloning from the actively running database right so we'll go with the online backup option click on next on this screen you can see the details primary database is dev primary host is dev.dbagenesis.com the primary database files will be copied directly to the standby database oracle home no staging areas are required that means it's a direct copy the degree of parallelism do you want to speed up reduce depends on the size of the database right now it's a test database i think two degree of parallelism is enough that means our man will be allocating two channels that's perfectly fine primary host credentials like you guys already know because in my environment i have already saved the credentials dev underscore oracle user name credentials by default always means the user which owns the oracle installation so dev underscore user that's the name credentials and this is like primary database standby redo log files srls so we'll be going with the default option use oracle managed files for standby redo log files right click on next at this stage we have to give the database location for the standby server we can see that the primary database is dev primary host is dev.dbgenesis.com standby database attributes what is the instance name you want to give now most of the times people choose different instance name for the standby but i prefer to keep it same as the primary you can read it the instance name also referred to as the s id must be unique on the standby host it is not saying that it should be unique in your environment it is saying it must be unique on the standby server itself on the standby server we don't have any other database so we can choose to have the same instance name as the primary so the instance names are same both on primary and the standby database storage will be on file system standby database location so standby database is on the standby host we have to change this one it is not on the dev server so i will select where i want to create the standby select the stb.dbgenesis.com oracle home is by default same as primary but in case if your oracle home is different you can give the oracle home location over here standby host credentials go to the name credential okay it's already there right stb oracle user we had created this user while adding the agent right click on next on the file locations like standby database file locations what we are going to choose is use oracle optimal flexible architecture compliant directory structure we have ofa option or you can select this option keep file names and location the same as the primary database i think this is more convenient the listener configuration this is on the standby database guys on the standby server you can see standby host is stb.dvagencys.com so on the standby server guys like this one i have not configured any listener even listener will be configured by oem for us we don't have to worry i just installed the oracle 12c software that's it nothing else so i want oem to create a listener for me so just type listener name li s t e n e r port number i'll choose one five two one and if this listener does not exist don't worry oem will create one for us click on next all right guys in case if you see this error you can just ignore this one click on continue now standby database parameters what is the database unique name used to set the standby database db unique name parameter which must be unique within the enterprise in your complete enterprise you have to give a unique name i would choose to give it as dev underscore st that means it is the dev server standby database and the target name the display name used by enterprise manager for standby database so within oem what name do you want to give to this standby database it should be dev underscore sd that's a good one right we'll keep the unique name and the target name same next is standby archive locations it's all fine fra area it's in mb so i'll give it as 10 000 that way it becomes 10 gb right automatically delete applied archive redo log files when space is needed this is important option next is use data guard broker make sure you have this checked guys because oem uses data guard broker in order to manage your standby setup so if you want to perform a failover switch over everything will be taken care by data card broker but ultimately oem uses data guard broker to perform those actions on the target servers click on next and i think we are good to perform the standby setup once again you get this warning it just says that the following files already exist and it will be overwritten that's perfectly fine click on continue let us review the summary the target name is dev database name is dev instance name is dev which is running on dev.dbgenesis.com and i am performing a standby database setup so over here the standby name would be dev underscore st but the database name is same as the source can you see dev the instance name is also same as dev right oracle server version 1201 and this will be created on which servers stb.dbagenesis.com right it's a physical standby setup database unique name is dev underscore st and everything is fine click on finish and now oem should start configuring physical standby for you on the standby server can you see it says the standby database creation job has been submitted click on view job to look at the details as to what oem is cooking inside the best idea is guys i actually choose to go with the classic view click on the switch to classic view and over here you can see what exactly is happening inside oem you can quickly keep on refreshing and it says this option is running i'll choose this one source validation it is trying to validate the source click on running to look at what is happening inside we can see it's waiting for the output log we'll choose this option still waiting let us go back it takes little time for the agent software to reflect what's happening on the targets onto the oem so we'll just have to wait for some time all right we can see that source validation is completed you can select this option and we can see that no output for this step that's fine let's go back and we can also see that source preparation is completed click on this option and it should show you what exactly it was trying to prepare go back and then i think we are seeing that destination preparation is going on over here we can see that transfer initialization files you can click on this option initialization transfer files then transfer password files this is also done and currently we can see the destination preparation it's running let's go and look into it what's happening we can see that it's preparing to configure the listener that's good we see that it's starting the target instance and probably now oem will start performing the cloning all right meanwhile let's go back and see what's happening we can see duplicate database step is running click on this running option and we'll have to wait for the output let us click on this 30 seconds refresh and we'll wait for oem to give us some output on duplicate database all right we can see that our man has started and armand cloning is running also let us look at okay it says recovery manager completed okay we see that this step is completed right let's go back all right we see that oem has completed all these steps in configuring the physical standby right but we still see these status as running we'll wait for some more time guys until the status shows as completed because oem will need to bounce the standby database and then also start the mrp process we'll have to wait for some more time until the status shows as completed all right guys we can see that now the status is succeeded and for a very simple small test database it took 8 minutes and 42 seconds for oem to configure a physical standby and what we have done i think we just provided the input details of the target server and oem took over all the headache of performing the cloning setting up the physical standby also starting up the mrp process our job now is to log into the physical standby and check and also verify whether the data guard setup is perfectly fine or not let's clear the screen i'm on to the standby server let's clear once again sql plus slash ssdba all right it says connected to idle instance i think i need to export the correct sid env crep aura okay the oracle side is set to prod what i'll do is i'll export oracle under so sid equal to def right also guys if we check the psiphon ef grip pmon we see that dev instance is already running but this is on the standby server be very careful in our case the pimon that is running on the okay let me okay this pmon running on the dev server is also dev and over here also we have the dev sid p1 but both are running on different servers be very careful now let us get into sql plus slash assist dba the first condition for a physical standby is it will be in mount mode so let us select name comma open underscore mode from v dollar database we can see this is in mounted state also guys on our support website we have a great article about physical standby setup so i'll just open this article and show you the different queries to verify whether we have set up a physical standby or not you can see oracle data guard physical standby configuration open this article and scroll down to [Music] okay this is build standby scroll down verify standby configuration you can see on standby start mrp command i think mrp is already running we will check it in some time you can also run these commands but more importantly i am interested in this command select process status sequence number from v dollar manage standby let us run this over here and we can see mrp is applying log number nine what i'll do is go to the dev server let's get into the database and i want to check which archive log number is running so archive log list okay before that select name comma open underscore mode from v dollar database you see that this database is in read write mode and archive log list we see that ninth archive log is currently being generated right so let us perform couple of log switches and see whether the generated log files are being applied on standby or not so alter system switch lock file will do a couple of log switches and i'll directly go to standby rerun this command can you see waiting for gaap it is waiting for lock number 14 run it once again applying log number 15 can you see so our physical standby setup is verified it is working perfectly fine that was an amazing project guys we configured physical stand by using oem from one linux server to another linux server but this project does not end over here i want to give you an assignment and what you guys need to do is in your practice when you configure the physical standby i want you guys to perform a switch over using oem and try to see whether oem can help you perform the switch over one hint i want to give you is remember while we were configuring the physical standby oem uses data guard broker to manage your physical standby setup that's the hint now that you have your physical standby setup done i want you guys to go ahead and try to perform a switch over using oracle enterprise manager and i will see you all in the next video bye
Info
Channel: DBA Genesis
Views: 1,875
Rating: undefined out of 5
Keywords: oracle database, database administration, dba
Id: Phpm4cfVu7M
Channel Id: undefined
Length: 38min 40sec (2320 seconds)
Published: Sun Mar 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.