Saturday 16 October 2021

How to find which region we subscribed and logged in from OCI console?

This document describes us how to find which region we are logged in, what is our home region and how to subscribe to other regions. 

 

Log In to Cloud console: 


Provide the cloud account credentials to login.

 



 Click on "Sign In"



 Click on "Manage Regions" from the right top drop down menu.


We can able to see Home Region and other available regions.


 
 

Click on subscribe button to subscribe any other regions.





Thanks for going through the post................

 

 

Wednesday 13 October 2021

What is logical backup or datapump in oracle database? How to perform logical backup(Export and Import) or datapump?

This document describes what is logical backup in oracle database and how to do a logical backup. 


What is logical backup or Data Pump in oracle database? 

We are taking backup of logical objects(Schemas, Tables, Indexes, Views, Procedures, Tablespaces and Full database). That is the reason we are calling it as logical backup or Data Pump. We are using oracle provided utilities EXPDP and IMPDP which are command line utilities to take logical backups in the database. 

The Data Pump utilities EXPDP and IMPDP invoke Data Pump export and Data Pump import respectively. These utilities uses the procedures in DBMS_DATAPUMP pl/sql package to perform export/import.

We require one logical directory to use data pump(expdp/impdp) export or import.

Please click Here to find how to create a logical directory in the database. 


Full Database Export and Import:

Use below commands to export and import full database. We can utilize parallel option to improve data pump job and we can split the dump files instead of single dump file. It is easier to copy the dump files to  other servers as well. 

expdp "'/ as sysdba'" full=Y directory=EXPDP parallel=5 dumpfile=EXPDP_DBNAME_dump_%U.dmp job_name=EXPDP_DBNAME logfile=EXPDP_DBNAME.log

impdp "'/ as sysdba'" full=Y directory=IMPDP parallel=5 dumpfile=EXPDP_DBNAME_dump_%U.dmp job_name=IMPDP_DBNAME logfile=IMPDP_DBNAME.log


Schema Export and Import:

Use below command to take export or import of a single schema in the database.

expdp "'/ as sysdba'" schemas=INVOICE directory=EXPDP parallel=5 dumpfile=EXPDP_DBNAME_INVOICE_dump_%U.dmp job_name=EXPDP_DBNAME logfile=expdp_invoice.log

impdp "'/ as sysdba'" schemas=INVOICE directory=IMPDP parallel=5 dumpfile=EXPDP_DBNAME_INVOICE_dump_%U.dmp job_name=IMPDP_DBNAME logfile=impdp_invoice.log

 

Tablespace Export and Import:

Use below command to export or import tablespaces in the database.

expdp "'/ as sysdba'" tablespaces=hr_data directory=EXPDP parallel=5 dumpfile=EXPDP_TABLESPACE_dump_%U.dmp job_name=EXPDP_DBNAME logfile=expdp_tablespace.log

impdp "'/ as sysdba'" tablespaces=hr_data directory=IMPDP parallel=5 dumpfile=EXPDP_TABLESPACE_dump_%U.dmp job_name=IMPDP_DBNAME logfile=impdp_tablespace.log

 

Table Export and Import:

Use below command to export or import table in the database.

expdp "'/ as sysdba'" tables=SCOTT,HR directory=EXPDP parallel=5 dumpfile=EXPDP_TABLE_dump_%U.dmp job_name=EXPDP_DBNAME logfile=expdp_table.log

impdp "'/ as sysdba'" tables=SCOTT,HR directory=IMPDP parallel=5 dumpfile=EXPDP_TABLE_dump_%U.dmp job_name=IMPDP_DBNAME logfile=impdp_table.log

 

How to verify existing Data  Pump jobs?

We can use dba_datapump_jobs or user_datapump_jobs view to verify existing data pump jobs in the database.

 

 

 

Thanks for going through the post.......


 


What is directory objects in oracle? How to create a directory object in it.

This document describes about the directory objects, why are we using directory objects, what is the use of directory creation in oracle database and how to create directory in the oracle database.

 

What are directory objects? What is the use of directory objects?

A DIRECTORY object describes a logical alias name for a physical directory which lies on the database server file system under which the files to be accessed are located. We can access the files which are under physical directory by using logical directory if we have privileges. Depends on the privilege(Ex: select, read,write etc...) we can restrict the users to access the objects which are under directory.

We require logical directory to export or import the data in oracle database.

How to create a directory in oracle database?

we can create directory using create directory command. 

Create one physical directory in the system wherever we want.

[oracle@server1 u02]$ mkdir EXPDP_DATA


[oracle@server1 u02]$ cd EXPDP_DATA/


[oracle@server1 EXPDP_DATA]$ pwd
/u02/EXPDP_DATA

Connect as sysdba to the database and create logical directory by using below command.

 

SQL> create directory EXPDP as '/u02/EXPDP_DATA';

Directory created.

SQL>

How to find the information about existing directories in the database?

We can use dba_directories view to find the existing directories in the database.

Ex:

SQL> col OWNER for a10
SQL> col DIRECTORY_NAME for a15
SQL> col DIRECTORY_PATH for a30
SQL> set lines 200
SQL> select OWNER,DIRECTORY_NAME,DIRECTORY_PATH from dba_directories;

SQL> select OWNER,DIRECTORY_NAME,DIRECTORY_PATH from dba_directories where directory_name='EXPDP';

OWNER       DIRECTORY_NAME    DIRECTORY_PATH
----------         ---------------                    ------------------------------
SYS                EXPDP                          /u02/EXPDP_DATA
 
SQL>


 


 

Thanks for going through the post.........