<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Database &#8211; Blog DBA Dutra</title>
	<atom:link href="https://www.dbadutra.com/category/database/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbadutra.com</link>
	<description></description>
	<lastBuildDate>Tue, 06 Feb 2024 21:02:30 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
<site xmlns="com-wordpress:feed-additions:1">170494511</site>	<item>
		<title>Oracle Globally Distributed Database &#8211; Overview</title>
		<link>https://www.dbadutra.com/2024/02/oracle-globally-distributed-database/</link>
					<comments>https://www.dbadutra.com/2024/02/oracle-globally-distributed-database/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Tue, 06 Feb 2024 21:01:15 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Oracle Globally Distributed Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6232</guid>

					<description><![CDATA[Today, I will start a series of blogs about Oracle&#8217;s Globally Distributed Database, in the first article, we will give a brief overview of Oracle&#8217;s Globally Distributed Database. What is a Globally Distributed Database A globally distributed database is a method of partitioning data to distribute the computational and storage workload, which helps achieve hyperscale [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Today, I will start a series of blogs about Oracle&#8217;s Globally Distributed Database, in the first article, we will give a brief overview of Oracle&#8217;s Globally Distributed Database.</p>



<p><strong>What is a Globally Distributed Database</strong></p>



<p>A globally distributed database is a method of partitioning data to distribute the computational and storage workload, which helps achieve hyperscale computing.</p>



<p>Companies often achieve hyperscale computing using database sharding, in which they distribute segments of a data set—a shard—across lots of databases on many different computers.</p>



<p>Sharding uses a&nbsp;shared-nothing&nbsp;architecture in which shards share no hardware or software. All the shards together make up a single logical database, called a&nbsp;sharded database.</p>



<p>From the application&#8217;s perspective, a sharded database looks like a single database: the number of shards and data distribution across those shards are completely transparent to database applications. From the perspective of a database administrator, a shared database consists of multiple databases that can be managed collectively.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://www.dbadutra.com/wp-content/uploads/2024/02/image.png"><img fetchpriority="high" decoding="async" width="626" height="293" src="https://www.dbadutra.com/wp-content/uploads/2024/02/image.png" alt="" class="wp-image-6233" style="width:624px;height:auto" srcset="https://www.dbadutra.com/wp-content/uploads/2024/02/image.png 626w, https://www.dbadutra.com/wp-content/uploads/2024/02/image-300x140.png 300w" sizes="(max-width: 626px) 100vw, 626px" /></a></figure></div>


<p></p>



<p></p>



<h3 class="wp-block-heading">Oracle Globally Distributed Database</h3>



<h3 class="wp-block-heading">&nbsp;</h3>



<p>Oracle Globally Distributed Database disperses segments of a data set across many databases (shards) onto different computers—on-premises or in the cloud. It enables globally distributed, linearly scalable, multimodel databases. It requires no specialized hardware or software. Oracle Globally Distributed Database does all this while rendering the strong consistency, full power of SQL, support for structured and unstructured data, and the Oracle Database ecosystem. It meets data sovereignty requirements and supports applications that require low latency and high availability.</p>



<ul class="wp-block-list">
<li>SQL language used for object creation, strict data consistency, complex joins, ACID transaction properties, distributed transactions, relational data store, security, encryption, robust performance optimizer, backup and recovery, and patching with Oracle Database</li>



<li>Oracle innovations and enterprise-level features, including Advanced Security, Automatic Storage Management (ASM), Advanced Compression, partitioning, high-performance storage engine, SMP scalability, Oracle RAC, Exadata, in-memory columnar, online redefinition, JSON document store, and so on</li>



<li>Sharding-aware Oracle Database tools, such as SQL Developer, Enterprise Manager Cloud Control, Recovery Manager (RMAN), and Data Pump, for sharded database application development and management</li>



<li>Programmatic interfaces, such as Java Database Connectivity (JDBC), Oracle Call Interface (OCI), Universal Connection Pool (UCP), Oracle Data Provider for .NET (ODP.NET), and PL/SQL, including extensions for sharded application development</li>



<li>Extreme availability with Oracle Data Guard and Oracle Active Data Guard. Other replication options include Raft replication, built into&nbsp;Oracle Globally Distributed Database.</li>



<li>Support for multi-model data like relational, text, and JSON</li>



<li>Existing life-cycle management and operational processes can be kept, leveraging in-house and worldwide Oracle database administrator skill sets</li>



<li>Enterprise-level support</li>



<li>Extreme scalability and availability of NoSQL databases</li>
</ul>



<p></p>



<h3 class="wp-block-heading">Benefits of Oracle Globally Distributed Database</h3>



<h3 class="wp-block-heading">&nbsp;</h3>



<p>Oracle Globally Distributed Database&nbsp;provides linear scalability, complete fault isolation, and global data distribution for the most demanding applications.</p>



<p>Key benefits of&nbsp;Oracle Globally Distributed Database&nbsp;include:</p>



<ul class="wp-block-list">
<li><strong>Linear Scalability</strong></li>
</ul>



<p>The&nbsp;Oracle Globally Distributed Database&nbsp;shared–nothing architecture eliminates performance bottlenecks and provides unlimited scalability.&nbsp;Oracle Globally Distributed Database&nbsp;supports scaling up to 1000 shards.</p>



<ul class="wp-block-list">
<li><strong>Extreme Availability and Fault Isolation</strong></li>
</ul>



<p>Single points of failure are eliminated because shards do not share resources such as software, CPU, memory, or storage devices. The failure or slow-down of one shard does not affect the performance or availability of other shards.</p>



<p>Oracle MAA best practice solutions, such as Oracle Data Guard and Oracle RAC, protect shards.</p>



<p>An unplanned outage or planned maintenance of a shard impacts only the availability of the data on that shard, so only the users of that small portion of the data are affected, for example, during a failover brownout.</p>



<ul class="wp-block-list">
<li><strong>Geographical Distribution of Data</strong></li>
</ul>



<p>Oracle Globally Distributed Database enables you to deploy a global database, where a single logical database can be distributed over multiple geographies. This makes it possible to satisfy data privacy regulatory requirements (Data Sovereignty) and allows the storage of particular data close to its consumers (Data Proximity).</p>



<p></p>



<h3 class="wp-block-heading">New Features: Oracle Globally Distributed Database and 23c</h3>



<ul class="wp-block-list">
<li>Raft Replication</li>



<li>Directory-Based Sharding</li>



<li>Synchronous Duplicated Tables</li>



<li>Fine-Grained Refresh Rate Control For Duplicated Tables</li>



<li>Sharded Database Coordinated Backup and Restore Enhancements</li>



<li>Automatic Data Move on Sharding Key Update</li>



<li>Move Data Chunks Between Shardspaces</li>



<li>Global Partitioned Index Support on Subpartitions</li>



<li>PL/SQL Function Cross-Shard Query Support</li>



<li>Pre-Deployment Network Validation</li>



<li>New Partition Set Operations for Composite Sharding</li>



<li>Parallel Cross-Shard DML Support</li>



<li>Oracle Data Pump Adds Support for Sharding Metadata</li>



<li>Automatic Parallel Direct Path Load Using SQL*Loader</li>
</ul>



<p>The Oracle Globally Distributed Database is set to revolutionize the world of distributed database operations.</p>



<p>I hope you first enjoyed this great resource we have at OCI.</p>



<p>In the next articles, we will provide more technical details about the product Oracle Globally Distributed Autonomous Database and also go into details of the new features with Oracle 23c.</p>



<p>See you in the next article.</p>



<p><strong>Disclaimer: “The postings on this site are my own and do not necessarily represent my current employer positions, strategies, or opinions. The information here was edited to be useful for general purpose, specific data, and identifications was removed to allow reaching a generic audience and to be useful.</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2024/02/oracle-globally-distributed-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6232</post-id>	</item>
		<item>
		<title>Database Security Assessment Tool (DBSAT 3.0)</title>
		<link>https://www.dbadutra.com/2024/01/database-security-assessment-tool-dbsat-3-0/</link>
					<comments>https://www.dbadutra.com/2024/01/database-security-assessment-tool-dbsat-3-0/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Fri, 26 Jan 2024 21:12:07 +0000</pubDate>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[DBSAT]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6219</guid>

					<description><![CDATA[The Oracle Database Security Assessment Tool (DBSAT), currently in version 3.1.0 (January 2024), is a command-line tool focused on detecting potential security vulnerabilities. Its greatest scope occurs within the database but it also inspects operating system and network components (listener) in search of failures. The tool provides insight into the current status of users, roles, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>The Oracle Database Security Assessment Tool (DBSAT), currently in version 3.1.0 (January 2024), is a command-line tool focused on detecting potential security vulnerabilities. Its greatest scope occurs within the database but it also inspects operating system and network components (listener) in search of failures.</p>



<p>The tool provides insight into the current status of users, roles, permissions, and security control policies to promote successful approaches to mitigating potential security risks.</p>



<p><strong>What&#8217;s new in DBSAT 3.0 ?</strong></p>



<p>New checks added in DBSAT 3.0 include the newly introduced Oracle Database 23c&nbsp;<a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/dbseg/using-sql-firewall.html#GUID-B268CC0A-4FE5-4A50-9C20-FABC99B5C4AD" target="_blank" rel="noreferrer noopener">SQL Firewall</a>, auditing-related issues, sensitive data and transparent sensitive data protection, and a wealth of other checks necessary for any security-conscious organization. Remarks and recommendations are updated to make them clearer and actionable.</p>



<p>Desupport notices list&nbsp;database&nbsp;features and parameters that are reaching or&nbsp;have&nbsp;reached their end-of-life so you can take proactive measures to phase out their usage. DBSAT Discoverer also added support for India&#8217;s permanent account number (PAN) and the unique identification (Aadhaar) number.</p>



<p>From its beginning, DBSAT offered a distillation of decades of security experience, checking configuration issues that might introduce unnecessary risk. Until now, DBSAT clearly identified checks that were related to security frameworks like the DISA STIGs, Center for Internet Security (CIS) benchmarks, or data privacy regulations like GDPR. However, no checks clearly indicated that they were Oracle best practices. DBSAT 3.0 fixes that issue: Findings that are Oracle best practices are now clearly identified.</p>



<p><strong>When is DBSAT not enough?</strong></p>



<p>DBSAT is a simple standalone tool that helps assess the security configuration of a single Oracle Database. What if you want to automate assessments across your fleet, track deviations from approved baselines, get alerts, keep history, and compare all in one interface? Use Oracle Data Safe or Oracle Audit Vault and Database Firewall to go the extra mile in assessments.</p>



<p>The DBSAT is made up of two components:</p>



<p></p>



<p><strong>DBSAT Collector</strong>: Responsible for executing SQL queries and operating system commands that collect the data to be evaluated. The data is stored in a file that is later used by DBSAT Reporter in the analysis phase.</p>



<p><strong>DBSAT Reporter</strong>: Responsible for analyzing the collected data and generating reports of findings and recommendations in files of multiple formats such as HTML, Excel and Text.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-44.png"><img decoding="async" width="637" height="352" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-44.png" alt="" class="wp-image-6220" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-44.png 637w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-44-300x166.png 300w" sizes="(max-width: 637px) 100vw, 637px" /></a></figure>



<p>Reference: <a href="https://docs.oracle.com/en/database/oracle/security-assessment-tool/3.0.0/satug/index.html#GUID-999F5696-F368-4E54-86DB-DEFC593B2042">https://docs.oracle.com/en/database/oracle/security-assessment-tool/3.0.0/satug/index.html#GUID-999F5696-F368-4E54-86DB-DEFC593B2042</a></p>



<p></p>



<p>The main benefits of using DBSAT are:</p>



<ul class="wp-block-list">
<li>Quick identification of database security configuration errors;</li>



<li>Recommendations based on best security practices;</li>



<li>Reduction of the amplitude of an attack and exposure to risk.</li>
</ul>



<p>DBSTAT works on Oracle database 11.2.0.4 and later versions including multitenant and cloud environments. The supported platforms are:</p>



<p>Oracle DBSAT runs on:</p>



<ul class="wp-block-list">
<li>Solaris x64 and Solaris SPARC64</li>



<li>Linux x86-64 and Linux 64-bit Arm</li>



<li>Windows x64</li>



<li>HP-UX IA (64-bit)</li>



<li>IBM AIX (64-bit) and Linux on zSeries (64-bit)</li>
</ul>



<p>Its use is very simple and consists of downloading the MOS file (My Oracle Support &#8211; Doc ID 2138254.1), unzipping it, and running the script to collect and report security vulnerabilities. DBSAT is a lightweight utility that does not hamper system performance while running.</p>



<p>Running DBSAT Collector:</p>



<p>For DBSTAT to collect all the data and perform a complete validation, it must be executed from the database server, as some operating system commands are executed to collect data that cannot be obtained from the database. DBSTAT must also be run with an operating system user that has read permission on ORACLE_HOME files and directories for data to be collected and processed properly.</p>



<p>Collections in the database are carried out mainly on data dictionary views, so the user that will be provided in the connection string to the database must have sufficient permissions to select data from these views.</p>



<p>Collector Prerequisites</p>



<p>To gather all necessary data, run the Oracle DBSAT Collector on the database server. The collector uses operating system commands to gather process and file system information that the database alone cannot provide. Besides, the Oracle DBSAT Collector must be run as an OS user with read permissions on files and directories under&nbsp;ORACLE_HOME&nbsp;using SQL*Plus (through Oracle Database or Instant Client) to collect and process file system data using OS commands.</p>



<p>The Oracle DBSAT Collector collects most of its data by querying database views. It must connect to the database as a user with sufficient privileges to select from these views. Grant the DBSAT user the following privileges:</p>



<ul class="wp-block-list">
<li>CREATE SESSION</li>



<li>READ&nbsp;or&nbsp;SELECT&nbsp;on&nbsp;SYS.REGISTRY$HISTORY</li>



<li>Role&nbsp;SELECT_CATALOG_ROLE</li>



<li>Role&nbsp;DV_SECANALYST&nbsp;(if Database Vault is enabled or if Database Vault Operations Control is enabled)</li>



<li>Role&nbsp;AUDIT_VIEWER&nbsp;(12c&nbsp;and later)</li>



<li>Role&nbsp;CAPTURE_ADMIN&nbsp;(12c&nbsp;and later)</li>



<li>READ&nbsp;or&nbsp;SELECT&nbsp;on&nbsp;SYS.DBA_USERS_WITH_DEFPWD</li>



<li>READ&nbsp;on&nbsp;SYS.DBA_AUDIT_MGMT_CONFIG_PARAMS</li>



<li>READ&nbsp;on&nbsp;SYS.DBA_CREDENTIALS</li>



<li>EXECUTE&nbsp;on&nbsp;SYS.DBMS_SQL</li>
</ul>



<p>Syntax for running the DBSAT Collector:</p>



<pre class="wp-block-preformatted">$ dbsat collect &lt;database_connect_string&gt; &lt;output_file&gt;</pre>



<pre class="wp-block-preformatted">[oracle@oracle-db-lab dbsat]$  ./dbsat collect "c##test1/test#123" /home/oracle/dbsat/collect/output_ORCL

Database Security Assessment Tool version 3.1 (Jan 2024)

This tool is intended to assist you in securing your Oracle database
system. You are solely responsible for your system and the effect and
results of the execution of this tool (including, without limitation,
any damage or data loss). Further, the output generated by this tool may
include potentially sensitive system configuration data and information
that could be used by a skilled attacker to penetrate your system. You
are solely responsible for ensuring that the output of this tool,
including any generated reports, is handled in accordance with your
company's policies.

Connecting to the target Oracle database...


SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 19 23:52:20 2024
Version 19.19.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

Setup complete.
SQL queries complete.
OS commands complete.
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
DBSAT Collector completed successfully.

Calling /u01/app/oracle/product/19.0.0/dbhome_1/bin/zip to encrypt output_ORCL.json...

Enter password:
Verify password:
  adding: output_ORCL.json (deflated 86%)
zip completed successfully.
[oracle@oracle-db-lab dbsat]
</pre>



<p>By default, the file will be generated and compressed with a password. However, we can omit the need to enter a password by adding the -n parameter in the best collect call. However, considering information security, this is not recommended.</p>



<p>Running DBSAT Reporter:</p>



<p>The prerequisite for DBSAT Reporter is that Python 2.6 or higher is installed on the server where the report will be generated. By default it is already installed in most UNIX environments.</p>



<p>To confirm the existence and version of Python run:</p>



<pre class="wp-block-preformatted">python -V </pre>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-45.png"><img decoding="async" width="481" height="100" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-45.png" alt="" class="wp-image-6221" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-45.png 481w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-45-300x62.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-45-475x100.png 475w" sizes="(max-width: 481px) 100vw, 481px" /></a></figure>



<p>Syntax for running the DBSAT Report:</p>



<pre class="wp-block-preformatted">dbsat report [-a] [-n] [-x &lt;section&gt;] &lt;input_file&gt;

</pre>



<p>The Reporter supports the following command-line options:</p>



<ul class="wp-block-list">
<li><em>-a</em></li>
</ul>



<p>Runs the reports for all the database accounts.</p>



<ul class="wp-block-list">
<li><em>-n</em></li>
</ul>



<p>Specifies no encryption for output.</p>



<ul class="wp-block-list">
<li><em>-g</em></li>
</ul>



<p>Shows all grants including common grants in a pluggable database.</p>



<ul class="wp-block-list">
<li><em>-x</em></li>
</ul>



<p>Excludes a section from the report.</p>



<p>Valid sections are:</p>



<ul class="wp-block-list">
<li>USER&nbsp;:&nbsp;User Accounts</li>



<li>PRIV&nbsp;:&nbsp;Privileges and Roles</li>



<li>AUTH&nbsp;:&nbsp;Authorization Control</li>



<li>CRYPT&nbsp;:&nbsp;Encryption</li>



<li>ACCESS&nbsp;:Fine-Grained Access Control</li>



<li>AUDIT&nbsp;:&nbsp;Auditing</li>



<li>CONF&nbsp;:&nbsp;Database Configuration</li>



<li>NET&nbsp;:&nbsp;Network Configuration</li>



<li>OS&nbsp;:&nbsp;Operating System</li>
</ul>



<p>To exclude multiple sections use a comma-separated list, for example:</p>



<p>-x USER,PRIV</p>



<p>Or:</p>



<p>-x USER&nbsp;-x PRIV</p>



<p>Omitting this option will include all sections of the report.</p>



<p>The same path name is used to generate the report files produced by the Reporter in HTML, Excel, JSON, and Text formats with the appropriate file extensions.</p>



<p>Run the Reporter.</p>



<p></p>



<pre class="wp-block-preformatted">[oracle@oracle-lab dbsat]$ export JAVA_HOME=/u01/app/oracle/product/21.0.0/dbhome_1/jdk
[oracle@oracle-lab dbsat]$ export PATH=$JAVA_HOME/bin:$PATH
[oracle@oracle-lab dbsat]$ ./dbsat report -n output_ORCL

Database Security Assessment Tool version 3.1 (Jan 2024)

This tool is intended to assist you in securing your Oracle database
system. You are solely responsible for your system and the effect and
results of the execution of this tool (including, without limitation,
any damage or data loss). Further, the output generated by this tool may
include potentially sensitive system configuration data and information
that could be used by a skilled attacker to penetrate your system. You
are solely responsible for ensuring that the output of this tool,
including any generated reports, is handled in accordance with your
company's policies.

DBSAT Reporter ran successfully.

[oracle@oracle-lab dbsat]$

</pre>



<p>DBSAT Reports:</p>



<p>DBSAT produces output in various formats for various audiences and purposes. An HTML report, for example, provides detailed results in an easy-to-navigate format using links while a Spreadsheet report provides a high-level summary of each finding, as well as allowing you to manipulate columns by adding new ones for your purposes and prioritization.</p>



<p>Example of a DBSAT summary in HTML:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-46.png"><img loading="lazy" decoding="async" width="975" height="519" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-46.png" alt="" class="wp-image-6222" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-46.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-46-300x160.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-46-768x409.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure></div>


<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-48.png"><img loading="lazy" decoding="async" width="687" height="407" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-48.png" alt="" class="wp-image-6227" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-48.png 687w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-48-300x178.png 300w" sizes="(max-width: 687px) 100vw, 687px" /></a></figure>



<p>1. Rule title and unique ID:</p>



<p>The ID has two parts: the prefix identifies the report section and the suffix identifies the specific rule.</p>



<p>2. Status:</p>



<p>Status can be used to define the prioritization of indicators, where a high-risk finding requires immediate action while a low-risk finding can be scheduled and adjusted with less priority.</p>



<ul class="wp-block-list">
<li>Pass: No errors or risks identified;</li>



<li>Evaluate: It is necessary to carry out a manual analysis to identify the degree of risk;</li>



<li>Some Risk: Low risk;</li>



<li>Significant Risk: Medium rich;</li>



<li>Severe Risk: High security risk;</li>



<li>Opportunity: Additional opportunities to improve security using additional technologies.</li>
</ul>



<p>3. Summary:</p>



<p>Discovery summary.</p>



<p>4. Details:</p>



<p>Provides detailed information to explain the discovery.</p>



<p>5. Remarks:</p>



<p>Explains the standard used to evaluate the results found. It can also explain recommended actions for remediation if a risk is reported.</p>



<p>6. References:</p>



<p>Lists the discovery based on the CIS Oracle Database Benchmark, DISA STIGs, Oracle Best Practices.</p>



<p></p>



<p>I hope this article helps you.&nbsp;&nbsp;</p>



<p>See you in the next article.</p>



<p><strong>Disclaimer: “The postings on this site are my own and do not necessarily represent my current employer positions, strategies, or opinions. The information here was edited to be useful for general purpose, specific data, and identifications was removed to allow reaching a generic audience and to be useful.</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2024/01/database-security-assessment-tool-dbsat-3-0/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6219</post-id>	</item>
		<item>
		<title>Backup and restore your Oracle Home</title>
		<link>https://www.dbadutra.com/2024/01/backup-and-restore-your-oracle-home/</link>
					<comments>https://www.dbadutra.com/2024/01/backup-and-restore-your-oracle-home/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Fri, 19 Jan 2024 21:47:35 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Oracle HOme]]></category>
		<category><![CDATA[Restore]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6207</guid>

					<description><![CDATA[&#160;&#160; I did this how-to with the purpose of you using it as a &#8221; best practice&#8221; and having a regular backup of your Oracle Home in case you, or another guy on your team, accidentally remove part of or entire files and folders on it. I will reproduce the steps on Compute instance in [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>&nbsp;&nbsp; I did this how-to with the purpose of you using it as a &#8221; best practice&#8221; and having a regular backup of your Oracle Home in case you, or another guy on your team, accidentally remove part of or entire files and folders on it.</p>



<p>I will reproduce the steps on Compute instance in OCI; I hope that is not your case on a production database server, but nobody knows when shit happens, and you may need this procedure to recover and put your database online after an accident.</p>



<p>   As you can see, my database is up and running in my Oracle 19c home.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-36.png"><img loading="lazy" decoding="async" width="975" height="411" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-36.png" alt="" class="wp-image-6208" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-36.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-36-300x126.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-36-768x324.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>The location of my ORACLE HOME is listed for this database on my file /etc/oratab</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-37.png"><img loading="lazy" decoding="async" width="975" height="553" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-37.png" alt="" class="wp-image-6209" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-37.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-37-300x170.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-37-768x436.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Now, let&#8217;s issue a backup of my oracle home, do this procedure with root user. You can backup OH online, no problem at all on the database side to issue this step.</p>



<pre class="wp-block-preformatted">[oracle@oracle-db-lab dbhome_1]$ tar -cf /home/oracle/dbhome19c_installed.tar .
[oracle@oracle-db-lab dbhome_1]$ ls -ltrh /home/oracle/dbhome19c_installed.tar
-rw-r--r--. 1 oracle oinstall 5.0G Jan 18 22:35 /home/oracle/dbhome19c_installed.tar
[oracle@oracle-db-lab dbhome_1]$</pre>



<p>I will remove all files on my Oracle Home to simulate the corruption or loss of the Oracle Home.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-38.png"><img loading="lazy" decoding="async" width="975" height="501" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-38.png" alt="" class="wp-image-6210" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-38.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-38-300x154.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-38-768x395.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p></p>



<p>After removing the directory we will validate that it is not working</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-39.png"><img loading="lazy" decoding="async" width="975" height="100" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-39.png" alt="" class="wp-image-6211" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-39.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-39-300x31.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-39-768x79.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Now all utilities were gone!!</p>



<p>As root user again, let&#8217;s restore our backup from Oracle Home to the correct path using these commands below and let&#8217;s check the size of the folder:</p>



<pre class="wp-block-preformatted">[oracle@oracle-db-lab dbhome_1]$ tar -xf /home/oracle/dbhome19c_installed.tar .</pre>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-40.png"><img loading="lazy" decoding="async" width="975" height="147" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-40.png" alt="" class="wp-image-6212" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-40.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-40-300x45.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-40-768x116.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Now all utilities were gone!!</p>



<p>As root user again, let&#8217;s restore our backup from Oracle Home to the correct path using these commands below and let&#8217;s check the size of the folder:</p>



<pre class="wp-block-preformatted">[oracle@oracle-db-lab dbhome_1]$ tar -xf /home/oracle/dbhome19c_installed.tar .</pre>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-41.png"><img loading="lazy" decoding="async" width="975" height="147" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-41.png" alt="" class="wp-image-6213" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-41.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-41-300x45.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-41-768x116.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>As you can see, it is the same size as the original one, 5 GB, which is good for us. To guarantee that everything is good, I will do a relink on Oracle binaries before I try to open my database again.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-42.png"><img loading="lazy" decoding="async" width="975" height="87" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-42.png" alt="" class="wp-image-6214" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-42.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-42-300x27.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-42-768x69.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>There are no errors on the relink file, so it means that we successfully restored our original Oracle home, and now we can start our database again.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2024/01/image-43.png"><img loading="lazy" decoding="async" width="975" height="516" src="https://www.dbadutra.com/wp-content/uploads/2024/01/image-43.png" alt="" class="wp-image-6215" srcset="https://www.dbadutra.com/wp-content/uploads/2024/01/image-43.png 975w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-43-300x159.png 300w, https://www.dbadutra.com/wp-content/uploads/2024/01/image-43-768x406.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>I hope this article helps you restore the situation I described initially. I recommend you include a backup of your Oracle Home in your backup schedules. Otherwise, you will need to reinstall Oracle again and maybe patch all the patches you applied to your Oracle Home before the crash.  </p>



<p>See you in the next article.</p>



<p><strong>Disclaimer: “The postings on this site are my own and do not necessarily represent my current employer positions, strategies, or opinions. The information here was edited to be useful for general purpose, specific data, and identifications was removed to allow reaching a generic audience and to be useful.</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2024/01/backup-and-restore-your-oracle-home/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6207</post-id>	</item>
		<item>
		<title>Refresh database from Data Guard</title>
		<link>https://www.dbadutra.com/2023/12/refresh-database-from-data-guard/</link>
					<comments>https://www.dbadutra.com/2023/12/refresh-database-from-data-guard/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Wed, 13 Dec 2023 20:17:28 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Dataguard]]></category>
		<category><![CDATA[Refresh]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6150</guid>

					<description><![CDATA[My client asked me for help. He needs to update the DEV environment every month The current process (using export-import) takes a few days. To reduce the time, an alternative approach was implemented The new procedure should considerably reduce the refresh time considerably to a few hours. 1         Pre-Requirements 2         Preparation Standby preparation Check if [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>My client asked me for help. He needs to update the DEV environment every month</p>



<p>The current process (using export-import) takes a few days.</p>



<p>To reduce the time, an alternative approach was implemented</p>



<ul class="wp-block-list">
<li>Replicate constantly all production changes to a standby database.&nbsp;&nbsp; This is achieved using Data Guard</li>



<li>For the refresh<ul><li>Stop synchronization</li></ul><ul><li>Drop old DEV databases</li></ul><ul><li>Create new DEV databases by cloning from the standby database</li></ul>
<ul class="wp-block-list">
<li>Restart synchronization</li>
</ul>
</li>
</ul>



<p>The new procedure should considerably reduce the refresh time considerably to a few hours.</p>



<h4 class="wp-block-heading"><a>1         Pre-Requirements</a></h4>



<ul class="wp-block-list">
<li>Oracle version and Patch Level on Primary and Secondary should be same.</li>



<li>Db_unique_name on standby and primary database should be different in order to used in DG_CONFIG setting of the LOG_ARCHIVE_CONFIG parameter.</li>
</ul>



<h4 class="wp-block-heading"><a>2         Preparation</a></h4>



<p></p>



<h4 class="wp-block-heading"><a><strong>Standby preparation</strong></a></h4>



<p>Check if standby is in sync with primary</p>



<pre class="wp-block-preformatted">****** To check archivelog apply lag

SELECT al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied" FROM
(select thread# thrd, MAX(sequence#) almax FROM v$archived_log WHERE resetlogs_change#=(SELECT resetlogs_change#
FROM v$database) GROUP BY thread#) al, (SELECT thread# thrd, MAX(sequence#) lhmax FROM v$log_history
WHERE resetlogs_change#=(SELECT resetlogs_change# FROM v$database) GROUP BY thread#) lh WHERE al.thrd = lh.thrd;

</pre>



<p>Convert standby in snapshot standby</p>



<pre class="wp-block-preformatted">

shutdown immediate
startup mount
alter database convert to snapshot standby;
alter database open;

<a><strong> </strong></a></pre>



<p><a><strong>Create DB links between Standby and DEV</strong></a></p>



<pre class="wp-block-preformatted">---- Standby

alter pluggable database ALL open read only;
CREATE USER c##r_clone identified by Oracle23 CONTAINER=ALL;
GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE, SYSOPER, RESOURCE, CREATE ANY TABLE, UNLIMITED TABLESPACE TO  c##r_clone CONTAINER=ALL;
GRANT DBA to c##r_clone;

CREATE DATABASE LINK refresh_link CONNECT TO c##r_clone identified by Oracle23 using 'DUTSD'; 

----- Dev Database

CREATE DATABASE LINK refresh_link CONNECT TO c##r_clone identified by Oracle23 using 'DUTSST';

alter pluggable database ALL open read only;
CREATE USER c##r_clone identified by Oracle23 CONTAINER=ALL;
GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE, SYSOPER, RESOURCE, CREATE ANY TABLE, UNLIMITED TABLESPACE TO  c##r_clone CONTAINER=ALL;
GRANT DBA to c##r_clone;

</pre>



<p><a><strong>Cleanup old PDB&#8217;s in DUTSD</strong></a></p>



<pre class="wp-block-preformatted">####### DROP OLD PDB - DUTSD
Show pdbs; 

ALTER PLUGGABLE DATABASE &lt;PDBNAME> CLOSE;
DROP PLUGGABLE DATABASE &lt;PDBNAME> INCLUDING DATAFILES;
</pre>



<h4 class="wp-block-heading"><a>3   Clone PDBs</a></h4>



<p>The files of standby were created using OMF convention.&nbsp;&nbsp; For this reason the database files need to be converted from</p>



<p>+DATA01/DUTSD/&lt;GUID&gt;/DATAFILE/&lt;file&gt;.&lt;id&gt;&nbsp; to</p>



<p>+DATA01/DUTSST/DATAFILE/&lt;file&gt;.dbf&#8217;</p>



<p><a><strong>Clone DUTSD</strong></a></p>



<pre class="wp-block-preformatted">CREATE PLUGGABLE DATABASE DUTSD FROM DUTSD@refresh_link storage unlimited tempfile reuse 
file_name_convert=('+DATA01/DUTSD/CCA899613E3D0713E0531114C30A2022/DATAFILE/duts01.474.1147957609','+DATA01/DUTSST/DATAFILE/duts01.dbf',
'+DATA01/DUTSD/CCA899613E3D0713E0531114C30A2022/DATAFILE/duts02.269.1147957617','+DATA01/DUTSST/ /DATAFILE/duts02.dbf') 
keystore identified by "Duts23" parallel 6;
</pre>



<h4 class="wp-block-heading"><a>4   Finalize the refresh</a></h4>



<pre class="wp-block-preformatted">. oraenv
sqlplus / as sysdba
shutdown immediate

startup mount


</pre>



<p><a><strong>Restore datafiles permissions</strong></a></p>



<pre class="wp-block-preformatted">
exec dbms_dnfs.restore_datafile_permissions('&lt;CDBNAME>');

</pre>



<p><a><strong>Convert the snapshot back to physical standby</strong></a></p>



<pre class="wp-block-preformatted">show pdbs
alter database convert to physical standby;
shutdown immediate
startup
</pre>



<p>See you soon in other articles.</p>



<p>Stay tuned by following us on Twitter @aontalba and Linkedin.</p>



<p><strong>Disclaimer: “The postings on this site are my own and do not necessarily represent my current employer positions, strategies, or opinions. The information here was edited to be useful for general purpose, specific data, and identifications was removed to allow reaching a generic audience and to be useful.”</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/12/refresh-database-from-data-guard/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6150</post-id>	</item>
		<item>
		<title>OSWatcher como instalar e usar</title>
		<link>https://www.dbadutra.com/2023/12/oswatcher-como-instalar-e-usar/</link>
					<comments>https://www.dbadutra.com/2023/12/oswatcher-como-instalar-e-usar/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Tue, 12 Dec 2023 21:49:17 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6142</guid>

					<description><![CDATA[Estou com um problem em um compute instance no OCI, e o support me solicitou um OSWatcher para analisar o ambiente. Diante disso como eu não tinha nenhum documento facilitando uma busca rápida, resolvi escrever este post para pode ajudar outras pessoas que no momento de necessitarem de uma consulta rápida não precisem ficar se [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Estou com um problem em um compute instance no OCI, e o support me solicitou um OSWatcher para analisar o ambiente.</p>



<p><br>Diante disso como eu não tinha nenhum documento facilitando uma busca rápida, resolvi escrever este post para pode ajudar outras pessoas que no momento de necessitarem de uma consulta rápida não precisem ficar se matando para achar as informações.</p>



<p>Vamos lá para nossa instalação.</p>



<p>Relatórios de desempenho do Oracle OSWatcher</p>



<p>A ferramenta OSWatcher é uma ferramenta muito interessante que coleta e mantém dados estatísticos dos recursos do sistema operacional periodicamente e nos reporta. Você pode baixar e usar o software OSWatcher do suporte Oracle.</p>



<p><strong>OSWatcher (Doc ID 301137.1)</strong></p>



<p><strong>OS Watcher User&#8217;s Guide (Doc ID 1531223.1)</strong></p>



<p>A ferramenta OSWatcher executa alguns comandos como TOP, iostat, vmstat, netstat em determinados intervalos e mantém esses dados no servidor.</p>



<p>Instalação do OSWatcher</p>



<p>Passo 1: Baixe o OSWatcher e extraia-o conforme a seguir.</p>



<pre class="wp-block-preformatted">[opc@vm-blog oswbb]$ ll
total 5132
-rw-rw-r-- 1 opc opc 5253120 Dec 12 20:49 oswbb840.tar
[opc@vm-blog oswbb]$
[opc@vm-blog oswbb]$ tar -xvf oswbb840.tar
oswbb/
oswbb/uncpr.bat
oswbb/sarsub.sh
oswbb/psmemsub.sh
oswbb/stopOSWbb.sh
oswbb/analysis/
oswbb/piddsub.sh
oswbb/arpsub.sh
oswbb/docs/
oswbb/docs/OSWatcher/
oswbb/docs/OSWatcher/oswbb_README.txt
oswbb/docs/OSWatcher/RAC_Traceroute_Automation_Readme.txt
oswbb/docs/OSWatcher/OSWatcherUserGuide.html
oswbb/docs/The_Analyzer/
oswbb/docs/The_Analyzer/AnalyzerUserGuide.html
oswbb/docs/The_Analyzer/oswbba_README.txt
oswbb/docs/OSWatcherOverview_840.pdf
oswbb/Exampleprivate.net
oswbb/tmp/
oswbb/oswbba.jar
oswbb/oswib.sh
oswbb/ltop.sh
oswbb/archive/
oswbb/oswnet.sh
oswbb/call_uptime.sh
oswbb/OSWatcher.sh
oswbb/vmsub.sh
oswbb/pidsub.sh
oswbb/src/
oswbb/src/js/
oswbb/src/js/bootstrap.js
oswbb/src/js/modernizr.js
oswbb/src/js/jquery-2.1.4.min.js
oswbb/src/js/THIRDPARTYLICENSE.txt
oswbb/src/js/jquery.lightbox.js
oswbb/src/js/tabs.js
oswbb/src/js/scripts.js
oswbb/src/js/templatemo_custom.js
oswbb/src/Thumbs.db
oswbb/src/fonts/
oswbb/src/fonts/FontAwesome.otf
oswbb/src/fonts/fontawesome-webfont.woff
oswbb/src/fonts/fontawesome-webfont.woff2
oswbb/src/fonts/fontawesome-webfont.eot
oswbb/src/fonts/fontawesome-webfont.ttf
oswbb/src/fonts/fontawesome-webfont.svg
oswbb/src/META-INF/
oswbb/src/META-INF/application-client.xml
oswbb/src/images/
oswbb/src/images/Thumbnail_Placeholder.png
oswbb/src/images/next.png
oswbb/src/images/bx_loader.gif
oswbb/src/images/close.png
oswbb/src/images/loading.gif
oswbb/src/images/previous.png
oswbb/src/css/
oswbb/src/css/templatemo_misc.css
oswbb/src/css/bootstrap.min.css
oswbb/src/css/style.css
oswbb/src/css/font-awesome.min.css
oswbb/src/css/templatemo_style.css
oswbb/src/css/animate.css
oswbb/src/pro.htm
oswbb/src/oswbba_input.txt
oswbb/topaix.sh
oswbb/xensub.sh
oswbb/iosub.sh
oswbb/oswsub.sh
oswbb/nfssub.sh
oswbb/xtop.sh
oswbb/genprvnet.sh
oswbb/oswrds.sh
oswbb/call_sar.sh
oswbb/call_du.sh
oswbb/ifconfigsub.sh
oswbb/mpsub.sh
oswbb/Example_extras.txt
oswbb/locks/
oswbb/OSWatcherFM.sh
oswbb/tar_up_partial_archive.sh
oswbb/data/
oswbb/tar_up_full_archive.sh
oswbb/gif/
oswbb/startOSWbb.sh
[opc@vm-blog oswbb]$

O conteúdo do OSWatcher é o seguinte.

[opc@vm-blog oswbb]$ cd oswbb/
[opc@vm-blog oswbb]$ ll
total 472
drwxr-xr-x 2 opc opc      6 Nov 19  2019 analysis
drwxr-xr-x 2 opc opc      6 Nov 19  2019 archive
-rwxrwxr-x 1 opc opc    546 Jul 15  2019 arpsub.sh
-rwxrwxr-x 1 opc opc     67 Jul 15  2019 call_du.sh
-rwxrwxr-x 1 opc opc     68 Jul 15  2019 call_sar.sh
-rwxrwxr-x 1 opc opc     71 Jul 15  2019 call_uptime.sh
drwxrwxr-x 2 opc opc      6 Nov 19  2019 data
drwxrwxr-x 4 opc opc     76 Nov 19  2019 docs
-rwxrwxr-x 1 opc opc    665 Jul 15  2019 Example_extras.txt
-rwxrwxr-x 1 opc opc   1864 Jul 15  2019 Exampleprivate.net
-rwxrwxr-x 1 opc opc   3990 Jul 15  2019 genprvnet.sh
drwxrwxr-x 2 opc opc      6 Nov 19  2019 gif
-rwxrwxr-x 1 opc opc    795 Jul 15  2019 ifconfigsub.sh
-rwxrwxr-x 1 opc opc    743 Jul 15  2019 iosub.sh
drwxrwxr-x 2 opc opc      6 Nov 19  2019 locks
-rwxrwxr-x 1 opc opc   1507 Jul 15  2019 ltop.sh
-rwxrwxr-x 1 opc opc    542 Jul 15  2019 mpsub.sh
-rwxrwxr-x 1 opc opc    745 Jul 15  2019 nfssub.sh
-rwxrwxr-x 1 opc opc   8035 Jul 15  2019 OSWatcherFM.sh
-rwxrwxr-x 1 opc opc  55817 Nov 19  2019 OSWatcher.sh
-rw-r--r-- 1 opc opc 289876 Nov 19  2019 oswbba.jar
-rwxrwxr-x 1 opc opc    414 Jul 15  2019 oswib.sh
-rwxrwxr-x 1 opc opc    579 Jul 15  2019 oswnet.sh
-rwxrwxr-x 1 opc opc    825 Jul 15  2019 oswrds.sh
-rwxrwxr-x 1 opc opc    524 Jul 15  2019 oswsub.sh
-rwxrwxr-x 1 opc opc    561 Jul 15  2019 piddsub.sh
-rwxrwxr-x 1 opc opc    565 Jul 15  2019 pidsub.sh
-rwxrwxr-x 1 opc opc   1481 Jul 15  2019 psmemsub.sh
-rwxrwxr-x 1 opc opc    557 Jul 15  2019 sarsub.sh
drwxrwxr-x 7 opc opc    126 Nov 19  2019 src
-rwxrwxr-x 1 opc opc   2574 Jul 15  2019 startOSWbb.sh
-rwxrwxr-x 1 opc opc    752 Jul 15  2019 stopOSWbb.sh
-rwxrwxr-x 1 opc opc    819 Jul 15  2019 tar_up_full_archive.sh
-rwxrwxr-x 1 opc opc   8234 Jul 15  2019 tar_up_partial_archive.sh
drwxr-xr-x 2 opc opc      6 Nov 19  2019 tmp
-rwxrwxr-x 1 opc opc    527 Jul 15  2019 topaix.sh
-rwxrwxr-x 1 opc opc    414 Nov 13  2019 uncpr.bat
-rwxrwxr-x 1 opc opc    545 Jul 15  2019 vmsub.sh
-rwxrwxr-x 1 opc opc    571 Jul 15  2019 xensub.sh
-rwxrwxr-x 1 opc opc   1486 Jul 15  2019 xtop.sh
[opc@vm-blog oswbb]$
</pre>



<p><strong>Passo 2:</strong>   Para iniciar a ferramenta OSWatcher, execute startOSWbb.sh como a seguir.</p>



<pre class="wp-block-preformatted">startOSW.sh &lt;SnapshotInterval > &lt;ArchiveInterval></pre>



<p>Por exemplo; Se iniciarmos o OSWatcher como sh startOSWbb.sh 60 10, então o OSWatcher vai coletar dados a cada 60 segundos e manterá esses dados por 10 horas.</p>



<p>Por default ele inicia a coleta com intervalo de 30 segundos e mantém os logs por 48 horas.</p>



<pre class="wp-block-preformatted">opc@vm-blog oswbb]$
Info...You did not enter a value for snapshotInterval.
Info...Using default value = 30
Info...You did not enter a value for archiveInterval.
Info...Using default value = 48
Setting the archive log directory to/oswbb/oswbb/archive

Testing for discovery of OS Utilities...
VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
IP found on your system.
TOP found on your system.
Warning... /proc/slabinfo not found on your system. Check to see if this user has permission to access this file.
PIDSTAT found on your system.
NFSIOSTAT found on your system.
Warning... TRACEROUTE not found on your system. No TRACEROUTE data will be collected.

Discovery of CPU CORE COUNT
CPU CORE COUNT will be used by oswbba to automatically look for cpu problems

CPU CORE COUNT = 4
VCPUS/THREADS = 4

Discovery completed.

Starting OSWatcher v8.4.0  on Tue Dec 12 21:02:21 GMT 2023
With SnapshotInterval = 30
With ArchiveInterval = 48

OSWatcher - Written by Carl Davis, Center of Expertise,
Oracle Corporation
For questions on install/usage please go to MOS (Note:301137.1)

Data is stored in directory: /oswbb/oswbb/archive

Starting Data Collection...

oswbb heartbeat:Tue Dec 12 21:02:26 GMT 2023
oswbb heartbeat:Tue Dec 12 21:02:56 GMT 2023
</pre>



<p>Você pode parar o OSWatcher através do comando</p>



<pre class="wp-block-preformatted">[opc@vm-blog oswbb]$ ./stopOSWbb.sh
[opc@vm-blog oswbb]$
</pre>



<p>Agora podemos analisar os dados</p>



<pre class="wp-block-preformatted">[opc@vm-blog oswbb]$ java -jar oswbba.jar -i archive

Starting OSW Analyzer V8.4.0
OSWatcher Analyzer Written by Oracle Center of Expertise
Copyright (c)  2019 by Oracle Corporation

Parsing Data. Please Wait...

Scanning file headers for version and platform info...


Parsing file vm-blog_pidstat_23.12.12.2100.dat ...

Parsing file vm-blog_iostat_23.12.12.2100.dat ...
This directory already exists. Rewriting...

Parsing file vm-blog_vmstat_23.12.12.2100.dat ...

Parsing file vm-blog_netstat_23.12.12.2100.dat ...

Parsing file vm-blog_top_23.12.12.2100.dat ...

Parsing file vm-blog_ps_23.12.12.2100.dat ...


Parsing Completed.


Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs
Enter 5 to Display Disk IO Graphs
Enter 61 to Display Individual OS Process I/O RPS Graphs
Enter 62 to Display Individual OS Process I/O WPS Graphs
Enter 63 to Display Individual OS Process Percent User CPU Graphs
Enter 64 to Display Individual OS Process Percent System CPU Graphs
Enter 65 to Display Individual OS Process Percent Total CPU (User + System) Graphs
Enter 66 to Display Individual OS Process Percent Memory Graphs

Enter GP to Generate Individual Process Profile
Enter GC to Generate All CPU Gif Files
Enter GM to Generate All Memory Gif Files
Enter GD to Generate All Disk Gif Files
Enter GN to Generate All Network Gif Files

Enter L to Specify Alternate Location of Gif Directory
Enter Z to Zoom Graph Time Scale (Does not change analysis dataset)
Enter B to Returns to Baseline Graph Time Scale (Does not change analysis dataset)
Enter R to Remove Currently Displayed Graphs

Enter X to Export Parsed Data to Flat File
Enter S to Analyze Subset of Data(Changes analysis dataset including graph time scale)
Enter A to Analyze Data
Enter D to Generate DashBoard

Enter Q to Quit Program
</pre>



<p>Para este exemplo selecionei a opção 1</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2023/12/image-3.png"><img loading="lazy" decoding="async" width="975" height="299" src="https://www.dbadutra.com/wp-content/uploads/2023/12/image-3.png" alt="" class="wp-image-6144" srcset="https://www.dbadutra.com/wp-content/uploads/2023/12/image-3.png 975w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-3-300x92.png 300w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-3-768x236.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Para este exemplo selecionei a opção</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2023/12/image-4.png"><img loading="lazy" decoding="async" width="975" height="296" src="https://www.dbadutra.com/wp-content/uploads/2023/12/image-4.png" alt="" class="wp-image-6145" srcset="https://www.dbadutra.com/wp-content/uploads/2023/12/image-4.png 975w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-4-300x91.png 300w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-4-768x233.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Também podemos gerar um Dashboard para analise.</p>



<pre class="wp-block-preformatted">Please Select an Option:D
Enter a unique analysis/dashboard directory name or enter &lt;CR> to accept default name:

A new analysis file analysis/vm-blog_Dec12050009_1702416975/analysis.txt has been created.

Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Run_Queue.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Run_Adjusted_Queue.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Block_Queue.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_HB.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_PS_Processes.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_Idle.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_Util.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_System.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_User.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_Wa.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_Interrupts.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Context_Switches.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Memory_Swap.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Memory_Free.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Memory_Page_In_Rate.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Memory_Page_Out_Rate.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Cpu_Wa.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_Block_Queue.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_ST.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_AW.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_PB.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_RPS.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_WPS.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_OS_IO_TPS.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_rx_ok.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_rx_err.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_rx_drp.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_rx_ovr.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_tx_ok.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_tx_err.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_tx_drp.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ lo_tx_ovr.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_rx_ok.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_rx_err.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_rx_drp.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_rx_ovr.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_tx_ok.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_tx_err.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_tx_drp.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_link_ enp0s6_tx_ovr.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpOutRequests.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpInReceives.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpFragCreates.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpFragOKs.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpInDiscards.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_IpReasmFails.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_ip_fragments_in_rate.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_ip_fragments_out_rate.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpInDatagrams.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpOutDatagrams.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpInErrors.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpInCsumErrors.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpRcvbufErrors.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_UdpSndbufErrors.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpInSegs.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpOutSegs.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpRetransSegs.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpOutRsts.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpEstabResets.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_TcpAttemptFails.jpg
Generating file analysis/vm-blog_Dec12050009_1702416975/dashboard/generated_files/OSWg_tcp_retran_error_rate.jpg

Files written to the analysis directory.

</pre>



<p>Onde é Gerado um relatório no final da analise.</p>



<figure class="wp-block-image size-full"><a href="https://www.dbadutra.com/wp-content/uploads/2023/12/image-5.png"><img loading="lazy" decoding="async" width="975" height="506" src="https://www.dbadutra.com/wp-content/uploads/2023/12/image-5.png" alt="" class="wp-image-6146" srcset="https://www.dbadutra.com/wp-content/uploads/2023/12/image-5.png 975w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-5-300x156.png 300w, https://www.dbadutra.com/wp-content/uploads/2023/12/image-5-768x399.png 768w" sizes="(max-width: 975px) 100vw, 975px" /></a></figure>



<p>Espero que isso possa te ajudar em algum momento.<br><br>Até a próxima.</p>



<p><strong>Disclaimer: “The postings on this site are my own and do not necessarily represent my current employer positions, strategies, or opinions. The information here was edited to be useful for general purpose, specific data, and identifications was removed to allow reaching a generic audience and to be useful.</strong></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/12/oswatcher-como-instalar-e-usar/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6142</post-id>	</item>
		<item>
		<title>Fixando ORA-19909  &#8211; #JoelKallmanDay </title>
		<link>https://www.dbadutra.com/2023/10/fixando-ora-19909-joelkallmanday/</link>
					<comments>https://www.dbadutra.com/2023/10/fixando-ora-19909-joelkallmanday/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Wed, 11 Oct 2023 22:10:28 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6095</guid>

					<description><![CDATA[Um grande amigo me pediu uma ajuda para identificar um problema em um Data Guard, achei que seria legal compartilhar como fixar o problema do ORA-19909 Vamos ao nosso laboratório Primary:DB Name: DUSTOP Standby:DB Unique Name: DUTSB======== Redo apply no standby falhou repentinamente, conforme mostrado no alert.log: Thu Oct 09 14:40:13 CST 2023Media Recovery Log [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Um grande amigo me pediu uma ajuda para identificar um problema em um Data Guard, achei que seria legal compartilhar como fixar o problema do ORA-19909</p>



<p></p>



<p>Vamos ao nosso laboratório</p>



<p></p>



<p>Primary:<br>DB Name: DUSTOP</p>



<p>Standby:<br>DB Unique Name: DUTSB<br>========</p>



<p>Redo apply no standby falhou repentinamente, conforme mostrado no alert.log:</p>



<p><br>Thu Oct 09 14:40:13 CST 2023<br>Media Recovery Log &lt; directory >/DUTSB/arch/DUTSB_1_699789524_129430.arc[1]  <br>Thu Oct 10 14:40:26 CST 2023<br>Media Recovery Waiting for thread 1 sequence 129431 [2]                       <br>Thu Oct 10 14:44:34 CST 2023<br>Redo Shipping Client Connected as PUBLIC<br>&#8212; Connected User is Valid<br>RFS[4]: Assigned to RFS process 24267<br>RFS[4]: Identified database type as &#8216;physical standby&#8217;<br>RFS[4]: Archived Log: &#8216;&lt; directory >/DUTSB/arch/DUTSB_1_800028335_10.arc&#8217;<br>RFS[4]: Physical Standby in the future of Branch(resetlogs_id) 800028335<br>RFS[4]: Standby database SCN: 1746:-485073214  Primary branch SCN: 1746:-486307562<br>RFS[4]: New Archival REDO Branch(resetlogs_id): 800028335  Prior: 699789524<br>RFS[4]: Archival Activation ID: 0x5a34242d Current: 0x2f28438f<br>RFS[4]: Effect of primary database OPEN RESETLOGS<br>RFS[4]: Managed Standby Recovery process is active<br>New incarnation branch detected in ArchiveLog, filename &lt; directory >/DUTSB/arch/DUTSB_1_800028335_10.arc [3] <br>Inspection of file changed rdi from 1 to 2<br>Setting recovery target incarnation to 2<br>Thu Oct 10 14:44:37 CST 2023<br>MRP0: Incarnation has changed! Retry recovery&#8230;<br>Thu Oct 10 14:44:37 CST 2023<br>Errors in file &lt; directory >/DUTSB/admin/bdump/DUTSB_mrp0_20506.trc:<br>ORA-19906: recovery target incarnation changed during recovery [4]<br>Recovery interrupted!<br>Thu Oct 10 14:44:40 CST 2023<br>Errors in file &lt; directory >/DUTSB/admin/bdump/DUTSB_mrp0_20506.trc:<br>ORA-19906: recovery target incarnation changed during recovery<br>Thu Oct 10 14:45:00 CST 2023<br>Managed Standby Recovery not using Real Time Apply<br>Warning: Recovery target destination is in a sibling branch<br>of the controlfile checkpoint. Recovery will only recover<br>changes to datafiles.<br>Datafile 1 (ckpscn 7502822792898) is orphaned on incarnation#=1<br>MRP0: Background Media Recovery terminated with error 19909<br>Thu Oct 10 14:45:00 CST 2023<br>Errors in file &lt; directory >/DUTSB/admin/bdump/DUTSB_mrp0_20506.trc:<br>ORA-19909: datafile 1 belongs to an orphan incarnation [5]<br>ORA-01110: data file 1: &#8216;&lt; directory >/DUTSB/data02/system01.dbf&#8217;<br>Thu Oct 10 14:45:00 CST 2023<br>Errors in file &lt; directory >/DUTSB/admin/bdump/DUTSB_mrp0_20506.trc:<br>ORA-19909: datafile 1 belongs to an orphan incarnation</p>



<p>Isso ocorre porque o banco de dados standby, por diversos motivos, é aberto com resetlogs e informações que residem no FRA. O RMAN cataloga implicitamente o FRA, fazendo com que as informações sobre esta encarnação de &#8220;teste&#8221; sejam inseridas no arquivo standby controlfile que esta montado. Portanto existe informação sobre uma nova encarnação.</p>



<p>Para resolver o problema, no standby:</p>



<p>Opção 1:</p>



<p>Redefina a encarnação para a encarnação anterior que corresponda à primária. Por exemplo:</p>



<p>Esta é a encarnação do banco de dados primário:</p>



<p>RMAN> list incarnation of database;<br><br>using target database control file instead of recovery catalog<br><br>DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time<br>&#8212;&#8212;- &#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;- &#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-<br>1       1       DUTSOP   791150198        CURRENT 121289826  02-JUN-23</p>



<p>Esta é a encarnação do banco de dados Standby</p>



<p>RMAN&gt; list incarnation of database;<br><br>using target database control file instead of recovery catalog</p>



<p>DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time<br>&#8212;&#8212;- &#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;- &#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-<br>1       1       DUTSB   791150198        PARENT  121289826  02-JUN-23<br>2       2       DUTSB   791150198        CURRENT 7502821558550 22-AGO-23</p>



<p>No standby, execute:</p>



<p>RMAN&gt; reset database to incarnation 1;</p>



<p>Opção 2:</p>



<p>Limpe as informações FRA associadas aos resetlogs executados no Standby.</p>



<p>1) remover arquivos archivelog e/ou autobackups de controlfile que foram gerados pelo standby quando ele foi ativado (aberto com resetlogs). Deixe apenas os arquivos archivelog recebidos do primário.</p>



<p>2) considere atualizar o arquivo de controlfile do standby com uma cópia do primário para remover informações de encarnação desnecessárias do v$database_incarnation do controlfile do standby</p>



<p>3) inicie a recuperação manual, aplicando o próximo archivelog do primário para confirmar que a recuperação continuará executando.</p>



<p>4) reinicie a recuperação automática no standby</p>



<p></p>



<p></p>



<p>Te vejo em breve em outros artigos.</p>



<p>Fique ligado seguindo no twitter @aontalba and Linkedin.</p>



<p><strong>Disclaimer:&nbsp;“The postings on this site are my own and don’t necessarily represent my actual employer positions, strategies, or opinions. The information here was edited&nbsp; to be useful for general purpose, specific data, and identifications was removed to allow reach a generic audience and to be useful.”</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/10/fixando-ora-19909-joelkallmanday/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6095</post-id>	</item>
		<item>
		<title>COMO REMOVER HAIP ON ODA 19.13.0.0.0 DEPOIS DO PATCH</title>
		<link>https://www.dbadutra.com/2023/05/como-remover-haip-on-oda-19-13-0-0-0-depois-do-patch/</link>
					<comments>https://www.dbadutra.com/2023/05/como-remover-haip-on-oda-19-13-0-0-0-depois-do-patch/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Wed, 10 May 2023 15:19:11 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6018</guid>

					<description><![CDATA[Eu precisava remover o HAIP do ODA após migrar para a versão 19.13.0.0.0 e decidi preparar este procedimento. Esse plano de ação deve exigir apenas uma reinicialização do clusterware versus correção, o que pode resultar em duas ou três reinicializações do clusterware. Vamos ao procedimento. 1. Backup gpnp profile [grid@testoda1 peer]$ cd /u01/app/19.0.0.0/grid/gpnp/&#8217;hostname&#8217;/profiles/peer[grid@testoda1 peer]$ cp [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Eu precisava remover o HAIP do ODA após migrar para a versão 19.13.0.0.0 e decidi preparar este procedimento.</p>



<p>Esse plano de ação deve exigir apenas uma reinicialização do clusterware versus correção, o que pode resultar em duas ou três reinicializações do clusterware.</p>



<p>Vamos ao procedimento.<br><br></p>



<p><br>1. Backup gpnp profile<br><br>[grid@testoda1 peer]$ cd /u01/app/19.0.0.0/grid/gpnp/&#8217;hostname&#8217;/profiles/peer<br>[grid@testoda1 peer]$ cp -p profile.xml profile.xml.bkp<br>[grid@testoda2 peer]$ /u01/app/19.0.0.0/grid/gpnp/&#8217;hostname&#8217;/profiles/peer<br>[grid@testoda2 peer]$ cp -p profile.xml profile.xml.bkp</p>



<p><br>2. Obtenha as interfaces cluster_interconnect (apenas no node 1)<br><br>[grid@testoda1 ~]$ /u01/app/19.0.0.0/grid/bin/oifcfg getif<br><br>btbond1 10.32.16.0 global public<br>p1p1 192.168.16.0 global cluster_interconnect,asm<br>p1p2 192.168.17.0 global cluster_interconnect,asm<br><br>Observe: que os nomes de interface privada podem ser diferentes, dependendo do modelo e / ou versão do ODA que foi usada para implantar a máquina etc.</p>



<p>No restante desta nota, estamos usando p1p1 / p1p2 como exemplo nas etapas abaixo.</p>



<p><br>3. Faça backup de arquivos ifcfg- &lt;interface&gt; existentes<br><br>[root@testoda1 ~]# cd /etc/sysconfig/network-scripts<br>[root@testoda1 network-scripts]# cp ifcfg-p1p1 backupifcfgFiles/ifcfg-p1p1.bak<br>[root@testoda1 network-scripts]# cp ifcfg-p1p2 backupifcfgFiles/ifcfg-p1p2.bak<br>[root@testoda2 ~]# cd /etc/sysconfig/network-scripts<br>[root@testoda2 network-scripts]# cp ifcfg-p1p1 backupifcfgFiles/ifcfg-p1p1.bak<br>[root@testoda2 network-scripts]# cp ifcfg-p1p2 backupifcfgFiles/ifcfg-p1p2.bak</p>



<p><br>4. Crie ifcfg-icbond0 e modifique os arquivos ifcfg- &lt;interface&gt;<br><br>[root@testoda1 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-icbond0<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=icbond0<br>ONBOOT=yes<br>BOOTPROTO=none<br>USERCTL=no<br>TYPE=BOND<br>IPV6INIT=no<br>NM_CONTROLLED=no<br>PEERDNS=no<br>MTU=9000<br>BONDING_OPTS=&#8221;mode=active-backup miimon=100 primary=p1p1&#8243;<br>IPADDR=192.168.16.24<br>NETMASK=255.255.255.0<br><br>[root@testoda1 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-p1p1<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=p1p1<br>TYPE=Ethernet<br>ONBOOT=yes<br>NM_CONTROLLED=no<br>USERCTL=no<br><br># disable generic and large receive offloads on all interfaces,<br># to prevent known problems, specifically in bridge configurations.<br><br>ETHTOOL_OFFLOAD_OPTS=&#8221;lro off gro off&#8221;<br>IPV6INIT=no<br>PEERDNS=no<br>BOOTPROTO=none<br>MASTER=icbond0<br>SLAVE=yes<br>MTU=9000<br><br>[root@testoda1 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-p1p2<br><br>/etc/sysconfig/network-scripts/ifcfg-p1p2<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=p1p2<br>TYPE=Ethernet<br>ONBOOT=yes<br>NM_CONTROLLED=no<br>USERCTL=no<br><br># disable generic and large receive offloads on all interfaces,<br># to prevent known problems, specifically in bridge configurations.<br><br>ETHTOOL_OFFLOAD_OPTS=&#8221;lro off gro off&#8221;<br>IPV6INIT=no<br>PEERDNS=no<br>BOOTPROTO=none<br>MASTER=icbond0<br>SLAVE=yes<br>MTU=9000<br><br>[root@testoda2 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-icbond0<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=icbond0<br>ONBOOT=yes<br>BOOTPROTO=none<br>USERCTL=no<br>TYPE=BOND<br>IPV6INIT=no<br>NM_CONTROLLED=no<br>PEERDNS=no<br>MTU=9000<br>BONDING_OPTS=&#8221;mode=active-backup miimon=100 primary=p1p1&#8243;<br>IPADDR=192.168.16.25<br>NETMASK=255.255.255.0<br><br>[root@testoda2 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-p1p1<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=p1p1<br>TYPE=Ethernet<br>ONBOOT=yes<br>NM_CONTROLLED=no<br>USERCTL=no<br><br># disable generic and large receive offloads on all interfaces,<br># to prevent known problems, specifically in bridge configurations.<br><br>ETHTOOL_OFFLOAD_OPTS=&#8221;lro off gro off&#8221;<br>IPV6INIT=no<br>PEERDNS=no<br>BOOTPROTO=none<br>MASTER=icbond0<br>SLAVE=yes<br>MTU=9000<br><br>[root@testoda2 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-p1p2<br><br># This file is automatically created by the ODA software.<br><br>DEVICE=p1p2<br>TYPE=Ethernet<br>ONBOOT=yes<br>NM_CONTROLLED=no<br>USERCTL=no<br><br># disable generic and large receive offloads on all interfaces,<br># to prevent known problems, specifically in bridge configurations.<br><br>ETHTOOL_OFFLOAD_OPTS=&#8221;lro off gro off&#8221;<br>IPV6INIT=no<br>PEERDNS=no<br>BOOTPROTO=none<br>MASTER=icbond0<br>SLAVE=yes<br>MTU=9000<br><br><br><br>5. Criando / substituindo init.ora-s para instâncias APX<br><br>[grid@testoda1]$ echo &#8220;+APX1.cluster_interconnects=&#8217;192.168.16.24&#8242;&#8221; &gt; $ORACLE_HOME/dbs/init+APX1.ora<br><br>[grid@testoda2]$ echo &#8220;+APX2.cluster_interconnects=&#8217;192.168.16.25&#8242;&#8221; &gt; $ORACLE_HOME/dbs/init+APX2.ora<br><br></p>



<p>6. Pare o Clusterware no node 2<br><br>[root@testoda2 ~]# /u01/app/18.0.0.0/grid/bin/crsctl stop crs -f</p>



<p><br>7. Defina a nova interface cluster_interconnect ligada e remova as interfaces p1p1 / p1p2 da configuração (apenas no node 1)<br><br>[grid@testoda1 ~]$ oifcfg setif -global icbond0/192.168.16.0:cluster_interconnect,asm<br><br>[grid@testoda1 ~]$ oifcfg getif<br><br>btbond1 10.209.244.0 global public<br>p1p1 192.168.16.0 global cluster_interconnect,asm<br>p1p2 192.168.17.0 global cluster_interconnect,asm<br>icbond0 192.168.16.0 global cluster_interconnect,asm<br><br>[grid@testoda1 ~]$ oifcfg delif -global p1p1/192.168.16.0<br><br>[grid@testoda1 ~]$ oifcfg delif -global p1p2/192.168.17.0<br><br>[grid@testoda1 ~]$ oifcfg getif<br><br>btbond1 10.209.244.0 global public<br>icbond0 192.168.16.0 global cluster_interconnect,asm</p>



<p><br>8. Remova a dependência do HAIP no ora.asm</p>



<p><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl modify res ora.cluster_interconnect.haip -attr ENABLED=0 -init<br><br>[root@testoda2 ~]# /u01/app/19.0.0.0/grid/bin/crsctl modify res ora.cluster_interconnect.haip -attr ENABLED=0 -init<br><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl modify res ora.asm -attr &#8220;START_DEPENDENCIES=&#8217;hard(ora.cssd,ora.ctssd) pullup(ora.cssd,ora.ctssd) weak(ora.drivers.acfs)&#8217;, STOP_DEPENDENCIES=&#8217;hard(intermediate:ora.cssd)'&#8221; -init<br><br>[root@testoda2 ~]# /u01/app/19.0.0.0/grid/bin/crsctl modify res ora.asm -attr &#8220;START_DEPENDENCIES=&#8217;hard(ora.cssd,ora.ctssd) pullup(ora.cssd,ora.ctssd) weak(ora.drivers.acfs)&#8217;, STOP_DEPENDENCIES=&#8217;hard(intermediate:ora.cssd)'&#8221; -init</p>



<p><br>9. Removendo o recurso ora.cluster_interconnect.haip<br><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl delete resource ora.cluster_interconnect.haip -init –f<br><br>[root@testoda2 ~]# /u01/app/19.0.0.0/grid/bin/crsctl delete resource ora.cluster_interconnect.haip -init –f</p>



<p><br>10. Pare o Clusterware no node1<br><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl stop crs -f</p>



<p><br>11. Reinicie a rede<br><br>[root@testoda1 network-scripts]# service network restart<br><br>[root@testoda1 network-scripts]# ifconfig -a<br><br>[root@testoda1 network-scripts]# cat /proc/net/bondinf/icbond0<br><br>[root@testoda2 network-scripts]# service network restart<br><br>[root@testoda2 network-scripts]# ifconfig -a<br><br>[root@testoda2 network-scripts]# cat /proc/net/bondinf/icbond0<br><br><br>12. Reinicie o Clusterware<br><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl start crs<br><br>[root@testoda2 ~]# /u01/app/19.0.0.0/grid/bin/crsctl start crs<br><br><br>13. Reinicie o dcs-agent para redescobrir as interfaces automaticamente<br><br>[grid@testoda1 ~]# /opt/oracle/dcs/bin/restartagent.sh<br><br>[grid@testoda2 ~]# /opt/oracle/dcs/bin/restartagent.sh</p>



<p>14. Verificando o serviço de cluster após remover o serviço</p>



<p>[root@testoda1 ~]#<br><br>[root@testoda1 ~]# /u01/app/19.0.0.0/grid/bin/crsctl check cluster -all<br>**************************************************************<br>odasys11:<br>CRS-4537: Cluster Ready Services is online<br>CRS-4529: Cluster Synchronization Services is online<br>CRS-4533: Event Manager is online<br>**************************************************************<br>odasys12:<br>CRS-4537: Cluster Ready Services is online<br>CRS-4529: Cluster Synchronization Services is online<br>CRS-4533: Event Manager is online<br>**************************************************************</p>



<p>Espero ter ajudado com este procedimento</p>



<p></p>



<p><strong>Disclaimer: “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited  to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful.”</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/05/como-remover-haip-on-oda-19-13-0-0-0-depois-do-patch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6018</post-id>	</item>
		<item>
		<title>Flashback Automatico em Banco Standby</title>
		<link>https://www.dbadutra.com/2023/03/flashback-automatico-em-banco-standby/</link>
					<comments>https://www.dbadutra.com/2023/03/flashback-automatico-em-banco-standby/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Thu, 09 Mar 2023 20:44:18 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=6005</guid>

					<description><![CDATA[Um dos recursos do Oracle 19, 21c é que, quando um flashback ou uma recuperação pontual é executada no banco de dados principal em um Oracle Data Guard, a mesma operação também é executada no banco de dados standby. Após uma operação de flashback ou PITR, o banco de dados principal é aberto com a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Um dos recursos do Oracle 19, 21c  é que, quando um flashback ou uma recuperação pontual é executada no banco de dados principal em um Oracle Data Guard, a mesma operação também é executada no banco de dados standby.</p>



<p>Após uma operação de flashback ou PITR, o banco de dados principal é aberto com a opção RESETLOGS.</p>



<p>O RESETLOGS leva a uma nova encarnação do primário ou do PDB no primário.</p>



<p>O que há de novo no Oracle 19c?</p>



<p>O processo MRP no standby detecta a nova encarnação e move o banco de dados standby para a um novo redo desta nova encarnação e, em seguida, faz o flashback do banco de dados standby ou no pluggable database para o mesmo ponto no tempo que o primário ou o PDB no primário.</p>



<p>Em versões anteriores, tínhamos que obter o RESETLOGS SCN# no primário e então emitir manualmente um comando FLASHBACK DATABASE no banco de dados standby para habilitar a recuperação gerenciada e continuar com o processo de redo apply.</p>



<p>Além disso, outro novo recurso do Oracle 19c é que, quando criamos um ponto de restauração no banco de dados principal, ele também cria automaticamente um ponto de restauração no banco de dados de Standby</p>



<p>Esses pontos de restauração são chamados de <strong>Replicated Restore Points</strong><strong> </strong>e têm o nome do ponto de restauração com o sufixo “_PRIMARY”.</p>



<p>No banco de dados primário, criaremos um ponto de restauração garantido.</p>



<pre class="wp-block-preformatted">SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

SQL> create table simduts.objects as select * from all_objects;

Table created.

SQL> select count(*) from simduts.objects;

  COUNT(*)
----------
     71296


SQL> create restore point rec_grp guarantee flashback database;

Restore point created.

SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
REC_GRP
</pre>



<p>Observe que o banco de dados standby, o ponto de restauração foi criado automaticamente e o nome tem o sufixo “_PRIMARY”</p>



<p></p>



<pre class="wp-block-preformatted">SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
YES

SQL>  select count(*) from simduts.objects;

  COUNT(*)
----------
     71296

SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
REC_GRP_PRIMARY
</pre>



<p>No banco de dados primário, podemos ver que a coluna REPPLICATED tem o valor NO para o ponto de restauração, enquanto no banco de dados em standby o valor é SIM</p>



<p></p>



<p></p>



<pre class="wp-block-preformatted">Banco de dados Primário

SQL> select NAME,REPLICATED from v$restore_point;

NAME			       REP
------------------------------ ---
REC_GRP	       		NO
Banco de dados Standby

SQL> select NAME,REPLICATED from v$restore_point;

NAME			       REP
------------------------------ ---
REC_GRP_PRIMARY	       YES
</pre>



<p>Agora simulamos um caso em que um erro foi cometido e agora precisamos executar uma operação de flashback no banco de dados primário para resolver o erro. O flashback é executado no ponto de restauração criado anteriormente e, em seguida, abrimos o banco de dados com a opção RESETLOGS.</p>



<p></p>



<pre class="wp-block-preformatted">SQL> truncate table simduts.objects;

Table truncated.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1241513488 bytes
Fixed Size		    8896016 bytes
Variable Size		  335544320 bytes
Database Buffers	  889192448 bytes
Redo Buffers		    7880704 bytes
Database mounted.

SQL> flashback database to restore point rec_grp;

Flashback complete.

SQL> alter database open resetlogs;

Database altered.
</pre>



<p>O banco de dados standby é colocado no modo MOUNT e veremos que o processo MRP no banco de dados em espera iniciará e executará a operação automática de flashback no banco de dados em standby também.</p>



<p></p>



<pre class="wp-block-preformatted">SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1241513488 bytes
Fixed Size		    8896016 bytes
Variable Size		  318767104 bytes
Database Buffers	  905969664 bytes
Redo Buffers		    7880704 bytes
Database mounted.
 
...
...
 rfs (PID:21384): Primary database is in MAXIMUM PERFORMANCE mode
2023-03-08T22:00:30.671381+06:00
 rfs (PID:21384): Selected LNO:6 for T-1.S-3 dbid 1240291890 branch 1013527366
2023-03-08T22:00:34.853803+06:00
ARC0 (PID:22457): Archived Log entry 10 added for T-1.S-3 ID 0x6bcedc52 LAD:1
2023-03-08T22:00:34.930249+06:00
 rfs (PID:22500): Primary database is in MAXIMUM PERFORMANCE mode
2023-03-08T23:00:35.073538+06:00
 rfs (PID:22500): Selected LNO:6 for T-1.S-4 dbid 1240291890 branch 1013527366
2023-03-08T22:00:35.909833+06:00
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT  NODELAY
2023-03-08T22:00:35.910522+06:00
Attempt to start background Managed Standby Recovery process (duts)
Starting background process MRP0
2023-03-08T22:00:35.932806+06:00
MRP0 started with pid=96, OS id=25505 
2023-03-08T22:00:35.935882+06:00
Background Managed Standby Recovery process started (duts)
2023-03-08T22:00:40.940224+06:00
Serial Media Recovery started

...
...

MRP0 (PID:25505): Recovery coordinator performing automatic flashback of database to SCN:0x00000000001fcce6 (2084069)
Flashback Restore Start
Flashback Restore Complete
Flashback Media Recovery Start
2023-03-08T22:01:01.852650+06:00
Setting recovery target incarnation to 2
2023-03-08T22:01:01.852994+06:00
Serial Media Recovery started
stopping change tracking
2023-03-08T22:01:01.976765+06:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/DUTS_SB/archivelog/2023-03-08/o1_mf_1_9_bkn8pkx6.arc
2023-03-08T22:01:02.142326+06:00
Resize operation completed for file# 3, old size 522240K, new size 552960K
Restore point REC_GRP_PRIMARY propagated from primary already exists
2023-03-08T22:01:02.215320+06:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/DUTS_SB/archivelog/2023-03-08/o1_mf_1_10_bkn9pnf3.arc
2023-03-08T22:01:02.657960+06:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/DUTS_SB/archivelog/2023-03-08/o1_mf_1_11_bkn10s6g2.arc
2023-03-08T22:01:02.795226+06:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/DUTS_SB/archivelog/2023-03-08/o1_mf_1_12_bkn11cxvl.arc
2023-03-08T22:01:02.956167+06:00
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT  NODELAY
2023-03-08T22:01:04.624321+06:00
Incomplete Recovery applied until change 2094050 time 08/03/2023 21:47:15
Flashback Media Recovery Complete
</pre>



<p>Quando vemos a mensagem “Flashback Media Recovery Complete” no banco de dados standby no alert.log, agora podemos abrir o banco de dados standby.</p>



<p>Observe que a configuração do Data Guard Broker não está mostrando nenhum erro e não precisamos executar nenhuma etapa manual no banco de dados standby para habilitar a configuração após o flashback do banco de dados primário.<br> </p>



<pre class="wp-block-preformatted">SQL> ALTER DATABASE OPEN;

Database altered.

DGMGRL> show configuration;

Configuration - duts_dg

  Protection Mode: MaxPerformance
  Members:
  duts    - Primary database
    duts_sb - Physical standby database 

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 54 seconds ago)

</pre>



<p></p>



<p>Espero que este artigo ajude !!!</p>



<p></p>



<p><strong>Disclaimer:&nbsp;“The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited&nbsp; to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/03/flashback-automatico-em-banco-standby/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6005</post-id>	</item>
		<item>
		<title>How to identify High Water Mark</title>
		<link>https://www.dbadutra.com/2023/01/how-to-identify-high-water-mark/</link>
					<comments>https://www.dbadutra.com/2023/01/how-to-identify-high-water-mark/#comments</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Thu, 12 Jan 2023 16:54:12 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=5985</guid>

					<description><![CDATA[A friend called me asking for help because a tablespace did not reduce size after purging the data. I explained to him how to identify high-water marks, and decided to write this article. This article explains, with examples, how to view the high-water mark and when the high-water mark is reset. The queries in this [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>A friend called me asking for help because a tablespace did not reduce size after purging the data.</p>



<p>I explained to him how to identify high-water marks, and decided to write this article.</p>



<p>This article explains, with examples, how to view the high-water mark and when the high-water mark is reset. The queries in this article apply when the segment, whose high-water mark must be determined, is in one datafile and is not spawned across multiple data files.</p>



<p>The high-water mark is the boundary between used and unused space in a segment. As requests for new free blocks that cannot be satisfied by existing free lists are received, the block to which the high-water mark points to becomes a used block, and the high-water mark is advanced to the next block.</p>



<p>The high-water mark is the level at which blocks have never been formatted to receive data.<br><br>When a table is created in a tablespace, some initial number of blocks/extents are allocated to the table. Later, as the number of rows inserted increases, extents are allocated accordingly.</p>



<p><br>To find out how many blocks/extents are allocated to the table, query DBA_SEGMENTS for &#8216;blocks&#8217; and &#8216;extents&#8217;.</p>



<p></p>



<pre class="wp-block-preformatted">SQL&gt;create table HWTB (num number) tablespace HW;

Table created

SQL&gt;select blocks, extents from dba_segments where segment_name='HWTB'

  BLOCKS       EXTENTS
-------- -------------
       8             1


Now, to view the high water mark, perform an:

</pre>



<pre class="wp-block-preformatted">SQL&gt; analyze table test1 compute statistics;</pre>



<p></p>



<p>Querying dba_tables for &#8216;Blocks&#8217; and &#8216;Empty_blocks&#8217; should give the high-water mark.<br><br>Blocks &#8212; &gt; Number blocks that has been formatted to recieve data<br>Empty_blocks &#8212;&gt; Among the allocated blocks, the blocks that were never used</p>



<p></p>



<pre class="wp-block-preformatted">SQL&gt; select blocks,empty_blocks,num_rows from dba_tables where table_name='HWTB'

        BLOCKS               EMPTY_BLOCKS             NUM_ROWS
-------------- -------------------------- --------------------
             0                          7                    0


-- If you insert some rows, then the output of the above query returns:


        BLOCKS               EMPTY_BLOCKS             NUM_ROWS
-------------- -------------------------- --------------------
             1                          6                    8


-- blocks+Empty_blocks=1+6=7 (but not 8) because 1 block is for segment header.

-- Insert some more rows into table 'HWTB' to increase the number of extents allocated,
-- so that DBA_SEGMENTS will show:


        BLOCKS         EXTENTS
-------------- ---------------
            32               4


-- And dba_tables (after analyze table) shows:


        BLOCKS               EMPTY_BLOCKS             NUM_ROWS
-------------- -------------------------- --------------------
            24                          5                10315


</pre>



<p>Deleting the records does not lower the high-water mark. Therefore, deleting the records does not raise the &#8216;Empty_blocks&#8217;. After deleting the records, if you query dba_segments or dba_tables, there would be no change. Even an &#8216;Alter table test1 deallocate unused;&#8217; will not bring the high-water mark down.</p>



<p><br><br>To determine the exact number of blocks that contain data i.e. space used by table below the high water mark, query rowid and get the first and last used block from the rowid.</p>



<p></p>



<pre class="wp-block-preformatted">SQL&gt; select count (distinct dbms_rowid.rowid_block_number(rowid)) "used blocks" from HWTB;


This works fine if only one file is used for the segment. If more files, we need to include the file number in some way, for instance:

</pre>



<pre class="wp-block-preformatted">SQL&gt; select count (distinct dbms_rowid.rowid_block_number(rowid)||'-'||dbms_rowid.rowid_relative_fno (rowid)) "used blocks" from HWTB

            USED_BLOCKS
-----------------------
                     19


</pre>



<p>From this, we can conclude that for table &#8216;HWTB&#8217;, 32 blocks are allocated out of which 24 blocks are formatted to receive data but only 19 blocks contain the actual data.<br><br><br>The high-water mark can be reset with a truncate table or if the table is moved to another tablespace.&nbsp;</p>



<p>One option to shrink a segment to reset the high-water mark is the command ALTER TABLE SHIRK SPACE.</p>



<p></p>



<pre class="wp-block-preformatted">SQL&gt; ALTER TABLE HWTB SHRINK SPACE;</pre>



<p></p>



<p class="has-text-align-left">When the table is created with CTAS from another table, the high water mark of the latter table is not reflected in the new table. If the table is moved back to the same tablespace, the high water mark is reset. In this case, query on obj#, dataobj# of obj$. Obj# remains the same but dataobj# changes.</p>



<p></p>



<p></p>



<p>Hope this helps you!!! </p>



<p></p>



<p></p>



<p>Disclaimer: “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited  to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/01/how-to-identify-high-water-mark/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5985</post-id>	</item>
		<item>
		<title>How to change DBNAME on Oracle RAC</title>
		<link>https://www.dbadutra.com/2023/01/how-to-change-dbname-on-oracle-rac/</link>
					<comments>https://www.dbadutra.com/2023/01/how-to-change-dbname-on-oracle-rac/#comments</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Wed, 11 Jan 2023 22:51:03 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=5982</guid>

					<description><![CDATA[Change Oracle DB name using NID: How to Change the DBID, DBNAME Using NID Utility (Doc ID 863800.1) 1. In Real Application Cluster, we need to set cluster_database parameter to false and mount an instance on only one node: sqlplus / as sysdba alter system set cluster_database=false scope=spfile; oracle@db01:~# . oraenv ORACLE_SID = [DUTSDB] ? [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Change Oracle DB name using NID<strong>: How to Change the DBID, DBNAME Using NID Utility (Doc ID 863800.1)</strong><strong></strong></p>



<p>1. In Real Application Cluster, we need to set cluster_database parameter to false and mount an instance on only one node:</p>



<pre class="wp-block-preformatted">sqlplus / as sysdba
alter system set cluster_database=false scope=spfile;


oracle@db01:~# . oraenv
ORACLE_SID = [DUTSDB] ? DUTSPD
The Oracle base has been changed from /opt/Oracle/app/oracle to /opt/Oracle/database
oracle@db01:~#
oracle@db01:~#
oracle@db01:~#
oracle@db01:~#
oracle@db01:~#
oracle@db01:~# sqlplus / as sysdba

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

SQL> alter system set cluster_database=false scope=spfile;

System altered.

SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      DUTSPD

SQL> exit

oracle@db01:~# srvctl stop database -d dutspd



oracle@db01:~# sqlplus / as sysdba

Connected to an idle instance.

SQL> startup mount;

ORACLE instance started.

Total System Global Area 1.6435E+10 bytes
Fixed Size                  2242304 bytes
Variable Size            8925481216 bytes
Database Buffers         7482638336 bytes
Redo Buffers               24707072 bytes
Database mounted.
SQL> SQL>

</pre>



<p>2. From the 1st node run nid utility. Specify username with sysdba privilege, target database name, and SETNAME parameter to yes.</p>



<pre class="wp-block-preformatted">oracle@db01:~# clear
oracle@db01:~# ps -ef | grep pmon
  oracle  9127  5662   0   Jun 05 ?           4:28 asm_pmon_+ASM1
  oracle 11287  5662   0   Jun 05 ?          25:09 ora_pmon_DUTSDB
  oracle 16694  5662   0 12:13:19 ?           0:00 ora_pmon_DUTSPD
  oracle 17630 10739   0 12:15:05 pts/4       0:00 grep pmon
oracle@db01:~# . oraenv
ORACLE_SID = [DUTSDB] ? DUTSPD
The Oracle base remains unchanged with value /opt/Oracle/database
oracle@db01:~#



oracle@db01:~# nid TARGET=SYS DBNAME=DUTSPB

DBNEWID: Release 19.16.0.0.0 - Production on Mon Dec 28 12:17:04 2022

Password:
Connected to database DUTSPD (DBID=2319832658)

Connected to server version 19.16.0

Control Files in database:
    +DATA/dutspd/controlfile/current.265.1075567891
    +RECO/dutspd/controlfile/current.317.1075567891

Change database ID and database name DUTSPD to DUTSPB? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 2319832658 to 2596561288
Changing database name from DUTSPD to DUTSPB
    Control File +DATA/dutspd/controlfile/current.265.1075567891 - modified
    Control File +RECO/dutspd/controlfile/current.317.1075567891 - modified
    Datafile +DATA/dutspd/datafile/system.343.107556773 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/sysaux.346.107556773 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/undotbs1.336.107556773 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/users.335.107556773 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/undotbs2.327.107556790 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcsys_data.342.107640472 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcsys_index.348.107640472 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/learch_tbs.337.107640472 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip2.338.107640472 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/cfnweb.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_qweeby.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_lbbw.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_eptca.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcbws.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_learch_acceptance.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_editus.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcsys_train_data.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcsys_train_index.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_bil.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcip_test.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcep_test.db - dbid changed, wrote new name
    Datafile +DATA/dutspd/tempfile/temp.270.107556789 - dbid changed, wrote new name
    Datafile +DATA/dutspd/datafile/arcsys_train_temp.db - dbid changed, wrote new name
    Control File +DATA/dutspd/controlfile/current.265.1075567891 - dbid changed, wrote new name
    Control File +RECO/dutspd/controlfile/current.317.1075567891 - dbid changed, wrote new name
    Instance shut down

Database name changed to DUTSPB.
Modify parameter file and generate a new password file before restarting.
Database ID for database DUTSPB changed to 2596561288.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

oracle@db01:~#
</pre>



<p>3. Change db_name parameter in the initialization parameter file:</p>



<pre class="wp-block-preformatted">oracle@db01:~# . oraenv
ORACLE_SID = [DUTSPD] ? DUTSPB
The Oracle base remains unchanged with value /opt/Oracle/database
oracle@db01:~# sqlplus / as sysdba
Connected to an idle instance.

SQL> startup nomount;
alter system set db_name=DUTSPB scope=spfile;
alter system set cluster_database=true scope=spfile;
shut immediate;
ORACLE instance started.

Total System Global Area 1.6435E+10 bytes
Fixed Size                  2242304 bytes
Variable Size            8925481216 bytes
Database Buffers         7482638336 bytes
Redo Buffers               24707072 bytes
SQL>
System altered.

SQL>
System altered.

SQL> ORA-01507: database not mounted



ORACLE instance shut down.
SQL> SQL>


oracle@db01:dbs# sqlplus / as sysdba
Connected to an idle instance.

SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 1.6435E+10 bytes
Fixed Size                  2242304 bytes
Variable Size            8925481216 bytes
Database Buffers         7482638336 bytes
Redo Buffers               24707072 bytes
Database mounted.
SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL>
</pre>



<p>4. Remove existing password file entry and create a new one in both nodes:</p>



<pre class="wp-block-preformatted">oracle@db01:db_home_1# cd $ORACLE_HOME
oracle@db01:db_home_1# cd dbs
oracle@db01:dbs# orapwd  file=orapwDUTSPB

Enter password for SYS:
oracle@db01:dbs#

5.  Change the service of the database</pre>



<pre class="wp-block-preformatted">oracle@db01:dbs# sqlplus / as sysdba


SQL> alter system set db_unique_name=DUTSPB scope=spfile sid='*';

System altered.

SQL>


oracle@db01:dbs#  srvctl add database -d DUTSPB -o /opt/Oracle/database/product/19.0.0/db_home_1 -r primary -s OPEN -p '+DATA/DUTSPB/spfileDUTSPB.ora' -n db01
oracle@db01:dbs# srvctl add instance -d DUTSPB -i DUTSPB1 -n db01
oracle@db01:dbs# srvctl add instance -d DUTSPB -i DUTSPB2 -n db02
oracle@db01:dbs#

oracle@db01:dbs# srvctl config database -d DUTSPB
Database unique name: DUTSPB
Database name: DUTSPB
Oracle home: /opt/Oracle/database/product/19.0.0/db_home_1
Oracle user: oracle
Spfile: +DATA/DUTSPB/spfileDUTSPB.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: DUTSPB
Database instances: DUTSPB1, DUTSPB2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
oracle@db01:dbs#


oracle@db01:dbs# . oraenv
ORACLE_SID = [+ASM1] ? DUTSPB
The Oracle base remains unchanged with value /opt/Oracle/database
oracle@db01:dbs#
oracle@db01:dbs# sqlplus / as sysdba
Connected to an idle instance.

SQL>  startup mount pfile=/opt/Oracle/database/product/19.0.0/db_home_1/dbs/initDUTSPB.ora

SQL> create spfile='+DATA/DUTSPB/ spfileDUTSPB.ora' from pfile='/opt/Oracle/database/product/19.0.0/db_home_1/dbs/initDUTSPB.ora;
File created.
SQL>exit

oracle@db01:dbs# srvctl start database -d  DUTSPB


Hope this helps you!!!

Disclaimer: “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited  to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2023/01/how-to-change-dbname-on-oracle-rac/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5982</post-id>	</item>
	</channel>
</rss>
