littlecowk35 / eic-bao-tri-he-thong-oss

Automatically exported from code.google.com/p/eic-bao-tri-he-thong-oss
0 stars 0 forks source link

Chuyển hoàn OSS sang server khác #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Chuyển OSS đã hoạt động có dữ liệu cũ sáng một server khác
Bao gồm:
Chuyển Database:
Chuyển application sang thư mục khác
Cấu hình lại đường dẫn thư mục

Original issue reported on code.google.com by ntanh...@gmail.com on 3 Oct 2014 at 2:27

GoogleCodeExporter commented 9 years ago
Nhận file dump export từ schemas htlyktt cũ
Tạo người dùng htlyktt2 trên database mới. Import database từ 
người dùng cũ vào schema mới tạo

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Grant privillege full import cho người dùng htlyktt2
Copy file dump vào thư mục /home/eicweb/dump
Improt file vừa chép váo schema mới
<code>
impdp htlyktt/admin@XE file=htlykttfull.dmp directory=EXP_DUMP fromuser=htlyktt 
touser=htlyktt</code>

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 2:43

GoogleCodeExporter commented 9 years ago
#2
Lỗi
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name EXP_DUMP is invalid

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 2:44

GoogleCodeExporter commented 9 years ago
eicweb@pcdhserver:~$ impdp htlyktt2/admin@XE file=htlykttfull.dmp 
logfile=htlykttfull.log directory=EXP_DUMP fromuser=htlyktt touser=htlyktt2

error:
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit 
Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39143: dump file "/home/eicweb/dump/htlykttfull.dmp" may be an original 
export dump file

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 2:49

GoogleCodeExporter commented 9 years ago
Sử dụng tool imp
imp htlyktt2/admin@XE file=htlykttfull.dmp log=htlykttfull.log fromuser=htlyktt 
touser=htlyktt2
error
IMP-00002: failed to open htlykttfull.dmp for read

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 2:52

GoogleCodeExporter commented 9 years ago
Sử dụng full path

imp htlyktt2/admin@XE file=/home/eicweb/dump/htlykttfull.dmp 
log=htlykttfull.log fromuser=htlyktt touser=htlyktt2

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 3:05

GoogleCodeExporter commented 9 years ago
Chép thư mục application sang địa thư mục mới để thử nghiệm
Sửa các port trong file server.xml thành 9080, 9005, 9008
Cấu hình file portal-setup-wizard.properties
admin.email.from.name=developer Dev
jdbc.default.password=admin  
liferay.home=/opt/liferay-qlcv/liferay-oss/oss-test
admin.email.from.address=hpnam9x@gmail.com
jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.default.username=htlyktt2
jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe     
setup.wizard.enabled=false
# My config
hibernate.jdbc.batch_size=0
jdbc.default.checkoutTimeout=3600
jdbc.default.maxIdleTime=3600

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 3:28

GoogleCodeExporter commented 9 years ago
cấu hình lại đường dẫn Java trong tập tin 
tomcat-7.0.42/bin/catalina.sh

JAVA_HOME=/opt/oss-dev/openjdk
JRE_HOME=/opt/oss-dev/openjdk/jre

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 3:31

GoogleCodeExporter commented 9 years ago
11:22:43,096 ERROR [localhost-startStop-1][MainServlet:209] 
com.liferay.portal.kernel.events.ActionException: 
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist_ 
[Sanitized]

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 4:23

GoogleCodeExporter commented 9 years ago
Dữ liệu bị thiếu một số table của Liferay

Xóa hết các table trong Schema cũ
select 'drop table '||table_name||' cascade constraints;' from user_tables;

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 5:01

GoogleCodeExporter commented 9 years ago
statup and create table
import database using ignore
imp htlyktt2/admin@XE ignore=y file=/home/eicweb/dump/htlykttfull.dmp 
log=htlykttfull.log fromuser=htlyktt touser=htlyktt2

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 8:27

GoogleCodeExporter commented 9 years ago
chép lại application server
Startup thành công

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 10:46

GoogleCodeExporter commented 9 years ago
tại đường dẫn: /home/eic/dump
export dữ liệu đầy đủ ra
eicweb@pcdhserver:/opt/liferay/tomcat-7.0.42$ expdp htlyktt2/admin 
directory=EXP_DUMP dumpfile=htlykttfull-v1.dmp logfile=htlykttfull-v1.log 
schemas=htlyktt2;

Original comment by ntanh...@gmail.com on 3 Oct 2014 at 10:51

GoogleCodeExporter commented 9 years ago
Using database copy
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev/r31/Database
Copy/DatabaseCopy.html

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 2:43

GoogleCodeExporter commented 9 years ago
http://www.oracle.com/technetwork/issue-archive/2012/12-sep/o52sqldev-1735911.ht
ml

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 2:44

GoogleCodeExporter commented 9 years ago
Sử dụng Database Diff để Compare dữ liệu schema htlyktt với 
htlyktt2
http://blog.devart.com/comparing-two-oracle-schemas-is-simple-now.html

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 3:41

GoogleCodeExporter commented 9 years ago
Kêt quả so sánh 2 schema

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 8:03

Attachments:

GoogleCodeExporter commented 9 years ago
Import lại dữ liệu thống kê nội dung câu nhập
1. Xóa table cimarit_TKNoiDungCauNhap
2. Import lại từ file htlykttfull.dmp
Code
imp htlyktt2/admin@XE ignore=y file=/home/eicweb/dump/htlykttfull.dmp 
tables=CIMARIT_TKNOIDUNGCAUNHAP log=htlykttfull-4-10-2014.log fromuser=htlyktt 
touser=htlyktt2

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 8:22

GoogleCodeExporter commented 9 years ago
so sánh table CIMARIT_TKNOIDUNGCAUNHAP giữa 2 schema thấy dữ liệu 
đầy đủ

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 8:34

GoogleCodeExporter commented 9 years ago

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 8:34

Attachments:

GoogleCodeExporter commented 9 years ago
Backup source application tại thư mục: 
opt/liferay-qlcv/liferay-oss/oss-v2-4-10-2014.tar.gz 

Backup database tại thư mục:
/home/eicweb/dump/htlykttfull-v2.dmp

Original comment by ntanh...@gmail.com on 4 Oct 2014 at 8:59