分类:
2008-10-28 10:12:00
如何恢复一个只有完好数据文件的数据库?
本文欲将此数据文件恢复成数据库TTI,实例名TTI
$ORACLE_HOME=d:oracleora92
1、创建相关目录
d:oracleoradatatti --拷贝数据文件到此目录下,如果没有redolog文件,需要手工创建
d:oracleadminttibdump d:oracleadmintticdump d:oracleadmintticreate d:oracleadminttipfile d:oracleadminttiudump
2、创建初始化文件(本例的初始化文件D:oracleadminttipfileinit.ora)
可拷贝现有数据库的初始化文件进行修改,主要修改内容如下:
db_name=tti background_dump_dest=D:oracleadminttibdump core_dump_dest=D:oracleadmintticdump timed_statistics=TRUE user_dump_dest=D:oracleadminttiudump control_files=("D:oracleoradatattiCONTROL01.CTL", "D:oracleoradatattiCONTROL02.CTL", "D:oracleoradatattiCONTROL03.CTL") instance_name=tti dispatchers="(PROTOCOL=TCP) (SERVICE=ttiXDB)"
3、创建实例及密码文件
开始-〉执行-〉cmd D:>oradim.exe -new -sid tti -startmode m D:>orapwd.exe file=d:oracleora92databasePWDtti.ora password=zlw001
4、添加监听和连接
1)在d:oracleora92networkadminlistener.ora中的SID_LIST_LISTENER下面添加如下内容:
(SID_DESC = (GLOBAL_DBNAME = tti) (ORACLE_HOME = D:oracleora92) (SID_NAME = tti) )
2)在d:oracleora92networkadmintnsnames.ora中添加如下内容:
(这里注意:如果你的d:oracleora92networkadminsqlnet.ora中的参数
NAMES.DEFAULT_DOMAIN = ###,则你的tnsnames.ora中下面的title那里也要改为tti.###)
tti = #title (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = MIS011)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = tti) ) )
[1]
db_name=tti background_dump_dest=D:oracleadminttibdump core_dump_dest=D:oracleadmintticdump timed_statistics=TRUE user_dump_dest=D:oracleadminttiudump control_files=("D:oracleoradatattiCONTROL01.CTL", "D:oracleoradatattiCONTROL02.CTL", "D:oracleoradatattiCONTROL03.CTL") instance_name=tti dispatchers="(PROTOCOL=TCP) (SERVICE=ttiXDB)"
开始-〉执行-〉cmd D:>oradim.exe -new -sid tti -startmode m D:>orapwd.exe file=d:oracleora92databasePWDtti.ora password=zlw001
(SID_DESC = (GLOBAL_DBNAME = tti) (ORACLE_HOME = D:oracleora92) (SID_NAME = tti) )
tti = #title (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = MIS011)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = tti) ) )