非关键性数据文件丢失(可以脱机数据文件的丢失): run{sql alter database datafile offline;restore datafile ;recover datafile ;slq alter database datafile online;} 除了system、undo_tablespace参数后值对应的表空间都可以采用以上的办法恢复。 [oracl
非关键性数据文件丢失(可以脱机数据文件的丢失):run{ sql 'alter database datafile <> offline'; restore datafile <>; recover datafile <>; slq 'alter database datafile <> online'; }
除了system、undo_tablespace参数后值对应的表空间都可以采用以上的办法恢复。
[oracle@oracle ~]$ ls /u01/oracle/oradata/jadl10g/ control01.ctl control03.ctl redo01.log redo03.log system01.dbf undotbs01.dbf control02.ctl example01.dbf redo02.log sysaux01.dbf temp01.dbf users01.dbf [oracle@oracle ~]$ rm /u01/oracle/oradata/jadl10g/example01.dbf [oracle@oracle ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 15:23:57 2014 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options SQL> select * from hr.employees; select * from hr.employees * ERROR at line 1: ORA-01116: error in opening database file 5 ORA-01110: data file 5: '/u01/oracle/oradata/jadl10g/example01.dbf' ORA-27041: unable to open file Linux-x86_64 Error: 2: No such file or directory Additional information: 3 [oracle@oracle ~]$ vi /tmp/1.rman
创建一个恢复的脚本:
[oracle@oracle ~]$ cat /tmp/1.rman run{ sql 'alter database datafile 5 offline'; restore datafile 5; recover datafile 5; sql 'alter database datafile 5 online'; }
rman利用建立的脚本恢复数据库的数据:
[oracle@oracle ~]$ rman target / cmdfile=/tmp/1.rman Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 15:29:28 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: JADL10G (DBID=2011530396) RMAN> run{ 2> sql 'alter database datafile 5 offline'; 3> restore datafile 5; 4> recover datafile 5; 5> sql 'alter database datafile 5 online'; 6> } 7> using target database control f【本文来自鸿网互联 (http://www.68idc.cn)】ile instead of recovery catalog sql statement: alter database datafile 5 offline Starting restore at 06-NOV-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=159 devtype=DISK channel ORA_DISK_1: starting datafile backupset restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00005 to /u01/oracle/oradata/jadl10g/example01.dbf channel ORA_DISK_1: reading from backup piece /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T135107_b5p32dhf_.bkp channel ORA_DISK_1: restored backup piece 1 piece handle=/u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_nnndf_TAG20141106T135107_b5p32dhf_.bkp tag=TAG20141106T135107 channel ORA_DISK_1: restore complete, elapsed time: 00:00:07 Finished restore at 06-NOV-14 Starting recover at 06-NOV-14 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:00 Finished recover at 06-NOV-14 sql statement: alter database datafile 5 online Recovery Manager complete.
此时执行查询就不会出现错误了。
system/example 都丢失该如何处理?
shutdowm abort
restore datafile 1,5;
recover database;
alter database open;
这样操作后,不需要重新备份数据库 ,以前的备份是有效的。
恢复映像副本
RMAN> backup as copy datafile 5; Starting backup at 06-NOV-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=159 devtype=DISK channel ORA_DISK_1: starting datafile copy input datafile fno=00005 name=/u01/oracle/oradata/jadl10g/example01.dbf output filename=/u01/oracle/flash_recovery_area/JADL10G/datafile/o1_mf_example_b5pbo2pc_.dbf tag=TAG20141106T160034 recid=10 stamp=862934437 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 Finished backup at 06-NOV-14 RMAN> recover copy of datafile 5; ---改命令就是对上面的数据文件做增量的修改, Starting recover at 06-NOV-14 using channel ORA_DISK_1 no copy of datafile 5 found to recover Finished recover at 06-NOV-14
数据文件从一个路径迁移到新的路径
数据文件从文件系统到ASM
数据文件从ASM到文件系统
实施以上需求的办法:
set newname for datafile '...' to '...';
restore ...
switch datafile all;
recover ....
将数据文件迁移到ASM:
SQL> select name from v$asm_diskgroup; vi a.rman run{ sql 'alter tablespace a1 offline immediate'; set newname for datafile 7 to '+DB'; restore datafile 7; switch datafile all; ---交换文件 recover datafile 7; slq 'alter tablespace a1 online'; }
在rman执行该脚本;
12c是比较特殊的:
alter database datafile 13 move '/u01/......';----移动到新的路径

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1
Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
