交谈中请勿轻信汇款、中奖信息、陌生电话,勿使用外挂软件。
676822674(676822674) 2012/9/9 9:32:47
ip地址查看
su - root
root
ifconfig
启动oracle
su - oracle
oracle
lsnrctl start
export ORACLE_SID=+ASM
sqlplus / as sysasm
startup
export ORACLE_SID=orclasm
sqlplus / as sysdba
startup
emctl start dbconsole
676822674(676822674) 2012/9/9 9:37:52
rman target /
restore database validate;
restore controlfile validate;
restore archivelog from time "to_date('20120908 102544','yyyymmdd hh24miss')" until time 'sysdate' validate;
676822674(676822674) 2012/9/9 9:48:55
mkdir -p /oracle/oraclebak/orclasm/
[oracle@localhost oraclebak]$ cd /oracle/oraclebak/orclasm/
vi rmanbaklevel0.sh
export ORACLE_HOME=/oracle/product/11.1.0/db_1
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
export ORACLE_SID=orclasm
$ORACLE_HOME/bin/rman target / nocatalog cmdfile=/oracle/oraclebak/orclasm/rmanbaklevel0.sql log=/oracle/oraclebak/orclasm/rmanbaklevel0.log append
改变文件的属性,使之变成可执行文件
chmod +x rmanbaklevel0.sh
vi rmanbaklevel0.sql
run {
BACKUP
incremental level=0
SKIP INACCESSIBLE
FILESPERSET 10
# recommended format
FORMAT '/oracle/oraclebak/orclasm/diskdb0_T.%T_s.%s_d.%d'
DATABASE;
sql 'alter system archive log current';
BACKUP
incremental level=0
filesperset 200
FORMAT '/oracle/oraclebak/orclasm/diskar0_T.%T_s.%s_d.%d'
ARCHIVELOG ALL delete all input ;
BACKUP
# recommended format
FORMAT '/oracle/oraclebak/orclasm/diskctl0_T.%T_s.%s_d.%d'
CURRENT CONTROLFILE;
sql "create pfile=''?/dbs/initorclasm.ora.bak'' from spfile";
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
restore database validate;
restore controlfile validate;
restore archivelog from time 'sysdate-1' until time 'sysdate' validate;
}
./rmanbaklevel0.sh
676822674(676822674) 2012/9/9 9:54:46
restore database validate;
restore controlfile validate;
restore archivelog from time "to_date('20120908 102544','yyyymmdd hh24miss')" until time 'sysdate' validate;
田新营(676822674) 10:33:01
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd -p
田新营(676822674) 10:47:02
list failure all;
advise failure;
repair failure;
田新营(676822674) 10:54:58
drop table big_table;
create table big_table tablespace users
as
select rownum id, a.*
from all_objects a
where 1=0
/
alter table big_table nologging;
--oracle 11g
--oracle10g少后两个字段
declare
l_cnt number;
l_rows number := 1000000;
begin
insert /* append */
into big_table
select rownum, a.*
from all_objects a
where rownum <= l_rows;
l_cnt := sql%rowcount;
commit;
while (l_cnt loop
insert /* APPEND */ into big_table
select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME,
OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME,
TIMESTAMP, STATUS, TEMPORARY,
GENERATED, SECONDARY,namespace,edition_name
from big_table
where rownum <= l_rows-l_cnt;
l_cnt := l_cnt + sql%rowcount;
commit;
end loop;
end;
/
select count(*) from big_table;
田新营(676822674) 11:03:05
restore database;
recover database until until time to_date('2012-9-9 10:58:25', 'YYYY-MM-DD HH24:MI:SS');
田新营(676822674) 11:17:13
recover database until time "to_date('2012-9-9 10:58:25', 'YYYY-MM-DD HH24:MI:SS')";
田新营(676822674) 11:31:45
ALTER DATABASE DROP LOGFILE MEMBER '+DATA/orclasm/onlinelog/group_2.264.793538387';
ALTER DATABASE ADD LOGFILE MEMBER '+DATA/orclasm/onlinelog/group_2.264.793538387';
select * from v$log order by 1,4;
select * from v$logfile order by 1,4;
田新营(676822674) 11:33:33
alter system switch logfile;
田新营(676822674) 11:45:44
list failure;
list failure all;
advise failure;
田新营(676822674) 11:48:55
recover database until sequence 5;
田新营(676822674) 14:27:13
drop table big_table;
create table big_table tablespace users
as
select rownum id, a.*
from all_objects a
where 1=0
/
alter table big_table nologging;
--oracle 11g
--oracle10g少后两个字段
declare
l_cnt number;
l_rows number := 10000000;
begin
insert /* append */
into big_table
select rownum, a.*
from all_objects a
where rownum <= l_rows;
l_cnt := sql%rowcount;
commit;
while (l_cnt loop
insert /* APPEND */ into big_table
select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME,
OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME,
TIMESTAMP, STATUS, TEMPORARY,
GENERATED, SECONDARY,namespace,edition_name
from big_table
where rownum <= l_rows-l_cnt;
l_cnt := l_cnt + sql%rowcount;
commit;
end loop;
end;
/
田新营(676822674) 14:58:22
\\192.168.2.36\ocp\ORACLE认证(最新)\OCP11G\题库
oca考047,052,ocp考053
田新营(676822674) 15:06:28
alter database add supplemental log data;
select supplemental_log_data_min,
supplemental_log_data_pk,
supplemental_log_data_ui,
supplemental_log_data_fk,
supplemental_log_data_all
from v$database;
田新营 分享文件 15:15:30
"详解Oracle闪回技术.doc"
676822674(676822674) 2012/9/9 9:32:47
ip地址查看
su - root
root
ifconfig
启动oracle
su - oracle
oracle
lsnrctl start
export ORACLE_SID=+ASM
sqlplus / as sysasm
startup
export ORACLE_SID=orclasm
sqlplus / as sysdba
startup
emctl start dbconsole
676822674(676822674) 2012/9/9 9:37:52
rman target /
restore database validate;
restore controlfile validate;
restore archivelog from time "to_date('20120908 102544','yyyymmdd hh24miss')" until time 'sysdate' validate;
676822674(676822674) 2012/9/9 9:48:55
mkdir -p /oracle/oraclebak/orclasm/
[oracle@localhost oraclebak]$ cd /oracle/oraclebak/orclasm/
vi rmanbaklevel0.sh
export ORACLE_HOME=/oracle/product/11.1.0/db_1
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
export ORACLE_SID=orclasm
$ORACLE_HOME/bin/rman target / nocatalog cmdfile=/oracle/oraclebak/orclasm/rmanbaklevel0.sql log=/oracle/oraclebak/orclasm/rmanbaklevel0.log append
改变文件的属性,使之变成可执行文件
chmod +x rmanbaklevel0.sh
vi rmanbaklevel0.sql
run {
BACKUP
incremental level=0
SKIP INACCESSIBLE
FILESPERSET 10
# recommended format
FORMAT '/oracle/oraclebak/orclasm/diskdb0_T.%T_s.%s_d.%d'
DATABASE;
sql 'alter system archive log current';
BACKUP
incremental level=0
filesperset 200
FORMAT '/oracle/oraclebak/orclasm/diskar0_T.%T_s.%s_d.%d'
ARCHIVELOG ALL delete all input ;
BACKUP
# recommended format
FORMAT '/oracle/oraclebak/orclasm/diskctl0_T.%T_s.%s_d.%d'
CURRENT CONTROLFILE;
sql "create pfile=''?/dbs/initorclasm.ora.bak'' from spfile";
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
restore database validate;
restore controlfile validate;
restore archivelog from time 'sysdate-1' until time 'sysdate' validate;
}
./rmanbaklevel0.sh
676822674(676822674) 2012/9/9 9:54:46
restore database validate;
restore controlfile validate;
restore archivelog from time "to_date('20120908 102544','yyyymmdd hh24miss')" until time 'sysdate' validate;
田新营(676822674) 10:33:01
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd -p
田新营(676822674) 10:47:02
list failure all;
advise failure;
repair failure;
田新营(676822674) 10:54:58
drop table big_table;
create table big_table tablespace users
as
select rownum id, a.*
from all_objects a
where 1=0
/
alter table big_table nologging;
--oracle 11g
--oracle10g少后两个字段
declare
l_cnt number;
l_rows number := 1000000;
begin
insert /* append */
into big_table
select rownum, a.*
from all_objects a
where rownum <= l_rows;
l_cnt := sql%rowcount;
commit;
while (l_cnt loop
insert /* APPEND */ into big_table
select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME,
OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME,
TIMESTAMP, STATUS, TEMPORARY,
GENERATED, SECONDARY,namespace,edition_name
from big_table
where rownum <= l_rows-l_cnt;
l_cnt := l_cnt + sql%rowcount;
commit;
end loop;
end;
/
select count(*) from big_table;
田新营(676822674) 11:03:05
restore database;
recover database until until time to_date('2012-9-9 10:58:25', 'YYYY-MM-DD HH24:MI:SS');
田新营(676822674) 11:17:13
recover database until time "to_date('2012-9-9 10:58:25', 'YYYY-MM-DD HH24:MI:SS')";
田新营(676822674) 11:31:45
ALTER DATABASE DROP LOGFILE MEMBER '+DATA/orclasm/onlinelog/group_2.264.793538387';
ALTER DATABASE ADD LOGFILE MEMBER '+DATA/orclasm/onlinelog/group_2.264.793538387';
select * from v$log order by 1,4;
select * from v$logfile order by 1,4;
田新营(676822674) 11:33:33
alter system switch logfile;
田新营(676822674) 11:45:44
list failure;
list failure all;
advise failure;
田新营(676822674) 11:48:55
recover database until sequence 5;
田新营(676822674) 14:27:13
drop table big_table;
create table big_table tablespace users
as
select rownum id, a.*
from all_objects a
where 1=0
/
alter table big_table nologging;
--oracle 11g
--oracle10g少后两个字段
declare
l_cnt number;
l_rows number := 10000000;
begin
insert /* append */
into big_table
select rownum, a.*
from all_objects a
where rownum <= l_rows;
l_cnt := sql%rowcount;
commit;
while (l_cnt loop
insert /* APPEND */ into big_table
select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME,
OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME,
TIMESTAMP, STATUS, TEMPORARY,
GENERATED, SECONDARY,namespace,edition_name
from big_table
where rownum <= l_rows-l_cnt;
l_cnt := l_cnt + sql%rowcount;
commit;
end loop;
end;
/
田新营(676822674) 14:58:22
\\192.168.2.36\ocp\ORACLE认证(最新)\OCP11G\题库
oca考047,052,ocp考053
田新营(676822674) 15:06:28
alter database add supplemental log data;
select supplemental_log_data_min,
supplemental_log_data_pk,
supplemental_log_data_ui,
supplemental_log_data_fk,
supplemental_log_data_all
from v$database;
田新营 分享文件 15:15:30
"详解Oracle闪回技术.doc"
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90986/viewspace-742966/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/90986/viewspace-742966/