> For the complete documentation index, see [llms.txt](https://tritueviet.gitbook.io/server/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tritueviet.gitbook.io/server/oracle/import-export-all-oracle-database.md).

# Import Export all oracle database

```
#EXPORT

source /home/oracle/.bash_profile
sqlplus / as sysdba

#path file in /home/oracle folder
CREATE OR REPLACE DIRECTORY test_dir AS '/home/oracle/orabak/';
GRANT READ, WRITE ON DIRECTORY test_dir TO USER_SCHEMA;

#exit sqlplus

#export data
expdp USER_SCHEMA/password@SID_SERVICE_NAME schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log

################################################################################
#IMPORT

source /home/oracle/.bash_profile
sqlplus / as sysdba

#path file in /home/oracle folder
CREATE OR REPLACE DIRECTORY test_dir AS '/home/oracle/orabak/';
GRANT READ, WRITE ON DIRECTORY test_dir TO USER_SCHEMA;

#to import go to create USER_SCHEMA match in new db
impdp USER_SCHEMA/new_password@SID_SERVICE_NAME  schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log

```

**Creat readOnly user**

```
source /home/oracle/.bash_profile
sqlplus / as sysdba

alter session set "_ORACLE_SCRIPT"=true;
create user READUSER identified by password;
grant create session, select any table, select any dictionary to READUSER;



```
