Saturday, May 3, 2025

How to open pluggable database in read write mode ?

 open pluggable database in read write mode

SQL>

SQL>

SQL>

SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         3 DEMOPDB1                       MOUNTED

SQL>




SQL> alter pluggable database demopdb1 open read write;


Pluggable database altered.


SQL>


SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         3 DEMOPDB1                       READ WRITE NO

SQL>


Friday, May 2, 2025

Role of data engineer ?

### ** Data Engineer**


#### **Role Overview:**

- A Data Engineer focuses on building and maintaining data pipelines and infrastructure for data analytics and machine learning.

- Works with large-scale data systems and cloud platforms.


#### **Key Responsibilities:**

- Design and build data pipelines to collect, process, and store data.

- Work with big data technologies (e.g., Hadoop, Spark) and cloud platforms (e.g., AWS, Azure, GCP).

- Optimize data storage and retrieval for analytics.

- Collaborate with data scientists and analysts to provide clean, structured data.

- Implement data governance and security policies.


#### **Skills Required:**

- Proficiency in programming languages like Python, Java, or Scala.

- Knowledge of big data tools (e.g., Apache Spark, Kafka, Hadoop).

- Experience with cloud platforms (e.g., AWS, Azure, GCP).

- Expertise in ETL (Extract, Transform, Load) processes.

- Familiarity with data modeling and database systems.


#### **Pros:**

- High demand in modern data-driven industries (e.g., tech, e-commerce, AI).

- Exposure to cutting-edge technologies and tools.

- Opportunities to work on innovative projects like machine learning and real-time analytics.


#### **Cons:**

- Requires continuous learning due to rapidly evolving tools and technologies.

- Can involve complex problem-solving and debugging.

- May require knowledge of multiple programming languages and frameworks.

Thursday, May 1, 2025

How to use auto trace for performance tuning ?

 Autotrace 




SQL> set autotrace traceonly explain ;

SQL> set serveroutput on

SQL>

SQL>

SQL> select * from test;


Execution Plan

----------------------------------------------------------

Plan hash value: 1357081020


--------------------------------------------------------------------------

| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |      |     6 |   240 |     2   (0)| 00:00:01 |

|   1 |  TABLE ACCESS FULL| TEST |     6 |   240 |     2   (0)| 00:00:01 |

--------------------------------------------------------------------------


Note

-----

   - dynamic statistics used: dynamic sampling (level=2)


SQL> set autotrace off

SQL>





SQL>

SQL>

SQL> set autotrace on

SQL>

SQL> select * from test;


        ID NAME

---------- --------------------------------------------------

         1 A

         1 A

         1 A

         1 A

         1 A

         1 A


6 rows selected.



Execution Plan

----------------------------------------------------------

Plan hash value: 1357081020


--------------------------------------------------------------------------

| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |      |     6 |   240 |     2   (0)| 00:00:01 |

|   1 |  TABLE ACCESS FULL| TEST |     6 |   240 |     2   (0)| 00:00:01 |

--------------------------------------------------------------------------


Note

-----

   - dynamic statistics used: dynamic sampling (level=2)



Statistics

----------------------------------------------------------

          0  recursive calls

          0  db block gets

          4  consistent gets

          0  physical reads

          0  redo size

        724  bytes sent via SQL*Net to client

        380  bytes received via SQL*Net from client

          2  SQL*Net roundtrips to/from client

          0  sorts (memory)

          0  sorts (disk)

          6  rows processed


SQL>

SQL> set autotrace off

How to generate explain plan for query in Oracle ?

 Generate explain plan for query


SQL> explain plan for select * from test;


Explained.



SQL> explain plan set statement_id ='anurag' for select * from test;


Explained.


SQL>



SQL> select * from table(dbms_xplan.display());


PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

Plan hash value: 1357081020


--------------------------------------------------------------------------

| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |      |     1 |    40 |     2   (0)| 00:00:01 |

|   1 |  TABLE ACCESS FULL| TEST |     1 |    40 |     2   (0)| 00:00:01 |

--------------------------------------------------------------------------


Note

-----


PLAN_TABLE_OUTPUT

--------------------------------------------------------------------------------

   - dynamic statistics used: dynamic sampling (level=2)


12 rows selected.


SQL>