Microsoft Windows XP [版本 5.1.2600]
(C) 版權(quán)所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>conn sys/system@orcl;
'conn' 不是內(nèi)部或外部命令,也不是可運(yùn)行的程序
或批處理文件。
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 - Production on 星期六 6月 30 23:57:18 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> conn sys/system@orcl;
ERROR:
ORA-01017: invalid username/password; logon denied
SQL> conn sys/xiexie@orcl as sysdba;
已連接。
SQL> shutdow immediate
數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫(kù)。
ORACLE 例程已經(jīng)關(guān)閉。
SQL> startup mount;
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 535662592 bytes
Fixed Size 1334380 bytes
Variable Size 230687636 bytes
Database Buffers 297795584 bytes
Redo Buffers 5844992 bytes
數(shù)據(jù)庫(kù)裝載完畢。
SQL> alter database open
2 ;
數(shù)據(jù)庫(kù)已更改。
SQL> archive log list
數(shù)據(jù)庫(kù)日志模式 存檔模式
自動(dòng)存檔 啟用
存檔終點(diǎn) USE_DB_RECOVERY_FILE_DEST
最早的聯(lián)機(jī)日志序列 23
下一個(gè)存檔日志序列 25
當(dāng)前日志序列 25
SQL> show parameter db_recovery_file_dest;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string d:\app\Administrator\flash_rec
overy_area
db_recovery_file_dest_size big integer 2G
SQL> select sysdate from dual
2 ;
SYSDATE
--------------
01-7月 -12
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
會(huì)話已更改。
SQL> select sysdate from dual;
SYSDATE
-------------------
2012-07-01 00:01:40
SQL> set time on;
00:02:12 SQL> show user;
USER 為 "SYS"
00:02:20 SQL> select * from test_1;
NAME_TEST TEL
------------------------------ -----------
xie 13907756220
xie2 13907756220
xie3 13907756220
xie4 123
00:03:01 SQL> insert into test_1 values ('xie5','12345');
已創(chuàng)建 1 行。
00:03:29 SQL> commit;
提交完成。
00:04:34 SQL> select * from test_1;
NAME_TEST TEL
------------------------------ -----------
xie 13907756220
xie2 13907756220
xie3 13907756220
xie4 123
xie5 12345
00:04:40 SQL> shutdown immediate
數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫(kù)。
ORACLE 例程已經(jīng)關(guān)閉。
00:05:33 SQL> ;
1* select * from test_1
00:05:33 SQL> startup mount;
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 535662592 bytes
Fixed Size 1334380 bytes
Variable Size 230687636 bytes
Database Buffers 297795584 bytes
Redo Buffers 5844992 bytes
數(shù)據(jù)庫(kù)裝載完畢。
00:06:25 SQL> flashback database to timestamp(to_date('2012-07-01 00:02:20','yyy
y-mm-dd hh24:mi:ss'));
flashback database to timestamp(to_date('2012-07-01 00:02:20','yyyy-mm-dd hh24:m
i:ss'))
*
第 1 行出現(xiàn)錯(cuò)誤:
ORA-38726: 未啟用閃回?cái)?shù)據(jù)庫(kù)事件記錄。
00:09:05 SQL> alter database flashback on;
數(shù)據(jù)庫(kù)已更改。
00:10:20 SQL> archive log list;
數(shù)據(jù)庫(kù)日志模式 存檔模式
自動(dòng)存檔 啟用
存檔終點(diǎn) USE_DB_RECOVERY_FILE_DEST
最早的聯(lián)機(jī)日志序列 23
下一個(gè)存檔日志序列 25
當(dāng)前日志序列 25
00:10:26 SQL> select * from test_1;
select * from test_1
*
第 1 行出現(xiàn)錯(cuò)誤:
ORA-01219: 數(shù)據(jù)庫(kù)未打開(kāi): 僅允許在固定表/視圖中查詢
00:10:37 SQL> alter database open;
數(shù)據(jù)庫(kù)已更改。
00:11:33 SQL> select * from test_1;
NAME_TEST TEL
------------------------------ -----------
xie 13907756220
xie2 13907756220
xie3 13907756220
xie4 123
xie5 12345
00:12:08 SQL> commit;
提交完成。
00:12:17 SQL> insert into test_1 values('xie6','123');
已創(chuàng)建 1 行。
00:12:39 SQL> shutdown immediate;
ORA-01097: 無(wú)法在事務(wù)處理過(guò)程中關(guān)閉 - 請(qǐng)首先提交或回退
00:12:55 SQL> commit;
提交完成。
00:13:04 SQL> shutdown immediate;
數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫(kù)。
ORACLE 例程已經(jīng)關(guān)閉。
00:13:21 SQL> startup mount;
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 535662592 bytes
Fixed Size 1334380 bytes
Variable Size 230687636 bytes
Database Buffers 297795584 bytes
Redo Buffers 5844992 bytes
數(shù)據(jù)庫(kù)裝載完畢。
00:13:45 SQL> flashback database to timestamp(to_date('2012-07-01 00:02:20','yyy
y-mm-dd hh24:mi:ss'));
flashback database to timestamp(to_date('2012-07-01 00:02:20','yyyy-mm-dd hh24:m
i:ss'))
*
第 1 行出現(xiàn)錯(cuò)誤:
ORA-38729: 執(zhí)行 FLASHBACK 的閃回?cái)?shù)據(jù)庫(kù)日志數(shù)據(jù)不足。
00:15:03 SQL> select * from test_1;
select * from test_1
*
第 1 行出現(xiàn)錯(cuò)誤:
ORA-01219: 數(shù)據(jù)庫(kù)未打開(kāi): 僅允許在固定表/視圖中查詢
00:15:38 SQL> alter database open;
數(shù)據(jù)庫(kù)已更改。
00:16:25 SQL> select * from test_1;
NAME_TEST TEL
------------------------------ -----------
xie 13907756220
xie2 13907756220
xie3 13907756220
xie4 123
xie5 12345
xie6 123
已選擇6行。
00:16:30 SQL> shutdown immediate;
數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫(kù)。
ORACLE 例程已經(jīng)關(guān)閉。
00:16:58 SQL> startup mount;
ORACLE 例程已經(jīng)啟動(dòng)。
Total System Global Area 535662592 bytes
Fixed Size 1334380 bytes
Variable Size 230687636 bytes
Database Buffers 297795584 bytes
Redo Buffers 5844992 bytes
數(shù)據(jù)庫(kù)裝載完畢。
00:17:25 SQL> flashback database to timestamp(to_date('2012-07-01 00:11:33','yyy
y-mm-dd hh24:mi:ss'));
閃回完成。
00:17:53 SQL> alter database open;
alter database open
*
第 1 行出現(xiàn)錯(cuò)誤:
ORA-01589: 要打開(kāi)數(shù)據(jù)庫(kù)則必須使用 RESETLOGS 或 NORESETLOGS 選項(xiàng)
00:18:06 SQL> alter database open resetlogs;
數(shù)據(jù)庫(kù)已更改。
00:19:22 SQL> select * from test_1;
NAME_TEST TEL
------------------------------ -----------
xie 13907756220
xie2 13907756220
xie3 13907756220
xie4 123
xie5 12345
00:19:42 SQL>