Experiment 13: Export and Import

1. The purpose of the experiment

Master the use of commonly used data export and import tools.

2. Experimental content

1. Create a user (the first letter of my name), call EXP and IMP to back up the database (export the emp and dept tables in scott mode and import them into the new user). Record all PL/SQL statements that are executed correctly.

Export:

Insert picture description here

Cmd command line:

Insert picture description here

Authorization

Insert picture description here


Import:
Cmd command line:

Insert picture description here

After re-authorization

Insert picture description here


Insert picture description here

You can view the imported table under the created user

Insert picture description here

2. Call EXPDP and IMPDP to back up the database (create a new user zs and make all objects in zs user mode consistent with those in scott mode). Record all correctly executed PL/SQL statements in
Expdp export mode

Insert picture description here


Insert picture description here

Impdp import mode
If the import mode is used by other users, the import mode needs to use the SCHEMAS parameter. The user must have the IMP_FULL_DATABASE role or the DBA role

Insert picture description here


Insert picture description here

3. Use SQL*Loader to import external data. For the data file, see: the results of a class.xls.

I modified the file name in advance to grade.xls

(1) Create a new control file (directly create a notepad and modify the suffix txt to ctl)

Insert picture description here

The content of the control file:

load data
infile 'c:\temp\grade.csv'
into table grades
fields terminated by ','
(id,name,sex,class,grade)

(2) According to the Excel file, save as CSV format, it is recommended not to change the suffix

Insert picture description here

(3) Create a new table based on the Excel file

Insert picture description here

(4) Enter the command in cmd
sqlldr scott/root control=c:\temp\grade.ctl

Insert picture description here


Insert picture description here

Refer to the last question

[It’s the last database homework, and I’m going to start preparing for review again. What I want to say is that the microcomputer experiment is so difficult~]
"I don't just want to survive, I want to live meaningfully.-
"Robot Story"