SQL> startup
ORACLE 例程已經啟動
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
ORA
SQL> alter database open;
數據庫已更改
SQL> create table arch
表已創建
SQL> alter system switch logfile;
系統已更改
SQL> insert into arch
已創建
SQL> commit;
提交完成
SQL> insert into arch
已創建
SQL> /
已創建
SQL> /
已創建
SQL> /
已創建
SQL> commit;
提交完成
SQL> alter system switch logfile;
系統已更改
SQL> commit;
提交完成
SQL> select GROUP#
GROUP# SEQUENCE# ARC STATUS
SQL> alter database backup controlfile to
數據庫已更改
SQL> select count(*) from arch
COUNT(*)
SQL> select to_char(sysdate
TO_CHAR(SYSDATE
alter system switch logfile;
系統已更改
SQL> drop table arch
表已丟棄
SQL> create table salgrade (grade number
表已創建
SQL> select owner
OWNER NAME
TABLESPACE_NAME TO_CHAR(CREATION_TI
SYS SALGRADE
USERS
SQL> alter tablespace users offline for recover;
表空間已更改
~~~~~~~~~~~~~~~~
克隆數據庫
~~~~~~~~~~~~~~~~
oradim
set oracle_sid=clone
創建初始化文件initCLONE
增加*
注意db_name跟主數據庫一樣
歸檔路徑也可以一樣
SQL> create pfile=
文件已創建
shutdown
set ORACLE_SID=CLONE
C:\Documents and Settings\lifeng
SQL*Plus: Release
Copyright (c)
已連接到空閒例程
SQL> startup nomount pfile=
ORACLE 例程已經啟動
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
SQL> alter database mount clone database;
SQL> select name from v$datafile;
NAME
C:\ORACLE\ORADATA\TESTDB\SYSTEM
C:\ORACLE\ORADATA\TESTDB\UNDOTBS
C:\ORACLE\ORADATA\TESTDB\INDX
C:\ORACLE\ORADATA\TESTDB\TOOLS
C:\ORACLE\ORADATA\TESTDB\USERS
SQL> alter database rename file
數據庫已更改
SQL> alter database rename file
數據庫已更改
SQL> alter database rename file
數據庫已更改
SQL> alter database rename file
數據庫已更改
SQL> alter database rename file
數據庫已更改
SQL>
SQL>
SQL> alter database datafile
數據庫已更改
SQL> alter database datafile
數據庫已更改
SQL> alter database datafile
數據庫已更改
SQL> alter database datafile
數據庫已更改
SQL> alter database datafile
數據庫已更改
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL TIME
ORA
ORA
ORA
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
ORA
ORA
ORA
ORA
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
ORA
ORA
ORA
ORA
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
已應用的日志
完成介質恢復
在clone庫exp該表空間
exp SYS/clone TRANSPORT_TABLESPACE=y TABLESPACES=(users) TTS_FULL_CHECK=y file=expat
在主數據庫中
DROP TABLESPACE users INCLUDING CONTENTS;
在主庫
imp TRANSPORT_TABLESPACE=y FILE=expat
DATAFILES=(
From:http://tw.wingwit.com/Article/program/Oracle/201311/16580.html