First, prepare the target database
1. Ensure that the target database's character set Nls_characterset and the source database are consistent
SELECT * FROM Nls_database_parameters
2. Create a database table space to migrate
Select Tablespace_name from Dba_tablespaces
Create tablespace bbgodb datafile ' +data_vg ' size 300m autoextend on
3, create the corresponding schema
Create user bbgo identified by bbgo default Tablespace bbgodb
Grant Connect,resource to Bbgo
4. Create a directory and authorize
Mkdir/home/oracle/oracledump
Sqlplus/as SYSDBA
Create or replace directory Dump_dir as '/home/oracle/oracledump ';
Grant Read,write on directory Dump_dir to Bbgo;
Exit
Second, the schema of the export source database
1. Create a directory and authorize
Mkdir/home/oracle/oracledump
Sqlplus/as SYSDBA
Create or replace directory Dump_dir as '/home/oracle/oracledump ';
Grant Read,write on directory Dump_dir to Bbgo;
Exit
2. Export Data
EXPDP "'/As Sysdba '" Schemas=bbgo dumpfile=expdp.dmp directory=dump_dir logfile=bbgo.log compression=all
Iii. importing data into the target database
IMPDP "'/As Sysdba '" Directory=dump_dir dumpfile=expdp.dmp schemas=bbgo
Note: If schema is different, use Remap_schema=bbgo:bbgoa to remap
migrating databases with Oracle data pump