NOTE: This article is an INTERNAL article and is not visible to customers, currently. Please only link this article in internal comments, but not public comments.
Issue
- Detailed process of importing the dump file in Oracle 19c
Environment
- Oracle 19c docker image
Resolution
1. Pull the Oracle 19c image with the below command:
docker run -d --name OrDB19 -p 1521:1521 -p 8081:8081 -e ORACLE_SID=MORAL -e ORACLE_PDB=MORALPDB -e ORACLE_PWD=Oracle123 -v /u01/app/oracle/oradata:/opt/oracle/oradata oracledb19c/oracle.19.3.0-ee:oracle19.3.0-ee
2. Creating the schema, directory and providing required privileges:
amit@tiwari-pc:~$ docker exec -it bf057eb0db2e bash
[oracle@bf057eb0db2e ~]$cd /opt/oracle
[oracle@bf057eb0db2e oracle]$ sqlplus
SQL*Plus Release 19.0.0.0.0 - Production on Thu Oct 7 05:53:25 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All right reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
SQL> alter session set container=MORALPDB;
Session altered.
SQL> alter session set "_ORACLE_SCRIPT"=true;
Session altered.
SQL> create user VLTLRP1 identified by VLTLRP1;
User created.
SQL> grant connect,resource,dba to VLTLRP1;
Grant succeeded.
SQL> create or replace directory my_dir as '/opt/oracle';
Directory created.
SQL> grant read,write on directory my_dir to VLTLRP1;
Grant succeeded.
2. Place the dump file at "/u01/app/oracle" and make sure whether the path has sufficient permission and the exact path configured in the directory.
3. Now run the below import command:
host impdp directory=my_dir dumpfile=VLTLRP1_B4_19C_UPG.dmp logfile=VL_12Aug2021.logs schemas=VLTLRP1 remap_tablespace=VLTLRP1_DATA:USERS
As soon as the import process is completed you'll observe the logs as mentioned below. However, refer to the attachment for full logs:
Job "SYS"."SYS_IMPORT_SCHEMA_01" completed with ....******.... at Wed Aug 4 09:28:41 2021 elapsed 0 00:15:15
Disclaimer: If the process ends with errors verify the dump import with the customer as the errors might be due to the GRANTS by checking the object count as mentioned below. Object count should be equal to the customer end object count:
[oracle@bf057eb0db2e oracle]$ sqlplus sys@MORALPDB as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Aug 4 10:54:30 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select count(*) from dba_objects where owner like '&owner';
Enter value for owner: VLTLRP1
old 1: select count(*) from dba_objects where owner like '&owner'
new 1: select count(*) from dba_objects where owner like 'VLTLRP1'
COUNT(*)
----------
1625