在论坛看到一个帖子,说是renamedatafile报错了,第一感觉他的语法有问题,也很少用这个命令,就google了一下,发现语法没有问题,可能他的操作顺序有问题。因为rename的时候数据文件必须是offline的,或者数据库是mount状态。
在仔细想了想,以前也整理过一篇rename的文章,不过那篇blog的标题是移动数据文件,和今天的这篇的唯一区别就是在Rename的同时还改了下路径。还有就是这篇是英文的,就当练习一下英语吧。
Oracle移动数据文件的操作方法
http://blog.csdn.net/tianlesoftware/archive/2009/11/30/4899172.aspx
以下内容引自网络:
Datafilescanbemovedorrenamedusingoneoftwomethods:alterdatabaseoraltertablespace.
ThemaindifferencebetweenthemisthataltertablespaceonlyappliestodatafilesthatdonotcontaintheSYSTEMtablespace,activerollbacksegments,ortemporarysegments,buttheprocedurecanbeperformedwhiletheinstanceisstillrunning.Thealterdatabasemethodworksforanydatafile,buttheinstancemustbeshutdown.
1.Thealterdatabasemethod:
1.Shutdowntheinstance.
2.Renameand/ormovethedatafileusingoperatingsystemcommands.
3.Mountthedatabaseandusealterdatabasetorenamethefilewithinthedatabase.Afullyqualifiedfilenameisrequiredinthesyntaxofyouroperatingsystem.Forexampletorenameafilecalled'data01.dbf'to'data04.dbf'andmoveittoanewlocationatthesametime(atthispointintheexampletheinstancehasbeenshutdown)and;
4.Starttheinstance.
SVRMGR>connectsys/oracleassysdba;
SVRMGR>startupmountU1;
SVRMGR>alterdatabaserenamefile'/u01/oracle/U1/data01.dbf'TO'/u02/oracle/U1/data04.dbf';
SVRMGR>alterdatabaseopen;
Noticethesinglequotesaroundthefullyqualifiedfilenamesandremember,thefilesmustexistatthesourceanddestinationpaths.Theinstanceisnowopenusingthenewlocationandnameforthedatafile.
2.Thealtertablespacemethod:
Thismethodhastheadvantagethatitdoesn'trequireshuttingdowntheinstance,butitonlyworkswithnon-SYSTEMtablespaces.Further,itcan'tbeusedfortablespacesthatcontainactiverollbacksegmentsortemporarysegments.
1.Takethetablespaceoffline.
2.Renameand/ormovethedatafileusingoperatingsystemcommands.
3.Usethealtertablespacecommandtorenamethefileinthedatabase.
4.Bringthetablespacebackonline.
SVRMGR>connectsys/oracleassysdba
SVRMGR>altertablespaceapp_dataoffline;
SVRMGR>altertablespaceapp_daterenamedatafile'/u01/oracle/U1/data01.dbf'TO'/u02/oracle/U1/data04.dbf';
SVRMGR>altertablespaceapp_dataonline;
Thetablespacewillbebackonlineusingthenewnameand/orlocationofthedatafile.
BothofthesemethodologiescanbeusedwithinOracleEnterpriseManageralso.
<!--EndFragment-->
分享到:
相关推荐
Chapter 6, File Input and Output, shows you how to read the contents of a file, how to change them, and how to write your own data to files! In this chapter, you will learn about the io package, the ...
add) a JPEG commment in a JPEG file. That's all it does. All other fields in a JFIF or Exif file are left untouched. It even keeps the filesystem timestamp! It's based on the rdjpgcom and wrjpgcom ...
Write any that do not contain the target into a temporary file. Use Kill to remove the original file and then use Name to give the temporary file the old file name."<END><br>8 , cpyfile.zip This ...
It is a complete FTP client that allows you to browse FTP directories, 下载 and upload files, resume broken file transfer, create and remove directories, delete and rename files. All the operations ...
Use this with care as this is still somewhat experimental and I'm not sure how useful it is yet. You must make all changes within the buffer sent in to you. Treat the entire file as a stream. Byte ...
Search for text in a file or across multiple files Create, update, move, and rename files and folders Search the Web and download online content Update and format data in Excel spreadsheets of any ...
Automatically detects differences between resource and manifest and performs automatic --rename-manifest-package on [b]uild versionInfo - Used to repopulate the version information in ...
- **Return Values:** Discussion on return values and how functions can return data back to the calling code. - **Anonymous Functions:** Introduction to anonymous functions (closures) and their usage ...
If I need a compiled version I will ask for it. If you feel you need to send me a screen shot, please send it in GIF or PNG format. If you mail a bug report to me, please include the words "Drag ...
HLiteDemo.zip Hlite.Ocx When Placed On A Form And Called From A Textbox When It Has Focus It Will Highlight The Text Very Usefull In Data Entry Application<END><br>66,SysBacUpDemo.zip This Is A ...
Using Metalink's chunk checksums, aria2 automatically validates chunks of data while downloading a file like BitTorrent. The project page is located at https://aria2.github.io/. See aria2 On...
Registry compaction and also the option to rename a computer (which results in a change of both NetBIOS and DNS names). Version 3.02 corrects a bug where NewSid would not correctly copy default ...
Do not use an envelop, I collect USED postcards sent to me. Write on the postcard that it is your ICS registration. Address your card to: Francois PIETTE, rue de Grady 24, 4053 Embourg, Belgium. Don...
Some Final Comments on the MOV Instructions <br>4.9 Laboratory ...File 4.9.4 Assembling Your Code with MASM 4.9.5 Debuggers and CodeView' 4.9.5.1 A Quick Look at CodeView 4.9.5.2 The ...
o Fixed the problem with sending the data to stdout (when the filename is empty string). * Version 1.93: o Updated the internal country names (added more 14 countries) that are used for ...
$a xor $b :异或 (当$a或$b为true时为true,两者一样时为false) ! $a :非 比较运算符有: $a == $b :相等 $a != $b :不等 $a $b :小于 $a $b :小于等于 $a > $b :大于 $a >= $b :大于等于 与C一样PHP也有...
excel_file1 = pd.read_excel('data/测试.xlsx', encoding='utf-8') ``` 如果你需要指定特定的工作表,可以使用`sheet_name`参数,它可以是工作表的名称或其索引(从0开始): ```python excel_file1 = pd.read_...
wb_out.SaveAs str_new_file_path, xlCSV ' create a csv file Set sht_out = wb_out.Worksheets("CNUM_COMPANY_OUTPUT") Set dict_cnum_company = CreateObject("Scripting.Dictionary") ' ...后续代码省略... ...
Examining Data . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 8.11 8.12 8.13 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...