首页 > Linux操作系统 > Linux操作系统 > 启动只有数据文件的备份的数据库
只有数据文件的备份,没有控制文件,临时文件备份,启动数据库。
只有数据文件备份
oracle@linux-rpu7:~/oradata/temobi> ls
low.dbf sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
生成参数文件
oracle@linux-rpu7:~/product/10.2/db_1/dbs> cp inittmorcl.ora inittemobi.ora
oracle@linux-rpu7:~/product/10.2/db_1/dbs> vi inittemobi.ora
xxxxxxxx
:1,$s/tmorcl/temobi/g
建立需要目录:
oracle@linux-rpu7:~> mkdir /opt/oracle/admin/temobi/adump -p
oracle@linux-rpu7:~> mkdir /opt/oracle/admin/temobi/cdump
oracle@linux-rpu7:~> mkdir /opt/oracle/admin/temobi/bdump
oracle@linux-rpu7:~> mkdir /opt/oracle/admin/temobi/udump
oracle@linux-rpu7:~> mkdir /opt/oracle/admin/temobi/dpdump
oracle@linux-rpu7:~> export ORACLE_SID=temobi
oracle@linux-rpu7:~> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Fri May 21 20:15:22 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 100666664 bytes
Database Buffers 62914560 bytes
Redo Buffers 2924544 bytes
建立控制文件:
SQL> create controlfile set database temobi resetlogs noarchivelog
2 maxlogfiles 40
3 maxlogmembers 3
4 maxinstances 2
5 maxdatafiles 100
6 maxloghistory 300
7 logfile
8 group 1 '/opt/oracle/oradata/temobi/redo01.log' size 50m,
9 group 2 '/opt/oracle/oradata/temobi/redo02.log' size 50m,
10 group 3 '/opt/oracle/oradata/temobi/redo03.log' size 50m
11 datafile
12 '/opt/oracle/oradata/temobi/system01.dbf',
13 '/opt/oracle/oradata/temobi/sysaux01.dbf',
14 '/opt/oracle/oradata/temobi/undotbs01.dbf',
15 '/opt/oracle/oradata/temobi/users01.dbf',
16 '/opt/oracle/oradata/temobi/low.dbf'
17 character set zhs16gbk;
Control file created.
打开数据库
SQL> alter database open resetlogs;
Database altered.
SQL> ho ls /opt/oracle/oradata/temobi
control01.ctl control03.ctl redo01.log redo03.log system01.dbf users01.dbf
control02.ctl low.dbf redo02.log sysaux01.dbf undotbs01.dbf
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 100666664 bytes
Database Buffers 62914560 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile; 创建spfile
File created.
SQL> ho ls $ORACLE_HOME/dbs
hc_temobi.dat initdw.ora inittemobi.ora lkTEMOBI orapwtmorcl spfiletemobi.ora
hc_tmorcl.dat init.ora inittmorcl.ora lkTMORCL snapcf_tmorcl.f spfiletmorcl.ora
检查用户数据是否存在
SQL> conn low/low
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
TEST TABLE
SQL> select * from test;
OBJECT_NAME
--------------------------------------------------------------------------------
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
------------------------------ ---------- -------------- -------------------
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
--------- --------- ------------------- ------- - - -
TEST
60075 60075 TABLE
19-MAY-10 19-MAY-10 2010-05-19:16:06:29 VALID N N N
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22779291/viewspace-663347/ ,如需转载,请注明出处,否则将追究法律责任。