想建立一个测试数据库背景:业务机是64位,测试机是32位,系统都是win2003我想的步骤如下:
1.在测试机安装数据库,目录同业务机,然后关闭测试机数据库
2.业务机shutdown,把oradata目录中的数据表空间和控制文件copy到测试机相应的目录中3.启动测试机数据库问题是:
这样做,测试机数据库启动不起来。这个该具体怎么做呢?
1.在测试机安装数据库,目录同业务机,然后关闭测试机数据库
2.业务机shutdown,把oradata目录中的数据表空间和控制文件copy到测试机相应的目录中3.启动测试机数据库问题是:
这样做,测试机数据库启动不起来。这个该具体怎么做呢?
alter database open;报ora-01092错误
不过建议 lz 使用 rman 中的 duplicate 命令处理,并且在复制完成后需要使用 utlirp.sql 脚本转换 plsql 代码。如果数据库不大,可以直接使用 imp/exp 方法进行复制。当然这样产生的数据库副本在物理上与原数据库是不一致的。
当然,文本参数文件也比不可少,可以通过原来的服务参数文件生成,再进行相应的修改。
[orcl@aegean /] sqlplus / as sysdba
SQL> shutdown immediateStep 2: Archive the datafiles of the database aegean.
[orcl@aegean /] cd $ORACLE_BASE/oradata/aegean
[orcl@aegean aegean] tar -cjf /home/orcl/db.tar.bz2 system01.dbf sysaux01.dbf undo01.dbf users01.dbfStep 3: Copy the archive file of the database aegean to the target host sparta.Step 4: Prepare the directories on the host sparta.
[orcl@aegean /] mkdir -p $ORACLE_BASE/oradata/sparta
[orcl@aegean /] mkdir -p $ORACLE_BASE/flash_recovery_area/SPARTAStep 5: Extract the archive file to the target directory.
[orcl@aegean /] tar -C $ORACLE_BASE/oradata/sparta -xjf /home/orcl/db.tar.bz2Step 6: Create an oracle password file for the instance sparta
[orcl@sparta /] orapwd file=$ORACLE_HOME/dbs/orapwsparta.ora password=sysStep 7: Create a text service parameter file for the instance sparta.
$ORACLE_HOME/dbs/initsparta.ora
-------------------------------------------------------------------------------
db_name = "sparta"
db_domain = ''
db_block_size = 8192
sga_target = 280M
processes = 150
open_cursors = 300
db_recovery_file_dest_size = 4G
db_recovery_file_dest = '$ORACLE_BASE/flash_recovery_area'
undo_management = auto
undo_tablespace = 'UNDO'
control_files = ($ORACLE_BASE/oradata/sparta/control01.ctl,
$ORACLE_BASE/flash_recovery_area/SPARTA/control02.ctl)
compatible = 10.2.0.1.0
__dg_broker_service_names=''
--------------------------------------------------------------------------------Step 8: Start the instance sparta.
[orcl@aegean /] sqlplus / as sysdba
SQL> startup nomountStep 9: Create a control file for the database sparta.
SQL> create controlfile
set database "sparta"
logfile
group 1 ('$ORACLE_BASE/oradata/sparta/redo01_01.log') size 40M,
group 2 ('$ORACLE_BASE/oradata/sparta/redo02_01.log') size 40M
resetlogs
datafile '$ORACLE_BASE/oradata/sparta/system01.dbf',
'$ORACLE_BASE/oradata/sparta/sysaux01.dbf',
'$ORACLE_BASE/oradata/sparta/undo01.dbf',
'$ORACLE_BASE/oradata/sparta/users01.dbf'
maxlogfiles 50
maxlogmembers 3
maxloghistory 400
maxdatafiles 200
maxinstances 4
noarchivelog
/Step 10: Open the database sparta.
SQL> alter database open resetlogs;Step 11: Add a tempfile to the temporary tablespace.
SQL> alter tablespace temp add tempfile '$ORACLE_BASE/oradata/sparta/temp01.dbf' size 40M reuse autoextend on;Step 12: Create a server parameter file.
SQL> create spfile from pfile;
另外,在 windows 系统上需要使用 oradim.exe 创建一个 oracle 服务后才可以启动实例。
oracle服务不是安装数据库后就自带了,还需要手动创建?
http://www.cnblogs.com/nclly/archive/2009/01/06/1370409.html