DronaBlog

Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Monday, October 23, 2023

What is Checksum - understanding with an example

 What is a checksum?

A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. Checksums are often used to verify data integrity, but they are not relied upon to verify data authenticity.





How does a checksum work?

A checksum is generated by running a mathematical algorithm on a piece of data. The algorithm produces a unique value, called the checksum, which is based on the content of the data. If the data is changed in any way, the checksum will also change.

Example of a checksum:

Suppose we have a file called myfile.txt with the following contents:

This is a test file.

We can generate a checksum for this file using the following command:

md5sum myfile.txt

This will output the following checksum:

d41d8cd98f00b204e9800998ecf8427e myfile.txt

If we now change the contents of the file to be:

This is a test file with some changes.

And then generate a checksum again, we will get the following output:

ba948517d011032327d7224464325882 myfile.txt

As you can see, the checksum has changed because the contents of the file have changed.





Uses of checksums

Checksums are used in a variety of ways, including:

  • To verify the integrity of downloaded files. Many software developers provide checksums for their downloads so that users can verify that the files have not been corrupted during the download process.
  • To verify the integrity of data transmitted over a network. For example, checksums can be used to detect errors in TCP/IP packets.
  • To verify the integrity of data stored on disk. For example, checksums can be used to detect errors in file systems.


Checksums: A simple way to protect your data

Checksums are a simple but effective way to protect your data from errors. By generating a checksum for a piece of data and then comparing it to the checksum later on, you can verify that the data has not been corrupted.

Checksums are used in a variety of ways, including:

  • To verify the integrity of downloaded files. Many software developers provide checksums for their downloads so that users can verify that the files have not been corrupted during the download process.
  • To verify the integrity of data transmitted over a network. For example, checksums can be used to detect errors in TCP/IP packets.
  • To verify the integrity of data stored on disk. For example, checksums can be used to detect errors in file systems.

How to generate a checksum

There are many different ways to generate a checksum. The most common method is to use a cryptographic hash function such as MD5 or SHA-256. These functions produce a unique value, called the checksum, which is based on the content of the data.

To generate a checksum using a cryptographic hash function, you can use the following command:

md5sum myfile.txt

This will output the following checksum:

d41d8cd98f00b204e9800998ecf8427e myfile.txt





How to verify a checksum

To verify a checksum, you can simply compare it to the checksum that was generated for the data. If the checksums match, then the data has not been corrupted. If the checksums do not match, then the data has been corrupted.

Checksums are a simple and effective way to protect your data from errors. By generating a checksum for a piece of data and then comparing it to the checksum later on, you can verify that the data has not been corrupted.

Additional tips

  • It is important to use a strong checksum algorithm, such as MD5 or SHA-256. Weak checksum algorithms are more likely to produce false positives or negatives.
  • It is also important to store the checksums in a safe place. If the checksums are lost or corrupted, then you will not be able to verify the integrity of your data.
  • If you are verifying the integrity of downloaded files, be sure to download the checksums from a trusted source. Do not download checksums from the same website where you downloaded the files.

Checksums are a valuable tool for protecting your data from errors. By following the tips above, you can use checksums to ensure that your data is always accurate and reliable.


Learn about Oracle here



Tuesday, September 19, 2023

Troubleshooting the "No Supported Authentication Methods Available" Error in SSH

 Introduction:





Encountering the "No supported authentication methods available server sent public key" error when connecting to an EC2 instance via SSH is a common frustration. This error can prevent you from accessing your remote server. In this article, we'll explore the causes of this error and provide solutions to resolve it.

Understanding the Error: The "no supported authentication methods available (server sent public key)" error message occurs when your SSH client cannot successfully authenticate with the remote EC2 instance. Several factors can contribute to this issue:

  • Incorrect Login Credentials: Entering an incorrect username or password during the SSH connection attempt will result in failed authentication.
  • Incorrect SSH Key: If you're using SSH keys for authentication, an invalid or incorrect key can prevent successful connection to the remote server.
  • Server Configuration: If the remote server is not properly configured to allow the chosen authentication method, you won't be able to authenticate.

Solving the Problem: Let's explore steps to resolve the "no supported authentication methods available server sent public key" error:

  1. Address SSH Public Key Issues:

    • Edit the /etc/ssh/sshd_config file.
    • Set PasswordAuthentication and ChallengeResponseAuthentication to 'yes'.
    • Restart SSH:
      • Option 1: sudo /etc/init.d/ssh restart




      • Option 2: sudo service sshd restart

  2. Refer to AWS Documentation:

    • AWS provides comprehensive documentation on connecting to EC2 instances using various SSH clients. You can find detailed instructions here: AWS EC2 SSH Documentation.

  3. Verify Correct Logins for Specific AMIs:

    • Depending on the Amazon Machine Image (AMI) you're using, the login usernames may vary. Use the following logins based on your AMI:
      • Ubuntu or root for Ubuntu AMIs
        • ec2-user for Amazon Linux AMIs
          • centos for CentOS AMIs
            • debian or root for Debian AMIs
              • ec2-user or fedora for Fedora AMIs
                • ec2-user or root for RHEL AMIs, SUSE AMIs, and others.

            • Using SSH on Different Operating Systems:

              • For Windows:
                • Obtain the PEM key from the AWS website and generate a PPK file using PuttyGen. Then, use Putty for SSH, selecting the PPK file under "Connection -> SSH -> Auth" for authorization.
              • For Linux:
                • Run the following command: ssh -i your-ssh-key.pem login@IP-or-DNS.

            • Accessing Your EC2 Instance:

              • Open an SSH client or refer to PuTTY for Windows users.
              • Locate your private key file (e.g., test_key.pem), ensuring it has the appropriate permissions (use chmod 400 if needed).
              • Connect to your EC2 instance using its Public DNS, e.g., ssh -i "test_key.pem" ubuntu@xxx-yyy-100-10-100.us-east-2.compute.amazonaws.com.

            Conclusion: While the "no supported authentication methods available server sent public key" error can be frustrating, it is often resolvable. By double-checking your login credentials, SSH key, and trying different authentication methods, you can usually overcome this issue. If problems persist, it's advisable to investigate the server's configuration and consult server logs or contact the server administrator for assistance.


            Learn more about Oracle here



            Wednesday, July 26, 2023

            Understanding Oracle Error ORA-12154: TNS: Could not resolve the connect identifier specified

             Introduction:

            ORA-12154 is a commonly encountered error in Oracle Database, and it often perplexes developers and database administrators alike. This error is associated with the TNS (Transparent Network Substrate) configuration and is triggered when the Oracle client cannot establish a connection to the Oracle database due to an unresolved connect identifier. In this article, we will explore the causes, symptoms, and potential solutions for ORA-12154, equipping you with the knowledge to overcome this error effectively.






            What is ORA-12154?

            ORA-12154 is a numeric error code in the Oracle Database system that corresponds to the error message: "TNS: Could not resolve the connect identifier specified." It is a connection-related error that occurs when the Oracle client is unable to locate the necessary information to establish a connection to the database specified in the TNS service name or the connection string.


            Common Causes of ORA-12154:

            a) Incorrect TNS Service Name: One of the primary reasons for this error is providing an incorrect TNS service name or alias in the connection string. This could be due to a typographical error or the absence of the service name definition in the TNSNAMES.ORA file.

            b) Missing TNSNAMES.ORA File: If the TNSNAMES.ORA file is not present in the correct location or it lacks the required configuration for the target database, ORA-12154 will occur.

            c) Improper Network Configuration: Network misconfigurations, such as firewalls blocking the required ports or issues with the listener, can lead to this error.

            d) DNS Resolution Problems: ORA-12154 might also arise if the Domain Name System (DNS) cannot resolve the host name specified in the connection string.

            e) Multiple Oracle Homes: In cases where multiple Oracle installations exist on the client machine, the ORACLE_HOME environment variable must be set correctly to point to the appropriate installation.


            Symptoms of ORA-12154:

            When the ORA-12154 error occurs, users may experience the following symptoms:

            • Inability to connect to the Oracle database from the client application.
            • Error messages displaying "ORA-12154: TNS: Could not resolve the connect identifier specified."
            • A sudden termination of database operations initiated by the client.





            Resolving ORA-12154:
            a) Verify TNSNAMES.ORA Configuration: Ensure that the TNSNAMES.ORA file is correctly configured with the appropriate service names, hostnames, and port numbers. Double-check for any typographical errors.

            b) Set ORACLE_HOME Correctly: If multiple Oracle installations coexist, ensure that the ORACLE_HOME environment variable is set to the correct installation path.

            c) Use Easy Connect Naming Method: Instead of using TNS service names, consider using the Easy Connect naming method by specifying the connection details directly in the connection string (e.g., //hostname:port/service_name).

            d) Check Listener Status: Confirm that the Oracle Listener is running on the database server and is configured to listen on the correct port.

            e) Test the TNS Connection: Utilize the tnsping utility to test the connectivity to the database specified in the TNSNAMES.ORA file.

            f) DNS Resolution: If using a hostname in the connection string, ensure that the DNS can resolve the hostname to the appropriate IP address.

            g) Firewall Settings: Verify that the necessary ports are open in the firewall settings to allow communication between the client and the database server.


            ORA-12154 is a common Oracle error that arises due to connection-related issues, particularly in locating the database service name specified in the connection string. By understanding the possible causes and applying the appropriate solutions, you can effectively troubleshoot and resolve this error, ensuring smooth and uninterrupted communication between your Oracle client and database server. Remember to double-check configurations and verify network settings to avoid future occurrences of ORA-12154.





            Learn more about Oracle here



            Friday, July 14, 2023

            What are the differences between ETL and ELT

             In Informatica, ETL (Extract, Transform, Load) and ELT (Extract, Load, Transform) are two approaches used for data integration and processing. Here are the key differences between ETL and ELT in Informatica:

            1. Data Processing Order:



            ETL: In the ETL approach, data is extracted from various sources, then transformed or manipulated using an ETL tool (such as Informatica PowerCenter), and finally loaded into the target data warehouse or system. Transformation occurs before loading the data.

            ELT: In the ELT approach, data is extracted from sources and loaded into the target system first, typically a data lake or a data warehouse. Transformation occurs after loading the data, using the processing power of the target system.

             

            2. Transformation:

            ETL: ETL focuses on performing complex transformations and manipulations on the data during the extraction and staging process, often utilizing a dedicated ETL server or infrastructure.

            ELT: ELT leverages the processing capabilities of the target system, such as a data warehouse or a big data platform, to perform transformations and manipulations on the loaded data using its built-in processing power. This approach takes advantage of the scalability and processing capabilities of modern data platforms.


            3. Scalability and Performance:

            ETL: ETL processes typically require dedicated ETL servers or infrastructure to handle the transformation workload, which may limit scalability and performance based on the available resources.

            ELT: ELT leverages the scalability and processing power of the target system, allowing for parallel processing and distributed computing. This approach can handle large volumes of data and scale more effectively based on the capabilities of the target system.


            4. Data Storage:

            ETL: ETL processes often involve extracting data from source systems, transforming it, and then loading it into a separate target data warehouse or system.

            ELT: ELT processes commonly involve extracting data from source systems and loading it directly into a target system, such as a data lake or a data warehouse. The data is stored in its raw form, and transformations are applied afterward when needed.






            5. Flexibility:

            ETL: ETL provides more flexibility in terms of data transformations and business logic as they can be defined and executed within the ETL tool. It allows for a controlled and centralized approach to data integration.

            ELT: ELT provides more flexibility and agility as it leverages the processing power and capabilities of the target system. The transformations can be performed using the native features, tools, or programming languages available in the target system.


            Here is the summary:



            Ultimately, the choice between ETL and ELT in Informatica depends on factors such as the volume and complexity of data, the target system's capabilities, performance requirements, and the specific needs of the data integration project.

            Wednesday, June 7, 2023

            What are the differences between Database View and Materialized View?

            In the world of database management systems, views are powerful tools that allow users to retrieve and manipulate data in a simplified manner. Oracle, one of the leading database vendors, offers two types of views: database views and materialized views. While both serve similar purposes, there are significant differences between them in terms of their functionality, storage, and performance. In this article, we will explore these differences with a focus on Oracle's database views and materialized views, along with an example to illustrate their usage






            A) Definition and Functionality:

            1. Database View: A database view is a virtual table that is derived from one or more underlying tables or views. It provides a logical representation of the data and can be used to simplify complex queries by predefining joins, filters, and aggregations. Whenever a query is executed against a view, the underlying data is dynamically fetched from the base tables.

            2. Materialized View: A materialized view, on the other hand, is a physical copy or snapshot of a database view. Unlike a database view, it stores the result set of a query in a separate table, making it a persistent object. Materialized views are typically used to improve query performance by precomputing and storing the results of expensive and complex queries, reducing the need for re-computation during subsequent queries.


            B) Data Storage:

            1. Database View: Database views do not store any data on their own. They are stored as a definition or metadata in the database dictionary and do not occupy any additional storage space. Whenever a query is executed against a view, it is processed in real-time by retrieving the data from the underlying tables.

            2. Materialized View: Materialized views store their data in physical tables, which are separate from the base tables. This storage mechanism allows for faster data retrieval, as the results of the query are already computed and stored. Materialized views occupy disk space to store their data, and this storage requirement should be considered when designing the database schema.


            C) Query Performance:

            1. Database View: Database views are advantageous for simplifying complex queries and enhancing data abstraction. However, they may suffer from performance issues when dealing with large datasets or queries involving multiple joins and aggregations. Since the data is fetched from the underlying tables dynamically, the execution time may be slower compared to materialized views.

            2. Materialized View: Materialized views excel in terms of query performance. By storing the precomputed results of a query, they eliminate the need for repetitive calculations. As a result, subsequent queries against materialized views can be significantly faster compared to database views. Materialized views are particularly useful when dealing with queries that involve extensive processing or access to remote data sources.






            Now, let's consider an example to better understand the differences:

            Suppose we have a database with two tables: "Orders" and "Customers." We want to create a view that displays the total order amount for each customer. Here's how we can achieve this using both a database view and a materialized view in Oracle:


            Database View:

            CREATE VIEW Total_Order_Amount AS

            SELECT c.Customer_Name, SUM(o.Order_Amount) AS Total_Amount

            FROM Customers c

            JOIN Orders o ON c.Customer_ID = o.Customer_ID

            GROUP BY c.Customer_Name;


            Materialized View:

            CREATE MATERIALIZED VIEW MV_Total_Order_Amount

            BUILD IMMEDIATE

            REFRESH FAST ON COMMIT

            AS

            SELECT c.Customer_Name, SUM(o.Order_Amount) AS Total_Amount

            FROM Customers c

            JOIN Orders o ON c.Customer_ID = o.Customer_ID

            GROUP BY c.Customer_Name;


            In this example, the database view "Total_Order_Amount" does not store any data and retrieves it in real-time when queried. On the other hand, the materialized view "MV_Total_Order_Amount" stores the computed results of the query, enabling faster retrieval in subsequent queries. However, the materialized view needs to be refreshed to synchronize the data with the underlying tables. The "REFRESH FAST ON COMMIT" option ensures that the materialized view is updated automatically when changes are committed to the base tables.


            While both database views and materialized views offer a convenient way to retrieve and manipulate data, they differ in their functionality, storage mechanisms, and query performance characteristics. Database views provide a logical representation of the data and are suitable for simplifying complex queries, while materialized views offer improved performance by persistently storing precomputed results. Understanding these differences is crucial for making informed decisions when designing and optimizing database systems in Oracle.

             





            Learn more about Oracle here





            Thursday, April 20, 2023

            What are Roadblocks to SQL Tuning?

             SQL tuning is an important aspect of database management, as it can significantly improve the performance of SQL queries. However, there are several roadblocks that can impede the process of SQL tuning. In this article, we will discuss some of the common roadblocks to SQL tuning and how to overcome them.






            Lack of understanding of SQL:

            One of the primary roadblocks to SQL tuning is a lack of understanding of SQL. In order to optimize SQL queries, it is important to have a thorough understanding of SQL syntax, indexing, and query execution plans. This requires expertise in SQL and the ability to interpret performance metrics.


            Poorly designed database schema:

            A poorly designed database schema can make SQL tuning difficult. If tables are not properly normalized, or if indexes are not used correctly, SQL queries can become slow and inefficient. A well-designed database schema is essential for efficient SQL tuning.


            Inefficient query design:

            Inefficient query design can make SQL tuning challenging. Queries that use excessive joins, subqueries, or complex expressions can be difficult to optimize. Writing simple, straightforward queries is essential for effective SQL tuning.



            Insufficient system resources:

            Insufficient system resources, such as insufficient memory or slow storage devices, can make SQL tuning challenging. It is important to ensure that the system has enough resources to handle the workload.


            Complexity of the database environment:

            A complex database environment, such as a distributed database, can make SQL tuning more difficult. In such cases, it may be necessary to use specialized tools and techniques to optimize SQL queries.


            Inadequate testing and analysis:

            Inadequate testing and analysis can make SQL tuning challenging. It is important to test SQL queries under realistic conditions and to analyze performance metrics to identify performance bottlenecks.






            Resistance to change:

            Resistance to change can be a significant roadblock to SQL tuning. Database administrators and developers may be resistant to making changes to SQL queries, even if they are inefficient. Overcoming this resistance requires effective communication and collaboration between team members.


            In conclusion, SQL tuning can be challenging due to a variety of roadblocks, such as a lack of understanding of SQL, poorly designed database schema, inefficient query design, insufficient system resources, complexity of the database environment, inadequate testing and analysis, and resistance to change. Overcoming these roadblocks requires a combination of expertise, tools, and effective communication and collaboration between team members. With the right approach, however, SQL tuning can significantly improve the performance of SQL queries and enhance the overall performance of the database system.


            Learn more about SQL here



            What are causes of poor Oracle performance?

             Oracle is a popular and powerful relational database management system used by many organizations. However, even with its advanced features, poor performance can occur. There are several reasons why Oracle may experience poor performance, and in this article, we will explore some of the common causes.


            Poor system design and configuration:

            One of the main reasons for poor Oracle performance is a poorly designed or configured system. Inadequate hardware resources, misconfigured database parameters, and poorly optimized queries can all lead to performance issues.






            High system load:

            If the system is processing too many requests or queries, it can result in high system load and ultimately lead to poor performance. In some cases, adding more hardware resources may be necessary to alleviate the load.


            Database fragmentation:

            Fragmentation occurs when data is scattered across the database, leading to slow query performance. This can be caused by improper indexing, inefficient queries, or poor system design.



            Poorly optimized queries:

            Queries that are not optimized for performance can lead to poor Oracle performance. This can include inefficient SQL code, unoptimized joins, and poorly constructed queries.


            Data growth:

            As the amount of data in the database increases, performance can degrade. Large databases can become unwieldy, leading to slow queries and poor performance. Regular database maintenance, such as data archiving, can help alleviate this issue.


            Inadequate system resources:

            Inadequate system resources, such as insufficient memory or slow storage devices, can lead to poor performance. It is important to ensure that the system has enough resources to handle the workload.






            Network latency:

            Slow network connections can cause delays in data transmission, leading to poor Oracle performance. It is important to optimize network connections to ensure efficient data transfer.



            Lack of database maintenance:

            Regular database maintenance is necessary to ensure optimal performance. Neglecting maintenance tasks such as backup and recovery, indexing, and table space management can lead to poor performance.


            In conclusion, there are many potential causes of poor Oracle performance. A well-designed system with adequate resources, optimized queries, regular maintenance, and efficient network connections can help mitigate performance issues. Regular monitoring and analysis can also help identify and address performance bottlenecks. By addressing these issues, organizations can ensure optimal performance and maximize the value of their Oracle database.


            Learn more about Oracle here,




            Understanding Survivorship in Informatica IDMC - Customer 360 SaaS

              In Informatica IDMC - Customer 360 SaaS, survivorship is a critical concept that determines which data from multiple sources should be ret...