1.查看数据库运行状态
$ srvctl status database -d roneInstance rone_2 is running on node rone2Online relocation: INACTIVE
2.开始迁移
$ srvctl relocate database -d rone -n rone1
3.迁移结束后查看
$ srvctl status database -d roneInstance rone_1 is running on node rone1Online relocation: INACTIVE
源节点对应的alert日志信息:
Fri Sep 23 02:58:04 2016Decreasing number of real time LMS from 1 to 0Fri Sep 23 03:01:05 2016Reconfiguration started (old inc 6, new inc 8)List of instances: 1 2 (myinst: 2) Global Resource Directory frozen Communication channels reestablishedFri Sep 23 03:01:05 2016 * domain 0 valid = 1 according to instance 1 Master broadcasted resource hash value bitmaps Non-local Process blocks cleaned outFri Sep 23 03:01:05 2016 LMS 0: 0 GCS shadows cancelled, 0 closed, 0 Xw survived Set master node info Submitted all remote-enqueue requests Dwn-cvts replayed, VALBLKs dubious All grantable enqueues granted Submitted all GCS remote-cache requests Fix write in gcs resourcesReconfiguration completeFri Sep 23 03:01:18 2016ALTER SYSTEM SET service_names='rone' SCOPE=MEMORY SID='rone_2';Shutting down instance (transactional local)Shutting down instance: further logons disabledFri Sep 23 03:01:21 2016Stopping background process CJQ0Stopping background process QMNCStopping background process MMNLStopping background process MMONLocal transactions complete. Performing immediate shutdownLicense high water mark = 6All dispatchers and shared servers shutdownALTER SYSTEM SET _shutdown_completion_timeout_mins=30 SCOPE=MEMORY;ALTER DATABASE CLOSE NORMAL /* db agent *//* {2:16649:279} */Fri Sep 23 03:01:28 2016SMON: disabling tx recoveryStopping background process RCBGSMON: disabling cache recoveryFri Sep 23 03:01:33 2016NOTE: Deferred communication with ASM instanceNOTE: deferred map free for map id 11Shutting down archive processesArchiving is disabledArchive process shutdown avoided: 0 activeThread 2 closed at log sequence 1Successful close of redo thread 2Fri Sep 23 03:01:33 2016NOTE: Deferred communication with ASM instanceNOTE: deferred map free for map id 4Fri Sep 23 03:01:33 2016Completed: ALTER DATABASE CLOSE NORMAL /* db agent *//* {2:16649:279} */ALTER DATABASE DISMOUNT /* db agent *//* {2:16649:279} */Shutting down archive processesArchiving is disabledFri Sep 23 03:01:33 2016NOTE: Deferred communication with ASM instanceNOTE: deferred map free for map id 2Completed: ALTER DATABASE DISMOUNT /* db agent *//* {2:16649:279} */ARCH: Archival disabled due to shutdown: 1089Shutting down archive processesArchiving is disabledFri Sep 23 03:01:33 2016NOTE: force a map free for map id 2NOTE: force a map free for map id 4NOTE: force a map free for map id 11Fri Sep 23 03:01:33 2016Stopping background process VKTMARCH: Archival disabled due to shutdown: 1089Shutting down archive processesArchiving is disabledFri Sep 23 03:01:34 2016NOTE: Shutting down MARK background processFri Sep 23 03:01:35 2016freeing rdom 0Fri Sep 23 03:01:40 2016Instance shutdown complete
目标节点的alert日志信息:
Fri Sep 23 03:00:53 2016Starting ORACLE instance (normal)************************ Large Pages Information *******************Per process system memlock (soft) limit = UNLIMITED Total Shared Global Region in Large Pages = 0 KB (0%) Large Pages used by this instance: 0 (0 KB)Large Pages unused system wide = 0 (0 KB)Large Pages configured system wide = 0 (0 KB)Large Page size = 2048 KB RECOMMENDATION: Total System Global Area size is 566 MB. For optimal performance, prior to the next instance restart: 1. Increase the number of unused large pages by at least 283 (page size 2048 KB, total size 566 MB) system wide to get 100% of the System Global Area allocated with large pages********************************************************************LICENSE_MAX_SESSION = 0LICENSE_SESSIONS_WARNING = 0Initial number of CPU is 1Private Interface 'eth1:1' configured from GPnP for use as a private interconnect. [name='eth1:1', type=1, ip=169.254.210.154, mac=08-00-27-3c-72-c7, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]Public Interface 'eth0' configured from GPnP for use as a public interface. [name='eth0', type=1, ip=192.168.56.131, mac=08-00-27-95-e5-90, net=192.168.56.0/24, mask=255.255.255.0, use=public/1]Public Interface 'eth0:1' configured from GPnP for use as a public interface. [name='eth0:1', type=1, ip=192.168.56.135, mac=08-00-27-95-e5-90, net=192.168.56.0/24, mask=255.255.255.0, use=public/1]Public Interface 'eth0:3' configured from GPnP for use as a public interface. [name='eth0:3', type=1, ip=192.168.56.133, mac=08-00-27-95-e5-90, net=192.168.56.0/24, mask=255.255.255.0, use=public/1]CELL communication is configured to use 0 interface(s):CELL IP affinity details: NUMA status: non-NUMA system cellaffinity.ora status: N/ACELL communication will use 1 IP group(s): Grp 0: Picked latch-free SCN scheme 3Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DESTAutotune of undo retention is turned on. LICENSE_MAX_USERS = 0SYS auditing is disabledStarting up:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing options.ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1System name: LinuxNode name: rone1.example.comRelease: 2.6.32-358.el6.x86_64Version: #1 SMP Tue Jan 29 11:47:41 EST 2013Machine: x86_64Using parameter settings in server-side pfile /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initrone_1.oraSystem parameters with non-default values: processes = 150 spfile = "+DATA/rone/spfilerone.ora" sga_target = 564M control_files = "+DATA/rone/controlfile/current.260.923215671" control_files = "+CRS/rone/controlfile/current.256.923215671" db_block_size = 8192 compatible = "11.2.0.4.0" cluster_database = TRUE db_create_file_dest = "+DATA" db_recovery_file_dest = "+CRS" db_recovery_file_dest_size= 5007M remote_login_passwordfile= "EXCLUSIVE" db_domain = "" dispatchers = "(PROTOCOL=TCP) (SERVICE=roneXDB)" remote_listener = "rone-scan:1521" audit_file_dest = "/u01/app/oracle/admin/rone/adump" audit_trail = "DB" db_name = "rone" open_cursors = 300 pga_aggregate_target = 187M diagnostic_dest = "/u01/app/oracle"Cluster communication is configured to use the following interface(s) for this instance 169.254.210.154cluster interconnect IPC version:Oracle UDP/IP (generic)IPC Vendor 1 proto 2Fri Sep 23 03:01:03 2016PMON started with pid=2, OS id=5284 Fri Sep 23 03:01:03 2016PSP0 started with pid=3, OS id=5286 Fri Sep 23 03:01:04 2016VKTM started with pid=4, OS id=5288 at elevated priorityVKTM running at (1)millisec precision with DBRM quantum (100)msFri Sep 23 03:01:04 2016GEN0 started with pid=5, OS id=5292 Fri Sep 23 03:01:04 2016DIAG started with pid=6, OS id=5294 Fri Sep 23 03:01:04 2016DBRM started with pid=7, OS id=5296 Fri Sep 23 03:01:04 2016PING started with pid=8, OS id=5298 Fri Sep 23 03:01:04 2016ACMS started with pid=9, OS id=5300 Fri Sep 23 03:01:04 2016DIA0 started with pid=10, OS id=5302 Fri Sep 23 03:01:04 2016LMON started with pid=11, OS id=5304 Fri Sep 23 03:01:04 2016LMD0 started with pid=12, OS id=5306 * Load Monitor used for high load check * New Low - High Load Threshold Range = [960 - 1280] Fri Sep 23 03:01:04 2016LMS0 started with pid=13, OS id=5308 at elevated priorityFri Sep 23 03:01:04 2016RMS0 started with pid=14, OS id=5312 Fri Sep 23 03:01:04 2016LMHB started with pid=15, OS id=5314 Fri Sep 23 03:01:04 2016MMAN started with pid=16, OS id=5316 Fri Sep 23 03:01:04 2016DBW0 started with pid=17, OS id=5318 Fri Sep 23 03:01:04 2016LGWR started with pid=18, OS id=5320 Fri Sep 23 03:01:04 2016CKPT started with pid=19, OS id=5322 Fri Sep 23 03:01:04 2016SMON started with pid=20, OS id=5324 Fri Sep 23 03:01:04 2016RECO started with pid=21, OS id=5326 Fri Sep 23 03:01:04 2016RBAL started with pid=22, OS id=5328 Fri Sep 23 03:01:04 2016ASMB started with pid=23, OS id=5330 Fri Sep 23 03:01:04 2016MMON started with pid=24, OS id=5332 Fri Sep 23 03:01:04 2016starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...Fri Sep 23 03:01:04 2016MMNL started with pid=25, OS id=5336 NOTE: initiating MARK startup starting up 1 shared server(s) ...Starting background process MARKFri Sep 23 03:01:04 2016MARK started with pid=27, OS id=5340 NOTE: MARK has subscribed lmon registered with NM - instance number 1 (internal mem no 0)Reconfiguration started (old inc 0, new inc 8)List of instances: 1 2 (myinst: 1) Global Resource Directory frozen* allocate domain 0, invalid = TRUE Communication channels reestablished * domain 0 valid according to instance 2 * domain 0 valid = 1 according to instance 2 Master broadcasted resource hash value bitmaps Non-local Process blocks cleaned out LMS 0: 0 GCS shadows cancelled, 0 closed, 0 Xw survived Set master node info Submitted all remote-enqueue requests Dwn-cvts replayed, VALBLKs dubious All grantable enqueues granted Submitted all GCS remote-cache requests Fix write in gcs resourcesReconfiguration completeFri Sep 23 03:01:05 2016LCK0 started with pid=30, OS id=5348 Starting background process RSMNFri Sep 23 03:01:05 2016RSMN started with pid=31, OS id=5350 ORACLE_BASE not set in environment. It is recommendedthat ORACLE_BASE be set in the environmentFri Sep 23 03:01:06 2016ALTER SYSTEM SET local_listener=' (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.133)(PORT=1521))' SCOPE=MEMORY SID='rone_1';ALTER DATABASE MOUNT /* db agent *//* {2:16649:255} */NOTE: Loaded library: System SUCCESS: diskgroup DATA was mountedNOTE: dependency between database rone and diskgroup resource ora.DATA.dg is establishedSUCCESS: diskgroup CRS was mountedNOTE: dependency between database rone and diskgroup resource ora.CRS.dg is establishedSuccessful mount of redo thread 1, with mount id 643541812Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)Lost write protection disabledCompleted: ALTER DATABASE MOUNT /* db agent *//* {2:16649:255} */ALTER DATABASE OPEN /* db agent *//* {2:16649:255} */Picked broadcast on commit scheme to generate SCNsFri Sep 23 03:01:14 2016Thread 1 opened at log sequence 4 Current log# 2 seq# 4 mem# 0: +DATA/rone/onlinelog/group_2.262.923215683 Current log# 2 seq# 4 mem# 1: +CRS/rone/onlinelog/group_2.258.923215687Successful open of redo thread 1MTTR advisory is disabled because FAST_START_MTTR_TARGET is not setFri Sep 23 03:01:14 2016SMON: enabling cache recovery[5352] Successfully onlined Undo Tablespace 2.Undo initialization finished serial:0 start:576094 end:576424 diff:330 (3 seconds)Verifying file header compatibility for 11g tablespace encryption..Verifying 11g file header compatibility for tablespace encryption completedSMON: enabling tx recoveryDatabase Characterset is AL32UTF8No Resource Manager plan activeFri Sep 23 03:01:16 2016Starting background process GTX0Fri Sep 23 03:01:16 2016GTX0 started with pid=34, OS id=5377 Starting background process RCBGFri Sep 23 03:01:16 2016RCBG started with pid=35, OS id=5379 replication_dependency_tracking turned off (no async multimaster replication found)Fri Sep 23 03:01:16 2016minact-scn: Inst 1 is a slave inc#:8 mmon proc-id:5332 status:0x2minact-scn status: grec-scn:0x0000.00000000 gmin-scn:0x0000.00000000 gcalc-scn:0x0000.00000000Starting background process QMNCFri Sep 23 03:01:16 2016QMNC started with pid=36, OS id=5381 Completed: ALTER DATABASE OPEN /* db agent *//* {2:16649:255} */Fri Sep 23 03:01:19 2016Starting background process CJQ0Fri Sep 23 03:01:19 2016CJQ0 started with pid=44, OS id=5418 Fri Sep 23 03:01:19 2016ALTER SYSTEM SET service_names='bbone' SCOPE=MEMORY SID='rone_1';minact-scn: Inst 1 is now the master inc#:8 mmon proc-id:5332 status:0x7minact-scn status: grec-scn:0x0000.00000000 gmin-scn:0x0000.00000000 gcalc-scn:0x0000.00000000minact-scn: Master returning as live inst:2 has inc# mismatch instinc:0 cur:8 errcnt:0Fri Sep 23 03:01:35 2016Reconfiguration started (old inc 8, new inc 10)List of instances: 1 (myinst: 1) Global Resource Directory frozen * dead instance detected - domain 0 invalid = TRUE Communication channels reestablished Master broadcasted resource hash value bitmaps Non-local Process blocks cleaned outFri Sep 23 03:01:35 2016 LMS 0: 0 GCS shadows cancelled, 0 closed, 0 Xw survived Set master node info Submitted all remote-enqueue requests Dwn-cvts replayed, VALBLKs dubious All grantable enqueues granted Post SMON to start 1st pass IR Submitted all GCS remote-cache requests Post SMON to start 1st pass IR Fix write in gcs resourcesReconfiguration completeFri Sep 23 03:01:35 2016Instance recovery: looking for dead threadsInstance recovery: lock domain invalid but no dead threads
命令说明:
Command: srvctl relocate database -d{[-n ] [-w ] | -a [-r]} [-v]-d Unique name of database to relocate-n Target node to which to relocate database-w Online relocation timeout in minutes-a Abort failed online relocation-r Remove target node of failed online relocation request from the candidate server list of administrator-managed RAC One Node database-v Verbose output-h Print usage