Oracle uses data pump to migrate users

Source: Internet
Author: User
Tags create directory

I. Export data using a data Pump 1.1. Determine the character set:

SELECT * from V$nls_parameters;

Or

Select Userenv (' language ') from dual;

1.2. Setting up the client character set (Windows)

Set Nls_lang = Nls_language_nls_territory. Nls_characterset

1.3. Determine the table space occupied by the object of the schema
Sql> Select distinctsegment_type,tablespace_name SQL>  fromdba_segments SQL> WhereOwner='NC2010'; Segment_type Tablespace_name------------------ ------------------------------TABLEnnc_data03TABLEnnc_data02lobsegment nnc_data01INDEXnnc_index01INDEXNNC_DATA01INDEXnnc_index02TABLENnc_data01lobindex nnc_data01INDEXnnc_index039rows selected. SQL>
1.4 Viewing the User default table space

Select Username,default_tablespace from User_users;

1.5. Export data with Data pump
--Create directory and empowerSql>Conn/  asSysdba; SQL> CreateDirectoryBackup  as 'E:\backup'; SQL> Grant Read, write onDirectoryBackup  toNC60; SQL> Select *  fromdba_directories--Export Schema[[email protected] ~]$ EXPDP NC60/NC60 DIRECTORY=BackupDumpFile=Tianlesoftware.dmp SCHEMAS=NC60 logfile=Exp.Log;--Note, if the source library is different from the Oracle version of the destination library, you need to specify the version parameter when exporting. 
Two. Import a dump file into a RAC or single instance 2.1 to determine the character set

Select Userenv (' language ') from dual;

2.2 Setting up the client character set (Linux)

Export Nls_lang = nls_language_nls_territory. Nls_characterset

2.3 Checking the RAC run status 2.4 Creating related users and table spaces
--View data FilesSelect file_name  fromDba_data_files;--Create tablespace (same as 1.3 query results)--sql> Create tablespace nnc_data01 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--sql> Create tablespace nnc_data02 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--sql> Create tablespace nnc_data03 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--sql> Create tablespace nnc_index01 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--sql> Create tablespace nnc_index02 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--sql> Create tablespace nnc_index03 datafile ' +data/orcl/datafile/tianlesoftware.dbf ' size 50m;--Create userSql> Create UserNC60 identified byNC60defaultTablespace NNC_DATA01TemporaryTablespaceTemp;--granting PermissionsGrantResource,connect,dba toNC60;
2.5 Creating an Import directory

Sql> Create directory backup as '/backup ';

Sql> Grant read,write on the directory backup to NC60;

2.6 Importing Data

[Email protected] u01]$ export ORACLE_SID=ORCL1

[Email protected] u01]$ IMPDP nc60/nc60 directory=backup dumpfile=nc60.dmp schemas=nc60 logfile=impdp.log;

Note, if the source library is different from the Oracle version of the destination library, you need to specify the version parameter when importing.

Oracle uses data pump to migrate users

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.