Rac creates data files in areas not shared

Source: Internet
Author: User

Rac creates a data file in a non-shared location. oracle 11g 11.2.0.1linux server 64-bit 5.4 node1: Creates a data file '/tmp/rman. dbf' is not stored in the shared disk. Then, a table casd is created and data is added. In this case, the following error is returned when the casd information can be queried on node1 and then queried on node2: SQL> select * from casd; select * from casd * ERROR at line 1: ORA-01157: cannot identify/lock data file 7-see DBWR trace fileORA-01110: data file 7: '/tmp/rman. dbf' and view the trace file: [oracle @ rac2 ~] $ Cat/u01/diag/rdbms/racdb/racdb2/trace/racdb2_ora_661_trctrace file/u01/diag/rdbms/racdb/racdb2/trace/explain Database 11g Enterprise Edition Release 11.2.0.1.0-64bit productionWith the Partitioning, real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing optionsORACLE_HOME =/u01/app/oracleSystem name: LinuxNode name: rac2.loca LdomainRelease: 2.6.18-164. el5Version: #1 SMP Tue Aug 18 15:51:48 EDT 2009 Machine: x86_64Instance name: racdb2Redo thread mounted by this instance: 2 Oracle process number: 42 Unix process pid: 6620, image: oracle@rac2.localdomain (TNS V1-V3) *** 16:05:24. 915 *** session id: (49.6) 16:05:24. 915 *** client id :() 16:05:24. 915 *** service name :( SYS $ USERS) 4.915 *** module name :( sqlplus@rac2.localdomain (TNS V1-V3) 16:05:24. 915 *** action name :() 16:05:24. 915 DDE rules only execution for: ORA 1110 ----- START Event Driven Actions Dump -------- END Event Driven Actions Dump ------- start dde Actions Dump ----- Executing SYNC actions ----- start dde Action: 'db _ STRUCTURE_INTEGRITY_CHECK '(Async) ----- Successfully dispatched ----- EN D dde Action: 'db _ STRUCTURE_INTEGRITY_CHECK '(SUCCESS, 1 csec) ----- Executing ASYNC actions ----- end dde Actions Dump (total 1 csec) ----- *** 16:06:10. 952DDE: Problem Key 'ora 1110 'was flood controlled (0x1) (no incident) ORA-01110: data file 7:'/tmp/rman. dbf '*** 16:06:33. 733DDE rules only execution for: ORA 1110 ----- START Event Driven Actions Dump -------- END Event Driv En Actions Dump --------- start dde Actions Dump ----- Executing SYNC actions ----- start dde Action: 'db _ STRUCTURE_INTEGRITY_CHECK '(Async) ----- Successfully dispatched ----- end dde Action: 'db _ STRUCTURE_INTEGRITY_CHECK '(SUCCESS, 0 csec) ----- Executing ASYNC actions ----- end dde Actions Dump (total 0 csec) ----- *** 2013-04-25 16:06:45. 051DDE: Problem Key 'ora 1110 'was flood controlled (0x1) (no Incident) ORA-01110: data file 7: '/tmp/rman. dbf '*** 16:07:23. 495DDE: Problem Key 'ora 1110 'was flood controlled (0x1) (no incident) ORA-01110: data file 7:'/tmp/rman. dbf' solution 1: Use the asmcmd cp file to the shared disk, and then perform the following rename procedure: (I encountered an error in the environment when installing rac. Please forgive me) to use asmcmd, ensure that the variables are correct: node1: [oracle @ rac1 ~] $ Export ORACLE_HOME =/u01/oracle/grid [oracle @ rac1 ~] $ Export ORACLE_SID = + ASM1 [oracle @ rac1 ~] $ Asmcmd ASMCMD> cd + DATA/racdb/datafileASMCMD> lssysaux.260.812747931system. commands> ASMCMD> ad -- enter a command to prompt the commands: -------- md_backup, md_restore lsattr, setattr cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias mkdir, pwd, rm, rmalias chdg, chkdg, dropdg, iostat, lsdsk, lsod, mk Dg, mount offline, online, rebal, remap, umount dsget, dsset, lsop, shutdown, spbackup, spcopy, spget spmove, spset, startup chtmpl, lstmpl, mktmpl, rmtmpl chgrp, chmod, chown, groups, kgmod, lsgrp, wlc, lsusr mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr volcreate, voldelete, voldisable, volenable, volinfo volresize, volset, volstat ASMCMD> cp/tmp/rman. dbf + DATA/racdb/datafile/rman. dbf -- Start copying Bay copying/tmp/rman. dbf-> + DATA/racdb/datafile/rman. dbfASMCMD> cd + DATA/racdb/datafileASMCMD> lsSYSAUX.260.810947931SYSTEM. then exit and use sqlplus to change [oracle @ rac1 tmp] $ sqlplus/as sysdba SQL * Plus: Release 11.2.0.1.0 Production on Thu Apr 25 16:40:28 2013 Copyright (c) 1982,200 9, Oracle. all rights Reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, data Mining and Real Application Testing options SQL> ALTER DATABASE RENAME FILE '/tmp/rman. dbf 'to' + DATA/racdb/datafile/rman. dbf'; alter database rename file '/tmp/rman. dbf 'to' + DATA/racdb/datafile/rman. db F '* ERROR at line 1: ORA-01511: error in renaming log/data filesORA-01121: cannot rename database file 7-file is in use or recoveryORA-01110: data file 7: '/tmp/rman. dbf 'SQL> SQL> alter datafile'/tmp/rman. dbf 'offline; -- this is not an archive mode, so you cannot directly use offlinealter datafile'/tmp/rman. dbf 'offline * ERROR at line 1: ORA-00940: invalid ALTER command SQL> alter database datafile'/tmp/rman. dbf 'offline drop; -- make Use offline drop Database altered. SQL> ALTER DATABASE RENAME FILE '/tmp/rman. dbf 'to' + DATA/racdb/datafile/rman. dbf'; -- change Database altered again. SQL> alter database datafile '+ DATA/racdb/datafile/rman. dbf 'Online; -- direct online will report an error (because scn is not the current one) alter database datafile '+ DATA/racdb/datafile/rman. dbf 'Online * ERROR at line 1: ORA-01113: file 7 needs media recoveryORA-01110: data file 7: '+ DATA/racdb/data File/rman. dbf 'SQL> recover database datafile 7; -- the author remembers the wrong command ORA-00274: illegal recovery option datafile SQL> recover datafile 7; -- Restore Media recovery complete using Media. SQL> alter database datafile '+ DATA/racdb/datafile/rman. dbf'online; -- this online operation succeeded Database altered. SQL> select * from casd -- Data Query succeeded 2; ID NAME ---------- ------------------ 1 cc then go to node 2 for query: [oracle @ rac2 ~] $ Sqlplus/as sysdba SQL * Plus: Release 11.2.0.1.0 Production on Thu Apr 25 16:53:46 2013 Copyright (c) 1982,200 9, Oracle. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, data Mining and Real Application Testing options SQL> select * from casd; ID NAME- --------- -------------------- 1 cc OK !!! 2. Use rman to restore 1. Note that you must use rman to back up data files in archive mode. Otherwise, the following message is displayed during backup: RMAN> backup datafile 7; starting backup at 25-APR-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID = 56 instance = racdb1 device type = DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setRMAN-00571: ======================== ======================================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/25/2013 17: 03: 37ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode, then mount and alter database archivelog; the result is: SQL> alter data Base archivelog; alter database archivelog * ERROR at line 1: ORA-01126: database must be mounted in this instance and not open in anyinstance and return to node2 to stop the instance, then return to node1SQL> alter database archivelog; Database altered. then run backup [oracle @ rac1 tmp] $ rman target/Recovery Manager: Release 11.2.0.1.0-Production on Thu Apr 25 17:10:23 2013 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rig Hts reserved. connected to target database: RACDB (DBID = 808564626, not open) -- Here I am connected in the mount state, of course, you can also open the State RMAN> backup datafile 7; starting backup at least target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID = 35 instance = racdb1 device type = DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifydata File (s) in backup setinput datafile file number = 00007 name =/tmp/rman. dbfchannel ORA_DISK_1: starting piece 1 at 25-APR-13channel ORA_DISK_1: finished piece 1 at 25-APR-13piece handle =/u01/app/oracle/dbs/sort tag = comment = NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00: 00: 01 Finished backup at 25-APR-13 RMAN> list backup; List of Backup Sets ============== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 17.67 m disk 00:00:16 25-APR-13 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: tag20130316t162944 Piece Name:/u01/app/oracle/dbs/02o7vpbo_1_1 Control File supported ded: Ckp SCN: 1987592 Ckp time: 25-APR-13 BS Key Type LV Size Device Type Elapsed Time Completion Time -- ----- ---- -- ---------- ----------- ------------ --------------- 2 Full 1.10 m disk 00:00:01 25-APR-13 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: tag20130417t171035 Piece Name: /u01/app/oracle/dbs/05o7vrob_1_1 List of Datafiles in backup set 2 File LV Type Ckp SCN Ckp Time Name ---- ------------ ------- ---- 7 Full 1991004 25-APR-13/tmp/rman. dbf [oracle @ rac1 tmp] $ sqlplus/as sysdba SQL * Plus: Release 11.2.0.1.0 Production on Thu Apr 25 17:11:39 2013 Copyright (c) 1982,200 9, Oracle. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> alter database open; database altered. SQL>! Mv/tmp/rman. dbf/tmp/rman. dbf. bak SQL> select * from rman; ID NAME ---------- 1 ccSQL> alter system flush buffer_cache; System altered. SQL> select * from rman; select * from rman * ERROR at line 1: ORA-01116: error in opening database file 7ORA-01110: data file 7: '/tmp/rman. dbf 'ora-27041: unable to open fileLinux-x86_64 Error: 2: No such file or directoryAdditional information: 3 [oracle @ rac1 tmp] $ rman target/RMAN> run {2> set newname for datafile '/tmp/rman. dbf 'to' + DATA/racdb/datafile/rman. dbf'; 3> restore datafile 7; 4> switch datafile 7; 5> recover datafile 7; 6 >} executing command: set newname Starting restore at least target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID = 50 instance = racdb1 device type = DISK channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile (s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00007 to + DATA/racdb/datafile/rman. dbfchannel ORA_DISK_1: reading from backup piece/u01/app/oracle/dbs/05o7vrob_1_1channel ORA_DISK_1: piece handle =/u01/app/oracle/dbs/05o7vrob_1_1 tag = tag201301_t171035channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00: 00: 03 Finished restore at 25-APR-13 RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03009: failure of switch command on default channel at 04/25/2013 17: 19: 13ORA-19623: file 7 is open at this time, I use sqlplus: SQL> alter database datafile '/tmp/rman. dbf 'offline drop; then: RMAN> run {2> set newname for datafile'/tmp/rman. dbf 'to' + DATA/racdb/datafile/rman. dbf'; 3> restore datafile 7; 4> switch datafile 7; 5> recover datafile 7; 6 >} executing command: set newname Starting restore at 25-APR-13using channel ORA_DISK_1 datafile 7 is already restored to file + DATA/racdb/datafile/rman. dbfrestore not done; all files read only, offline, or already restoredFinished restore at 25-APR-13 datafile 7 switched to datafile copyinput datafile copy RECID = 4 STAMP = 813691325 file name = + DATA/racdb/datafile/rman. dbf Starting recover at 25-APR-13using channel ORA_DISK_1 starting media recoverymedia recovery complete, elapsed time: 00:00:02 Finished recover at 25-APR-13 Node 1: SQL> select * from rman; ID NAME ---------- -------- 1 cc Node 2: SQL> select * from rman; ID NAME ---------- 1 ccOK, complete .........

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.