<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5085850589914248681</id><updated>2026-10-05T11:16:02.610+02:00</updated><category term="rac"/><category term="ORA-27123 shared memory IBM AIX Error 13 Permission Denied"/><category term="Oracle index administration data warehouse"/><category term="RAC startup problem no logging"/><category term="SAN"/><category term="aix"/><category term="asm"/><category term="asm views under the hood"/><category term="cluster"/><category term="crs"/><category term="dbca"/><category term="monitor"/><category term="oprocd"/><category term="performance"/><category term="prkp"/><category term="reboot"/><category term="reorganize"/><category term="resource"/><category term="script"/><category term="sga_target asmm amm"/><category term="shrink"/><category term="space"/><category term="stripe"/><category term="table"/><category term="unident of disk asm"/><category term="use oracle configuration manager"/><title type='text'>Managing Oracle</title><subtitle type='html'>This blog is about Managing Oracle databases, a day-to-day job for many.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-2000673034709613208</id><published>2025-01-27T10:13:00.004+01:00</published><updated>2025-01-27T15:34:45.666+01:00</updated><title type='text'>Remove a lot of data from a table (4 ways)</title><content type='html'>Deleting old historical data or test data from a database is one of these DBA jobs that may be boring, but may also need sufficient attention and care.&amp;nbsp;&lt;br /&gt;There are three ways to delete massive amounts of data, one more care full. than others:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Truncate&lt;br /&gt;The easiest and most destructive way of deleting data is truncating a table. A truncate command is like cutting down a tree: It simply cuts away all data from a table and leaves it empty. It is unreversible, there is no UNDO saved.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Truncate has two options to either release all reserved space of a table or to keep it, for reallocation of new data.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; truncate table massive_table drop storage;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will empty the table and release all occupied storage in the datafiles, to be used by other objects. When new data is inserted into the table, it may be less fragmented, depending on the overal fragmentation of the datafiles.&lt;br /&gt;&lt;br /&gt;The other option is:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; truncate table massive_table&amp;nbsp;reuse storage;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will empty the table, but keep the allocated storage. This is quite use full for tables that hold huge amounts of data during a batch process or repeating process. When storage is reused, the database does not need to reallocate it, when data is inserted into the table again.&amp;nbsp;&lt;br /&gt;The data in the table will be as fragmented as it was before.&lt;br /&gt;&lt;br /&gt;There is also an extra option &quot;cascade&quot;. This can be added to the statement when foreign keys are used referencing other tables:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; truncate table massive_table&amp;nbsp;drop storage cascade;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;CTAS&lt;br /&gt;Create Table As Select is probably the most safe way when deleting huge amounts of data. It can be used to save the data to be deleted into a backup table before a truncate is executed. It is also possible to create a new table with &quot;data to keep only&quot; and use that table instead of the old one, by e.g. renaming it:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; create table data_to_keep as &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;select * from massive_table &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where year &amp;gt;= to_date(&#39;01-01-2010&#39;,&#39;dd-mm-yyyy&#39;);&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; drop table massive table purge;&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; alter table data_to_keep rename to massive_table;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember to add Indexes afterwards if they existed and recalculate statistics.&lt;br /&gt;&lt;br /&gt;It is also possible to truncate the massive_table and reinsert the saved data back into it:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; create table data_to_keep as&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select * from massive_table&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where year &amp;gt;= to_date(&#39;01-01-2010&#39;,&#39;dd-mm-yyyy&#39;);&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; truncate table massive table drop storage;&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; insert into massive_table (select * from data_to_keep);&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; commit;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Partitioning&lt;br /&gt;Another way to delete massive amounts of data on a more regular basis is the use of partitioning. Partitioning is only available in an Enterprise Edition database and it needs a separaten license.&amp;nbsp;&lt;br /&gt;It requires to think over the partitioning clause. If in the future data is to deleted based on a year, it is not smart to partition e.g. on company name.&lt;br /&gt;It interval-partitioning is not used (see &lt;a href=&quot;https://managingoracle.blogspot.com/2012/05/interval-partitioning.html&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;article), then partitions to be deleted can be found using:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; select &#39;select count(*) from pohead_his partition (&#39;||partition_name||&#39;) ;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;from user_tab_partitions where table_name=&#39;MASSIVE_TABLE&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;and partition_name like &#39;%2010&#39;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;This generates a list of statements to drop the partitions from the table&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Filtered Move&lt;br /&gt;Probably the easiest way to delete massive amounts of data the quickest way is a filtered move. In this way the table is rebuild with only the data that is needed to be kept.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The statement to do this, also has options to do this &quot;online&quot; ( Enterprise Edition only) and to update the indexes automatically.&lt;br /&gt;The statement:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; alter table massive_table &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;move online&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;update indexes&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;including rows&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where year&amp;nbsp;&amp;gt;= to_date(&#39;01-01-2010&#39;,&#39;dd-mm-yyyy&#39;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;This statement rebuilds the massive_table and deletes all data that have a year older than Jan. 1st of 2010.&amp;nbsp;&lt;br /&gt;Since an &quot;alter table move&quot; is a DDL action, an implicit commit is executed.&amp;nbsp;&lt;br /&gt;So, there is no way back. It is as effective as the CTAS option, but way more easier and faster.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;This concludes this blog entry. Hopefully it helps</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/2000673034709613208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2025/01/remove-lot-of-data-from-table-3-ways.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2000673034709613208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2000673034709613208'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2025/01/remove-lot-of-data-from-table-3-ways.html' title='Remove a lot of data from a table (4 ways)'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-4488992146184495868</id><published>2025-01-27T09:00:00.003+01:00</published><updated>2025-01-27T09:00:42.854+01:00</updated><title type='text'>Generate Reset Password statements</title><content type='html'>&lt;p&gt;&amp;nbsp;A lot of companies we as DBA&#39;s work for have Test- and Development databases that are based on a copy of a Production database. Every time a lower environment databases is refreshed with a copy of production, there are always post-clone steps needed, to convert the production data into test- or development-data. A nice article to make this action easy can be read&amp;nbsp;&lt;a href=&quot;https://managingoracle.blogspot.com/2022/11/refreshable-pdbs-dr-setup-made-easy.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;One of these post-clone steps is a reset of passwords for all user accounts. Passwords on the lower environments should not be the same as on the production database.&lt;br /&gt;Before a test- or development database is refreshed, it is smart to retrieve and keep all passwords of user accounts of the old copy of these databases and restore them after the refresh.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Below a script is listed that generates &quot;ALTER USER...&quot; statements for all users in the database, except the common-users. It is known that resetting a password for a common user can only be done on the CDB level and not on the PDB level, so they are excluded.&lt;/p&gt;&lt;p&gt;The script makes use of a database directory called TMPDIR, that points to &#39;/tmp&#39;. First create this directory:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; CREATE DIRECTORY TMPDIR AS &#39;/tmp&#39;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; GRANT READ,WRITE ON DIRECTORY TMPDIR TO CLONE_USER;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;It is assumed the one knows that grants have to be set before one can create a directory, or that one asks someone else (the DBA) to create a directory for him/her. The user CLONE_USER is a fictive user, e.g. the user that performs the post-clone actions.&lt;/p&gt;&lt;p&gt;Before the old copy of the Test-/Development database is destroyed/replaced, run this script, to save the old passwords.&lt;/p&gt;&lt;p&gt;The script:&lt;br /&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;declare&lt;br /&gt;&amp;nbsp; &amp;nbsp; cursor userlist is&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select username&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from&amp;nbsp; &amp;nbsp;dba_users&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where&amp;nbsp; &amp;nbsp; &amp;nbsp; common = &#39;NO&#39;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; l_usercmd varchar2(500);&lt;br /&gt;&amp;nbsp; &amp;nbsp; l_query&amp;nbsp; &amp;nbsp;varchar(500);&lt;br /&gt;&amp;nbsp; &amp;nbsp; fd&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utl_file.file_type;&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp; &amp;nbsp; -- Open SQL output file&lt;br /&gt;&amp;nbsp; &amp;nbsp; fd := utl_file.fopen(&#39;TMPDIR&#39;, &#39;ResetUserPasswords.sql&#39;, &#39;W&#39;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; for r1 in userlist&lt;br /&gt;&amp;nbsp; &amp;nbsp; loop&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Generate CREATE USER command for every user&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_usercmd := dbms_metadata.get_ddl(&#39;USER&#39;, r1.username);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Reformat query so it can be used to reset the password&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; l_query&amp;nbsp; &amp;nbsp;:=&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trim(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; replace(replace(replace(substr(l_usercmd, 1, instr(l_usercmd, &#39;DEFAULT&#39;) - 1), &#39;CREATE&#39;, &#39;ALTER&#39;) || &#39;;&#39;, chr(10), &#39;&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , chr(13)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , &#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Write the query into the SQL file&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; utl_file.put_line(fd, l_query);&lt;br /&gt;&amp;nbsp; &amp;nbsp; end loop;&lt;br /&gt;&amp;nbsp; &amp;nbsp; utl_file.put_line(fd, &#39;quit;&#39;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; utl_file.fclose(fd);&lt;br /&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When successfully finished, a script &quot;ResetUserPassword.sql&quot; can be found in /tmp.&lt;br /&gt;Execute this script on the new copy of the Test-/Development database.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/4488992146184495868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2025/01/generate-reset-password-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4488992146184495868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4488992146184495868'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2025/01/generate-reset-password-statements.html' title='Generate Reset Password statements'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-2783279277100643235</id><published>2025-01-22T11:26:00.140+01:00</published><updated>2025-01-27T08:24:07.410+01:00</updated><title type='text'>Password rollover time</title><content type='html'>&lt;p&gt;A new security feature announced for Oracle 23ai has been back ported to 19c as of RU 19.12. &lt;br /&gt;The feature offers the possibility to keep using an old password for a certain period after a new password for an account was set. This feature is called &quot;Password Rollover Time&quot;.&lt;/p&gt;&lt;p&gt;And it is great!!&lt;br /&gt;&lt;br /&gt;Now whenever an application account gets the password changed, one can postpone the update of the application itself to a moment where downtime can be planned. The same with regular users: If a user changes his/her password and the next day forgot that they did, they still can login with the old password. Sounds pretty cool, but the first question would be: &lt;br /&gt;How about security ?&lt;br /&gt;Allowing users to logon with an old password lowers the level of security, doesn&#39;t it?&lt;/p&gt;&lt;p&gt;It does not!!&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;When a password life time is used, forcing users to change their password after a given amount of time, there is also a grace time set, within which a password must be changed before it expires.&lt;br /&gt;&lt;br /&gt;If the user changes his/her password, a kind of extra grace period added for the user or the application owner to have the new password configured in all their applications before the new password becomes valid definitely.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Password Rollover Time is controlled by the profile a user has. The value entered is a numeric value and ranges from 0 to 60 days. When set to the default, being 0, the functionality is disabled.&amp;nbsp;&lt;br /&gt;Setting/Enabling this functionality is done by setting a non-zero value like :&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ALTER PROFILE USER_PROFILE LIMIT PASSWORD_ROLLOVER_TIME 10;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This gives a user 10 days to still keep using their old password after a password has been changed. &lt;br /&gt;So the value given is in days. To set the value e.g. to 6 hours enter the value as following:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ALTER PROFILE USER_PROFILE LIMIT PASSWORD_ROLLOVER_TIME 6/24;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;background-color: #ffe599; color: #cc0000;&quot;&gt;Important: &lt;/span&gt;&lt;br /&gt;When also the PASSWORD_GRACE_TIME and PASSWORD_LIFE_TIME are used in the same profile, the maximum number or days for PASSWORD_ROLLOVER_TIME can not be greater than the PASSWORD_GRACE_TIME. &lt;br /&gt;This is expected, otherwise password life time would be extended.&lt;br /&gt;Also, if you try to set PASSWORD_ROLLOVER_TIME to a value larger than PASSWORD_GRACE_TIME an error is thrown:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;gt;&amp;gt; ALTER PROFILE KRG_USERS LIMIT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;PASSWORD_GRACE_TIME 10&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;PASSWORD_ROLLOVER_TIME 20&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;Error at line 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ORA-02377: invalid profile limit PASSWORD_ROLLOVER_TIME&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The timer will start at the first login after a password has been reset. The last date/time when the password was reset, can be seen in the dba_users table.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Also, when a password rollover has been enabled from the profile, the account status for that users changes from &quot;OPEN&quot; to &quot;OPEN &amp;amp; IN ROLLOVER&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;An example:&lt;/div&gt;&lt;div&gt;Create a profile that has grace_time, life_time and rollover_time for a password set:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;CREATE PROFILE PWROLLTIME LIMIT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; PASSWORD_GRACE_TIME 7&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; PASSWORD_LIFE_TIME 90&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; PASSWORD_ROLLOVER_TIME 6;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create a user that uses this profile:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;CREATE USER ORCL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; IDENTIFIED BY P0wer_Rail&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; DEFAULT TABLESPACE USERS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; TEMPORARY TABLESPACE TEMP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; PROFILE PWROLLTIME&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; ACCOUNT UNLOCK;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT CREATE SESSION TO ORCL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ALTER USER ORCL QUOTA UNLIMITED ON USERS;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now when the password is changed, either by the user, or by and administrator, the account status in dba_users changes:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; ALTER USER ORCL IDENTIFIED BY ELEC_TR4IN;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; SELECT USERNAME, ACCOUNT_STATUS, PASSWORD_CHANGE_DATE&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;FROM&amp;nbsp; DBA_USERS WHERE USERNAME=&#39;ORCL&#39;;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;USERNAME&amp;nbsp; &amp;nbsp;ACCOUNT_STATUS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PASSWORD_CHANGE_DATE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;---------- -------------------------------- --------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ORCL &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;OPEN &amp;amp; IN ROLLOVER&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22-JAN-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;1 row selected.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Following the created profile, this state will remain for the coming 6 days. After 6 days the account_status will change back to &quot;OPEN&quot; and the old password will not be valid anymore.&amp;nbsp;&lt;br /&gt;If within these 6 days the password of this user is changed again, then first change password is not valid anymore. Within one period of PASSWORD_ROLLOVER_TIME, always the oldest and most new password are valid;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So if we would issue another password change within the 6 days, on the account above:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; ALTER USER ORCL IDENTIFIED BY ORACLE_4U;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;then the user can login using the passwords &lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;P0wer_Rail&lt;/span&gt; and &lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ORACLE_4U&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the example above these two password will both be valid until Jan 28th.&lt;/div&gt;&lt;div&gt;If in the period between now and Jan 28th the rollover time in the profile is changed, the validness of the passwords is adjusted accordingly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/2783279277100643235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2025/01/password-rollover-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2783279277100643235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2783279277100643235'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2025/01/password-rollover-time.html' title='Password rollover time'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-2288117840534322283</id><published>2025-01-09T11:52:00.008+01:00</published><updated>2025-01-09T12:10:16.627+01:00</updated><title type='text'>Restore database from NFS storage   </title><content type='html'>&lt;p&gt;In this blog the restore of an Oracle database is described. The database was, before it got
lost, daily backed up to an NFS mounted storage device. Next to that, every 10
minutes backups of the archived log files were created.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Starting
point:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;text-indent: -18pt;&quot;&gt;Clean
installed VM, no database running&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;File
systems created and sized to needed size&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;No
DB, no spfiles etc. found on the system&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;





&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot;&gt;Steps:&lt;/p&gt;&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Set ORACLE_SID&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Mount NetApp storage for this database under
/mnt/backup/$ORACLE_SID&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Find newest backup file that contains the spfile
and restore it&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt; text-indent: 18pt;&quot;&gt;ls -lrt /mnt/backup/$ORACLE_SID/c*&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;If you do not have a valid
spfile or init.ora RMAN has the ability to nomount an instance without the
requirement of a spfile. This will allow you to restore your spfile from a
valid backup.&lt;/p&gt;&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;$ rman target /&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
( do not connect to the recovery catalog, as it will not find this forcefully
started instance)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt; startup nomount force;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;To be able to restore the
spfile, we do need the DBID for the database to be restored. Use SQLplus and query
the DBID from the RMAN catalog;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;SQL&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;select db_id from&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;db where reg_db_unique_name=&#39;DBAPRDC&#39;;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;text-indent: -18pt;&quot;&gt;Return
to RMAN and execute the following statements:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt;
set DBID=&amp;lt;ID from query&amp;gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt;
restore spfile from ‘&amp;lt;file found in ls -lrt command&amp;gt;&#39;;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo2; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-ascii-font-family: Aptos; mso-bidi-font-family: Aptos; mso-fareast-font-family: Aptos; mso-hansi-font-family: Aptos;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;-&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Shutdown
the database and restart &lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;it in nomount
using the restored spfile and then connect to the RMAN catalog:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt; shutdown
immediate;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-ansi-language: EN-US;&quot;&gt;
RMAN&amp;gt; startup nomount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;Quit RMAN and restart using the recovery catalog;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;rman target / rcvcat
/@tsmora&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;text-indent: -18pt;&quot;&gt;Restore
the controlfiles from the same backup file that held the spfile:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt;
restore controlfile from ‘&amp;lt;file found in ls -lrt command&amp;gt;’;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;The control files are automatically
restored to the correct location.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Restore and recover database&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Now it is time to restore and recover the
database. &lt;br /&gt;
Since we assume that we don’t have anything but the backup of the database, a
full recovery is not possible as we are missing the latest redo information
from the online redo files. We do have to recovery with the amount of redo we
have from archived log backups:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-ansi-language: EN-US;&quot;&gt;RMAN&amp;gt; alter database mount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-ansi-language: EN-US;&quot;&gt;RMAN&amp;gt; restore
database;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-ansi-language: EN-US;&quot;&gt;RMAN&amp;gt; recover
database until available redo;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;Depending on the database size, this may take a
while.&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;text-indent: -18pt;&quot;&gt;Open
the database using RESETLOGS, to let the new redo-log file being created:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;RMAN&amp;gt; alter database
open resetlogs;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;margin-left: 18.0pt;&quot;&gt;That completes the restore of the database.&lt;br /&gt;Remember that the last couple minutes between the latest archivelog backup and
the point in time where database got lost are gone. Data inconsistencies may therefore
exist.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/2288117840534322283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2025/01/restore-database-from-nfs-storage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2288117840534322283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/2288117840534322283'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2025/01/restore-database-from-nfs-storage.html' title='Restore database from NFS storage   '/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-6902271424323572438</id><published>2024-07-10T15:09:00.004+02:00</published><updated>2024-07-10T15:09:39.188+02:00</updated><title type='text'>Runinstaller -silent on AIX not so silent at all</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;A short blog-entry about running an unattended
installation of Oracle 19c on AIX. With previous releases we have never seen
this issue whereas an unattended installation completed without an issue.&lt;br /&gt;
One expect the installation to be silent, not asking anything at all and completing
the installation using a given response file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;On 19c however, the runinstaller asks if
you have run the rootpre.sh, even if you have specified the “-silent” option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;To solve this problem, echo a “Y” into a
pipe and pass it to the runinstaller script, like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; line-height: 107%;&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;echo “y” | runinstaller -silent -ignorePrereq
-waitforcompletion \&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;-responseFile oracle-db-software-install.rsp&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/6902271424323572438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2024/07/runinstaller-silent-on-aix-not-so.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/6902271424323572438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/6902271424323572438'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2024/07/runinstaller-silent-on-aix-not-so.html' title='Runinstaller -silent on AIX not so silent at all'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-162953474487513808</id><published>2024-03-22T13:38:00.006+01:00</published><updated>2024-03-26T10:43:23.529+01:00</updated><title type='text'>Central Unified Audit Trail</title><content type='html'>&lt;p&gt;With the increasing risk of being hacked, suffering from ransomware attacks, the deployment of and activation of Unified Auditing on databases is highly recommended.&lt;/p&gt;&lt;p&gt;But, when being responsible for a lot of databases, all the Unified Audit data needs to be checked, maintained and where possible archived.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjvEbbUaSbePH43G63b2BQAh_yN-aEG-N09vipaXF5n8dGCVw9e4iQLsIacMkZXpN6YwSJDABMHAqpCxYHeEnktQmiZAVMvRSKIFRZqh091CW3vQuPQ8h6tLENXycz8yVO6EGYkWaiK5IfP55rV_zbO72f_WpmoxD19OThpzmMtOgvid-NwV60w_9fNbgM&quot; style=&quot;clear: left; display: inline; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;462&quot; data-original-width=&quot;527&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjvEbbUaSbePH43G63b2BQAh_yN-aEG-N09vipaXF5n8dGCVw9e4iQLsIacMkZXpN6YwSJDABMHAqpCxYHeEnktQmiZAVMvRSKIFRZqh091CW3vQuPQ8h6tLENXycz8yVO6EGYkWaiK5IfP55rV_zbO72f_WpmoxD19OThpzmMtOgvid-NwV60w_9fNbgM&quot; width=&quot;274&quot; /&gt;&lt;/a&gt;In this blog we will describe the setup of a central repository to be used for unified auditing. This setup is only valid for databases using the multitenant setup, and therefore are running on 12.1 and higher.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Oracle has the DataVault solution available that is also able to collect this kind of information in a central location. With many databases however, a DataVault license can become a costly challenge.&lt;br /&gt;That is why we investigated a manual solution.&lt;br /&gt;The idea of this solution is as in the picture.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;All databases have Unified Auditing enabled and send on regular intervals their Audit data to this Central Table in a central database.&lt;br /&gt;&lt;br /&gt;What is needed to get this correctly setup:&lt;br /&gt;1) A central database with sufficient free space&lt;br /&gt;2) A user in this database to hold the central repository table&lt;/p&gt;&lt;p&gt;3) A common user in all other databases&lt;br /&gt;4) A database link for this common user, connecting to the central database using the repository user.&lt;br /&gt;5) A procedure to regularly send Audit data to the central repository table.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;1) The central database is preferably a Enterprise Edition database with the partitioning option enabled. Collecting Unified Auditing data can make a table grow very fast, especially in a average used environment. Preferably create a seperate PDB for this repository, to prevent other users from being able to read this data.&lt;/p&gt;&lt;p&gt;2) The user in this database needs to have a strong password but no special rights to be able to hold the repository table. CREATE TABLE rights and a tablespace quota are the only rights necessary.&lt;br /&gt;It is recommended to create a partitioned table with the same structure as the CDB_UNIFIED_AUDIT_TRAIL table that resides in the CDB of each database and contains Auditing data for every open PDB. Preferably add two extra columns to this table, for the CDB name and PDB names of the remote databases.&amp;nbsp;&lt;/p&gt;&lt;div&gt;3) In the remote databases create a common user in the root-container. This user is going to collect the Unified Audit data for all PDB&#39;s and write this to the central table. It is recommended to send data over per PDB, instead of the whole table at once. Remember that whenever a PDB is closed, the data for that PDB can not be read from this table, so when looping thtough the PDB&#39;s you will not miss any data when e.g. a PDB is temporarily down.&lt;/div&gt;&lt;div&gt;What to write to this central repository is depending on what is already there. We use the max(event_timestamp) value found in the destination table to determine what data has to be copied.&lt;br /&gt;The first run will therefore take the most time, as there is no max(event_timestamp) found yet at the destination. A creation script would look like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;CREATE USER C##AUDIT_AP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; IDENTIFIED BY &quot;&amp;lt;some complex password&amp;gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; HTTP DIGEST DISABLE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; DEFAULT TABLESPACE UNIAUDITD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; TEMPORARY TABLESPACE TEMP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; PROFILE C##KRG_DB_MGMT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; ACCOUNT UNLOCK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; ;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT CREATE SESSION TO C##AUDIT_AP;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT AUDIT_VIEWER TO C##AUDIT_AP;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ALTER USER C##AUDIT_AP DEFAULT ROLE ALL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT CREATE DATABASE LINK TO C##AUDIT_AP;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT CREATE PROCEDURE TO C##AUDIT_AP;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT CREATE TABLE TO C##AUDIT_AP;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT SELECT ON CDB_PDBS TO C##AUDIT_AP CONTAINER=ALL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;GRANT SELECT ON CDB_UNIFIED_AUDIT_TRAIL TO C##AUDIT_AP CONTAINER=ALL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;i&gt;ALTER USER C##AUDIT_AP SET CONTAINER_DATA = ALL FOR CDB_UNIFIED_AUDIT_TRAIL CONTAINER=CURRENT;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;i&gt;ALTER USER C##AUDIT_AP SET CONTAINER_DATA = ALL FOR CDB_PDBS CONTAINER=CURRENT;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;ALTER USER C##AUDIT_AP QUOTA UNLIMITED ON UNIAUDITD;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Please note the two lines in bold, that give this user special rights to read these two container tables&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4) The common user has its own private database link connecting to the repository database. This makes sure that the repository data is secure from unwanted access by other users.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5) Finally a procedure is needed to regularly copy the audit data over to the repository.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some remarks on where to pay attention:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- The cdb_unified_audit_trail table differs per database version and even per patchlevel when on 19c. This means that all inserts have to have a complete specication of which colums to take into account.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- Running an inline query in a procedure to get the max(event_timestamp) from the repository for a certain PDB always resulted in a NULL value. We solved this by using an execute immediate, but we were unable to explain the why.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Feel free to send me a message on this topic, if you would like to have a copy of the procedure we have written.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/162953474487513808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2024/03/central-unified-audit-trail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/162953474487513808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/162953474487513808'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2024/03/central-unified-audit-trail.html' title='Central Unified Audit Trail'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjvEbbUaSbePH43G63b2BQAh_yN-aEG-N09vipaXF5n8dGCVw9e4iQLsIacMkZXpN6YwSJDABMHAqpCxYHeEnktQmiZAVMvRSKIFRZqh091CW3vQuPQ8h6tLENXycz8yVO6EGYkWaiK5IfP55rV_zbO72f_WpmoxD19OThpzmMtOgvid-NwV60w_9fNbgM=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-8080898650222706783</id><published>2024-01-12T09:43:00.003+01:00</published><updated>2024-01-12T09:43:54.170+01:00</updated><title type='text'>Dataguard Setup</title><content type='html'>&lt;div&gt;1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;General information&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With the ever increasing level of security, the need to keep up to date with the latest patches of the Oracle database also increases.&lt;/div&gt;&lt;div&gt;Patching of an Oracle database becomes easier and easier with the release of Oracle 19c and the AutoUpgrade tool, but that subject is covered in another document.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this document we describe the setup of a Dataguard environment and the patching of it. At Kramp we use Dataguard for the RMAN catalog database, to ensure that this database is always available. The RMAN catalog database is a very important database, as without it backups of a database can not be created.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next to the setup of the Dataguard environment we will describe the patching of it. Understandably it differs from patching a Single Instance database, because of the redo apply process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that in normal situations the use of dataguard is a licensed option. Since we however use it here on the database used for the RMAN catalog, which is a free-to-use database, also the use of dataguard is free of charge.&lt;/div&gt;&lt;div&gt;Note that we’re talking here about standard dataguard. Active dataguard where a standby database would be opened up read-only is a must-license feature always.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This document does not cover the contents of the database involved in this setup. &lt;/div&gt;&lt;div&gt;2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Setup of Dataguard&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this section the setup of the dataguard environment is described. In the examples the setup of the test environment for the RMAN catalog database is used for the screenshots and statements.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The basic setup of the environment consists of two Linux servers:&lt;/div&gt;&lt;div&gt;vtl1g002: the primary server, running an Oracle 19c EE database&lt;/div&gt;&lt;div&gt;vtl1g003: the secondary server, running the exact same Oracle version&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is important for a Dataguard setup that both primary and secondary servers run the same Oracle version and patch level.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the primary server an empty database is created in the CDB/PDB setup called TSMT01C.&lt;/div&gt;&lt;div&gt;The OSuser for this installation is called “tsmt01”, so all file system locations are based on the Kramp standard:&amp;nbsp; /opt/tsmt01/xxx&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the below sub sections the setup is explained in steps.&amp;nbsp;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;2.1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Enable archive logging&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dataguard relies on the shipping of redo information from primary server to the secondary server. To support this, both the primary and secondary server databases must have archived log mode enabled.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Start SQLplus on the primary server database and execute the following commands:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;shutdown immediate;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;startup mount;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;alter database archivelog;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;alter database open;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After enabling archivelog mode, make sure the database is backed up and archived logfiles are cleaned out.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After that the database must be set into Force Logging mode, so that all actions done on the database will result in redo-generation, even if a statement uses the NOLOGGING option.&amp;nbsp;&lt;/div&gt;&lt;div&gt;To enable force logging, execute the following statement:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;alter database force logging;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;alter system switch logfile;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Create standby logfiles&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now create standby redo logs on the primary database in case of switchovers. The standby redo logs should be as big as the largest online redo logfile and there should be one extra group per thread. In our case we have 6 online redo file of 200Mb each.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This means we create 7 standby redo logs of the same size. They will be located in a subdirectory of the online log location.&amp;nbsp;&lt;/div&gt;&lt;div&gt;First create this directory on both the primary and secondary server:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ mkdir /opt/tsmt01/re01/standby&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Now we can create standby log file from within SQLplus.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This is only done on the primary database, as we will copy this database in a later step completely to the secondary server:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby01.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby02.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby03.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby04.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby05.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby06.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby07.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.3.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Initialization Parameters&lt;/div&gt;&lt;div&gt;For a dataguard solution both the primary &amp;amp;amp; standby databases should have the same name (db_name).&lt;/div&gt;&lt;div&gt;They should however distinguish themselves based on db_unique_name.&amp;nbsp;&lt;/div&gt;&lt;div&gt;In our case, the primary database is in the Amsterdam datacentre and will therefore be called TSMT01C_AMS. The standby is located in the Enschede datacentre and is called TSMT01C_ENS.&lt;/div&gt;&lt;div&gt;In this step we will already name the primary instance. After we copy the primary to the standby server, we will rename it then,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter system set db_unique_name=’TSMT01C_AMS’ scope=spfile;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bounce the database to activate the above change.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next parameter to be changed is “standby_file_management”. When set to “AUTO”, it makes sure that a physical change on the primary database, like adding or extending an tablespace is also reflected to the standby database.&lt;/div&gt;&lt;div&gt;This parameter is dynamic, so it does not need a restart (again):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter system set standby_file_management=AUTO scope=both;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enable this both on the primary and on standby database as this feature should also work after a failover or switchover.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If this parameter is not set to AUTO is will result in redo-apply on the standby server being unable to apply changes when dataguard is up and running.&lt;/div&gt;&lt;div&gt;If e.g. a tablespace is added on the primary database, the datafile(s) belonging to that new tablespace will not be present on the standby server. If this happens, the below error is seen in the DGMGRL console when looking at the configuration.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DGMGRL&amp;gt;; show configuration;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration - tsmt01c_config&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Protection Mode: MaxPerformance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Members:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; tsmt01c_ams - Primary database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; tsmt01c_ens - Physical standby database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Error: ORA-16766: Redo Apply is stopped&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Fast-Start Failover:&amp;nbsp; Disabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration Status:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ERROR&amp;nbsp; &amp;nbsp;(status updated 37 seconds ago)&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.4.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Duplicate the database&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the database is shutdown, then first copy the contents of the spfile into a pfile.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; create pfile from spfile;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;File created.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Change directory to the $ORACLE_HOME/dbs directory and copy the pfile to the standby server:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ scp initTSMT01C.ora&amp;nbsp; vtl1g003:`pwd`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the standby server copy the created initfile to ‘/tmp’ for use with RMAN as temporary initfile.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ cp /opt/tsmt01/ora/19.0.0.0/dbs/initTSMT01C.ora&amp;nbsp; /tmp/inittemp.ora&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now start the instance on the standby server in NOMOUNT mode&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; startup nomount pfile=’/tmp/inittemp.ora’;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then use RMAN on the standby server connecting to the primary database as target and to the -to be- standby as auxiliary.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ rman target sys/&amp;lt;password&amp;gt;@tsmt01c_ams&amp;nbsp; auxiliary sys/&amp;lt;password&amp;gt;@tsmt01c_ens&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Issue the following RMAN commands to copy the database:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;duplicate target database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; for standby&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; from active database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; dorecover&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; spfile&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; set db_unique_name=&#39;TSMT01C_ENS&#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; nofilenamecheck;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note the option “for standby”, telling the duplicate command that this database is used for a standby database. It will thus not change a DBID after the clone.&lt;/div&gt;&lt;div&gt;The duplicate command can ofcourse be extended with db_file_name_convert or log_file_name_convert options, if needed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Wait for the command to finish before continuing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally create a password file on the standby server, with the same password as used for SYS on the primary database server.&lt;/div&gt;&lt;div&gt;Preferably we copy the password file from the primary server to the standby server, to make sure that it contains the same password.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On primary server:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ cd $ORACLE_HOME/dbs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ scp orapwTSMT01C&amp;nbsp; &amp;nbsp;vtl1g003:`pwd`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As soon as the standby database has been created, add the same standby logfiles as on the primary:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby01.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby02.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby03.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby04.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby05.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby06.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;alter database add standby logfile ‘/opt/tsmt01/re01/standby/tsmt01c_stdby07.log’ size 200m;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;2.5.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Listener.ora&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit the listener.ora on&amp;nbsp; both the primary and secondary server to contain a static entry for the databases. This is needed for the dataguard broker to be able to access the database, even if it is not open.&lt;/div&gt;&lt;div&gt;Remember that only open databases will automatically register with a listener. When a database is in mounted mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Most documentation found on the Internet name a standby database to contain the “_stdby” extension, like “cdb1_stdby”&lt;/div&gt;&lt;div&gt;This is however not really smart, especially if a failover takes place and suddenly the standby database called “cdb1_stdby” suddenly becomes the primary databases.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This is why we name the databases following the physical location.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the primary database add the following entry to the listener.ora:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SID_LIST_TSMT01 =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; (SID_LIST =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (SID_DESC =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (GLOBAL_DBNAME = TSMT01C_AMS_DGMGRL)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ORACLE_HOME = /opt/tsmt01/ora/19.0.0.0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SID_NAME = TSMT01C)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ENVS=&quot;TNS_ADMIN=/opt/tsmt01/ora/network/admin&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the standby server add the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SID_LIST_TSMT01 =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; (SID_LIST =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (SID_DESC =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (GLOBAL_DBNAME = TSMT01C_ENS_DGMGRL)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ORACLE_HOME = /opt/tsmt01/ora/19.0.0.0)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SID_NAME = TSMT01C)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ENVS=&quot;TNS_ADMIN=/opt/tsmt01/ora/network/admin&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Note the use of CAPITALS in the database names. This is important, as it must match how it is used later in the Dataguard Broker setup.  &lt;/div&gt;&lt;div&gt;Restart both listener processes:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;lsnrctl stop&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;lsnrctl start&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.6.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Tnsnames.ora&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Update the tnsnames.ora file on both servers to have entries for both db_unique_names and the static “gloval_name” as defined in the listener.ora. The following entries therefore need to be added to the tnsnames.ora file on both servers:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;TSMT01C_AMS =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; (DESCRIPTION =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (ADDRESS_LIST =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = vtl1g002.kramponline.com)(PORT = 1521))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (CONNECT_DATA =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SERVER = DEDICATED)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SID = TSMT01C)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;TSMT01C_ENS =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; (DESCRIPTION =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (ADDRESS_LIST =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = vtl1g003.kramponline.com)(PORT = 1521))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; (CONNECT_DATA =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SERVER = DEDICATED)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SID = TSMT01C)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note the use of SID i.o SERVICE_NAME as the Dataguard Broker will need to connect to the databases when they are down. In that case the services are not available. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Enable the Broker&lt;/div&gt;&lt;div&gt;At this point we are ready to start the Dataguard synchronization process. The first step is to start the Dataguard Broker on both databases.&lt;/div&gt;&lt;div&gt;Since we want to prevent the standby database from becoming its own incarnation, we only start it in “mount” mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;The primary database can be opened in “open” mode.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the broker process&lt;/div&gt;&lt;div&gt;On the primary database:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ sqlplus / as sysdba&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Connected to an idle instance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; startup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;….&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;….&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database opened.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter system set dg_broker_start=true scope=both;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the standby database:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ sqlplus / as sysdba&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected to an idle instance.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; startup mount&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;….&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;….&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter system set dg_broker_start=true scope=both;&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;3.2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Create Broker configuration&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the primary server start the dataguard broker to register this server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ dgmgrl sys/&amp;lt;password&amp;gt;@tsmt01c_ams&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Dec 5 16:27:35 2023&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Version 19.16.0.0.0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Copyright (c) 1982, 2019, Oracle and/or its affiliates.&amp;nbsp; All rights reserved.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Welcome to DGMGRL, type &quot;help&quot; for information.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected to &quot;TSMT01C_AMS&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected as SYSDBA.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; create configuration tsmt01c_config as primary database is TSMT01C_AMS connect identifier is TSMT01C_AMS;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration &quot;tsmt01c_config&quot; created with primary database &quot;tsmt01c_ams&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now add the standby database:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; add database TSMT01C_ENS as connect identifier is TSMT01C_ENS;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database &quot;tsmt01c_ens&quot; added&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is important to use capitals in these statements for the database name if there are also capitals in the listener configuration.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If there is somewhere a discrepancy between these configurations, one can expect an ORA-01017 when trying to setup the dataguard configuration.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can check the configuration using the “show configuration” command:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; show configuration&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration - tsmt01c_config&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Protection Mode: MaxPerformance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Members:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; tsmt01c_ams - Primary database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; tsmt01c_ens - Physical standby database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Fast-Start Failover:&amp;nbsp; Disabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration Status:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DISABLED&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration status is “DISABLED” which means that dataguard is not active yet.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;We need to enable the configuration to let the standby database become and stay in sync with the primary database.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; enable configuration;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Enabled.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This commando may take a while depending on the amount of data that has to be synced.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.3.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Tnsnames.ora&lt;/div&gt;&lt;div&gt;Before this installation can be successfully used and before we can do e.g. a switchover or a failover, clients connecting to this Dataguard database need to be made aware about the existence of two hosts, possibly serving the primary database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To solve this an extra host address needs to be added to the tnsnames.ora entry for this database. There where a single instance usually only has one address line in tnsnames.ora, for a Dataguard setup you need to add one more.&lt;/div&gt;&lt;div&gt;The tnsnames entry for the above configuration therefor looks like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;TSMT01 =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; (DESCRIPTION =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; (ADDRESS_LIST =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ADDRESS=(PROTOCOL=TCP)(HOST=vtl1g002.kramponline.com)(PORT = 1521))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (ADDRESS=(PROTOCOL=TCP)(HOST=vtl1g003.kramponline.com)(PORT = 1521))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; (CONNECT_DATA =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SERVICE_NAME = TSMT01)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This way this entry enables the client to probe for which of the hosts is the active primary host and connections will always succeed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;3.4.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Monitoring&lt;/div&gt;&lt;div&gt;The configuration and activity can basically be monitored from the Dataguard Broker command line. More detailed monitoring and alerting on issues is better done from Oracle Enterprise Manager.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The fastest way to check the status of the Dataguard setup is to use the “show configuration” command from the Dataguard Broker command line.&lt;/div&gt;&lt;div&gt;This looks this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGR&amp;gt; show configuration&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration - tsmt01c_config&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Protection Mode: MaxPerformance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Members:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; tsmt01c_ens - Primary database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; tsmt01c_ams - Physical standby database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Fast-Start Failover:&amp;nbsp; Disabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration Status:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SUCCESS&amp;nbsp; &amp;nbsp;(status updated 44 seconds ago)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is important that the status show “SUCCESS”&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If one looks in detail to the above screen output, it is visible that it is different from that on the previous page. There the tsmt01c_ams was primary database. Now we have switched roles and tsmt01c_ens is the primary database.&amp;nbsp;&lt;/div&gt;&lt;div&gt;In the next chapter this is explained in detail &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.5.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switchover&lt;/div&gt;&lt;div&gt;From a dataguard setup, the members can switch roles. This can be done manually using a switchover, or automatically in case of a failover.&lt;/div&gt;&lt;div&gt;A failover can occur when e.g. de primary database server physically fails. The broker can in that case decide to promote the standby to be the primary database.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A failover or the setup of it, is not discussed in this document.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A switchover can be convenient in case of maintenance. If e.g. one of the servers needs to be shutdown, patched or something else, the standby database can take over the role of primary database. This makes it possible to shutdown the “before” primary database server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A switchover making the tsmt01c_ams the primary database server looks like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; switchover to tsmt01c_ams;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Performing switchover NOW, please wait...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;New primary database &quot;tsmt01c_ams&quot; is opening...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Operation requires start up of instance &quot;TSMT01C&quot; on database &quot;tsmt01c_ens&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Starting instance &quot;TSMT01C&quot;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected to an idle instance.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;ORACLE instance started.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected to &quot;TSMT01C_ENS&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database mounted.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Connected to &quot;TSMT01C_ENS&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Switchover succeeded, new primary is &quot;tsmt01c_ams&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Confirming the switchover by looking at the resulting configuration shows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt; show configuration&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration - tsmt01c_config&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Protection Mode: MaxPerformance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Members:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; tsmt01c_ams - Primary database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; tsmt01c_ens - Physical standby database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Fast-Start Failover:&amp;nbsp; Disabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Configuration Status:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SUCCESS&amp;nbsp; &amp;nbsp;(status updated 51 seconds ago)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;DGMGRL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.6.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Failovers&lt;/div&gt;&lt;div&gt;With Dataguard it is also possible to let the configuration automatically failover to the standby node in case of a failure of the primary node.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This is called Fast Start Fail Over, of FSFO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To configure this, we should setup a so-called observer-server, a standalone server that is responsible for monitoring the primary database.&lt;/div&gt;&lt;div&gt;In case the observer notices that the primary database is not responding for a couple of seconds, for what kind of reason, it instructs the dataguard broker to switch the configuration to the standby database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For the current purpose of our Dataguard Setup, we do not need automatic failover, so we skip this configuration for now.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/8080898650222706783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2024/01/dataguard-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8080898650222706783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8080898650222706783'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2024/01/dataguard-setup.html' title='Dataguard Setup'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-4606464431284330058</id><published>2024-01-12T07:59:00.102+01:00</published><updated>2024-01-12T08:44:17.199+01:00</updated><title type='text'>Patching Dataguard</title><content type='html'>&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Patching&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When patching a database it is normal to bring down the database, patch the ORACLE_HOME and finally run ‘datapatch’ to apply any database changes introduced with the patch to the database.&lt;/div&gt;&lt;div&gt;With Out-Of-Place patching a new ORACLE_HOME is installed next to the existing and the database is started with that HOME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But how do we do that with Dataguard?&lt;/div&gt;&lt;div&gt;Where we know that Dataguard applies changes done in the primary database onto the standby database using the redo-apply, we can’t patch the Dataguard the regular way.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If we would patch the primary database the usual way, it will apply database changes to the standby database of a patch that may be unknown to the ORACLE_HOME of this standby database.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;The basics&lt;/div&gt;&lt;div&gt;This is why Oracle has introduced the so-called “Standby First Patching method”.&lt;/div&gt;&lt;div&gt;With this method, the ORACLE_HOME of the standby database is patched first. But we can’t run datapatch on this ORACLE_HOME as the database is not open to receive these changes.&amp;nbsp;&lt;/div&gt;&lt;div&gt;So, after we have patched the ORACLE_HOME of the standby server, we switch roles, making the standby the primary. Then we can patch the ORACLE_HOME of the previous primary, now standby server.&lt;/div&gt;&lt;div&gt;Finally we run datapatch on the new primary and switch back.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In steps:&lt;/div&gt;&lt;div&gt;1)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Disable redo apply on standby database&lt;/div&gt;&lt;div&gt;2)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Shutdown standby database&lt;/div&gt;&lt;div&gt;3)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Patch the ORACLE_HOME on the standby database&lt;/div&gt;&lt;div&gt;4)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the standby database&amp;nbsp;&lt;/div&gt;&lt;div&gt;5)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the redo apply&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Perform a switchover. The patched standby database now becomes primary database, but without that datapatch has- run.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Now repeat step 1 to 5 for the “new” standby database&lt;/div&gt;&lt;div&gt;8)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;When finished, switch back roles&lt;/div&gt;&lt;div&gt;9)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Finally run datapatch from the primary database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That concludes the in-place patching of a dataguard environment.&lt;/div&gt;&lt;div&gt;The above steps are only useful when patching an existing ORACLE_HOME, so-called in-place patching.&amp;nbsp;&lt;/div&gt;&lt;div&gt;At Kramp we prefer- however out-of-place patching, where we install a new ORACLE_HOME with the patch already applied.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With out-of-place patching the steps needed to be done are:&lt;/div&gt;&lt;div&gt;1)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Install a new patched home on both the primary and secondary server into a new directory.&lt;/div&gt;&lt;div&gt;2)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Disable redo apply on standby database&lt;/div&gt;&lt;div&gt;3)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Shutdown standby database&lt;/div&gt;&lt;div&gt;4)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Copy password file, spfile and dataguard config files from the&amp;nbsp;&lt;/div&gt;&lt;div&gt;5)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Change environment to the new ORACLE_HOME&lt;/div&gt;&lt;div&gt;6)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;OLD_ORACLE_HOME/dbs to the NEW_ORACLE_HOME/dbs&lt;/div&gt;&lt;div&gt;7)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the database using the new ORACLE_HOME in mount mode&lt;/div&gt;&lt;div&gt;8)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start redo-apply&lt;/div&gt;&lt;div&gt;9)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switchover the primary database role to the new started standby database.&lt;/div&gt;&lt;div&gt;10)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Repeat steps 1 to 7 for the former primary database server, now being the standby&lt;/div&gt;&lt;div&gt;11)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;When ready, run datapatch from the primary database&lt;/div&gt;&lt;div&gt;12)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switchover to let the initial primary database taking this role again&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the next pages both processes are seen with commands and screen output.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;In place patching&amp;nbsp;&lt;/div&gt;&lt;div&gt;In this section the real patch process of in-place patching is discussed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;The first step is to disable the redo apply on the standby database. The command to use from SQLplus is:&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiknwKXSaZu5BIYMOLin9Eif6TcxLrdRDWsdhxRux67rm2xsvBUN5B7rWJopUfS9aUET8OSkpshXRasc9LFJTi8wEG_KqT28yB1DA_wBRPpDtF0eYvGvEAMX2SloWqVKctiO-dRg17utPKh5iqHo8_oFiv5YZmMAAoxPB8ADjshFI6wh2dvWtzcZWQjAXY/s675/121.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;88&quot; data-original-width=&quot;675&quot; height=&quot;77&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiknwKXSaZu5BIYMOLin9Eif6TcxLrdRDWsdhxRux67rm2xsvBUN5B7rWJopUfS9aUET8OSkpshXRasc9LFJTi8wEG_KqT28yB1DA_wBRPpDtF0eYvGvEAMX2SloWqVKctiO-dRg17utPKh5iqHo8_oFiv5YZmMAAoxPB8ADjshFI6wh2dvWtzcZWQjAXY/w589-h77/121.PNG&quot; width=&quot;589&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Now we can shutdown the Standby database following step 2:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpAnavOeVliH_W-Jss6lleEDxyZA701QhvmedhfCM_2f35bmVNGtYpx8bYbXqjtsOK49kSBh93ZryDQzRZcfrvEQxKzHNkGwF_l6oAU29IXYbN4IWLbr0u9wloJPKpZV15MlR8i_sZ-IEjpltx77vkCJrROvz3bMR-Xk6L68NaSTgeU-kgQSmNshKhUw/s593/122.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;185&quot; data-original-width=&quot;593&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpAnavOeVliH_W-Jss6lleEDxyZA701QhvmedhfCM_2f35bmVNGtYpx8bYbXqjtsOK49kSBh93ZryDQzRZcfrvEQxKzHNkGwF_l6oAU29IXYbN4IWLbr0u9wloJPKpZV15MlR8i_sZ-IEjpltx77vkCJrROvz3bMR-Xk6L68NaSTgeU-kgQSmNshKhUw/w446-h139/122.PNG&quot; width=&quot;446&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that the “ORA-01109” confirms that we are connected to the standby database.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Stopping the database includes stopping the listener:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyQ1r9htj0-Z6omE0juOYDylHG-FZIQMg9v35-ZTOgCx5AL_zcBAhFzxj2w7E7onFJMk4MacwY7scFZQ6ZU5XrwVRXtGlFWeg3xpWf-mY4sGB7dbFuQGTjVSbWYg3va5ob6GiZgxPhiFShfSdluDX1iiMfUqNZvtseYXYXa3fgxymbNhSNtygC0YjAjGM/s675/123.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;135&quot; data-original-width=&quot;675&quot; height=&quot;101&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyQ1r9htj0-Z6omE0juOYDylHG-FZIQMg9v35-ZTOgCx5AL_zcBAhFzxj2w7E7onFJMk4MacwY7scFZQ6ZU5XrwVRXtGlFWeg3xpWf-mY4sGB7dbFuQGTjVSbWYg3va5ob6GiZgxPhiFShfSdluDX1iiMfUqNZvtseYXYXa3fgxymbNhSNtygC0YjAjGM/w505-h101/123.PNG&quot; width=&quot;505&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;At this point we assume that we have extracted the patch on a location with sufficient space, e.g. /opt/tsmt01/exp.&lt;/div&gt;&lt;div&gt;Also the OPatch version in the ORACLE_HOME has been replaced with the newest version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now we can apply the patches for database and ojvm:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjlvdMyR2O9vwSCRg1DiKgFFAzG6dJ8jUGlUnWVrtGJmyz5X_KpPmyxDoeFh8EUH_LPvSeucg4WrpWfrhkUbG194nR_auIC91MlTOaXyfj6Tj7HgsoYg_y9Tz410c_8csE6b2MPW4BwORby1BMCdrq_sFORolpOSg3CP-W6FbCbluHvzcbHgwWOHMFt78/s675/124.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;214&quot; data-original-width=&quot;675&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjlvdMyR2O9vwSCRg1DiKgFFAzG6dJ8jUGlUnWVrtGJmyz5X_KpPmyxDoeFh8EUH_LPvSeucg4WrpWfrhkUbG194nR_auIC91MlTOaXyfj6Tj7HgsoYg_y9Tz410c_8csE6b2MPW4BwORby1BMCdrq_sFORolpOSg3CP-W6FbCbluHvzcbHgwWOHMFt78/w488-h154/124.png&quot; width=&quot;488&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When finished, optionally clean out old replace patch-sets and release updates.&lt;/div&gt;&lt;div&gt;The statements to use are :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;opatch util listorderedinactivepatches&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This lists the inactive patches and release updates.&amp;nbsp;&lt;/div&gt;&lt;div&gt;You can actually delete them, using the command:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;opatch util deleteinactivepatches&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Then start the listener again.&lt;br /&gt;Also start the standby database in MOUNT mode.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Do NOT run datapatch !!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the redo apply services again:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFZgay-VwUdjNa3p82vbZec1kg1Ih_-13R3gKa6LF43J_-7Ens1cmSZ9UBilzMZ6RS3q4tQwwK6fq31BGqAVxU_F5Yf_hwFobCSrg0Y-_ghYf3plFCXhmsEa5h924UaTKYVAzCsFNKKR_2CoeVGGfQvNOK0o9bCcy9YWnSx7CjAgR8Cju7J5mvPCMNY4/s670/125.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;125&quot; data-original-width=&quot;670&quot; height=&quot;91&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFZgay-VwUdjNa3p82vbZec1kg1Ih_-13R3gKa6LF43J_-7Ens1cmSZ9UBilzMZ6RS3q4tQwwK6fq31BGqAVxU_F5Yf_hwFobCSrg0Y-_ghYf3plFCXhmsEa5h924UaTKYVAzCsFNKKR_2CoeVGGfQvNOK0o9bCcy9YWnSx7CjAgR8Cju7J5mvPCMNY4/w485-h91/125.png&quot; width=&quot;485&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It may, like in this screenshot, give an error is redo apply has already been started.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;At this point we can switch over to make the current Standby database the Primary database, after which we can repeat the above steps, which we will not show here again&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYIEbHkUPJZtys1uRgKQnBxTeopCuo0WgjLWn1ZlmxcbB66OKOai5n92jWCkDJbQOvc_vXEqimfQ4inN5lLO-MgjeO-5mfAPzy2ZT5vNKGC-bYBCsp_j4ENGOAkLDjzy8yEqf7M9cgK8nQVMQaSN2pizTs9w0gyP_YQhecEGlpZI-ro-4o5P7vJ2PnmE/s670/126.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;247&quot; data-original-width=&quot;670&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYIEbHkUPJZtys1uRgKQnBxTeopCuo0WgjLWn1ZlmxcbB66OKOai5n92jWCkDJbQOvc_vXEqimfQ4inN5lLO-MgjeO-5mfAPzy2ZT5vNKGC-bYBCsp_j4ENGOAkLDjzy8yEqf7M9cgK8nQVMQaSN2pizTs9w0gyP_YQhecEGlpZI-ro-4o5P7vJ2PnmE/w446-h164/126.PNG&quot; width=&quot;446&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;So… step 7 is skipped, as it would display everything from step 1 to 5 again&lt;/div&gt;&lt;div&gt;Step 7 finishes with the switchover to the initial primary database again.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;8)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;In step 8 we’re going to run datapatch to apply the database changes that have come with the patch&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step into the ORACLE_HOME/OPatch directory and run ‘datapatch -verbose’:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwDAwDSDNgTVBpTTn5q0Td4ITiO8MZVIVYFMR1PDOc347ipzuwbUL2drC8-FkRgNpU9FH1BvZl8UIvOEN2nubIi3TwbaFay60Rnvo1cd21EXr-rqXOjzz5bLySTvzsezEDHaJHOmWJpfhEr0zUzuAMsu5886j-fMiu7tq9fk3Q8t1CW_HBlxTRlm-x7dQ/s667/127.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;667&quot; height=&quot;215&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwDAwDSDNgTVBpTTn5q0Td4ITiO8MZVIVYFMR1PDOc347ipzuwbUL2drC8-FkRgNpU9FH1BvZl8UIvOEN2nubIi3TwbaFay60Rnvo1cd21EXr-rqXOjzz5bLySTvzsezEDHaJHOmWJpfhEr0zUzuAMsu5886j-fMiu7tq9fk3Q8t1CW_HBlxTRlm-x7dQ/w447-h215/127.PNG&quot; width=&quot;447&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This process may take a while. Because of the redo apply, both the Primary and Standby database are now supplied with the changes coming with the patch.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.3.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Out of Place patching&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With out of place patching the downtime can be even more minimized. This method of patching uses a new patched installation as a new ORACLE_HOME.&lt;/div&gt;&lt;div&gt;The running database from the 1st ORACLE_HOME has to be brought down and can be immediately started from the 2nd ORACLE_HOME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because downtime is only very short, it is questionable if a switchover would not result in the same amount of downtime, as there also both databases are briefly down together while switching roles.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;In this section we assume that the new ORACLE_HOME is already in place.&amp;nbsp;&lt;/div&gt;&lt;div&gt;2)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;The first step is to disable the redo apply on the standby database. The command to use from SQLplus is:&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiknwKXSaZu5BIYMOLin9Eif6TcxLrdRDWsdhxRux67rm2xsvBUN5B7rWJopUfS9aUET8OSkpshXRasc9LFJTi8wEG_KqT28yB1DA_wBRPpDtF0eYvGvEAMX2SloWqVKctiO-dRg17utPKh5iqHo8_oFiv5YZmMAAoxPB8ADjshFI6wh2dvWtzcZWQjAXY/s675/121.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;88&quot; data-original-width=&quot;675&quot; height=&quot;70&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiknwKXSaZu5BIYMOLin9Eif6TcxLrdRDWsdhxRux67rm2xsvBUN5B7rWJopUfS9aUET8OSkpshXRasc9LFJTi8wEG_KqT28yB1DA_wBRPpDtF0eYvGvEAMX2SloWqVKctiO-dRg17utPKh5iqHo8_oFiv5YZmMAAoxPB8ADjshFI6wh2dvWtzcZWQjAXY/w536-h70/121.PNG&quot; width=&quot;536&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Now we can shutdown the database and the listener&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpAnavOeVliH_W-Jss6lleEDxyZA701QhvmedhfCM_2f35bmVNGtYpx8bYbXqjtsOK49kSBh93ZryDQzRZcfrvEQxKzHNkGwF_l6oAU29IXYbN4IWLbr0u9wloJPKpZV15MlR8i_sZ-IEjpltx77vkCJrROvz3bMR-Xk6L68NaSTgeU-kgQSmNshKhUw/s593/122.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;185&quot; data-original-width=&quot;593&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpAnavOeVliH_W-Jss6lleEDxyZA701QhvmedhfCM_2f35bmVNGtYpx8bYbXqjtsOK49kSBh93ZryDQzRZcfrvEQxKzHNkGwF_l6oAU29IXYbN4IWLbr0u9wloJPKpZV15MlR8i_sZ-IEjpltx77vkCJrROvz3bMR-Xk6L68NaSTgeU-kgQSmNshKhUw/w419-h131/122.PNG&quot; width=&quot;419&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Copy all parameter files, both for the database and the dataguard configuration, and the password file to the new ORACLE_HOME/dbs, e.g.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ cd $OLD_ORACLE_HOME/dbs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;$ cp *&amp;nbsp; $NEW_ORACLE_HOME/dbs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Set the environment tot the new ORACLE_HOME:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy-uSZZEqa20BHcRwizktCkcaujNahErkP5Dys6uprPfJj1e2VWup7bRbqdc3Alh0Qi2Io1Q75hovlSnColeGk5e3n59kN4C6LYjvkkx65t-ZvanaZ3yA7wKxHS9zDcYFBb8HWU9zh57bYc0lHwCfnSSuiN7lqBThPxwFj_CDm4joAjrbE8Tf1x4J41-k/s909/134.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;85&quot; data-original-width=&quot;909&quot; height=&quot;56&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy-uSZZEqa20BHcRwizktCkcaujNahErkP5Dys6uprPfJj1e2VWup7bRbqdc3Alh0Qi2Io1Q75hovlSnColeGk5e3n59kN4C6LYjvkkx65t-ZvanaZ3yA7wKxHS9zDcYFBb8HWU9zh57bYc0lHwCfnSSuiN7lqBThPxwFj_CDm4joAjrbE8Tf1x4J41-k/w600-h56/134.png&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;p class=&quot;MsoNoSpacing&quot; style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;b&gt;Also change the /etc/oratab and re-login
to make sure that also the PATH variable is set correctly. Otherwise binaries
from the OLD_ORACLE_HOME will be used to start the database again.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Edit the listener.ora file and update the ORACLE_HOME to point to the new location.&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Then start the listener again with the new HOME.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Also start the standby database in MOUNT mode.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Do NOT run datapatch !!!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;7)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Start the redo apply services again:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFZgay-VwUdjNa3p82vbZec1kg1Ih_-13R3gKa6LF43J_-7Ens1cmSZ9UBilzMZ6RS3q4tQwwK6fq31BGqAVxU_F5Yf_hwFobCSrg0Y-_ghYf3plFCXhmsEa5h924UaTKYVAzCsFNKKR_2CoeVGGfQvNOK0o9bCcy9YWnSx7CjAgR8Cju7J5mvPCMNY4/s670/125.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;125&quot; data-original-width=&quot;670&quot; height=&quot;97&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFZgay-VwUdjNa3p82vbZec1kg1Ih_-13R3gKa6LF43J_-7Ens1cmSZ9UBilzMZ6RS3q4tQwwK6fq31BGqAVxU_F5Yf_hwFobCSrg0Y-_ghYf3plFCXhmsEa5h924UaTKYVAzCsFNKKR_2CoeVGGfQvNOK0o9bCcy9YWnSx7CjAgR8Cju7J5mvPCMNY4/w517-h97/125.png&quot; width=&quot;517&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;It may, like in this screenshot, give an error is redo apply has already been started.&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;border: none; margin: 0 0 0 40px; padding: 0px;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;8)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;At this point we can switch over to make the current Standby database the Primary database, after which we can repeat the above steps, which we will not show here again&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYIEbHkUPJZtys1uRgKQnBxTeopCuo0WgjLWn1ZlmxcbB66OKOai5n92jWCkDJbQOvc_vXEqimfQ4inN5lLO-MgjeO-5mfAPzy2ZT5vNKGC-bYBCsp_j4ENGOAkLDjzy8yEqf7M9cgK8nQVMQaSN2pizTs9w0gyP_YQhecEGlpZI-ro-4o5P7vJ2PnmE/s670/126.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;247&quot; data-original-width=&quot;670&quot; height=&quot;198&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihYIEbHkUPJZtys1uRgKQnBxTeopCuo0WgjLWn1ZlmxcbB66OKOai5n92jWCkDJbQOvc_vXEqimfQ4inN5lLO-MgjeO-5mfAPzy2ZT5vNKGC-bYBCsp_j4ENGOAkLDjzy8yEqf7M9cgK8nQVMQaSN2pizTs9w0gyP_YQhecEGlpZI-ro-4o5P7vJ2PnmE/w537-h198/126.PNG&quot; width=&quot;537&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;9)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Repeat steps 1 through 7, to relocate the now running standby database to the new ORACLE_HOME&lt;/div&gt;&lt;div&gt;10)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switchover to let the initial primary database take this role again&lt;/div&gt;&lt;div&gt;11)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Run datapatch to apply the database changes that have come with the patch&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step into the ORACLE_HOME/OPatch directory and run ‘datapatch -verbose’:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwDAwDSDNgTVBpTTn5q0Td4ITiO8MZVIVYFMR1PDOc347ipzuwbUL2drC8-FkRgNpU9FH1BvZl8UIvOEN2nubIi3TwbaFay60Rnvo1cd21EXr-rqXOjzz5bLySTvzsezEDHaJHOmWJpfhEr0zUzuAMsu5886j-fMiu7tq9fk3Q8t1CW_HBlxTRlm-x7dQ/s667/127.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;667&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwDAwDSDNgTVBpTTn5q0Td4ITiO8MZVIVYFMR1PDOc347ipzuwbUL2drC8-FkRgNpU9FH1BvZl8UIvOEN2nubIi3TwbaFay60Rnvo1cd21EXr-rqXOjzz5bLySTvzsezEDHaJHOmWJpfhEr0zUzuAMsu5886j-fMiu7tq9fk3Q8t1CW_HBlxTRlm-x7dQ/w561-h270/127.PNG&quot; width=&quot;561&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This process may take a while. Because of the redo apply, both the Primary and Standby database are now supplied with the changes coming with the patch.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Troubleshooting&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;In this section, issues encountered during testing and writing of this blog are discussed.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Actually only two issues occurred.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.1.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Listener configuration&lt;/div&gt;&lt;div&gt;The first was during the out-of-place patching where the primary was unable to find the standby database, showing:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVecUzqj6SS2gTwzWyEfI5R5dwjVDyev8gSHN0IN99mFRbVjpY9hWnWfzgFZJNAKqoF1cJvhWy_Cp3JagKfmYyy2RhfXrziXw32pp2-fISiz-zdWcIW9RtNYOscrtDu3Untv3ilfYZ_LKd8n4hh3aFad9uSaBfpdJ9m5FYOOEF5yoXRuYA2woRwpGbdvs/s910/211.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;267&quot; data-original-width=&quot;910&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVecUzqj6SS2gTwzWyEfI5R5dwjVDyev8gSHN0IN99mFRbVjpY9hWnWfzgFZJNAKqoF1cJvhWy_Cp3JagKfmYyy2RhfXrziXw32pp2-fISiz-zdWcIW9RtNYOscrtDu3Untv3ilfYZ_LKd8n4hh3aFad9uSaBfpdJ9m5FYOOEF5yoXRuYA2woRwpGbdvs/w579-h170/211.png&quot; width=&quot;579&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you encounter this error, when having done out of place patching of the standby and the database and listener have been started on the standby server, then you probably have not updated the listener.ora file, having the ORACLE_HOME pointing to the new location in the static listener entry:&lt;/div&gt;&lt;div&gt;If the above is true, this is confirmed in the dataguard broker logfile “drcTSMT01C.log”&lt;/div&gt;&lt;div&gt;There is may say:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Data Guard Broker Status Summary:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Severity&amp;nbsp; Status&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Configuration&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tsmt01c_config Warning&amp;nbsp; ORA-16607: one or more members have failed&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Primary Database&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsmt01c_ams&amp;nbsp; &amp;nbsp; Error&amp;nbsp; ORA-16778: redo transport error for one or more members&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Physical Standby Database tsmt01c_ens&amp;nbsp; &amp;nbsp; Error&amp;nbsp; ORA-01034: ORACLE not available&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0JT5LceMHKPUkaD8oZTuSrvVlN_yazrsrCzI2N8GTJ3ztsbVLgxkmgV-02yUyKGjdQPl4MPafP-9CsraJQc-ZQIifFhHw_Bz530bB53VTGnutG1_bXoFkZFtWA8XpWRy5slJM4XbF1xAnLyZqvOG3YwDyDVe9GSvPtBoz8oPnkgxrhazVEMYxz_oJ60/s791/212.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;468&quot; data-original-width=&quot;791&quot; height=&quot;233&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt0JT5LceMHKPUkaD8oZTuSrvVlN_yazrsrCzI2N8GTJ3ztsbVLgxkmgV-02yUyKGjdQPl4MPafP-9CsraJQc-ZQIifFhHw_Bz530bB53VTGnutG1_bXoFkZFtWA8XpWRy5slJM4XbF1xAnLyZqvOG3YwDyDVe9GSvPtBoz8oPnkgxrhazVEMYxz_oJ60/w394-h233/212.PNG&quot; width=&quot;394&quot; /&gt;&lt;/a&gt;&lt;/div&gt;The problem is caused by the dataguard broker connecting the the standby listener, which in turn can not find a running database from the old ORACLE_HOME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To solve this problem, stop the Standby database and listener again, and update the ORACLE_HOME entry in the listener.ora as seen here. After updating the listener.ora restart the listener and database and all should work as expected.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.2.&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Switchover failing&lt;/div&gt;&lt;div&gt;During the patch process the configuration is switched over from primary to standby two times. This ensures that the database will remain available for the clients&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It may happen that a switchover fails, in restarting the two databases in the correct mode. An error in Dataguard Broker is then seen:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaMRA8pTbkaeQwme4QUe-vsGp_c5ab2l5GKZUd4oM6fERxyuOFQ_gM55XJzfrscZeSdTKKnB2CO_YlUemCM45wpYqCPpBGJIvw05z06i1rTFTGeeFQxjoMlOg2iNIB2jzoZ-MouKk-flR_5npvl8SW1Pjvs5UIASlsOChoyWcCazjO5hDbDY2kQ5crS4Q/s1027/221.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;392&quot; data-original-width=&quot;1027&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaMRA8pTbkaeQwme4QUe-vsGp_c5ab2l5GKZUd4oM6fERxyuOFQ_gM55XJzfrscZeSdTKKnB2CO_YlUemCM45wpYqCPpBGJIvw05z06i1rTFTGeeFQxjoMlOg2iNIB2jzoZ-MouKk-flR_5npvl8SW1Pjvs5UIASlsOChoyWcCazjO5hDbDY2kQ5crS4Q/w651-h248/221.PNG&quot; width=&quot;651&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Somehow the switchover was partly done.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Before acting upon this and blindly follow the action step, make sure that you check the other database if it is open in read-write mode and also if it is primary.&amp;nbsp;&lt;/div&gt;&lt;div&gt;This can be done using this query:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; column open_mode format a20&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; column database_role format a20;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; set linesize 100&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; select open_mode, database_role from v$database;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;OPEN_MODE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATABASE_ROLE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;-------------------- --------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;READ WRITE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PRIMARY&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It should return the same as seen here. Otherwise manual intervention is needed to really dig in to logfiles to find out where the switchover has gone of track.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If it returns the same output as seen here, you can safely start the standby in mount mode as indicated which will solve the problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/4606464431284330058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2024/01/patching-dataguard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4606464431284330058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4606464431284330058'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2024/01/patching-dataguard.html' title='Patching Dataguard'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiknwKXSaZu5BIYMOLin9Eif6TcxLrdRDWsdhxRux67rm2xsvBUN5B7rWJopUfS9aUET8OSkpshXRasc9LFJTi8wEG_KqT28yB1DA_wBRPpDtF0eYvGvEAMX2SloWqVKctiO-dRg17utPKh5iqHo8_oFiv5YZmMAAoxPB8ADjshFI6wh2dvWtzcZWQjAXY/s72-w589-h77-c/121.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-7110908966792907639</id><published>2022-11-11T10:34:00.007+01:00</published><updated>2023-11-07T22:21:54.154+01:00</updated><title type='text'>Refreshable PDBs, a DR setup made easy</title><content type='html'>&lt;p&gt;With the introduction of Oracle CDB-PDB architecture, DBA&#39;s had to get used to a whole way of thinking about databases. Databases became more flexible, more volatile in a sense that you can do many cool things with PDB&#39;s, easier upgrades, cloning etc...&lt;/p&gt;&lt;p&gt;With the release of Oracle 12.2 the cloning of PDB&#39;s got extended with a option to refresh a remote PDB with data from a local source PDB. The clone you created in a remote location can now be updated automatically with changes from its local partner (source) by applying redo that is retrieved over a database link.&lt;/p&gt;&lt;p&gt;This is called a &lt;b&gt;Refreshable Clone PDB&lt;/b&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;When thinking about these kind of options, DBA&#39;s may start to think of Dataguard, the Standby Database solution for Oracle Enterprise Editions.&amp;nbsp;&lt;br /&gt;The Refreshable Clone PDB is much of the same, but then free of any extra costs and very easy to setup and maintain. Even better, the Refreshable Clone PDB also works on Standard Edition, so an Enterprise Edition License is not needed here.&amp;nbsp;&lt;br /&gt;Of course the remote database server must be licensed correctly to run this database.&lt;/p&gt;&lt;p&gt;There are a number of advantages of having a Refreshable Clone PDB:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;When the Clone is on another server, you can use it as a Disaster Recovery solution. The &lt;b&gt;RPO &lt;/b&gt;is then dependent on the refresh rate you specify when creating the remote clone. &lt;br /&gt;&lt;b&gt;RTO &lt;/b&gt;is depending on the amount of work needed, to change the role of the clone to a production status in case of a disaster.&amp;nbsp;&lt;/li&gt;&lt;li&gt;When there is no disaster and when there is sufficient archivelog space on the source database, one can even open up the clone in a &quot;read only&quot; state for reporting purposes, thus unloading the source database. Keep in mind that the clone does not get updated when it is open and thus gets out of sync with its source. The redo can only be applied, when the clone is closed.&lt;br /&gt;Opening a database for reporting like this, hugely increases RTO and RPO.&lt;/li&gt;&lt;/ul&gt;A Refreshable Clone PDB can either be refreshed automatically or manually. When creating the clone this is specified in the &quot;CREATE PLUGGABLE DATABASE&quot; command. Of course the behavior can also changed afterwards. Manual refreshes can be run anyway, even in automatic refresh mode.&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Some requirements before you can create a Refreshable Clone PDB:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;A CDB on the remote location must already exist having the same patch version and components as the source CDB&lt;/li&gt;&lt;li&gt;A database link must be created from remote CDB, connecting to the local (source) CDB, using the SYSTEM account&lt;/li&gt;&lt;li&gt;The SYSTEM account in the source CDB must have &quot;CREATE PLUGGABLE DATABASE&quot; rights. In Oracle 12.2, this was the case, however in 19c this right is by default only granted to SYS.&lt;/li&gt;&lt;li&gt;The remote CDB must have the PDB_FILE_NAME_CONVERT parameter set in the spfile, if the directory structure of the clone does not match that of the source.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this example we assume that we have two CDBs, a CDB1 as the source and a CDB2 as the remote location. The PDB in the source is called HR_PROD. It is up to you if you want to name the Clone PDB the same. For DR this may be convenient, as this eases a failover. When used for reporting the Clone PDB may get another name.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;We assume that you have entered the correct connection string (named CDB1) in the tnsnames.ora on the remote server, pointing to the source server.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;We start with creating the database link:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; create database link TO_CDB1&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;connect to system identified by yourpassword &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;using &#39;CDB1&#39;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Now we are creating the Refreshable Clone PDB:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter system set&amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&amp;nbsp; pdb_file_name_convert=&#39;/u01/oradata/hrprod&#39;,&#39;/u01/oradata/hrclone&#39;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&amp;nbsp; scope=both;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; create pluggable database HR_CLONE from HR_PROD@TO_CDB1&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;refresh mode every 5 minutes;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;That&#39;s it !&lt;/p&gt;&lt;p&gt;Checking the result shows:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; show pdbs;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; CON_ID CON_NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OPEN MODE&amp;nbsp; RESTRICTED&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;---------- ------------------------------ ---------- ----------&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 PDB$SEED&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;READ ONLY&amp;nbsp; NO&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 HR_CLONE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MOUNTED&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you now start monitoring the alert_log of the CDB2, then messages like this will appear:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Serial Media Recovery started&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):max_pdb is 3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;2022-11-11T09:23:34.574917+01:00&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Media Recovery Log /u01/oradata/hrprod/fr01/CDB1/archivelog/2022_11_11/o1_mf_1_3270_kpw1ft17_.arc&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;2022-11-11T09:23:34.618074+01:00&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Media Recovery Log /u01/oradata/hrprod/fr01/CDB1/foreign_archivelog/HR_PROD/2022_11_11/o1_mf_1_3271_kpw1n6gy_.arc&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;2022-11-11T09:23:34.671022+01:00&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Incomplete Recovery applied until change 104159016 time 11/11/2022 09:23:34&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;2022-11-11T09:23:34.672222+01:00&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Media Recovery Complete (CDB2)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;HR_CLONE(3):Completed: alter pluggable database refres&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some other commands to manage the Refreshable Clone PDB are:&lt;/div&gt;&lt;p&gt;Manual refresh:&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter pluggable database HR_CLONE refresh;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Change the refresh interval:&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter pluggable database HR_CLONE refresh mode manual;&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter pluggable database HR_CLONE refresh mode every 30 minutes;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Open the database:&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter pluggable database HR_CLONE open read only;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Thinking about this, it may be convenient to first put refresh mode to manual, before opening the database. This prevent you from getting lots of errors in the alert_log;&lt;/p&gt;&lt;div&gt;To resume the replication of the redo, the PDB must be closed again and a refresh interval set.&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Switchover&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Because a Refreshable Clone PDB is not a Dataguard solution, a switchover is something manual, to be performed by the DBA. With Dataguard, failovers can be automated with near zero loss of data. &lt;br /&gt;When however doing a switchover correctly, the latest transactions are taken into account, also the switchover of a Cloned PDB must be possible with near zero dataloss.&lt;/p&gt;&lt;p&gt;We need to take into account that in the above database the refresh rate is set to 5 minutes. This means that every 5 minutes the source database is probed for changes. Whenever we do a switchover in between two such probes / refreshes, then we may loose changes applied in the source database during that interval.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;First: Switchover can be done by the database by using an ALTER PLUGGABLE DATABASE .... SWITCHOVER command, but this feature is restricted to Enterprise Edition on Exadata and all editions on Oracle Cloud Services.&lt;br /&gt;To overcome this for on-premise databases a hidden parameter can be set:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt;&amp;nbsp;alter system set &quot;_exadata_feature_on&quot;=true scope=spfile;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;A test using an on-premise Standard Edition runs into -yet- unresolvable errors, even when setting that parameter. It may be of the Standard Edition, but it may also be that the available documentation on the Internet is incomplete.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A manual switchover however is possible. Whenever we shutdown or loose the source database, we can disable the Refresh Mode on the Clone and open it in Read/Write mode to start using it.&lt;br /&gt;This then looks like this:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;SQL&amp;gt; alter pluggable database HR_CLONE&amp;nbsp;refresh;&lt;br /&gt;&lt;br /&gt;Pluggable database altered.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; alter pluggable database HR_CLONE&amp;nbsp;refresh mode none;&lt;br /&gt;&lt;br /&gt;Pluggable database altered.&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; alter pluggable database HR_CLONE&amp;nbsp;open;&lt;br /&gt;&lt;br /&gt;Pluggable database altered.&lt;/span&gt;&lt;/p&gt;&lt;div&gt;If you do not disable the automatic refresh mode, the pluggable database can not be opened in Read/Write mode and the command errors out.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;After opening the PDB in Read/Write mode it can not be reverted to Refreshable Clone.&amp;nbsp;&lt;br /&gt;It has to be recreated.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/7110908966792907639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2022/11/refreshable-pdbs-dr-setup-made-easy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7110908966792907639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7110908966792907639'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2022/11/refreshable-pdbs-dr-setup-made-easy.html' title='Refreshable PDBs, a DR setup made easy'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-8503722710346058443</id><published>2022-10-13T13:48:00.006+02:00</published><updated>2023-11-07T22:22:51.673+01:00</updated><title type='text'>DIAGNOSTIC &amp; TUNING packs automatically used</title><content type='html'>&lt;p&gt;We have configured an Oracle Enterprise Manager report that shows us the use of EE-options where we don&#39;t have a license.&lt;/p&gt;&lt;p&gt;What shows up, immediately started to confuse us.&amp;nbsp;&lt;br /&gt;It showed that the DIAGNOSTIC+TUNING option was used in several databases:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitxBjZ_WLH6hK48hlyVLRTcQR80lhQu9Gp6zVj57OxvkfleZOoxDcrpzEmM3VS6g6yTfUdgvLxKBVCCl8Gvyx0chcYy7AGj2r-Wuj_8VLtT6be1P5iQSHJwv_ymS_AgXyfNZ1e22QcrzohRdsk3OUbbz4GUartjY4BTuKeMTQ-GdiKQw1R7qZUm0ca/s461/OEMlist.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;204&quot; data-original-width=&quot;461&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitxBjZ_WLH6hK48hlyVLRTcQR80lhQu9Gp6zVj57OxvkfleZOoxDcrpzEmM3VS6g6yTfUdgvLxKBVCCl8Gvyx0chcYy7AGj2r-Wuj_8VLtT6be1P5iQSHJwv_ymS_AgXyfNZ1e22QcrzohRdsk3OUbbz4GUartjY4BTuKeMTQ-GdiKQw1R7qZUm0ca/w389-h172/OEMlist.png&quot; width=&quot;389&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;When checking the settings from within Oracle Enterprise Manager =&amp;gt; Management Pack Usage, it showed that the packs were not in use, the radio-button was not active:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLkHLmKawRRW1NDDOvEc1JLfxXYCyL086Hmv77Ur4YMhcoQrEp-oAGpx1ddOR65zjiglIo78BD05YyabYBQ6JSPC3ZT8n7XKQjfQ6oyO7Xk9Dy6kl2IyIDWqwj4OSRh-Rg-mUrhcIsZuoMLsxe-ep8zMrIL7F8Qs8ZDHmSIned_QmgcKNIPxpNneZg/s624/OEMusages.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;177&quot; data-original-width=&quot;624&quot; height=&quot;127&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLkHLmKawRRW1NDDOvEc1JLfxXYCyL086Hmv77Ur4YMhcoQrEp-oAGpx1ddOR65zjiglIo78BD05YyabYBQ6JSPC3ZT8n7XKQjfQ6oyO7Xk9Dy6kl2IyIDWqwj4OSRh-Rg-mUrhcIsZuoMLsxe-ep8zMrIL7F8Qs8ZDHmSIned_QmgcKNIPxpNneZg/w523-h127/OEMusages.png&quot; width=&quot;523&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;When clicking on the Edit button next to the radio-button, it surprised us to see this:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLq8V8mIorHt_jbHXZwvivYOBpB3REp0qSx2_kfmcDnjP2skvxnBo_35262HNz4hp7YDEXZnGvaGpAc3_1fS9_CkYICtMxjYPnGpCARyxZ2eQLOWralwE-n8p0uaBPN84b659-uDxxwgEoDzK9rdlwBVva7_A0pNy12KWdiDmUejxSX2p142UNx9mv/s1006/packusage.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;98&quot; data-original-width=&quot;1006&quot; height=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLq8V8mIorHt_jbHXZwvivYOBpB3REp0qSx2_kfmcDnjP2skvxnBo_35262HNz4hp7YDEXZnGvaGpAc3_1fS9_CkYICtMxjYPnGpCARyxZ2eQLOWralwE-n8p0uaBPN84b659-uDxxwgEoDzK9rdlwBVva7_A0pNy12KWdiDmUejxSX2p142UNx9mv/w744-h50/packusage.JPG&quot; width=&quot;744&quot; /&gt;&lt;/a&gt;&lt;/div&gt;So it looks to enabled, unless the previous screen did not show that.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When looking at the database itself, we see the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; show parameter control_management_pack_access&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;NAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TYPE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;------------------------------------ ---------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;VALUE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;control_management_pack_access&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;DIAGNOSTIC+TUNING&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, it is active.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Checking the spfile it is not defined there. So activation is probably a default.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Then we found this &lt;a href=&quot;https://docs.oracle.com/en/database/oracle/oracle-database/12.2/refrn/CONTROL_MANAGEMENT_PACK_ACCESS.html#GUID-A5CA11BA-AE1F-4A2E-9C59-A98BA1F4E5C2&quot; target=&quot;_blank&quot;&gt;document&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;where is states:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGlsG-jMU7V1X8W4PwT1zl6Q7P9NC-g9KeJrrYWTxZnwPt5uUFS35cP71DBC5_Ci02YrHH_1tGqo_bRR0ClvVwW1952pRxmpPBH9h95mai4lJgu1oprIq9kxZF6XoVKmy2w8sS3x_fswWs8T7Gb2PVBUKtvmBxWk7WkEAkGH3XKjTj__t4CmxVg9Jm/s785/PackDoc.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;285&quot; data-original-width=&quot;785&quot; height=&quot;136&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGlsG-jMU7V1X8W4PwT1zl6Q7P9NC-g9KeJrrYWTxZnwPt5uUFS35cP71DBC5_Ci02YrHH_1tGqo_bRR0ClvVwW1952pRxmpPBH9h95mai4lJgu1oprIq9kxZF6XoVKmy2w8sS3x_fswWs8T7Gb2PVBUKtvmBxWk7WkEAkGH3XKjTj__t4CmxVg9Jm/w376-h136/PackDoc.jpg&quot; width=&quot;376&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;So, when installing an Enterprise Edition of Oracle, and you don&#39;t have any pack licenses, you should explicitly set this option to NONE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I myself find this default value very much up to discussion. When a junior DBA installs a database for the company he starts working for, creates unknowingly a huge risk of extra costs when subjected to a License Audit.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The solution is easy, but also easily forgotten when installing a new database release:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; alter system set control_management_pack_access=NONE scope=both;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/8503722710346058443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2022/10/diagnostic-tuning-packs-automatically.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8503722710346058443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8503722710346058443'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2022/10/diagnostic-tuning-packs-automatically.html' title='DIAGNOSTIC &amp; TUNING packs automatically used'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitxBjZ_WLH6hK48hlyVLRTcQR80lhQu9Gp6zVj57OxvkfleZOoxDcrpzEmM3VS6g6yTfUdgvLxKBVCCl8Gvyx0chcYy7AGj2r-Wuj_8VLtT6be1P5iQSHJwv_ymS_AgXyfNZ1e22QcrzohRdsk3OUbbz4GUartjY4BTuKeMTQ-GdiKQw1R7qZUm0ca/s72-w389-h172-c/OEMlist.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-1734096551430467219</id><published>2022-09-14T16:25:00.003+02:00</published><updated>2023-11-07T22:23:07.017+01:00</updated><title type='text'>Using Oracle Wallets</title><content type='html'>&lt;p&gt;An Oracle Wallet is a file that contains encrypted credentials for databases. This prevents the use of hardcoded passwords in scripts and/or on the command line.&amp;nbsp;&lt;br /&gt;When using an Oracle Wallet the username and password are retrieved from this file on setting up the connection.&amp;nbsp;&lt;/p&gt;&lt;p&gt;The goal of using a wallet is to increase security. There were scripting in small companies usually contain plain-text passwords, the use of an Oracle Wallet can change this, when e.g. a company increases and more employees are using these scripts.&lt;/p&gt;&lt;p&gt;A small disadvantage of using an Oracle Wallet is that the wallet can contain only one set of credentials per database name.&amp;nbsp;&lt;br /&gt;Since it however uses TNS entries to connect to a database, one can store this one set of credentials per TNS name.&amp;nbsp;&lt;br /&gt;So in the case that you have a database called ORADB, TNS entries for each user group can be created in tnsnames.ora and thus credentials for each group.&amp;nbsp;&lt;br /&gt;Using e.d. credentials for batch jobs and other credentials for an application, two entries in tnsnames.ora would be sufficient to support his, e.g. ORADB_BATCH &amp;amp; ORADB_APP.&lt;/p&gt;&lt;p&gt;Setting up the use of a Wallet is easy. First of course a wallet has to be created. Use the following command to do so:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -create&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;The entered location is a directory where the wallet is created. Make sure the directory used exists.&lt;br /&gt;The command will ask you to enter a password. This password is used to encrypt the Wallet. Store this Wallet password somewhere on a safe place. It is needed every time when adding/removing or changing entries in the wallet.&amp;nbsp;&lt;/p&gt;&lt;div&gt;Adding/Deleting or changing entries in a wallet uses a similar syntax. Every type of action you perform on a wallet uses the &quot;mkstore&quot; command.&amp;nbsp;&lt;br /&gt;Adding an entry is done like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;mkstore -wrl&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;/u01/oradata/wallet&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;-createCredential TNS_NAME USER PASSWORD&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mksore -wrl /u01/oradata/wallet -createCredential ORADB_APP scott&amp;nbsp; tiger&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But now how do scripts use the wallet?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First we need to setup sqlnet.ora This file is usually found in the location defined by $TNS_ADMIN. IF it is not present, then create a new file and add the following contents to it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;WALLET_LOCATION =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;(SOURCE =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(METHOD = FILE)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;(METHOD_DATA =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(DIRECTORY = /u01/oradata/wallet)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQLNET.WALLET_OVERRIDE = TRUE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The WALLET_LOCATION part is self-explaining.&amp;nbsp;&lt;br /&gt;The WALLET_OVERRIDE parameter allows this method to override any existing OS authentication configuration.&amp;nbsp;&lt;/div&gt;&lt;div&gt;When adding an sqlnet.ora file or making changes to it, a listener restart is required to activate it.&lt;/div&gt;&lt;div&gt;This means that switching to the use of a wallet, requires a brief unavailability of the database for the business.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using the wallet is now easy.&amp;nbsp;&lt;br /&gt;Any connections to the database not using a credential, will use the stored credential in the wallet, e.g.:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;sqlplus /@ORADB_APP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;will succesfully login to the database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To manage the wallet over time, the following commands can be needed:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;1. List all wallet entries&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -listCredential&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Show password for specific entry&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -listCredential&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using presented list, use the INDEXnumber , e.g.:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -viewEntry oracle.security.client.password13&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Manual entry creation (TNS connection name must be unique) within wallet&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -createCredential TNS_NAME USER PASSWORD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -createCredential oradb_app scott tiger&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Manual entry deletion&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -deleteCredential TNS_NAME&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will delete &quot;all&quot;, entries for this TNS_NAME, but since a wallet can store only one credential per TNS_NAME, it will delete that credential&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. Wallet deletion&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -delete&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that this will delete the complete wallet. All entries are lost !!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6. Modifying an Entry:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;mkstore -wrl /u01/oradata/wallet -modifyCredential TNS_NAME USER PASSWORD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;The wallet is also usable for e.g. RMAN in combination with a catalog database, like:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;$ORACLE_HOME/bin/rman&amp;nbsp; target&amp;nbsp; /&amp;nbsp; &amp;nbsp;catalog&amp;nbsp; /@RMANCAT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/1734096551430467219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2022/09/using-oracle-wallets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1734096551430467219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1734096551430467219'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2022/09/using-oracle-wallets.html' title='Using Oracle Wallets'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-1983155761417829360</id><published>2022-04-29T11:51:00.003+02:00</published><updated>2023-11-07T22:24:00.691+01:00</updated><title type='text'>DBSAT and the risks for EBS databases</title><content type='html'>&lt;p&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;A couple of months ago we went on investigating the capabilities of Oracle&#39;s DBSAT, the DataBase Security and Assessment Tool.&lt;/p&gt;&lt;p&gt;The tool itself if powerful, it generates detailed information about vulnerabilities in your databases. The information is presented in readable HTML format that enables quick handling to reduce seurity risks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;However....&lt;/p&gt;&lt;p&gt;One special point of attention is needed here and we already made a mistake here.&lt;br /&gt;DBSAT recognizes the installation of the so-called &quot;sample schema&#39;s&quot; in the scanned database and reports on this detailed, looking like this:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYdc9UDQA6XUFJ6YiPXLD2hPpKlqwUqprRukVZcfVyO38X5UzkIM2DoJx5iJ-2I50J5JPCGqKHFJJF72NCNUx4qiRfr-s13jTDyYqYF44VqXvW3nWyMJS1s1oWPpjkIU6KsUPM-uH1Rp_kifnj8Dw_eogPfrcJKWimV2Z2x-UHob7FTchcrz7yoROw/s397/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;112&quot; data-original-width=&quot;397&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYdc9UDQA6XUFJ6YiPXLD2hPpKlqwUqprRukVZcfVyO38X5UzkIM2DoJx5iJ-2I50J5JPCGqKHFJJF72NCNUx4qiRfr-s13jTDyYqYF44VqXvW3nWyMJS1s1oWPpjkIU6KsUPM-uH1Rp_kifnj8Dw_eogPfrcJKWimV2Z2x-UHob7FTchcrz7yoROw/w499-h140/Capture.PNG&quot; width=&quot;499&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The special point of attention is regarding EBS database, as they have HR and OE schema&#39;s but then for real usage !!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The reporting of DBSAT that Sample Schema&#39;s are installed in EBS databases, which need to be dropped, is a so-called False Positive.&lt;/p&gt;&lt;p&gt;For EBS database DO NOT DROP these schema&#39;s, as it will render the EBS application unusable&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/1983155761417829360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2022/04/dbsat-and-risks-for-ebs-databases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1983155761417829360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1983155761417829360'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2022/04/dbsat-and-risks-for-ebs-databases.html' title='DBSAT and the risks for EBS databases'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYdc9UDQA6XUFJ6YiPXLD2hPpKlqwUqprRukVZcfVyO38X5UzkIM2DoJx5iJ-2I50J5JPCGqKHFJJF72NCNUx4qiRfr-s13jTDyYqYF44VqXvW3nWyMJS1s1oWPpjkIU6KsUPM-uH1Rp_kifnj8Dw_eogPfrcJKWimV2Z2x-UHob7FTchcrz7yoROw/s72-w499-h140-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-3148099740993343228</id><published>2021-11-05T11:17:00.003+01:00</published><updated>2023-11-07T22:24:27.717+01:00</updated><title type='text'>CIO mount on AIX and Oracle 19c</title><content type='html'>&lt;p&gt;Today we faced a really strange issue.&amp;nbsp;&lt;br /&gt;We are in the midst of upgrading all our databases to the Oracle 19c release, or patching existing installations to the latest patch level.&lt;/p&gt;&lt;p&gt;After working through a lot of databases on Redhat 7.x without any problems, the first database to be upgraded on IBM AIX7.2 was next. &lt;br /&gt;Release installation went fine, patching to the latest level also went without issues.&lt;/p&gt;&lt;p&gt;However when creating an empty CDB to house/upgrade the 12.1 PDB, we ran into strange problems. DBCA threw an error ORA-00205: error identifying control file:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8078PlvYNijDFj8h9rBKTLC0omPfpGxc39XaztsXCkUBI-lizd7Hqzf_OBtqCDL4OJcOGcGj0xic8h5wB6QKc0AyF0nO3bzDFTFk2Red0ZcLDMkBEHtplKpVvpwjFyn4lKrAHlwh1sMg/s805/dbca1.JPG&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;636&quot; data-original-width=&quot;805&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8078PlvYNijDFj8h9rBKTLC0omPfpGxc39XaztsXCkUBI-lizd7Hqzf_OBtqCDL4OJcOGcGj0xic8h5wB6QKc0AyF0nO3bzDFTFk2Red0ZcLDMkBEHtplKpVvpwjFyn4lKrAHlwh1sMg/w397-h314/dbca1.JPG&quot; width=&quot;397&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Looking at the file system location where the databases was planned to be, control files were present as expected.&amp;nbsp;&lt;br /&gt;Oracle support suggested to run a DBverify on the file, but that also sh&lt;span style=&quot;font-family: times;&quot;&gt;owed n&lt;/span&gt;o errors:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;$ORACLE_HOME/bin/dbv file=/opt/hisd01/db01/control01.ctl blocksize=16384&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;DBVERIFY: Release 19.0.0.0.0 - Production on Fri Nov 5 08:54:12 2021&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;Copyright (c) 1982, 2019, Oracle and/or its affiliates.&amp;nbsp; All rights reserved.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;DBVERIFY - Verification starting : FILE = /opt/hisd01/db01/control01.ctl&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;DBVERIFY - Verification complete&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;Total Pages Examined&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 880&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Processed (Data) : 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Failing&amp;nbsp; &amp;nbsp;(Data) : 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Processed (Index): 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Failing&amp;nbsp; &amp;nbsp;(Index): 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Processed (Other): 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Processed (Seg)&amp;nbsp; : 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Failing&amp;nbsp; &amp;nbsp;(Seg)&amp;nbsp; : 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Empty&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 880&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Marked Corrupt&amp;nbsp; &amp;nbsp;: 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Influx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Total Pages Encrypted&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 0&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;Highest block SCN&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 0&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;DBverify did not show any problems with the file. All pages were empty, but that is explained by the fact that the control files were newly created.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;So, then what is the problem?&lt;br /&gt;Why does the same action on Redhat 7.2 work like a charm, but throws this strange error on IBM AIX ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;For the answer we need to go back in time:&lt;/p&gt;&lt;p&gt;With the older Oracle releases running on IBM AIX, it was common to mount the file systems that contained database files and/or redo-log files with the CIO option. This enabled Concurrent I/O for the Oracle database, bypassing the file system cache.&lt;br /&gt;As of Oracle 10g this requirement has changed.&lt;br /&gt;I must admit that we never spend much attention on this change, as our UNIX system-admins were still delivering us systems with file systems that were CIO-mounted and performance was OK on all servers.&lt;/p&gt;&lt;p&gt;A very detailed explanation about CIO on AIX can be found &lt;a href=&quot;http://aix4admins.blogspot.com/2020/05/oracle-tuning-resource-limits-ulimits.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first time we hit a problem regarding CIO mounted file systems, was when we copied an existing database-server running on Oracle 11.2.0.4 to a new IBM Storage System (FS7200). As this was a full clone, were nothing on server side changed, we were puzzled by the fact that we could not start the database anymore, after the copy. &lt;br /&gt;Similar errors appeared about the control files that suddenly would be corrupted.&amp;nbsp;&lt;br /&gt;&lt;u&gt;Because &lt;/u&gt;it was a full clone, we never suspected the database itself. It had to be in the move to the new storage system. We then decided to remove the CIO option from the mount-point which solved the problem.&lt;/p&gt;&lt;p&gt;The whole problem is related to the fact that the default value of the filesystemio_options parameter has changed with the release of 19c. In Oracle 12c ( 12.1.0.2) the value of this parameter was default set to &quot;async&quot;, which enables asynchronous I/O where possible.&lt;/p&gt;&lt;p&gt;In release 19c the value of the filesystemio_options parameter is default set to &quot;none&quot; (on&amp;nbsp; Linux), which disables all I/O performance enhancements.&lt;br /&gt;When upgrading our first databases from Oracle 12c to 19c on Redhat 7.x, we ran into a huge degrade of I/O performance, because of this. The databases suddenly went from Asynchronous I/O to Synchronous I/O.&lt;br /&gt;Investigating the issue, it revealed that this parameter had changed with the new release. We then decided to set it to the recommended value of &quot;setall&quot;, which enables Direct I/O and Asynchronous I/O where possible.&amp;nbsp;&lt;br /&gt;I/O speed on Redhat immediately increased back to what we expected, resulting in the fact that we decided to make this value the default for all our databases.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;And there the problem with IBM AIX was originating. As the database want to open a file using Direct I/O and the file system is mounted with CIO, the files can not be read.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Conclusion:&lt;br /&gt;- When using Oracle set the filesystemio_options parameter to &quot;setall&quot;&lt;br /&gt;- When using Oracle on AIX, do not mount the file systems with the CIO option (anymore)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/3148099740993343228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2021/11/cio-mount-on-aix-and-oracle-19c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/3148099740993343228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/3148099740993343228'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2021/11/cio-mount-on-aix-and-oracle-19c.html' title='CIO mount on AIX and Oracle 19c'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8078PlvYNijDFj8h9rBKTLC0omPfpGxc39XaztsXCkUBI-lizd7Hqzf_OBtqCDL4OJcOGcGj0xic8h5wB6QKc0AyF0nO3bzDFTFk2Red0ZcLDMkBEHtplKpVvpwjFyn4lKrAHlwh1sMg/s72-w397-h314-c/dbca1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-8065331504996335495</id><published>2020-11-06T11:00:00.009+01:00</published><updated>2023-11-07T22:25:10.249+01:00</updated><title type='text'>Configuring Clients for Database Gateway for Websphere MQ 19c</title><content type='html'>&lt;p&gt;In this post, I will try to explain the upgrade of Database Gateway for MQ to version 19c. &lt;br /&gt;It comes with two problems that makes an upgrade from e.g. Database Gateway 12c to 19c a bit more challenging than one would expect.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;No support for PDBs&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The first problem to address is that Database Gateway setup scripts for the clients do still have no support for Pluggable Databases (PDBs). Already the 12c version scripts, used to deploy the code in a client database had to be manually edited to correct the connection string. Back then this was still understandable as the major bulk of existing client database was a single instance database.&amp;nbsp;&lt;br /&gt;In version 19c, I would expect to see some kind of support for the use of PDBs, but there is not. In both versions you still have to edit the deployment files when using it with a PDB. Otherwise the packages will be installed in the CDB, where they are not accessible from the PDBs.&lt;/p&gt;&lt;p&gt;The first thing that needs to be fixed, is that the pgmdeploy.sql program simply exits without doing a thing. This is caused by the &quot;whenever sqlerror exit&quot; in the beginning of the script, followed by a connection attempt using the &quot;scott/tiger&quot; account, that (should) nowhere exist.&amp;nbsp;&lt;br /&gt;The general way to solve this is to comment out the line that has this connect command. It is around line 65 in the script. Simply put two dashes in front of it, to comment it out.&lt;/p&gt;&lt;p&gt;The second line that needs to be edited is found on line 111 of the pgmdeploy script. There the connection string used, should be appended with the PDB name the installation will take place in.&lt;/p&gt;&lt;p&gt;Change the lines:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;PROMPT Verifying SYS Password...&lt;br /&gt;connect SYS/&amp;amp;INPASS2 as sysdba&lt;/span&gt;&lt;/p&gt;&lt;div&gt;into&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;PROMPT Verifying SYS Password...&lt;br /&gt;connect SYS/&amp;amp;INPASS2@&amp;lt;PDB NAME&amp;gt; as sysdba&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;For the pgmundeploy.sql the same needs to be done on line 91.&lt;/p&gt;Remark: There were the scripts used with a single instance database were able to continue, by simply using the [Enter] key only, with a PDB you actually have to specify a SYS password.&lt;br /&gt;&lt;p&gt;Now the deploy and undeploy scripts should work OK, for Oracle 19c clients, but.....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;No support for lower level databases&lt;/b&gt;&lt;/p&gt;&lt;p&gt;We all know that Oracle 12.1 is out of support, not even speaking about Oracle 11 databases. &lt;br /&gt;When you because of that, decide to upgrade Database Gateway 12c to Database Gateway 19c, you will run into a major but solvable issue, when the client databases you use are on Oracle 12.1 or even lower.&lt;br /&gt;&lt;br /&gt;If you however start using Database Gateway now for the first time and you decide to start with the latest (19c) release, then this issue is not easy to solve.&lt;br /&gt;&lt;br /&gt;The problem is that as of release 12.2 ( 19c is 12.2.0.4), the DBMS_STANDARD package has been extended with a new variable&amp;nbsp;&lt;span style=&quot;background-color: #eeeeee; font-family: monospace; font-size: 16px;&quot;&gt;ORA_MAX_NAME_LEN&lt;/span&gt;&amp;nbsp;and some dependent functions.&amp;nbsp;&lt;br /&gt;Oracle Database Gateway 19c uses this new variable, which does not exist on lower level databases.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;This makes the deploy of the PGM packages on Oracle 11 and Oracle 12.1 database impossible.&lt;br /&gt;Only if you have or can get the deploy scripts for an earlier Database Gateway release then you can use Database Gateway 19c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/p&gt;&lt;p&gt;To use an Oracle Database 11g or 12.1 with Database Gateway 19c, you should use the Database Gateway 12.1 deploy scripts.&lt;br /&gt;As soon as they are deployed, you need to replace the library definition for&amp;nbsp;LIBDG4MQ that has been created, making it point to the new 19c location of the library.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Use a statement similar to this and execute it as SYS in the client database ( PDB or single instance):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;create or replace library LIBDG4MQ as &lt;br /&gt;&#39;[your dbgateway_home]/lib/libdg4mqc.so&#39; &lt;br /&gt;transactional;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Afterwards recompile all PGM packages under the SYS schema and your done. Note that the PGM_UTL8 package remains Invalid. This is expected.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/8065331504996335495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2020/11/configuring-clients-for-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8065331504996335495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8065331504996335495'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2020/11/configuring-clients-for-database.html' title='Configuring Clients for Database Gateway for Websphere MQ 19c'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-3439355623590808709</id><published>2020-11-03T17:08:00.006+01:00</published><updated>2023-11-07T22:26:31.800+01:00</updated><title type='text'>DBCA hangs after entering Database Location (19c)</title><content type='html'>&lt;p&gt;Today we were installing a new Oracle server on IBM Pseries running AIX 7.2.&lt;br /&gt;The installation was done with the, at this moment, newest release of Oracle, being 19.9&lt;/p&gt;&lt;p&gt;The installation of the base release 19.3 and the release update went successful.&lt;/p&gt;&lt;p&gt;Creating a database however using dbca got stuck after entering the database file location in Step 5.&lt;br /&gt;The trace.log file of dbca only showed:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;INFO: Nov 03, 2020 3:29:54 PM oracle.install.commons.util.StatusControl showMessage&lt;br /&gt;INFO: Validating writability of the storage location provided&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;Since this was a new server and we already had installed multiple servers with this Oracle release but on Redhat Enterprise Linux 7, we suspected the AIX server to be the cause of this problem.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;UNIX administrators were involved and together we started searching for the cause.&lt;br /&gt;The file location was writable, the process state using &quot;truss&quot; showed a continues loop of checks, with certain repeating functions like &quot;ptx_get_cpuinfo&quot;, &quot;ptx_get_wparsysinfo&quot; and&amp;nbsp; &quot;ptx_get_wparsysstats&quot; etc..etc..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Oracle Support gave some result on these functions, but these results where linked to &#39;srvctl&#39; and not &#39;dbca&#39;. After entering a more detailed search description:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&quot;dbca hang database files location&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the first result was &lt;a href=&quot;https://support.oracle.com/epmos/faces/DocumentDisplay?id=2706037.1&amp;amp;displayIndex=1#FIX&quot; target=&quot;_blank&quot;&gt;Doc ID 2706037.1&lt;/a&gt; with the title:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Database creation via DBCA hangs when the database files location does not include {DB_UNIQUE_NAME}&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It turns out that according to this Doc that DBCA as of release 19.3 requires a DB_UNIQUE_NAME in the file location, whenever you deviate from the given default.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Again, on Linux we have never seen this issue, and all our systems have the same non-oracle-default setup.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;After appending our default location, with this DB_UNIQUE_NAME, dbca continued as expected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Conclusion:&amp;nbsp; On AIX it seems that DBCA can&#39;t work with a non-default database location, if it does not contain the DB_UNIQUE_NAME. &lt;br /&gt;It does however also not generate an error message to tell you about this. &lt;br /&gt;It simply gets stuck.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;However AIX is a very stable and reliable operating system, I tend to move all databases to Linux, since it is more reliable and thrustfull.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/3439355623590808709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2020/11/dbca-hangs-after-entering-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/3439355623590808709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/3439355623590808709'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2020/11/dbca-hangs-after-entering-database.html' title='DBCA hangs after entering Database Location (19c)'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-1392622487643009142</id><published>2020-10-16T10:53:00.004+02:00</published><updated>2023-11-07T22:26:52.105+01:00</updated><title type='text'>Top Activity option in OEM13 gone</title><content type='html'>&lt;p&gt;&amp;nbsp;After an upgrade from Oracle Enterprise Manager 12c to version 13c, we noticed that we had lost the &quot;Top Activity&quot; option, that used to be in the Performance Menu of the database page.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkIfG7ompZXDV41jRHgU5GM3Z752G8CDaNMdQi_tNZvqFyWwCPCPgTFYizd3Ydjs2E9a7s1HCrvNKqVFfh3Wfnpm0t6AvMq16DUUIdOiyk5dJnV0TLvOJg6Th5ziXyXAVQqicIZo6zsMU/s479/PerformanceMenu.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;329&quot; data-original-width=&quot;479&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkIfG7ompZXDV41jRHgU5GM3Z752G8CDaNMdQi_tNZvqFyWwCPCPgTFYizd3Ydjs2E9a7s1HCrvNKqVFfh3Wfnpm0t6AvMq16DUUIdOiyk5dJnV0TLvOJg6Th5ziXyXAVQqicIZo6zsMU/s320/PerformanceMenu.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Seen here is the Performance Menu of the version 13 of Oracle Enterprise Manager.&lt;/p&gt;&lt;p&gt;Below the &quot;Performance Home&quot; option the &quot;Top Activity&quot; option was available in version 12c&lt;/p&gt;&lt;p&gt;As you can see however, we are still able to access the screen.&lt;br /&gt;It does still exist. It is only that the menu option is gone.&lt;br /&gt;Luckily we kept the old http-link from version 12c, which we had saved as a Favorite in the browser.&lt;br /&gt;&lt;br /&gt;Accessing this page was now possible by simply editing this saved link and changing the server name.&lt;/p&gt;&lt;p&gt;For all of you who didn&#39;t save this link and also upgraded to the new version, the link looks like this:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;https://&amp;lt;your oem13 server&amp;gt;:7803/em/faces/sdk/nonFacesWrapper?target=&amp;lt;SID&amp;gt;&amp;amp;_em.coBM=%2Fconsole%2Fdatabase%2Finstance%2FwaitDetails%3F_em.coIFR%3Dtrue%26event%3DdoLoad%26target%3D&amp;lt;SID&amp;gt;%26type%3Doracle_database%26datasource%3DSQL%26waitClass%3DOverview&amp;amp;type=oracle_database&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Replace &amp;lt;your oem13 server&amp;gt; with the hostname of your Oracle Enterprise Manager server and &amp;lt;SID&amp;gt; with the database instance you want to monitor.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Keep in mind that this page requires the Oracle Diagnostic Pack license to access.&lt;/b&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIgXNgAaGXgkT9m4hT9Zdq65tvHF4zO-Pqglq3W7vhI3QWSwUM-aoOBoWVEHcmknQH4hJvKc48pcXwIhjn6cqNncDe3i7TcdqPuS_5ImSUZCBzbo2HuKbiA3ERVayt11T015f4Vmzhb4/s595/ManagementPackAccess.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;595&quot; data-original-width=&quot;466&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoIgXNgAaGXgkT9m4hT9Zdq65tvHF4zO-Pqglq3W7vhI3QWSwUM-aoOBoWVEHcmknQH4hJvKc48pcXwIhjn6cqNncDe3i7TcdqPuS_5ImSUZCBzbo2HuKbiA3ERVayt11T015f4Vmzhb4/s320/ManagementPackAccess.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;If you have the license, you can enable the Diagnostic Pack via Setup =&amp;gt; Management Pack =&amp;gt; Management Pack Access.&lt;p&gt;&lt;/p&gt;&lt;p&gt;You can also enable it from SQLplus by entering the command:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: x-small;&quot;&gt;SQL&amp;gt; alter system set&amp;nbsp;control_management_pack_access=&#39;DIAGNOSTIC&#39; scope=both;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/1392622487643009142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2020/10/top-activity-option-in-oem13-gone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1392622487643009142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/1392622487643009142'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2020/10/top-activity-option-in-oem13-gone.html' title='Top Activity option in OEM13 gone'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkIfG7ompZXDV41jRHgU5GM3Z752G8CDaNMdQi_tNZvqFyWwCPCPgTFYizd3Ydjs2E9a7s1HCrvNKqVFfh3Wfnpm0t6AvMq16DUUIdOiyk5dJnV0TLvOJg6Th5ziXyXAVQqicIZo6zsMU/s72-c/PerformanceMenu.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-352867080508429594</id><published>2019-09-26T16:25:00.001+02:00</published><updated>2023-11-07T22:28:07.716+01:00</updated><title type='text'>ORA-01017 on CONNECT / AS SYSDBA after changing OS user/group</title><content type='html'>From an existing database server the database Instance name and the OS-user and -group running the database had to change, as the database itself went from Development environment to Test environment.&lt;br /&gt;
The database was called &quot;STID01&quot;, its OS-user &quot;stid01&quot; with the group &quot;dbad01&quot;&lt;br /&gt;
&lt;br /&gt;
Everything was running just fine before the change.&lt;br /&gt;
It was intended to change the database name to &quot;STIT01&quot; and its OS-user to &quot;stit01&quot;, with the OS-group set to &quot;dbat01&quot;.&lt;br /&gt;
So a very simple change.&lt;br /&gt;
&lt;br /&gt;
We brought down the database and the UNIX admins changed the OS-username, its OS-group and renamed file system mount points also, as they also contain the Dev environment name.&lt;br /&gt;
&lt;br /&gt;
When I got the machine back, I ran a command to find all files on the system that belonged to the old user and changed their ownership to the new username and group.&lt;br /&gt;
After that I relinked the Oracle binaries, using the &quot;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;$ORACLE_HOME/bin/relink all&lt;/span&gt;&quot; command.&lt;br /&gt;
&lt;br /&gt;
Finally I updated the /etc/oratab, renamed and edited the initSTID01.ora file to match the new configuration and I also created a new password file.&lt;br /&gt;
&lt;br /&gt;
Now trying to connect to the database, it generated an ORA-01017 error on connect as &quot;/ as sysdba&quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;[stit01@vtl1g152 oraInventory]$ sqlplus / as sysdba&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 26 14:50:57 2019&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;Copyright (c) 1982, 2014, Oracle.&amp;nbsp; All rights reserved.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;ERROR:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;ORA-01017: invalid username/password; logon denied&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Connecting as user SYS with its password, entered in the password file did work.&lt;br /&gt;
So I started working on renaming the Instance and datafile locations using a generated control file script:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt;&amp;nbsp; alter database backup controlfile to trace as &#39;/tmp/crctrlfile.sql&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Afer renaming the database using the generated script the database was opened with the RESETLOGS option.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now I updated /etc/oratab, /etc/oraInst.loc and the .bash_profile file and reconnected.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Connecting with &quot;/ as sysdba&quot; still generated the same&amp;nbsp; ORA-01017 however&lt;/div&gt;
&lt;br /&gt;
Remembering a similar issue on IBM AIX, I went browsing the Internet.&lt;br /&gt;
Looking up things on Google, the main line of thinking in the results was based on the change of the OS-group. The user running the database, or wanting to connect as sysdba without a password should be member of a privileged dba-group set during the installation.&lt;br /&gt;
&lt;br /&gt;
During the installation of this ORACLE_HOME this group was understandably set to &quot;dbad01&quot;.&lt;br /&gt;
Now that we are part of group &quot;dbat01&quot; this OS authentication fails.&lt;br /&gt;
&lt;br /&gt;
This brought me into looking into the installation and setup of the ORACLE_HOME.&lt;br /&gt;
From ORACLE_HOME I ran a &quot;find&quot; command for all files containing the OS-group &quot;dbad01&quot;.&lt;br /&gt;
Two files came up as suspicious:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;./install/chainedInstall/globalcontext.xml&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;./rdbms/lib/config.c&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Especially the first one got my attention as a line in this file looked like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9u_yGyfGzQsX6eN9vKuAVQI0TnaJ6ppp22KIUlL4_XrS69d-2Y-Unb4Cggq3eELJJkE75EdiqSuPEgBmF7p45v-6no_j36bXUcUWHIdmy5v3nzB3MUF1oaSw_jk5x5VMB0ILJsE2tq7E/s1600/GlobalContextXml.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;120&quot; data-original-width=&quot;778&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9u_yGyfGzQsX6eN9vKuAVQI0TnaJ6ppp22KIUlL4_XrS69d-2Y-Unb4Cggq3eELJJkE75EdiqSuPEgBmF7p45v-6no_j36bXUcUWHIdmy5v3nzB3MUF1oaSw_jk5x5VMB0ILJsE2tq7E/s1600/GlobalContextXml.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Changing this file, setting the VALUE to &quot;dbat01&quot;, I ran a &quot;relink all&quot; again.&lt;br /&gt;
Still no luck, again an ORA-01017 when trying to connect.&lt;br /&gt;
&lt;br /&gt;
So, back to editing the next file.&lt;br /&gt;
Editing the file $ORACLE_HOME/rdbms/lib/config.c showed a whole list of variables set to &quot;dbad01&quot;. Looking at the location, this file is used for recompiling the library files.&lt;br /&gt;
&lt;br /&gt;
So we &quot;relink all&quot; again....and.... :&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;sqlplus / as sysdba&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 26 16:08:01 2019&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;Copyright (c) 1982, 2014, Oracle.&amp;nbsp; All rights reserved.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;Connected to an idle instance.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Yes, we fixed it&lt;/b&gt;. This confirms that the OS-group is the variable that controls password less authentication at SYSDBA level.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now this post reads more or less like a &quot;try or die&quot; post, but in fact it wasn&#39;t.&lt;/div&gt;
&lt;div&gt;
All changes before I went looking for the group-definition in the ORACLE_HOME are basic, well understandable changes that have to be done, when the OS-user and OS-group change on an Oracle database server&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For the remainder, I had seen and done this before on IBM AIX, but not yet on Linux.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The Post is therefore written following me searching for the right file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/352867080508429594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2019/09/ora-01017-on-connect-as-sysdba-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/352867080508429594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/352867080508429594'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2019/09/ora-01017-on-connect-as-sysdba-after.html' title='ORA-01017 on CONNECT / AS SYSDBA after changing OS user/group'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9u_yGyfGzQsX6eN9vKuAVQI0TnaJ6ppp22KIUlL4_XrS69d-2Y-Unb4Cggq3eELJJkE75EdiqSuPEgBmF7p45v-6no_j36bXUcUWHIdmy5v3nzB3MUF1oaSw_jk5x5VMB0ILJsE2tq7E/s72-c/GlobalContextXml.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-4580715040800192206</id><published>2019-05-17T14:43:00.001+02:00</published><updated>2019-05-17T14:43:48.687+02:00</updated><title type='text'>Calculating Table Sizes Oracle</title><content type='html'>In this post I will discuss the growth of tables, and the ways to calculate the space used.&lt;br /&gt;
For the newbies among us, an Oracle databases exists of tablespaces, the defined space consisting of datafiles on disk, that hold the databases objects, like tables and indexes.&lt;br /&gt;
&lt;br /&gt;
When a table grows, a tablespace can become full. The origin of this document is from one of these occassions where a tablespace is/was full and I was trying to free up space.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;But first some theory:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
How do tables grow in Oracle?&lt;br /&gt;
&lt;br /&gt;
Well that&#39;s an easy question, one would think, but depending on the way a table is used, the table can either grow slowly, grow very fast, or keep approximately the same size.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;When, in the last example, a table consists of very volatile data, so many inserts and deletes occur during a certain period of time, the database will use the space freed by the deletes for the new rows.&lt;/li&gt;
&lt;li&gt;When there are more rows added than there are deleted, a table will grow, as new rows are added at the end of the table, behind the so-called high-water-mark of the table.&lt;/li&gt;
&lt;li&gt;When an application uses a &#39;direct-insert&#39; method, mostly seen in bulk-loads, the data is inserted after the high water mark anyway, so the database does in that case not look for free space within the existing occupied space.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
That about how a table can grow, and of course this covers not all aspects that are involved.&lt;br /&gt;
We will address more dependencies, as we discuss the table&#39;s actual size.&lt;br /&gt;
&lt;br /&gt;
First we need make a small sidestep and discuss &quot;statistics&quot;.&lt;br /&gt;
&lt;br /&gt;
Oracle database statistics contain information about your data. Statistics information consists e.g. of the number of rows in a table, the average length of a row, the spreading of the data in the different columns and more. Via&amp;nbsp;&lt;a href=&quot;https://www.dummies.com/programming/databases/oracle/oracle-database-statistics/&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;link, you can find &quot;Oracle Database Statistics for Dummies&quot;.&lt;span id=&quot;goog_698627528&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now that we now, we can find the number of rows in a table on another way than running a &quot;select count(*)..&quot;, then we are able to calculate the size of the data within the table.&lt;br /&gt;
With that we can make a seperation between the actual physical size and the used size of a table.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGsmJhrsSlQt37CGickzACqL6gof4s7PDaEo0decYAxFj2sBQkL6Mbh55ZhKQ8GLQPSN9II1SYW2_LiK-itgV6v2Da_8JHwKnq8c0WKYT1PYx8PSOY_rBx7sxxN-5qyyIme5F5Lev7VhY/s1600/peasbowl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;533&quot; data-original-width=&quot;640&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGsmJhrsSlQt37CGickzACqL6gof4s7PDaEo0decYAxFj2sBQkL6Mbh55ZhKQ8GLQPSN9II1SYW2_LiK-itgV6v2Da_8JHwKnq8c0WKYT1PYx8PSOY_rBx7sxxN-5qyyIme5F5Lev7VhY/s200/peasbowl.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Imagine this bowl being a table. When we have calculated statistics on this bowl, we know that there are -approx.- 100 rows (peas) in this table, with an average row-size of 1 pea.&lt;br /&gt;
&lt;br /&gt;
The physical size of the bowl can be compared with the physical size of the table. This physical size consists of a 100 rows (peas) and a lot of free space, in this case air.&lt;br /&gt;
&lt;br /&gt;
If we wouldn&#39;t have table statistics, we would not know the occupied size of the table, but only the physical size. In that case we would not be able to tell anything of the tables usage.&lt;br /&gt;
&lt;br /&gt;
However when we do have statistics, we can tell more about the table&#39;s actual size. Oracle has options to shrink a table back to its used size, in order to free up space in the database but also to increase performance of the table, especially with inserts. If a table has a lot of free space, most of the time very fragmented, then the database possibly needs to spend lots of time to find a suitable empty spot in the table, where a row that is inserted would fit.&lt;br /&gt;
If we shrink the table to its used size, the database does not need to spent much time on looking for a free place and put the row at the end of the table. This is of course valid for so long, as there will be done new deletes again, which free up usable space again.&lt;br /&gt;
&lt;br /&gt;
Now imagine this situation of a huge table, having a lot of free space in it. The below query shows us that the table INVOICES only has 49% of actual used space:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;select ds.owner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, ds.segment_name tabname&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, ds.bytes&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, dt.num_rows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, dt.avg_row_len&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, dt.num_rows * dt.avg_row_len usedsize_bytes&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, round(dt.num_rows * dt.avg_row_len / ds.bytes * 100,1) &quot;%used&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;from&amp;nbsp; &amp;nbsp;dba_segments ds&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;, dba_tables dt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;where&amp;nbsp; &amp;nbsp; &amp;nbsp; dt.tablespace_name = &#39;DATA&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and ds.tablespace_name = dt.tablespace_name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and dt.owner = ds.owner&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and dt.table_name = ds.segment_name&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;OWNER&amp;nbsp; &amp;nbsp;TABNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BYTES&amp;nbsp; &amp;nbsp;NUM_ROWS AVG_ROW_LEN USEDSIZE_BYTES&amp;nbsp; &amp;nbsp; &amp;nbsp; %used&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;------- -------- ------------ ---------- ----------- -------------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FINANCE INVOICES&amp;nbsp; &amp;nbsp;9768534016&amp;nbsp; &amp;nbsp; 1204707&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3976&amp;nbsp; &amp;nbsp; &amp;nbsp;4789915032&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;49&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can use the &#39;alter table &lt;table_name&gt; shrink space&#39; command to reduce the physical size of the table.&amp;nbsp;&lt;/table_name&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; alter table FINANCE.INVOICES enable row movement;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; alter table FINANCE.INVOICES shrink space;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This will take some time, depending on the size of a table, but it will shrink the table to its smallest possible size. That is, when everything goes as expected. In our case it didn&#39;t. When running the above query again, the numbers now showed:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;OWNER&amp;nbsp; &amp;nbsp;TABNAME&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BYTES&amp;nbsp; &amp;nbsp;NUM_ROWS AVG_ROW_LEN USEDSIZE_BYTES&amp;nbsp; &amp;nbsp; &amp;nbsp; %used&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;------- -------- ------------ ---------- ----------- -------------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FINANCE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;INVOICES&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp;9753395200&amp;nbsp; &amp;nbsp; 1204707&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3976&amp;nbsp; &amp;nbsp; &amp;nbsp;4789915032&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;49&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The table&#39;s physical size decreased just a little, but not as much as expected.&lt;br /&gt;
So what causes this behavior, what extra factors can/must be taken into account and why can this table not be brought down to its actual data size ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table&#39;s definition here is causing the problem itself. The table is setup as following:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;CREATE TABLE FINANCE.INVOICES&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; INVOICE_ID&amp;nbsp; &amp;nbsp; NUMBER(10)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOT NULL,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; CUSTNO&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NUMBER(8)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOT NULL,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; INVOICE_DESC&amp;nbsp; VARCHAR2(4000 CHAR)&amp;nbsp; &amp;nbsp;NOT NULL,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; INV_AMOUNT&amp;nbsp; &amp;nbsp; NUMBER(10)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;TABLESPACE DATA&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;PCTUSED&amp;nbsp; &amp;nbsp; 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;PCTFREE&amp;nbsp; &amp;nbsp; 10&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;INITRANS&amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
With a database blocksize of 8192, it can easily be determined that only one row of the table fits in a block. The actual available blocksize for row-storage is 8192 - 10% ( pctfree ) = 7372 bytes&lt;br /&gt;
The average row length of the table is 3972, the maximum row_length is approx. 4028 bytes (not taking into account UTF encoding or whatever)&lt;br /&gt;
&lt;br /&gt;
So, it is easily calculated that every block of this table only holds one row, and no more. This is confirmed by looking at the number of rows in the table compared to the number of blocks the table occupies:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; select sum(blocks) from user_Extents where segment_name = &#39;INVOICES&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;2&amp;gt;&amp;nbsp; &amp;nbsp;union all&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;3&amp;gt;&amp;nbsp; &amp;nbsp;select num_rows from user_Tables where table_name = &#39;INVOICES&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CNT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;1190600&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;1206840&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So this table holds approximately 8192 - 3972 =&amp;nbsp;4220 bytes of free space in each block it allocates.&lt;br /&gt;
That is 3400 bytes of free row space +&amp;nbsp; 10% PCTFREE space = 820 bytes !&lt;br /&gt;
&lt;br /&gt;
We can double check if this is correct, by doing the following math:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;physical table size / ( db block size * average_row_length) =&amp;nbsp;4729063200&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This value (almost) matches the value of the USEDSIZE in the above table being 4789915032&lt;span style=&quot;font-family: courier new, courier, monospace; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;Can we optimize these tables in any way at all??&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Well, in our case for every row the database needs to read from disk, a whole block needs to read.&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Put it the other way around, we only get one row when we read one block from disk.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;If we would create a seperate tablespace for this table with 16kB blocksize, then it would make a difference. With still a PCTFREE of 10% we then would be able to store 3 rows in a single block, a 33% decrease of occupied space!!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
A small test showed us that with the current setting (8k blocksize), a test table filled with 69000 rows occupies 68608 blocks&amp;nbsp; ( approx. 536Mb )&lt;br /&gt;
&lt;br /&gt;
If we recreate the same table in a 16k blocksize tablespace, then the same table only occupies 23040 blocks ( approx. 360Mb )&lt;br /&gt;
This saved 33% of physical diskspace as expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Table growth is not only about rows in a table. Tables that are known for frequent data changes, ( inserts/deletes and updates) can benefit from a shrink every now and then.&lt;br /&gt;
However, if this does not bring the expected result as seen above, then the DBA or Data Architects can look at other solutions like different blocksize or maybe a change in the structure of a table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/4580715040800192206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2019/05/calculating-table-sizes-oracle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4580715040800192206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4580715040800192206'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2019/05/calculating-table-sizes-oracle.html' title='Calculating Table Sizes Oracle'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGsmJhrsSlQt37CGickzACqL6gof4s7PDaEo0decYAxFj2sBQkL6Mbh55ZhKQ8GLQPSN9II1SYW2_LiK-itgV6v2Da_8JHwKnq8c0WKYT1PYx8PSOY_rBx7sxxN-5qyyIme5F5Lev7VhY/s72-c/peasbowl.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-7378622967371735886</id><published>2018-07-18T16:17:00.003+02:00</published><updated>2023-11-07T22:28:52.807+01:00</updated><title type='text'>Using Flashback Data Archive for Changed Data Capture</title><content type='html'>&lt;b&gt;What is Change Data Capture?&lt;/b&gt;&lt;br /&gt;
When a row in a table gets updated the content of the table changes. This is also true when data gets inserted or deleted. With Change Data Capture (CDC) you would like to capture all changes made to a certain amount of data.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7P9xN0DgiMJ0UwCmGt69T8O7u7h1x4n6ie0WDqpdFfoKPZa9aGSisi623fySWH66LFJZbvB87rMj9_BRBTRA3ZvsUOoYNIVUWXdIMVqfeUySIqN1YRdwUqeQNdv37FofdTlgpUutBYU/s1600/dollargraph.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1024&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7P9xN0DgiMJ0UwCmGt69T8O7u7h1x4n6ie0WDqpdFfoKPZa9aGSisi623fySWH66LFJZbvB87rMj9_BRBTRA3ZvsUOoYNIVUWXdIMVqfeUySIqN1YRdwUqeQNdv37FofdTlgpUutBYU/s200/dollargraph.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;Take for example the value of the Dollar on the Stock Exchange. In relation to other coin-values the value of the Dollar can change many times during one day.&lt;br /&gt;
If the value is stored in a single row of a table, you only get the current value when looking at it. You never know what happened to it in the period between two look ups.&lt;br /&gt;
If you do need to know what happened in the mean time, it can be very useful to track and record all changes that happened on the value of the Dollar and thus on the table containing the value.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
With Oracle 9i Change Data Capture was introduced, and it made it possible to track changes to tables and store these changes in a separate table.&lt;br /&gt;
Other processes then could &quot;consume&quot; this captured data for further processing. CDC worked by creating triggers on the source tables, that transferred data synchronously to the staging tables. This caused processing overhead and, because it was synchronous, had effect on the applications working on the source tables.&lt;br /&gt;
&lt;br /&gt;
In Oracle 10g Asynchronous CDC was introduced, that captured data from the online redo log files. The triggers that captured the transaction activity were no longer needed and therefore the performance impact was reduced. This redo log capturing of data was combined with Oracle Streams, requiring a certain configuration for each CDC change set.&lt;br /&gt;
Unfortunately the Oracle 10g CDC is only available with Oracle Enterprise Editions. Because the changes where only captured from the redo log files after a commit was received, a minor delay is seen between the commit on the source tables and arrival of the changed data.&lt;br /&gt;
&lt;br /&gt;
In Oracle 11g the Oracle Streams functionality still exists but as of Oracle 12c this functionality along with CDC has been deprecated. It has been replaced by Oracle Golden Gate, which comes as a very expensive per core licensed solution.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Oracle Flashback&lt;/b&gt;&lt;br /&gt;
With Oracle 10g Oracle introduced the Flashback functionality. With Flashback the database recycle-bin was also introduced, enabling Database Administrators to retrieve dropped tables from within the recycle-bin. But the most important functionality of Flashback was the ability to look back in time. Default, depending on the size of the UNDO tablespace and its retention, a DBA was able to e.g&amp;nbsp; restore deleted data from a table shortly after it got deleted.&lt;br /&gt;
&lt;br /&gt;
When flashback was completely enabled on the database, the database would start creating flashback log files, keeping a record of all before-change values of the database up to a certain retention time.&lt;br /&gt;
More information on Oracle Flashback Technology can be found &lt;a href=&quot;http://www.oracle.com/technetwork/database/features/availability/flashback-overview-084412.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Flashback Data Archive&lt;/b&gt;&lt;br /&gt;
The Flashback functionality in Oracle Database has been extended with Flashback Data Archive in Oracle 11g. With Flashback Data Archive (FDA) it is possible to store all changed data on tables involved for a certain retention period or indefinitely.&lt;br /&gt;
There were the standard Flashback functionality writes a before-image of a row-change to a flashback logfile, using FDA this change is written to a table directly related to the table that has configured with FDA.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How does it work:&lt;/b&gt;&lt;br /&gt;
Flashback Data Archive is not only the name of the functionality. It is also a real archive object in the database that has to be created and that will hold all staging tables containing changed data. The archive is preferably created in its own tablespace to be able to manage the size of the archive.&lt;br /&gt;
All is explained by the following example.&lt;br /&gt;
&lt;br /&gt;
First create a tablespace to hold the Flashback Archive:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;create tablespace fb_storage&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;datafile &#39;/u01/oradata/fb_storage01.dbf&#39;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;size 100m autoextend on next 100m maxsize 5G;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the tablespace a Flashback Archive is created. At this point the decision has to be made if a database default archive is to be created, or a user-personal archive will be the best option.&lt;br /&gt;
To create a database default archive, user the tag &quot;default&quot; in the statement and execute it as user SYS:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;create flashback archive&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;default fb_archive&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;tablespace fb_storage&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;quota 4 g retention 1 day;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This creates Flashback Arvchive named &quot;fb_archive&quot;. The option &quot;default&quot; makes this archive the default archive of the database. It is possible to have more archives, but only one can be the default.&lt;br /&gt;
The qouta is set to 4G and the retention of the kept data is set to 1 day;&lt;br /&gt;
This quota is the maximum size of the archive in the given tablespace. If the archive becomes full then operations on the tracked tables will fail.&lt;br /&gt;
If the archive reaches 90% of its given quota, the database will start issuing &quot;out of space&quot; warnings, thus enabling the DBA to purge old data or increase the archive size.&lt;br /&gt;
&lt;br /&gt;
If a user specific archive is to be created, then this user needs to receive the rights to do so first (as user SYS):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;grant flashback archive administer to ehda;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;alter user scott quota unlimited on fb_storage;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
After this the user can create its own archive:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;create flashback archive fb_archive_scott_1day&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;tablespace fb_storage&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;quota 4G retention 1 day;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to put the name of the owner and the retention into the name of the archive. This makes working with archives easier, especially when more than one exists.&lt;br /&gt;
&lt;br /&gt;
The below query shows the just created archive in its tablespace:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select&amp;nbsp; &amp;nbsp;flashback_archive_name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, flashback_archive#&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, tablespace_name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;, quota_in_mb&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;from&amp;nbsp; &amp;nbsp; &amp;nbsp;dba_flashback_archive_ts&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;order by flashback_archive_name;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In order to use the default FDA on a certain table, rights have to be granted to the user owning that table(s) to use the FDA and its tablespace:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;grant flashback archive on fb_archive to scott;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;alter user scott quota unlimited on fb_storage;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The above steps are not needed if a user specific archive has been created.&lt;br /&gt;
&lt;br /&gt;
Now connect as user scott and enable flashback archive on a table that has to be tracked:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;alter table scott.emp flashback archive;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
or for his personal archive, name the archive to be used:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;alter table scott.emp flashback archive&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;fb_archive_scott_1day&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot;, courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Enabling and Disabling a flashback archive functionality on a table can be done by the table owner.&lt;br /&gt;
Disabling is done by a privileged user when using a database default archive.&lt;br /&gt;
&lt;br /&gt;
With the next change of data in the scott.emp table, a old-value ( before image ) is stored in the flashback archive.&lt;br /&gt;
Keep in mind that there is no &quot;before image&quot; for inserted data, so an inserted row is only seen in the flashback archive if it has undergone an update afterwards.&lt;br /&gt;
&lt;br /&gt;
The general documentation about FDA now would show a query about looking at changed data using the following query:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select * from&amp;nbsp; scott.emp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;versions between timestamp sysdate-4/1440&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;and sysdate;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This will show the contents of the scott.emp table including all the updated rows over the last 4 minutes. If the table started empty and only a couple of rows were inserted and changed, then this overview would still be quite readable. If the table however was already populated with a lot of data, you can only find changed data easily if you know (the primary key values of ) the rows that have changed.&lt;br /&gt;
To overcome this, it is also possible to directly query the staging table in the archive which holds only the changed rows. To find this staging table use the following query:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select * from&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp;dba_flashback_archive_tables&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp;where table_name =&#39;EMP&#39;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp;and owner=&#39;SCOTT&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It will return someting similar to this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;TABLE_NAME OWNER_NAME FLASHBACK_ARCHIVE_NAME&amp;nbsp; &amp;nbsp; ARCHIVE_TABLE_NAME&amp;nbsp; &amp;nbsp;STATUS&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;---------- ---------- ------------------------- -------------------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;EMP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SCOTT&amp;nbsp; &amp;nbsp; &amp;nbsp; FB_ARCHIVE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SYS_FBA_HIST_7785&amp;nbsp; &amp;nbsp; ENABLED&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here the archive table name for the SCOTT.EMP table is shown as SYS_FBA_HIST_7785;&lt;br /&gt;
Every table that is tracked with FDA has its own archive table.&lt;br /&gt;
Note that naming convention of archive tables start with &quot;SYS_FBA&quot;. When looking up, knowing this, it shows us that there are in total 3 tables associated with the SCOTT.EMP table in the FDA:&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Table&lt;/td&gt;&lt;td&gt;Description&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: normal;&quot;&gt;SYS_FBA_DDL_COLMAP_7785&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Table that holds a mapping of the columns of the history table to the original table.Because of the administrational overhead, adding or removing a column takes much longer on a tracked table compared to a normal table.&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: normal;&quot;&gt;SYS_FBA_HIST_7785&lt;/span&gt;&lt;/td&gt;&lt;td&gt;This table hold, as mentioned, the before images of the actual rows that have changed.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span style=&quot;font-size: normal;&quot;&gt;SYS_FBA_TCRV_7785&lt;/span&gt;&lt;/td&gt;&lt;td&gt;This table shows the STARTSCN &amp;amp; ENDSCN of the changes, inluding the OPeration that was involved (U=update, I=insert, etc..)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
The SYS_FBA_HIST_xxxx tables are structural identical to a join of the SYS_FBA_TCRV table and the original SCOTT.EMP table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Retrieving changed data:&lt;/b&gt;&lt;br /&gt;
As the archive tables hold the changed data along with SCN numbers, it is not hard to retrieve this data ordered in time, e.g:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select empno,ename,job&amp;nbsp;from&amp;nbsp; SYS_FBA_HIST_7785 order by endscn;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Select the maximum SCN number and retrieve all rows that have been archived before that SCN:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select max(endscn)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;from&amp;nbsp; &amp;nbsp;sys_fba_hist_7785;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;ENDSCN&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;-----------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;10640031020116&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
And then:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;select&amp;nbsp;empno,ename,job&amp;nbsp;from&amp;nbsp;sys_fba_hist_7785 where endscn &amp;lt; 10640031020116;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Purging the Flashback archive:&lt;/b&gt;&lt;br /&gt;
Besides the configured retention which would purge old data from the archive it is also possible to manually purge the data.&lt;br /&gt;
According to the Oracle Documentation, purging is possible based on SCN or TIMESTAMP, or by iussuing the command &quot;purge all&quot;, deleting all data.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Warning:&lt;/b&gt; What the official documentation fails to mention is that there is a bug in Oracle 11.2 and 12.1 which prevents purging the FDA based on SCN or TIMESTAMP. Only in 12.2 this bug is solved (Doc ID 16898135.8).&lt;br /&gt;
There is however a one-off patch available for Oracle 11.2.0.3 and and 11.2.0.4.&lt;br /&gt;
&lt;br /&gt;
So until this patch is installed, only &quot;purge all&quot; is a working solution, but that brings a timing problem as to when it is suitable to purge all data looking at the application that might be populating the table in the mean time. One can imagine that between reading the captured data and executing a &quot;purge all&quot;, new data might have been archived, so an&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;alter flashback archive fb_archive purge all;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
can possibly lead to data loss if the application that is responsible for populating the table is not shutdown beforehand.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DDL Limitations:&lt;/b&gt;&lt;br /&gt;
Before explaining on how to disable the tracking of data changes and dropping the archive, one DDL restrictions on tracked tables has to be mentioned.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Dropping the table&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Simple, isn&#39;t it??&lt;br /&gt;
There is documentation found on the Internet, even within well-known Blogs where it is stated that a tracked table can also not be truncated or renamed or undergo column changes.&lt;br /&gt;
This is however not true. Only dropping the table is not allowed and will generate an error:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;drop table scott.emp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;Error at line 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;ORA-55610: Invalid DDL statement on history-tracked table&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Disable / Remove the Flashback Data Archive:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Before an FDA can be removed, all tables that are tracked need to be decoupled, using the statement:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;alter table ehda.cohead&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;&amp;nbsp;no flashback archive;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In tests I ran, a common user ( owner of the table ) can enable the flashback archive function on a table, but disabling this generates an error:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;ORA-55620: No privilege to use Flashback Archive&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
A privileged user has to execute this command.&lt;br /&gt;
&lt;br /&gt;
As soon as all tables have be decoupled from the FDA, the FDA can be dropped:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;drop flashback archive fb_archive;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
After that also the tablespace can be dropped. Make sure before using the below command that the tablespace is really empty.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: normal;&quot;&gt;drop tablespace fb_storage including contents and datafiles;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;
I was really excited to learn about this -for me- new functionality. It brings a very easy way to capture changed data. The solution is easy to implement, comes with no downtime, or impact to the application or database.&lt;br /&gt;
Unfortunately there are still some bugs that prevent flawless use, unless the database is upgraded to 12.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/7378622967371735886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2018/07/using-flashback-data-archive-for.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7378622967371735886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7378622967371735886'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2018/07/using-flashback-data-archive-for.html' title='Using Flashback Data Archive for Changed Data Capture'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7P9xN0DgiMJ0UwCmGt69T8O7u7h1x4n6ie0WDqpdFfoKPZa9aGSisi623fySWH66LFJZbvB87rMj9_BRBTRA3ZvsUOoYNIVUWXdIMVqfeUySIqN1YRdwUqeQNdv37FofdTlgpUutBYU/s72-c/dollargraph.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-7041070211874942710</id><published>2018-05-22T11:41:00.001+02:00</published><updated>2023-11-07T22:29:28.696+01:00</updated><title type='text'>Automatic opening pluggable databases</title><content type='html'>When upgrading more and more databases from Oracle 11.2 to Oracle 12c we build more and more databases with the 12c CDB model.&lt;br /&gt;
Single Instande user databases have been converted to Pluggable DataBases ( PDB).&lt;br /&gt;
To make working with CDB&#39;s and PDB&#39;s easier, Oracle created an option to automatically open the PDB&#39;s as soon as the CDB is opened.&lt;br /&gt;
This save lots of work and makes automatic restarts from scripts easier.&lt;br /&gt;
&lt;br /&gt;
To achieve this, the state of a PDB can be saved, so that the CDB knows which PDB to open after a startup.&lt;br /&gt;
The command to save this state is to be run from the PDB, so assuming that we have a CDB called ORACDB and a PDB called PLUG1, the command to execute would be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ export ORACLE_SID=ORACDB&lt;br /&gt;
$ sqlplus / as sysdba&lt;br /&gt;
&lt;br /&gt;
SQL&amp;gt; alter pluggable database plug1 open;&lt;br /&gt;
SQL&amp;gt; alter session set container=plug1;&lt;br /&gt;
SQL&amp;gt; alter plugguble database plug1 save state;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, as soon as the CDB is started, the PDB is immediately accessible through the Listener.
&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/7041070211874942710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2018/05/automatic-opening-pluggable-databases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7041070211874942710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7041070211874942710'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2018/05/automatic-opening-pluggable-databases.html' title='Automatic opening pluggable databases'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-174518924051262022</id><published>2017-06-14T14:26:00.000+02:00</published><updated>2017-06-14T14:26:00.407+02:00</updated><title type='text'>ORA-15036: disk &#39;/dev/asmdata01&#39; is truncated</title><content type='html'>&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Today I encountered one of these that you don&#39;t want to encounter.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;We have this database server running Oracle 12c ( 12.1.0.2 ) on AIX 7.1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;This server hosts 4 databases all around 400GB in size.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The databases are located on one ASM LUN connected through SAN storage of 1.5Tb&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The need for yet another database on this server made us decide to increase the ASM disk to 2.1 TB and there we ran into problems.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The increased diskspace on Storage level and OS level was not recognized by ASM. It kept showing a size of 1.5 TB.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;We had to reboot the server anyway, becuase we also had to increase the memory size and from there on we were in trouble.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;Starting ASM went fine, but the disk was not mountable, diplaying the error:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;ORA-15036: disk &#39;/dev/asmdata01&#39; is truncated&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The disksize on OS level showed it as the expected 2.1Tb, within ASM it showed as 0 Mb !!!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The 2Tb disk-limit was a known limit for databases up to Oracle 11.2.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;Since we are on Oracle 12.1 I did not expect to run into this problem.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;The diskgroup however was created in the past with an 11.2 ASM and afterwards upgraded to 12.1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;The diskgroup compatibility settings were also set to 12.1, but still the 2Tb limit seemed to be in effect.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;The only solution we had was:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;* Recreate the diskgroup and restore all database from backup, or&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;* Reduce the disksize (LUNsize) on the SAN and hope it gets reduced from the end of the disk where it just had been extended.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;We chose option 2 above option 1.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;If option 2 failed, we were any convicted to option 1.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;Luckily for us it worked!!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;Reducing the LUN to 1.9 Tb, enabled ASM to recognize the disk and mount it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;All databases were OK afterwards, so no data was lost.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;There was one step left in the end, whereas the disksize to ASM still was 1.5GTb&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; select total_mb from v$asm_diskgroup where name=&#39;DB01&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; TOTAL_MB&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;1572864&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;so we had to resize the disk and in the end all is OK now&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; alter diskgroup db01 resize all;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;Diskgroup altered.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; select total_mb from v$asm_diskgroup where name=&#39;DB01&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; TOTAL_MB&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: #fff9d7;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;204697&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #fff9d7; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/174518924051262022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2017/06/ora-15036-disk-devasmdata01-is-truncated.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/174518924051262022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/174518924051262022'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2017/06/ora-15036-disk-devasmdata01-is-truncated.html' title='ORA-15036: disk &#39;/dev/asmdata01&#39; is truncated'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-163149894795127860</id><published>2017-03-22T16:55:00.004+01:00</published><updated>2023-11-07T22:30:07.002+01:00</updated><title type='text'>ORA-15067: command or option incompatible with diskgroup redundancy</title><content type='html'>At our company we had to replace the storage cabinets of a two node RAC cluster. The RAC cluster uses ASM diskgroups with NORMAL redundancy.&lt;br /&gt;
All diskgroups exist of two failgroups, with each failgroup located on one of the storage cabinets, for redundancy purposes, as seen here:&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;SQL&amp;gt; select &amp;nbsp; distinct a.name&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;, b.failgroup, count(*) numdisks&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 2 &amp;nbsp;from &amp;nbsp; &amp;nbsp; v$asm_diskgroup a&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , v$asm_disk b&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 4 &amp;nbsp;where &amp;nbsp;a.group_number = b.group_number&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 5 &amp;nbsp;order by name;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FAILGROUP &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NUMDISKS&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;------------ --------------------- ----------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;DB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DB01_0000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;DB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DB01_1000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FB01_0000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FB01_1000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
While all disks in FAILGROUPS DB01_0000 and FB01_0000 are on one storage cabinet the command to drop all disks on one &#39;side&#39; of the ASM diskgroup at once would be the first option to choose:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
However:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; alter diskgroup fb01 drop disks in failgroup FB01_0000;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;alter diskgroup fb01 drop disks in failgroup FB01_0000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;ORA-15067: command or option incompatible with diskgroup redundancy&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Since all data is mirrored across the two failure groups, one would expect to be able to drop one complete set of the mirror, so one complete failgroup.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
All can be explained by the redundancy of the diskgroup. Using NORMAL redundancy, the diskgroup expects to have at least one disk available in the first failgroup that can be used as a destination for a failing disk in the other failgroup. This is also seen when querying the REQUIRED_MIRROR_FREE value of the diskgroup:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; SELECT name, type, total_mb, free_mb, required_mirror_free_mb,usable_file_mb FROM V$ASM_DISKGROUP;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TYPE &amp;nbsp; &amp;nbsp; TOTAL_MB &amp;nbsp; &amp;nbsp;FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;------------------------------ ------ ---------- ---------- ----------------------- --------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NORMAL &amp;nbsp; &amp;nbsp; 512000 &amp;nbsp; &amp;nbsp; 503598 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 51200 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 226199&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;DB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NORMAL &amp;nbsp; &amp;nbsp; 819200 &amp;nbsp; &amp;nbsp; 801612 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;102400 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 349606&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The REQUIRED_MIRROR_FREE values are equal to the size of a single disk in these diskgroups as seen here:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;SQL&amp;gt; select distinct * from (&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 2 &amp;nbsp; &amp;nbsp;select b.name, a.total_mb&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 3 &amp;nbsp; &amp;nbsp;from v$asm_disk a&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 4 &amp;nbsp;, v$asm_diskgroup b&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 5 &amp;nbsp;where&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&amp;nbsp; 6 &amp;nbsp;a.group_number=b.group_number);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TOTAL_MB&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;------------------------------ ----------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;DB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 102400&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;FB01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;51200&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
So the NORMAL REDUNDANCY prevents us from dropping all disks at once in a failgroup.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Drop all disks but one in the failgroup and then first add at least one new disk from the new storage cabinet&lt;/div&gt;
&lt;div&gt;
After that dropping the last disk from the old storage cabinet should be possible.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8537033140336719&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/163149894795127860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2017/03/at-our-company-we-had-to-replace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/163149894795127860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/163149894795127860'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2017/03/at-our-company-we-had-to-replace.html' title='ORA-15067: command or option incompatible with diskgroup redundancy'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-4711463972786424883</id><published>2017-03-17T15:41:00.005+01:00</published><updated>2017-03-17T15:41:45.487+01:00</updated><title type='text'>Just Another Friday with DBCA</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQ9gimk0NCa_R4oaqREi3w7FeoYi3V6QPQ03OUmpJ76OpoRjkQRJabXgOryY0RUEekc4pJYgxBQJfMogywskgCE-8pxlXIQsinO6xq2LSGEU_mthSljK38rY9E7U9PWZgP2YLeitvIM8/s1600/JustAnotherFriday.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;486&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQ9gimk0NCa_R4oaqREi3w7FeoYi3V6QPQ03OUmpJ76OpoRjkQRJabXgOryY0RUEekc4pJYgxBQJfMogywskgCE-8pxlXIQsinO6xq2LSGEU_mthSljK38rY9E7U9PWZgP2YLeitvIM8/s640/JustAnotherFriday.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
And then &#39;dbca&#39; crashes, and you can start all over again....</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/4711463972786424883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2017/03/just-another-friday-with-dbca.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4711463972786424883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/4711463972786424883'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2017/03/just-another-friday-with-dbca.html' title='Just Another Friday with DBCA'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQ9gimk0NCa_R4oaqREi3w7FeoYi3V6QPQ03OUmpJ76OpoRjkQRJabXgOryY0RUEekc4pJYgxBQJfMogywskgCE-8pxlXIQsinO6xq2LSGEU_mthSljK38rY9E7U9PWZgP2YLeitvIM8/s72-c/JustAnotherFriday.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-7945226263409741617</id><published>2017-02-09T08:49:00.002+01:00</published><updated>2017-02-09T08:49:15.436+01:00</updated><title type='text'>ORA-12154 running dbca on a 12c RAC Cluster</title><content type='html'>When setting up a Oracle RAC cluster on 12.1.0.2 ( in our case patchlevel 170117 ), creating a database using dbca can run into an ORA-12154 unable to complete the database creation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The setup of an Oracle RAC cluster is that you have first of all the Oracle Grid Infrastructure, the so-called clusterware. This software piece is the cluster, and it is responsible for everything else but the actual RAC database.&lt;br /&gt;
Everything else also includes the Listener (SCAN-listener and normal listener). For this matter the default location of an Oracle Installation is used for the listener config file, being:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;$GRID_HOME/network/admin&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;The RDBMS part of the installation is another software installation, with its own default location for SQL-net files, being:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;$ORACLE_HOME/network/admin&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now when running &#39;dbca&#39; and while creating a database, a tnsnames.ora file is being created in the $ORACLE_HOME/network/admin directory for self-reference of this newly created database.&lt;br /&gt;
As soon as the database is ready, it tries to register with the clusterware. At that moment the clusterware processes try to connect to the database and fail with an&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ORA-12154 TNS Could not resolve service name&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reason for this is, that the clusterware home did not receive the tnsnames.ora information about the created database, resulting in an unresolvable service name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Before starting dbca, add support for the self-reference of the to-be created database into the $GRID_HOME/network/admin location, by creating an empty tnsnames.ora for the rdbms-user and a symbolic link to this file for the grid-user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;dbuser $ cd $ORACLE_HOME/network/admin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;&quot;&gt;dbuser&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;$ echo “NAMES.DIRECTORY_PATH=(TNSNAMES)” &amp;gt; sqlnet.ora&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;dbuser $ touch tnsnames.ora&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;dbuser $ chmod g+w . tnsnames.ora&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Next:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;griduser $ cd $GRID_HOME/network/admin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;griduser $ ln –s /opt/oraadmin/network/admin/tnsnames.ora tnsnames.ora&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;griduser $ ln –s /opt/oraadmin/network/admin/ sqlnet.ora sqlnet.ora&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In the above statements also a sqlnet.ora file is being created. This is (in our case) to prevent the grid-user from connecting to the still existing older version of this database by means of an EZCONNECT connection.&lt;br /&gt;
&lt;br /&gt;
Now when dbca creates an entry in the tnsnames.ora file the grid-user is also aware of its existence and the ORA-12154 does not appear&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/7945226263409741617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2017/02/ora-12154-running-dbca-on-12c-rac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7945226263409741617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/7945226263409741617'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2017/02/ora-12154-running-dbca-on-12c-rac.html' title='ORA-12154 running dbca on a 12c RAC Cluster'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5085850589914248681.post-8510741827968043140</id><published>2016-11-11T13:37:00.002+01:00</published><updated>2017-02-23T10:06:05.695+01:00</updated><title type='text'>Opatchauto for GI complains about actions.xml missing</title><content type='html'>On Oracle 12.1 doing a GI CPU installation it is possible that, when trying to install one of the quarterly patch updates, that &#39;opatchauto&#39; complains about an actions.xml file missing from one of the patch subdirectories.&lt;br /&gt;
&lt;br /&gt;
In DocID&amp;nbsp;2086760.1 on Oracle Support this problem is explained to be caused by a too low version of opatchauto.&lt;br /&gt;
When using an opatch version 12.1.0.1.7 or higher this problem will be gone.&lt;br /&gt;
&lt;br /&gt;
However, today I ran into the same problem, having opatch version 12.2.0.1.8 !!&lt;br /&gt;
&lt;br /&gt;
After a long search for the cause, I found another error in the logfile, saying:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;OPatchAutoBinary hit Binary Exception: oracle.opatchauto.code.binary.BinarySessionException:&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;ERROR: Unable to register this patch /opt/src/24433148. Select Patch is not valid.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This made me look at the directory structure where the patch was extracted.&lt;br /&gt;
There I noticed that I mistakenly had unzipped the patch as root-user, resulting in only root-permission files.&lt;br /&gt;
&lt;br /&gt;
After changing the ownership of the unzipped patch-directory to the grid-owner, the patch installation has successfully completed.&lt;br /&gt;
&lt;br /&gt;
So, permission problems on an unzipped patch directory can cause another problem to arise, making solving it a challenge.</content><link rel='replies' type='application/atom+xml' href='http://managingoracle.blogspot.com/feeds/8510741827968043140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://managingoracle.blogspot.com/2016/11/opatchauto-for-gi-complains-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8510741827968043140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5085850589914248681/posts/default/8510741827968043140'/><link rel='alternate' type='text/html' href='http://managingoracle.blogspot.com/2016/11/opatchauto-for-gi-complains-about.html' title='Opatchauto for GI complains about actions.xml missing'/><author><name>FJ Franken (DBA)</name><uri>http://www.blogger.com/profile/14960974918564490086</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5__-2Pa1y0GrCbq1kSKHt7W6tnNL9H4hgyEXio0euRoRTqsoIgN7b7_Vr3IdJQBMIgfbKNgWWYjDbUTLe6sFTVTbzwpYMs1j-PGhUmHdtJsePWeoSsv9yJPSBZa4bJJN-9TJhJQFAczPCdJI0cVNAMdyeH7m0im5-OGNMMmS476HugA/s220/20200121_082146.jpg'/></author><thr:total>0</thr:total></entry></feed>