--准备工作 select * from v$database; select file_name from dba_data_files;
create tablespace inv datafile '/oradata/ocm/inv01.dbf' size 2048M; create user inv identified by inv default tablespace inv temporary tablespace temp; grant dba,resource to inv;
alter user scott account unlock; SQL> conn scott/tiger select * from tab; select 'create table '||tname||' as select * from scott.'||tname||';' from tab;
create table BONUS as select * from scott.BONUS; create table DEPT as select * from scott.DEPT; create table EMP as select * from scott.EMP; create table SALGRADE as select * from scott.SALGRADE;
create table te_objects as select * from dba_objects;
--oracle冷备份
select instance_name,version,status,archiver,database_status from v$instance; select dbid,name,log_mode from v$database;
--执行语句准备 select 'cp '|| name ||' /ggs/backup/cold_back' from v$datafile union all select 'cp '|| name ||' /ggs/backup/cold_back' from v$tempfile union all select 'cp '|| member ||' /ggs/backup/cold_back' from v$logfile union all select 'cp '|| name ||' /ggs/backup/cold_back' from v$controlfile;