您好,登錄后才能下訂單哦!
這里涉及到三個oracle對象,一個是客戶的視圖,一個是客戶提供的中轉站服務器上的oracle,一個是我們自己的開發機的oracle,最終我們開發使用自己開發機的oracle的數據來進行開發,開發完成后,將oracle源改為客戶的視圖源,將產品部署到客戶提供的中轉站上。并且中轉站的oracle也已經不再需要,可以停掉,實際上web產品部署在另外一個節點,這個中轉站提供計算處理程序的居住場所。下面介紹我接入開發數據的具體步驟,我是按表的形式進行導入導出,并且用到的是oracle的數據泵。
驗證是否能夠連接,假設用戶密碼都是xsc,遠端ip是192.168.2.2,實例端口9010,實例名orcltyg
掃描實例端口: nmap 遠端ip
sqlplus "xsc"/"xsc"@192.168.2.2:9010/orcltyg
本機靜默安裝oracle11g(略)
本機創建表空間和oracle用戶,假設用戶為xsc,數據表空間為xsc,temp表空間xsctemp
create temporary tablespace xsctemp tempfile '/opt/oracle/oradata/orcl/xsctemp.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local;
create tablespace xsc logging datafile '/opt/oracle/oradata/orcl/xsc.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local autoallocate segment space management auto;
create user xsc identified by xsc default tablespace xsc temporary tablespace xsctemp;
grant connect,resource,dba to xsc;
創建到遠端192.168.2.2的dblink
create database link orcltyglink connect to xsc identified by "xsc" using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.2)(PORT = 9010)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ORCLTYG)))';
select * from xsjl@orcltyglink;
通過dblink連接遠端視圖選取數據創建本地的表xsjl
create table xsjl as select * from xsjl@orcltyglink;
選取一行來看
select * from xsjl where rownum<=1;
把它備份出來,并用ftp工具下載
mkdir /backup
chown -R oracle.oinstall /backup/
sqlplus / as sysdba
create or replace directory dir as '/backup/';
grant write,read on directory dir to xsc;
quit
nohup expdp xsc/xsc@orcl tables=xsjl dumpfile=xsjl.dmp logfile=xsjl.log directory=dir job_name=xsjl_job &
通過ftp或者sz下載,然后上傳到開發的oracle主機上
還原到開發機的oracle中
sqlplus / as sysdba
create temporary tablespace xsctemp tempfile '/u01/app/oracle/oradata/consume/xsctemp.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local;
create tablespace xsc logging datafile '/u01/app/oracle/oradata/consume/xsc.dbf' size 1000m autoextend on next 1000m maxsize unlimited extent management local autoallocate segment space management auto;
create user xsc identified by xsc default tablespace xsc temporary tablespace xsctemp;
grant connect,resource,dba to xsc;
quit
mkdir /u01/backup/
chown -R oracle.oinstall /u01/backup/
sqlplus / as sysdba
create or replace directory dir as '/u01/backup/';
grant write,read on directory dir to xsc;
quit
cd /u01/backup
rz [xsjl.dmp]
nohup impdp xsc/xsc dumpfile=xsjl.dmp logfile=xsjl.log directory=dir tables=xsjl job_name=xsjl_job &
驗證
select * from xsjl where rownum<=1;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。