?? backup.txt
字號(hào):
--準(zhǔn)備
sql>conn zht/zht
select count(*) from user_tables;
SQL> select username,default_tablespace from user_users;
SQL> create tablespace ZHTTBS datafile '%ORACLE_BASE%\oraData\My9iDB\ZhtTBS1.dbf
' size 50M;
SQL> alter user zht default tablespace "ZHTTBS";
create table table1(c1 numeric(10,2));
insert into t1 values(1);
insert into t1 values(2);
select * from table1;
--冷備
select name from v$datafile;
select name from v$tempfile;
select member form v$logfile;
select name from v$controlfile;
SQL>shutdown immediate
!copy file1 to file2
copy *.* d:\Oracle\OraData\ColdBackup\;
SQL>startup
SQL> select group#,sequence#,status,first_change# from v$log;
declare
-- Local variables here
i integer;
begin
-- Test statements here
for i in 1..1000
loop
insert into table1 values(i);
end loop;
end;
--熱備
SQL> select group#,sequence#,status,first_change# from v$log;
truncate table table1;
select * from table1;
alter tablespace zhttbs begin backup;
select a.file#,b.name,a.status from v$backup a,v$datafile b
where a.file#=b.file#;
insert into table1 values(1);
copy
insert into table1 values(2);
alter tablespace zhttbs end backup;
insert into table1 values(3);
select group#,sequence#,status,first_change# from v$log;
select * from table1;
select a.file#,b.name,a.status from v$backup a,v$datafile b
where a.file#=b.file#;
alter system archive log current;
--備份控制文件
show parameter user_dump_dest;
alter database backup controlfile to trace;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -