The safest steps for Oracle to import dmp files

Preparations (export dmp file)

    1. Use PL/SQL tools -- "export user objects, export definitions of all user tables, views, stored procedures, etc.

    2. Use PL/SQL tool --> export table, export data of all tables, this is the dmp file

    Save the exported sql script and dmp file for import

    Ok, start importing

    1. Delete user

drop user test cascade;

    2. Delete all tablespaces   

drop tablespace testdb INCLUDING CONTENTS;

drop tablespace testdb_index INCLUDING CONTENTS;

drop tablespace testdb_temp INCLUDING CONTENTS;

    3. Recreate the tablespace and user and authorize the user   

CREATE TABLESPACE "DB_QQTB"

    LOGGING

    DATAFILE 'D:\oracle\OraData\DB_QQTB01.ora' SIZE 2000M, 'D:\oracle\OraData\DB_QQTB02.ora' SIZE 2000M, 'D:\oracle\OraData\DB_QQTB03.ora' SIZE 2000M EXTENT MANAGEMENT LOCAL

    SEGMENT SPACE MANAGEMENT AUTO

    /

    CREATE TABLESPACE "DB_QQTB_INDEX"

    LOGGING

    DATAFILE 'D:\oracle\OraData\DB_QQTB_INDEX.ora' SIZE 500M EXTENT

    MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO

    /

    CREATE

    TEMPORARY TABLESPACE "DB_QQTB_TEMP" TEMPFILE

    'D:\oracle\OraData\DB_QQTB_TEMP.ora' SIZE 200M EXTENT MANAGEMENT

    LOCAL UNIFORM SIZE 1M

    /

    create user FZCX

    identified by "FZCX"

    default tablespace DB_QQTB

    temporary tablespace DB_QQTB_TEMP

    profile DEFAULT

    quota unlimited on DB_QQTB

    quota unlimited on DB_QQTB_temp;

    -- Grant/Revoke role privileges

    grant connect to FZCX;

    grant exp_full_database to FZCX;

    grant imp_full_database to FZCX;

    grant resource to FZCX;

    -- Grant/Revoke system privileges

    grant create procedure to FZCX;

    grant create trigger to FZCX;

    grant execute any procedure to FZCX;

    grant grant any privilege to FZCX;

    grant restricted session to FZCX;

    grant select any table to FZCX;

    grant unlimited tablespace to FZCX;

    grant create any view to FZCX;

    4. Open SQLPLUS (do not use PL/SQL, the sql script is too large), @path+filename.sql import table definition

    At this time, the definition of the table has been completed, but there is no data in the table. Now you can test whether the table exists

    5. Use PL/SQL Tools --> Import Table --> Oracle Import to select the dmp file to automatically start Sqlplus

    success! ! !

    Error analysis:

    1. Please pay attention to whether the size of the data file is sufficient, otherwise there will be an error, it is recommended to set a larger size, and the best partition is in ntfs format

    2. Please pay attention to whether the user who exported the dmp is the current user who performs the import. The user name appears: The required input is fromuser, which means the user name of the exported dmp, which must be accurate

Guess you like

Origin blog.csdn.net/weixin_43889788/article/details/130710210
Recommended