oracle10g單例項遷移至3節點RAC

skuary發表於2011-11-03

現整理了一下之前公司生產庫單例項遷移至RAC的操作,具體如下:

1 RAC上先刪除schemas;

drop user YESMYWINE cascade;
drop user MYNET_APP cascade;
drop user TEST cascade;
drop user YH_DU cascade;
drop user YESMYTEA cascade;
drop user CALLCENTER cascade;
drop user MYNET_TEST cascade;
drop user PERFSTAT cascade;
drop user MYNET_DEV cascade;
drop user BAKMYNET cascade;
drop user APP cascade;
drop user YMT_CC cascade;
drop user BAKMYTEA cascade;

drop tablespace TBS_USERS including contents and datafiles;
drop tablespace TEST including contents and datafiles;
drop tablespace EXAMPLE including contents and datafiles;
drop tablespace TBS_INDEX including contents and datafiles;
drop tablespace TBS_MYNET including contents and datafiles;
drop tablespace TBS_ORDERS including contents and datafiles;
drop tablespace PERFSTAT including contents and datafiles;
drop tablespace TBS_OTHER including contents and datafiles;

2 RAC上建立與單例項資料庫對應的表空間和schemas;

---新增臨時表空間
create temporary tablespace tbs_temp tempfile
           '+DATA/yesmynet/tempfile/temp01.dbf' size 2048m REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED;
alter tablespace tbs_temp add tempfile '+DATA/yesmynet/tempfile/temp02.dbf'  size 2048M reuse autoextend on next 100M;
alter database default temporary tablespace TBS_TEMP ;
---增加UNDO表空間
alter tablespace undotbs1 add datafile '+DATA/yesmynet/datafile/undotbs01.DBF' 400M reuse autoextend on next 10m maxsize unlimited;
alter system set undo_retention=10800 scope=both sid='*';
alter system set log_buffer=14198784 scope=spfile;
alter system set pga_aggregate_target=500M scope=both;
alter system set shared_pool_size=512M scope=spfile;
alter system set sga_max_size=21G scope=spfile;
alter system set sga_target=20G scope=spfile;

----------------------------建立對應的表空間----------------------------------------------------

CREATE TABLESPACE TBS_USERS DATAFILE '+DATA/yesmynet/datafile/userinfo_01.dbf'
SIZE 1024M
REUSE
AUTOEXTEND ON
NEXT 2M
MAXSIZE UNLIMITED
NOLOGGING
EXTENT MANAGEMENT
LOCAL
AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO;
ALTER TABLESPACE TBS_USERS ADD DATAFILE '+DATA/yesmynet/datafile/userinfo_02.dbf' SIZE 2G reuse autoextend on next 100M;
ALTER TABLESPACE TBS_USERS ADD DATAFILE '+DATA/yesmynet/datafile/userinfo_03.dbf' SIZE 2G reuse autoextend on next 100M;

CREATE TABLESPACE TBS_INDEX DATAFILE '+DATA/yesmynet/datafile/oraindex_01.ind'
SIZE 1024M
REUSE
AUTOEXTEND ON
NEXT 2M
MAXSIZE UNLIMITED
NOLOGGING
EXTENT MANAGEMENT
LOCAL
AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO;

CREATE TABLESPACE PERFSTAT DATAFILE '+DATA/yesmynet/datafile/perfstat.dbf'
SIZE 1024M
REUSE
AUTOEXTEND ON
NEXT 2M
MAXSIZE UNLIMITED
NOLOGGING
EXTENT MANAGEMENT
LOCAL
AUTOALLOCATE
SEGMENT SPACE MANAGEMENT AUTO;

create temporary tablespace TBS_TEMP tempfile
           '+DATA/yesmynet/tempfile/temp01.dbf' size 2048m REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED;
  select d.file_name, d.file_id, d.tablespace_name, d.bytes from dba_temp_files d;
alter tablespace TBS_TEMP add tempfile '+DATA/yesmynet/tempfile/temp02.dbf'  size 4096M reuse autoextend on next 100M;        
alter database default temporary tablespace TBS_TEMP ;
drop tablespace TEMP including contents and datafiles;

--------------------------------建立相關schemas並授權---------------------------------------------------
-- Create the user
create user MYNET_DEV
  identified by "dev_netmy"
  default tablespace TBS_USERS
  temporary tablespace TBS_TEMP
  profile DEFAULT;

-- Grant/Revoke role privileges
grant connect to MYNET_DEV;
grant resource to MYNET_DEV;

---------------------------------------------------------------------------------------------------------------------------------------

-- Create the user
create user MYNET_APP
  identified by "!098bsdb%porsche"
  default tablespace TBS_USERS
  temporary tablespace TBS_TEMP
  profile DEFAULT
  quota unlimited on tbs_users;
-- Grant/Revoke role privileges
grant connect to MYNET_APP;
grant dba to MYNET_APP;
grant resource to MYNET_APP;
-- Grant/Revoke system privileges
grant create view to MYNET_APP;
grant select any table to MYNET_APP;
grant unlimited tablespace to MYNET_APP;

-- Create the user
create user PERFSTAT
  identified by "perfstat"
  default tablespace PERFSTAT
  temporary tablespace TBS_TEMP
  profile DEFAULT
  quota unlimited on perfstat;
-- Grant/Revoke object privileges
grant execute on DBMS_JOB to PERFSTAT;
grant execute on DBMS_SHARED_POOL to PERFSTAT;
grant select on GV_$INSTANCE to PERFSTAT;
grant select on STATS$V_$DYNAMIC_REM_STATS to PERFSTAT;
grant select on STATS$V_$FILESTATXS to PERFSTAT;
grant select on STATS$V_$SQLSTATS_SUMMARY to PERFSTAT;
grant select on STATS$V_$SQLXS to PERFSTAT;
grant select on STATS$V_$TEMPSTATXS to PERFSTAT;
grant select on STATS$X_$KCBFWAIT to PERFSTAT;
grant select on STATS$X_$KSPPI to PERFSTAT;
grant select on STATS$X_$KSPPSV to PERFSTAT;
grant select on V_$BUFFERED_QUEUES to PERFSTAT;
grant select on V_$BUFFERED_SUBSCRIBERS to PERFSTAT;
grant select on V_$BUFFER_POOL to PERFSTAT;
grant select on V_$BUFFER_POOL_STATISTICS to PERFSTAT;
grant select on V_$CR_BLOCK_SERVER to PERFSTAT;
grant select on V_$CURRENT_BLOCK_SERVER to PERFSTAT;
grant select on V_$DATABASE to PERFSTAT;
grant select on V_$DB_CACHE_ADVICE to PERFSTAT;
grant select on V_$DLM_MISC to PERFSTAT;
grant select on V_$ENQUEUE_STATISTICS to PERFSTAT;
grant select on V_$EVENT_HISTOGRAM to PERFSTAT;
grant select on V_$EVENT_NAME to PERFSTAT;
grant select on V_$FILE_HISTOGRAM to PERFSTAT;
grant select on V_$INSTANCE to PERFSTAT;
grant select on V_$INSTANCE_CACHE_TRANSFER to PERFSTAT;
grant select on V_$INSTANCE_RECOVERY to PERFSTAT;
grant select on V_$JAVA_POOL_ADVICE to PERFSTAT;
grant select on V_$LATCH to PERFSTAT;
grant select on V_$LATCH_CHILDREN to PERFSTAT;
grant select on V_$LATCH_MISSES to PERFSTAT;
grant select on V_$LATCH_PARENT to PERFSTAT;
grant select on V_$LIBRARYCACHE to PERFSTAT;
grant select on V_$MUTEX_SLEEP to PERFSTAT;
grant select on V_$OSSTAT to PERFSTAT;
grant select on V_$PARAMETER to PERFSTAT;
grant select on V_$PGASTAT to PERFSTAT;
grant select on V_$PGA_TARGET_ADVICE to PERFSTAT;
grant select on V_$PROCESS to PERFSTAT;
grant select on V_$PROCESS_MEMORY to PERFSTAT;
grant select on V_$PROPAGATION_RECEIVER to PERFSTAT;
grant select on V_$PROPAGATION_SENDER to PERFSTAT;
grant select on V_$RESOURCE_LIMIT to PERFSTAT;
grant select on V_$ROLLSTAT to PERFSTAT;
grant select on V_$ROWCACHE to PERFSTAT;
grant select on V_$RULE_SET to PERFSTAT;
grant select on V_$SEGMENT_STATISTICS to PERFSTAT;
grant select on V_$SEGSTAT to PERFSTAT;
grant select on V_$SEGSTAT_NAME to PERFSTAT;
grant select on V_$SESSION to PERFSTAT;
grant select on V_$SESSION_EVENT to PERFSTAT;
grant select on V_$SESSTAT to PERFSTAT;
grant select on V_$SESS_TIME_MODEL to PERFSTAT;
grant select on V_$SGA to PERFSTAT;
grant select on V_$SGASTAT to PERFSTAT;
grant select on V_$SGA_TARGET_ADVICE to PERFSTAT;
grant select on V_$SHARED_POOL_ADVICE to PERFSTAT;
grant select on V_$SQL to PERFSTAT;
grant select on V_$SQLAREA to PERFSTAT;
grant select on V_$SQLSTATS to PERFSTAT;
grant select on V_$SQLTEXT to PERFSTAT;
grant select on V_$SQL_PLAN to PERFSTAT;
grant select on V_$SQL_WORKAREA_HISTOGRAM to PERFSTAT;
grant select on V_$STREAMS_APPLY_COORDINATOR to PERFSTAT;
grant select on V_$STREAMS_APPLY_READER to PERFSTAT;
grant select on V_$STREAMS_APPLY_SERVER to PERFSTAT;
grant select on V_$STREAMS_CAPTURE to PERFSTAT;
grant select on V_$STREAMS_POOL_ADVICE to PERFSTAT;
grant select on V_$SYSSTAT to PERFSTAT;
grant select on V_$SYSTEM_EVENT to PERFSTAT;
grant select on V_$SYSTEM_PARAMETER to PERFSTAT;
grant select on V_$SYS_TIME_MODEL to PERFSTAT;
grant select on V_$TEMP_HISTOGRAM to PERFSTAT;
grant select on V_$THREAD to PERFSTAT;
grant select on V_$UNDOSTAT to PERFSTAT;
grant select on V_$WAITSTAT to PERFSTAT;
-- Grant/Revoke role privileges
grant select_catalog_role to PERFSTAT;
-- Grant/Revoke system privileges
grant alter session to PERFSTAT;
grant create procedure to PERFSTAT;
grant create public synonym to PERFSTAT;
grant create sequence to PERFSTAT;
grant create session to PERFSTAT;
grant create table to PERFSTAT;
grant drop public synonym to PERFSTAT;

---------------------------------------------------
-- Grant/Revoke object privileges
grant select on CALLCENTER_TEAM_OPERSITE to MYNET_DEV;
grant select on COLUMN_NAME to MYNET_DEV;
grant select on COUPON_TMP to MYNET_DEV;
grant select, insert, update, delete, references on DIC_AREA to MYNET_DEV;
grant select, insert, update, delete, references on DIC_COMPANY to MYNET_DEV;
grant select, insert, update, delete, references on GOODSINFO to MYNET_DEV;
grant select, insert, update, delete, references on GOODSLINK to MYNET_DEV;
grant select on GOODS_CODE to MYNET_DEV;
grant select on GOODS_TEMP to MYNET_DEV;
grant select on GOODS_WINE_TYPE to MYNET_DEV;
grant execute on JOIN_CHAR to MYNET_DEV;
grant select on LOG_NAME to MYNET_DEV;
grant select on MATERIAL_CODE to MYNET_DEV;
grant select, insert, update, delete, references on MEMBERINFO to MYNET_DEV;
grant select on MEMBER_LEVER_TEMP to MYNET_DEV;
grant select, insert, update, delete, references on MN_ALL_SALESGOODS to MYNET_DEV;
grant select, insert, update, delete, references on MN_ALL_SALESGOODS_SPLIT to MYNET_DEV;
grant select, insert, update, delete, references on MN_SUIT_SALESGOODS_SPLIT to MYNET_DEV;
grant select on MT_BUTTLETIN to MYNET_DEV;
grant select on MT_GIFT_BOX_GOODS to MYNET_DEV;
grant select on MT_GIFT_CERTIFICATES_BOX to MYNET_DEV;
grant select on MT_GIFT_CERTIFICATES_CARD to MYNET_DEV;
grant select on MT_ICBC_PAY_INFO to MYNET_DEV;
grant select on MT_MEMBER_MARKET_INFO to MYNET_DEV;
grant select on MT_OPERATION_LOG to MYNET_DEV;
grant select on MT_OPERATION_LOG_PARA to MYNET_DEV;
grant select on MT_OPERATION_LOG_VIEW to MYNET_DEV;
grant select on MT_OTHER_USER to MYNET_DEV;
grant select on MT_POLL_CATEGORY to MYNET_DEV;
grant select on MT_POLL_OPTIONS to MYNET_DEV;
grant select on MT_POLL_QUESTION to MYNET_DEV;
grant select on MT_POLL_TRACKING to MYNET_DEV;
grant select on MT_YQWL_EMAIL to MYNET_DEV;
grant select, insert, update, delete, references on MV_ALL_PURCHASEGOODS to MYNET_DEV;
grant select, insert, update, delete, references on MV_ALL_SALESGOODS to MYNET_DEV;
grant select, insert, update, delete, references on MV_ALL_SALESGOODS_TEST to MYNET_DEV;
grant select on MV_BOOK_GOODS to MYNET_DEV;
grant select, insert, update, delete, references on MV_COUPON_BATCH to MYNET_DEV;
grant select, insert, update, delete, references on MV_COUPON_INFO to MYNET_DEV;
grant select, insert, update, delete, references on MV_DMS_SEND_BOOK_TEA to MYNET_DEV;
grant select, insert, update, delete, references on MV_DMS_SEND_BOOK_WINE to MYNET_DEV;
grant select on MV_GOODS_FROZEN_AMOUNT to MYNET_DEV;
grant select, insert, update, delete, references on MV_GOODS_TM1 to MYNET_DEV;
grant select, insert, update, delete, references on MV_GOODS_TM2 to MYNET_DEV;
grant select, insert, update, delete, references on MV_OPS_UNSEND_BOOK_SEARCH to MYNET_DEV;
grant select, insert, update, delete, references on MV_POST_AREA to MYNET_DEV;
grant select, insert, update, delete, references on MV_STOREHOUSE_AREA to MYNET_DEV;
grant select on MV_STORE_PAY_LOCAL to MYNET_DEV;
grant select, insert, update, delete, references on MV_SYS_MENU to MYNET_DEV;
grant select, insert, update, delete, references on MV_WMS_STOCK_REPORT to MYNET_DEV;
grant select on MW_BOOK_QC to MYNET_DEV;
grant select on MW_DICT_DOCUMENT_TYPE to MYNET_DEV;
grant select on MW_DICT_INVOICE_CONTENT to MYNET_DEV;
grant select on MW_MONTH_BUY_RATE_REP to MYNET_DEV;
grant select on MW_USER_GET_BOOK to MYNET_DEV;
grant select on MW_USER_LOGIN_RECORD_VIEW to MYNET_DEV;
grant select on MW_WINE_DOCUMENT to MYNET_DEV;
grant select on MW_ZS_PAY_INFO to MYNET_DEV;
grant select on M_ADSUPPLIER_USER to MYNET_DEV;
grant select on M_ADVERTISEMENT_CLICK to MYNET_DEV;
grant select on M_AFFILIATE to MYNET_DEV;
grant select on M_AREA_POST_RELATION to MYNET_DEV;
grant select on M_BANKPAY_INFO to MYNET_DEV;
grant select on M_BAR_CODE to MYNET_DEV;
grant select on M_BAR_CODE_GOODS to MYNET_DEV;
grant select on M_BATCH_IMPORT_STOCK to MYNET_DEV;
grant select on M_BATCH_SEND_GOODS to MYNET_DEV;
grant select on M_BUTTLETIN to MYNET_DEV;
grant select on M_CALLCENTER_FAQ to MYNET_DEV;
grant select on M_CALL_CENTER_SOURCE to MYNET_DEV;
grant select on M_CHANNEL_GOODS to MYNET_DEV;
grant select on M_CHANNEL_GOODS_SELL_LIMIT to MYNET_DEV;
grant select on M_CHANNEL_INFO to MYNET_DEV;
grant select, insert, update, delete, references, alter, index on M_CLICK_COUNT to MYNET_DEV;
grant select on M_CLICK_ONLINE_PAYMENT_HISTORY to MYNET_DEV;
grant select, insert, update, delete, references, alter, index on M_CLICK_TRACK to MYNET_DEV;
grant select on M_CLUB_MEMBER to MYNET_DEV;
grant select on M_CLUB_PASS to MYNET_DEV;
grant select on M_CONNECT_EXPRESS to MYNET_DEV;
grant select on M_CONNECT_GOODS to MYNET_DEV;
grant select on M_CONNECT_INFO to MYNET_DEV;
grant select on M_CONNECT_PARAMETER to MYNET_DEV;
grant select on M_CONNECT_WORK_RECORD to MYNET_DEV;
grant select on M_COUPON_GOODS to MYNET_DEV;
grant select on M_COUPON_INFO to MYNET_DEV;
grant select on M_COUPON_PRESENT to MYNET_DEV;
grant select on M_COUPON_REPEAT to MYNET_DEV;
grant select on M_CPA_INFO to MYNET_DEV;
grant select on M_CPS_INFO to MYNET_DEV;
grant select on M_DICT_CONSULTATION_TYPE to MYNET_DEV;
grant select on M_DICT_MAIL_INFO to MYNET_DEV;
grant select on M_EDM_RESULT to MYNET_DEV;
grant select on M_EMAIL_SUBSCRIPTION to MYNET_DEV;
grant select on M_EXPRESS_AREA to MYNET_DEV;
grant select on M_EXPRESS_AREA_GROUP to MYNET_DEV;
grant select on M_EXPRESS_DELIVERY_INFO to MYNET_DEV;
grant select on M_EXPRESS_GRADE to MYNET_DEV;
grant select on M_EXPRESS_GROUP to MYNET_DEV;
grant select on M_EXPRESS_GROUP_BAK to MYNET_DEV;
grant select on M_EXPRESS_INFO to MYNET_DEV;
grant select on M_FETCH_MATERIAL to MYNET_DEV;
grant select on M_FETCH_MATERIAL_DL to MYNET_DEV;
grant select on M_FLITTING_GOODS to MYNET_DEV;
grant select on M_FLITTING_INFO to MYNET_DEV;
grant select, insert, update, delete, references, alter, index on M_GOODS_AVG_PRICE to MYNET_DEV;
grant select on M_GOODS_IMAGE to MYNET_DEV;
grant select on M_GOODS_IMAGE_BUY_CHANNEL to MYNET_DEV;
grant select on M_GOODS_INFO to MYNET_DEV;
grant select on M_GOODS_INFO_UNIT_BAK to MYNET_DEV;
grant select on M_GOODS_LOCATION to MYNET_DEV;
grant select on M_GOODS_MATERIAL to MYNET_DEV;
grant select on M_GOODS_PARAMETER to MYNET_DEV;
grant select on M_GOODS_PRICE_UPDATE to MYNET_DEV;
grant select on M_GOODS_PURCHASE_PARA to MYNET_DEV;
grant select on M_GOODS_SAFETY_FACTOR to MYNET_DEV;
grant select on M_GOODS_SALEAMOUNT to MYNET_DEV;
grant select on M_GOODS_SELECTED to MYNET_DEV;
grant select on M_GOODS_SELLFLAG to MYNET_DEV;
grant select on M_GOODS_SEMI to MYNET_DEV;
grant select on M_GOODS_SITUATION_TYPE to MYNET_DEV;
grant select on M_GOODS_STATE_RECORD to MYNET_DEV;
grant select on M_GOODS_STOCK_HOUSE to MYNET_DEV;
grant select on M_GOODS_SUIT to MYNET_DEV;
grant select on M_GOODS_SUITATION to MYNET_DEV;
grant select on M_GOODS_TEA to MYNET_DEV;
grant select on M_GOODS_TEA_TYPE to MYNET_DEV;
grant select on M_GOODS_TEA_TYPE_RELATION to MYNET_DEV;
grant select on M_GOODS_UPDATE to MYNET_DEV;
grant select on M_GOODS_VIP_TYPE to MYNET_DEV;
grant select on M_GOODS_VIP_TYPE_RELATION to MYNET_DEV;
grant select on M_GOODS_WATER_MARK to MYNET_DEV;
grant select on M_GOODS_WINE to MYNET_DEV;
grant select on M_GOODS_WINE_AREA to MYNET_DEV;
grant select on M_GOODS_WINE_TYPE to MYNET_DEV;
grant select on M_GOODS_WINE_YEAR_DELETE to MYNET_DEV;
grant select on M_GOODS_YEAR_DELETE to MYNET_DEV;
grant select on M_GOODS_YEAR_STOCK to MYNET_DEV;
grant select on M_GROUP_BUY to MYNET_DEV;
grant select on M_GROUP_BUY_RECORD to MYNET_DEV;
grant select on M_HONOR_GAIN_RECORD to MYNET_DEV;
grant select on M_HONOR_INFO to MYNET_DEV;
grant select on M_HONOR_PROMOTION_RE to MYNET_DEV;
grant select on M_IB_PHONE to MYNET_DEV;
grant select on M_IB_RECORD to MYNET_DEV;
grant select on M_ICBC_PAY_INFO to MYNET_DEV;
grant select on M_INVOICE to MYNET_DEV;
grant select on M_INVOICE_STOCK_RECORD to MYNET_DEV;
grant select on M_IP_CITY to MYNET_DEV;
grant select on M_IP_FILTER to MYNET_DEV;
grant select on M_KQPAY_INFO to MYNET_DEV;
grant select on M_MARKETING_BUDGET to MYNET_DEV;
grant select on M_MARKETING_DETAIL to MYNET_DEV;
grant select on M_MARKETING_INFO to MYNET_DEV;
grant select on M_MASS_CHEAP_SELL to MYNET_DEV;
grant select on M_MATERIAL to MYNET_DEV;
grant select on M_MEMBER_ACCOUNT2 to MYNET_DEV;
grant select on M_MEMBER_ACCOUNT_MERGE to MYNET_DEV;
grant select on M_MEMBER_ACCOUNT_MERGE_RESULT to MYNET_DEV;
grant select on M_MEMBER_ARTICLE to MYNET_DEV;
grant select on M_MEMBER_ASK to MYNET_DEV;
grant select on M_MEMBER_ASK_PROCESS to MYNET_DEV;
grant select on M_MEMBER_CLASS_HISTORY to MYNET_DEV;
grant select on M_MEMBER_CONSUME_PROPERTY to MYNET_DEV;
grant select on M_MEMBER_CONTACT to MYNET_DEV;
grant select on M_MEMBER_COUPON to MYNET_DEV;
grant select on M_MEMBER_FAVORITES to MYNET_DEV;
grant select on M_MEMBER_GOODS_RECOMMEND to MYNET_DEV;
grant select on M_MEMBER_IMPORT_RECORD to MYNET_DEV;
grant select on M_MEMBER_MAIL_SUBSCRIBE to MYNET_DEV;
grant select on M_MEMBER_MARKETING to MYNET_DEV;
grant select on M_MEMBER_MARKETING_TEA to MYNET_DEV;
grant select on M_MEMBER_MARKETING_WINE to MYNET_DEV;
grant select on M_MEMBER_PRESENT_COUPON_RECORD to MYNET_DEV;
grant select on M_MEMBER_REFUSE to MYNET_DEV;
grant select on M_MEMBER_REG_RECORD to MYNET_DEV;
grant select on M_MEMBER_REPEAT to MYNET_DEV;
grant select on M_MEMBER_SUBSCRIBE to MYNET_DEV;
grant select on M_MEMBER_VERIFICATION_CODE to MYNET_DEV;
grant select on M_MER_PAY_RECORD to MYNET_DEV;
grant select on M_MER_PAY_RESULT to MYNET_DEV;
grant select on M_MONTH_REPORT to MYNET_DEV;
grant select on M_MONTH_REP_TMP to MYNET_DEV;
grant select on M_MOVE_STOCK_GOODS to MYNET_DEV;
grant select on M_MOVE_STOCK_INFO to MYNET_DEV;
grant select on M_MSN_PROMOTION_RECORD to MYNET_DEV;
grant select on M_MSN_SECOND_GOODS to MYNET_DEV;
grant select on M_NEWYEAR_PROMOTION_RECORD to MYNET_DEV;
grant select on M_NEWYEAR_SECOND_GOODS to MYNET_DEV;
grant select on M_NEW_TEA_BUY_ORDER to MYNET_DEV;
grant select on M_NEW_USER_SEARCH to MYNET_DEV;
grant select on M_OPERATION_RECORD to MYNET_DEV;
grant select on M_ORDER_DAMAGED to MYNET_DEV;
grant select on M_ORDER_DAMAGED_GOODS to MYNET_DEV;
grant select on M_ORDER_FOLLOW_RECORD to MYNET_DEV;
grant select on M_ORDER_GOODS to MYNET_DEV;
grant select on M_ORDER_INFO to MYNET_DEV;
grant select on M_ORDER_INFO_SEQ to MYNET_DEV;
grant select on M_ORDER_INVOICE to MYNET_DEV;
grant select on M_ORDER_JINGDONG_RE to MYNET_DEV;
grant select on M_ORDER_NEW_WINE_RELATION to MYNET_DEV;
grant select on M_ORDER_OOS_DETAIL to MYNET_DEV;
grant select on M_ORDER_OOS_INFO to MYNET_DEV;
grant select on M_ORDER_PROBLEM to MYNET_DEV;
grant select on M_ORDER_PROCESS_MEMO to MYNET_DEV;
grant select on M_ORDER_PROMOTION_RE to MYNET_DEV;
grant select on M_ORDER_RECORD_CHECK to MYNET_DEV;
grant select on M_ORDER_RETURNED to MYNET_DEV;
grant select on M_ORDER_RETURN_GOODS to MYNET_DEV;
grant select on M_ORDER_REVISIT to MYNET_DEV;
grant select on M_ORDER_SET to MYNET_DEV;
grant select on M_ORDER_STATUS_RECORD to MYNET_DEV;
grant select on M_ORDER_TAOBAO_RE to MYNET_DEV;
grant select on M_OTHER_USERS to MYNET_DEV;
grant select on M_OUTOB_MEMBER to MYNET_DEV;
grant select on M_POST_AREA to MYNET_DEV;
grant select on M_POTATO_INFO to MYNET_DEV;
grant select on M_POTATO_TIMES to MYNET_DEV;
grant select on M_PREFERENCE_GOODS to MYNET_DEV;
grant select on M_PRICE_REPORT to MYNET_DEV;
grant select on M_PRINT_PAPER_ALERT to MYNET_DEV;
grant select on M_PRODUCT_PLAN to MYNET_DEV;
grant select on M_PROMOTION_FIRST_PURCHASES to MYNET_DEV;
grant select on M_PROMOTION_GOODS_RE to MYNET_DEV;
grant select on M_PROMOTION_GROUP_LEVEL to MYNET_DEV;
grant select on M_PROMOTION_INFO to MYNET_DEV;
grant select on M_PROMOTION_MEMBER_RE to MYNET_DEV;
grant select on M_PROMOTION_MUTEX to MYNET_DEV;
grant select, insert, update, delete, references on M_PURCHASE_BARCODE to MYNET_DEV;
grant select on M_PURCHASE_BUDGET to MYNET_DEV;
grant select on M_PURCHASE_BUDGET_GOODS to MYNET_DEV;
grant select on M_PURCHASE_GOODS to MYNET_DEV;
grant select on M_PURCHASE_GOODS_PRICE to MYNET_DEV;
grant select on M_PURCHASE_INFO to MYNET_DEV;
grant select on M_PURCHASE_PAYMENT to MYNET_DEV;
grant select on M_QC_DETAIL to MYNET_DEV;
grant select on M_QC_INFO to MYNET_DEV;
grant select on M_QIXINTONG_WHITE to MYNET_DEV;
grant select on M_QUARTER_REPORT to MYNET_DEV;
grant select on M_QUARTER_REP_TMP to MYNET_DEV;
grant select on M_RECHARGE_ACCOUNT to MYNET_DEV;
grant select on M_RECHARGE_RECORD to MYNET_DEV;
grant select on M_RECOMEND_INFO to MYNET_DEV;
grant select on M_REPORT_URL to MYNET_DEV;
grant select on M_RETURN_DETAIL to MYNET_DEV;
grant select on M_ROLES_AUTHORITIES_MAP to MYNET_DEV;
grant select on M_SCORE_HISTORY to MYNET_DEV;
grant select on M_SEMI_MATERIAL to MYNET_DEV;
grant select on M_SEMI_PRODUCT to MYNET_DEV;
grant select on M_SEND_PAGE_FEE to MYNET_DEV;
grant select on M_SEND_PAGE_GOODS to MYNET_DEV;
grant select on M_SEND_PAGE_INFO_TMP to MYNET_DEV;
grant select on M_SEND_PAGE_NEED_FEE to MYNET_DEV;
grant select on M_SITE_CALL to MYNET_DEV;
grant select on M_SL_GOODS to MYNET_DEV;
grant select on M_SMS_RESULT to MYNET_DEV;
grant select on M_SMS_RESULT_BATCH to MYNET_DEV;
grant select on M_STOCK_FLITTING_GOODS to MYNET_DEV;
grant select on M_STOCK_FLITTING_INFO to MYNET_DEV;
grant select on M_STOCK_RECORD to MYNET_DEV;
grant select on M_STOCK_REPORT_MONTH to MYNET_DEV;
grant select on M_STOCK_REPORT_WEEK to MYNET_DEV;
grant select on M_STOCK_SALE_PURCH_REPORT to MYNET_DEV;
grant select on M_STORAGE_BLOCK to MYNET_DEV;
grant select on M_STORAGE_CHECK to MYNET_DEV;
grant select on M_STORAGE_CHECK_DETAIL to MYNET_DEV;
grant select on M_STORAGE_LOCATION to MYNET_DEV;
grant select on M_STORAGE_SC_DETAIL to MYNET_DEV;
grant select on M_STORAGE_SPOT_CHECK to MYNET_DEV;
grant select on M_STOREHOUSE to MYNET_DEV;
grant select on M_STOREHOUSE_SHORT_GOODS to MYNET_DEV;
grant select on M_STORE_AREA to MYNET_DEV;
grant select on M_STROE_FLITTING to MYNET_DEV;
grant select on M_SUPPLIER_ACCOUNT_RULE to MYNET_DEV;
grant select on M_SUPPLIER_CODE to MYNET_DEV;
grant select on M_SUPPLIER_GOODS to MYNET_DEV;
grant select on M_SUPPLIER_INFO to MYNET_DEV;
grant select on M_SUPPLIER_MATERIAL to MYNET_DEV;
grant select on M_SYS_AUTHORITIES to MYNET_DEV;
grant select on M_SYS_BUSINESS_REG to MYNET_DEV;
grant select on M_SYS_CODE_DIC to MYNET_DEV;
grant select on M_SYS_DATA_DIC to MYNET_DEV;
grant select on M_SYS_DEPARTMENT_INFO to MYNET_DEV;
grant select on M_SYS_EMPLOYEE_INFO to MYNET_DEV;
grant select on M_SYS_FIND_PSD to MYNET_DEV;
grant select on M_SYS_MENU to MYNET_DEV;
grant select on M_SYS_MENU_ROLE to MYNET_DEV;
grant select on M_SYS_ROLE_INFO to MYNET_DEV;
grant select on M_SYS_STATION_INFO to MYNET_DEV;
grant select on M_SYS_USER to MYNET_DEV;
grant select on M_SYS_USER_CUSTOMIZED_MENU to MYNET_DEV;
grant select on M_SYS_USER_LOG to MYNET_DEV;
grant select on M_SYS_USER_ROLE to MYNET_DEV;
grant select on M_SYS_USER_STATION to MYNET_DEV;
grant select on M_SYS_USER_STOREHOUSE_RELATION to MYNET_DEV;
grant select on M_TM_MEMBER to MYNET_DEV;
grant select on M_TRANSPORTATION_AREA to MYNET_DEV;
grant select on M_TRANSPORTATION_BILL to MYNET_DEV;
grant select on M_TRANSPORTATION_CLOSING to MYNET_DEV;
grant select on M_TRANSPORTATION_CLOSING_BILL to MYNET_DEV;
grant select on M_TRANSPORTATION_CO to MYNET_DEV;
grant select on M_TRY_DRINK to MYNET_DEV;
grant select on M_USER_PASSWORD_NOTIFY to MYNET_DEV;
grant select on M_USER_REPEAT to MYNET_DEV;
grant select on M_USER_REPEAT_A to MYNET_DEV;
grant select on M_VIP_GOODS to MYNET_DEV;
grant select on M_VIP_GOODS_BATCH to MYNET_DEV;
grant select on M_VIP_GOODS_BOOK to MYNET_DEV;
grant select on M_VIP_GOODS_PR to MYNET_DEV;
grant select on M_VOTE_RESULT to MYNET_DEV;
grant select on M_WLT_ORDER_RESULT to MYNET_DEV;
grant select on M_WLT_PAY_INFO to MYNET_DEV;
grant select on M_YEAR_ORDER_GOODS_RE to MYNET_DEV;
grant select on M_ZFBPAY_INFO to MYNET_DEV;
grant select on M_ZS_PAY_INFO to MYNET_DEV;
grant select, insert, update, delete, references on ORDERGOODS to MYNET_DEV;
grant select, insert, update, delete, references on ORDERS to MYNET_DEV;
grant select, insert, update, delete, references on ORDERSENDPAGE to MYNET_DEV;
grant select on PRC_GOODS_YEAR_TAB to MYNET_DEV;
grant select on PRC_GOODS_YEAR_TAB2 to MYNET_DEV;
grant select on SEQUENCE_TABLE to MYNET_DEV;
grant select on SEQ_M_ORDER_OOS_DETAIL_ID to MYNET_DEV;
grant select on SEQ_M_ORDER_OOS_INFO_ID to MYNET_DEV;
grant select on SEQ_M_SYS_USER_LOG_ID to MYNET_DEV;
grant select on SQL_RECORD to MYNET_DEV;
grant select on SYS_TEMP_FBT to MYNET_DEV;
grant select on TABLE_NAME to MYNET_DEV;
grant select on TEA_TUDOU_ZHONGQIU_ALL to MYNET_DEV;
grant select on TEST_BUG to MYNET_DEV;
grant select, insert, update, delete, references on V_MT_MONTH_BUY_RATE_REP to MYNET_DEV;
grant select, insert, update, delete, references on V_MW_MONTH_BUY_RATE_REP to MYNET_DEV;
grant select, insert, update, delete, references on V_M_MEMBER_ADDRESS to MYNET_DEV;
grant select on V_M_MEMBER_INFO to MYNET_DEV;
grant select on V_M_ORDER_INFO to MYNET_DEV;
grant select on V_M_SEND_PAGE_INFO to MYNET_DEV;
grant select on WINE_GOODS_CODE to MYNET_DEV;
grant select on WINE_SUPPLY_CODE to MYNET_DEV;
-------------------------------------------------------------------------------------
3 單例項DB上備份需要遷移的使用者資訊,並SCP至RAC其中一個節點;
expdp mynet_app directory=DPDATA1 dumpfile=dump_2_users.dmp schemas=MYNET_APP,MYNET_DEV
scp /oradata/db_bak/dump_2_users.dmp 118.126.14.45:/db_bak

還有一種方式,就是通過帶有network命令的impdp方式匯入(目標庫),速度更快,如下:

impdp sys/syspasswd directory = DPDATA1 network_link = yesmydb REMAP_TABLESPACE=tbs_users:tbs_users,sc:tbs_users,tbs_index:tbs_index,temp:tbs_temp

4 RAC上匯入對應資料資訊;
impdp mynet_app directory=DPDATA1 dumpfile=dump_2_users.dmp schemas=MYNET_APP,MYNET_DEV
5 分析表空間,統計相關資訊,重建索引,檢查授權資訊等。
BEGIN
   DBMS_STATS.GATHER_SCHEMA_STATS(ownname => 'MYNET_APP',
                                  estimate_percent =>DBMS_STATS.AUTO_SAMPLE_SIZE,
                                  ptions => 'gather auto',
                                  degree  => DBMS_STATS.AUTO_DEGREE,
                                  method_opt => 'for all columns size repeat',
                                  cascade => TRUE
                                 );
END;                               
/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25618347/viewspace-714074/,如需轉載,請註明出處,否則將追究法律責任。

相關文章