`
hunxiejun
  • 浏览: 1146127 次
文章分类
社区版块
存档分类
最新评论

How do I rename a data file

 
阅读更多

在论坛看到一个帖子,说是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-->
分享到:
评论

相关推荐

    go系统编程(英文版)

    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 ...

    edjpgcom|图片中插入一句话

    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 ...

    VB编程资源大全(英文源码 文件)

    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."&lt;END&gt;&lt;br&gt;8 , cpyfile.zip This ...

    VB编程资源大全(英文源码 网络)

    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 ...

    VclZip pro v3.10.1

    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 ...

    Automate.the.Boring.Stuff.with.Python.Practical.Programming

    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 ...

    apktool documentation

    Automatically detects differences between resource and manifest and performs automatic --rename-manifest-package on [b]uild versionInfo - Used to repopulate the version information in ...

    Senfore_DragDrop_v4.1

    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 ...

    VB编程资源大全(英文控件)

    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&lt;END&gt;&lt;br&gt;66,SysBacUpDemo.zip This Is A ...

    Aria2135032bit.7z

    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...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    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 ...

    ICS delphixe10源码版

    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...

    端口查看工具

    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 ...

    The Art of Assembly Language Programming

    Some Final Comments on the MOV Instructions &lt;br&gt;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 ...

    matlab图形界面设计(英文原版)

    Where Do I Start? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 Ways to Build MATLAB GUIs . . . . . . . . . . . . . . . . . . . . . . . 1-8 Creating a Simple GUI with GUIDE 2...

    PHP基础教程 是一个比较有价值的PHP新手教程!

    $a xor $b :异或 (当$a或$b为true时为true,两者一样时为false) ! $a :非 比较运算符有: $a == $b :相等 $a != $b :不等 $a $b :小于 $a $b :小于等于 $a &gt; $b :大于 $a &gt;= $b :大于等于 与C一样PHP也有...

    DebuggingWithGDB 6.8-2008

    4.11.1 A Non-obvious Benefit of Using Checkpoints . . . . . . . . . . . . 5 25 26 28 28 29 29 30 31 31 34 36 37 Stopping and Continuing . . . . . . . . . . . . . . . . . . 39 5.1 Breakpoints, ...

    Debugging with GDB --2003年6.0

    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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    最新版的DebuggingWithGDB7.05-2010

    4.12.1 A Non-obvious Benefit of Using Checkpoints . . . . . . . . . . . . . 25 25 28 29 30 30 31 32 32 35 38 40 41 ii 5 Debugging with gdb Stopping and Continuing . . . . . . . . . . . . . . . . . . ....

    ORACLE OSB开发指南

    Generating a JCA Business Service from an Outbound JCA File ............................................ 2-12 Generating a Business Service from Oracle Enterprise Repository..............................

Global site tag (gtag.js) - Google Analytics