How to import Oracle DMP File?

2022-06-15

First Step: localhost:8081/apex or 8080/apex when you encounter a user login screen, run this code:

- select account_status from dba_users where username = 'ANONYMOUS'; if you encounter this error: SP2-0640: Not connected, firstly run this code: sqlplus /nolog
  • - alter user ANONYMOUS identified by anonymous;
  • - alter user ANONYMOUS account unlock;

Second Step: Type localhost:8081 again and now you should see oracle apex page. Then click Administration link, and login with admin password

Third Step: Click Manage Workspaces->Create Workspace->Fill Form, I created CODESENIOR named workspace, Typed GLASSFISH_GUAVA as Schema Name(Database Name). Also this is user.

Fourth Step: Import DMP file as follows.

  • - sqlplus /nolog
  • - conn sys as sysdba
  • - create directory Codesenior_Directory as 'C:\Oracle';
  • - grant read, write on directory Codesenior_Directory to GLASSFISH_GUAVA;
  • - exit;
  • - impdp GLASSFISH_GUAVA/G_My_1987 directory=Codesenior_Directory dumpfile=SICDBA_DESARROLLO.dmp logfile=import.log

Fifth Step: Logout admin screen, type localhost:8081 again and now login by using created workspace, in this case CODESENIOR.

Now you can see imported fields.

 

Connect to DB From JDBC

First of all, we should find service name: select value from v$parameter where name like '%service_name%';

To run this command run sqlplus /nolog then conn sys as sysdba then start above command.

After then, use following codes:

String strNombreHost = "localhost";//or 127.0.0.1
String strNombreBD = "XE";
String strUsuario = "GLASSFISH_GUAVA";
String strContrasenia = "xxxxx";

/*DESARROLLO*/
String strCadenaCon = "jdbc:oracle:thin:@" + strNombreHost + ":1521:" + strNombreBD;            
           
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
cnConexion =  DriverManager.getConnection(strCadenaCon, strUsuario, strContrasenia);
cnConexion.setAutoCommit(false);

 

 

© 2019 All rights reserved. Codesenior.COM