網誌標籤
.NET Framework
(5)
文字編碼
(4)
防毒軟體
(1)
其他
(11)
資料庫
(25)
攝影
(2)
ADO.NET Entity Framework
(2)
ASP.NET
(49)
ASP.NET MVC
(4)
ASP.NET Test
(4)
CSS
(1)
Design Patten
(1)
FCKEditor
(3)
HTML
(2)
HTML5
(1)
hyper-v
(1)
IIS
(6)
JavaScript
(9)
JQuery
(1)
LINQ
(2)
MailTo編碼
(2)
oracle
(6)
RegularExpression
(1)
Rhino Mocks
(1)
Security
(2)
Server2008R2
(1)
SharePoint
(5)
Sql 2008
(1)
SSIS
(1)
SyntaxHighlighter
(1)
TFS2010
(1)
VirtualBox
(1)
VistualStudio2010
(3)
vs2003升級vs2008
(1)
windows
(1)
windows 7
(1)
oracle備份還原
《 備 份 》
<1>cmd視窗使用sysdba連上oracle
C:\> sqlplus "sys/bankpro@oracle9i as sysdba"
<2>將oracle資料庫關閉
SQL> shutdown normal;
<3>將oracle資料庫資料複製一份 ( 預設於oradata內,如oracle9i資料夾 )
《 還 原 》
<1>cmd視窗使用sysdba連上oracle
C:\> sqlplus "sys/bankpro@oracle9i as sysdba"
<2>將oracle資料庫關閉
SQL> shutdown normal;
<3>複製備份檔案至oracle資料夾中
<4>開啟oracle資料庫至nomount模式
SQL> startup nomount;
<5>提升資料庫至mount模式
SQL> alter database mount;
<6>修改資料庫檔案掛載位置
SQL>
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\CWMLITE01.DBF' TO C:\ORACLE\ORADATA\ORACLE9I\CWMLITE01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\DRSYS01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\DRSYS01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\EXAMPLE01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\EXAMPLE01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\EXCHANGE.ORA' TO 'C:\ORACLE\ORADATA\ORACLE9I\EXCHANGE.ORA';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\HIS.ORA' TO 'C:\ORACLE\ORADATA\ORACLE9I\HIS.ORA';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\INDX01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\INDX01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\INVOICE.ORA' TO 'C:\ORACLE\ORADATA\ORACLE9I\INVOICE.ORA';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\ODM01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\ODM01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\TOOLS01.DBF' TO C:\ORACLE\ORADATA\ORACLE9I\TOOLS01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\UNDOTBS01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\UNDOTBS01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\USERS01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\USERS01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\XDB01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\XDB01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\SYSTEM01.DBF' TO 'C:\ORACLE\ORADATA\ORACLE9I\SYSTEM01.DBF';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\REDO01.LOG' TO 'C:\ORACLE\ORADATA\ORACLE9I\REDO01.LOG';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\REDO02.LOG' TO 'C:\ORACLE\ORADATA\ORACLE9I\REDO02.LOG';
alter database rename file 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\REDO03.LOG' TO 'C:\ORACLE\ORADATA\ORACLE9I\REDO03.LOG';
也可將上方Script製作成一個如Restore.txt的文字檔
再利用sqlplus執行:
SQL> start c:\Restore.txt;
即可批次執行指令!!
<7>提升資料庫至open模式
alter database open;
<8>重新建立Temp檔
alter database tempfile 'E:\DANNYTEAM\DB\ORACLE\ORADATA\ORACLE9I\TEMP01.DBF' DROP;
alter tablespace temp add tempfile 'C:\ORACLE\ORADATA\ORACLE9I\TEMP01.DBF' SIZE 40m reuse;
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言