oracle 10g 第三章 制定備份工作計劃表

zhengbao_jun發表於2009-02-16

制定備份工作計劃表

第3章
sql>create temporary tablespace temp2 tempfile 'c:\xxxxxxxx\xx.dbf' size 100m extent management local uniform. size 128k;

啟動丟失臨時檔案得資料庫
COMMAND>SQLPLUS /NOLOG
sql>connect / as sysdba
sql>startup mount
sql>drop tablespace temp including contents;
sql>create temporary tablespace temp2 tempfile 'c:\xxxxxxxx\xx.dbf' size 100m extent management local uniform. size 128k;

改變資料庫得預設臨時表空間
sql>alter database default temporary tablespace temp2;

重建重執行日誌檔案
。。。。
sql>alter database drop logfile member 'c:\oracle\oradata\ora101t\redo01.log';
sql>alter database add logfile member 'c:\oracle\oradata\ora101t\redo01.log' to group 1;

恢復索引表空間
SQLPLUS /NOLOG
sql>connect / as sysdba
sql>startup
sql>drop tablespace indexes including contents;
sql>create tablespace indexes datafile 'c:\oracle\oradata\ora1010t\index01.dbf' size 20m;

重建索引
CREATE UNIQUE INDEX example_index_pk
ON EXAMPLE_table
(column_one,
column_two,
column_three,
column_four)
PCTFREE 10
INITRANS 2
MAXTRANX 255
TABLESPACE indexes
STORAGE(
initial 1m
next 1m
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS 8192
)
NOLOGGING
PARALLEL (degree 4)
/
sql>@create_example_index_pk

恢復只讀表空軍
SQL>ALTER tablespace users read only;
sql>alter system switch logfile;
sql>alter system switch logfile;
sql>alter system switch logfile;
sql>alter system switch logfile;

sql>shutdown immediate
sql>host
   command> cd c:\oracle\oradata\backup\ora101t
   command>copy c:\oracle\oradata\ora101t\*

command cd ..\..\ora101t
command>delete users01.dbf

sql>startu

sql>shutdown immediate
sql>host
    command>cd c:\oracle\oradata\ora101t
    command>copy c:\oracle\oradata\backup\ora101t\users01.dbf users01.dbf
    command>exit

sql>startup

重建密碼檔案
SQL>SHUTDOWN IMMEDIATE
SQL>SELECT * FROM V$PWFILE_USERS;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/235507/viewspace-553408/,如需轉載,請註明出處,否則將追究法律責任。

相關文章