查看服務(wù)器字符集
select userenv(‘language’) from dual;
修改linux 環(huán)境變量與數(shù)據(jù)庫(kù)一致,設(shè)置字符集(主數(shù)據(jù)庫(kù)操作系統(tǒng)與備份數(shù)據(jù)庫(kù)操作系統(tǒng)要一致)
vi .bash_profile
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NLS_LANG
source .bash_profile
查看文件字符集
cat data.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6
select nls_charset_name(to_number('0345'槽袄,'xxxx')) from dual;
創(chuàng)建用戶 并授權(quán)
create user user1 identified by 12346;
grant connect,resource,dba to user1 ;
創(chuàng)建表空間
create tablespace user1_space datafile '/home/oracle/app/oracle/oradata/helowin/user1_space.dbf' size 5120M
導(dǎo)出user1下面表結(jié)構(gòu)帜矾、表數(shù)據(jù)卿嘲、存儲(chǔ)過程、觸發(fā)器、序列 等
exp user1/user1_pwd@helowin owner=user1 file = /tmp/data.dmp
拷貝文件到另一臺(tái)主機(jī)
scp data.dmp root@192.168.1.100:/tmp
導(dǎo)入
imp user1/user1_pwd@helowin fromuser=user1 touser=user1 file=/tmp/data.dmp ignore=y