SQL> select name from v$datafile;NAME--------------------------------------------------------------------------------/oradata/sysdata/jingyu/system01.dbf/oradata/sysdata/jingyu/sysaux01.dbf/oradata/sysdata/jingyu/undotbs01.dbf/oradata/sysdata/jingyu/users01.dbfSQL> select name from v$tempfile; NAME--------------------------------------------------------------------------------/oradata/sysdata/jingyu/temp01.dbfSQL> select member from v$logfile;MEMBER--------------------------------------------------------------------------------/oradata/sysdata/jingyu/redo03.log/oradata/sysdata/jingyu/redo02.log/oradata/sysdata/jingyu/redo01.logSQL> select name from v$controlfile;NAME--------------------------------------------------------------------------------/oradata/sysdata/jingyu/control01.ctl/opt/app/oracle/fast_recovery_area/jingyu/control02.ctlSQL> show parameter pfileNAME TYPEVALUE------------------------------------ ----------- ------------------------------spfile string/opt/app/oracle/product/11.2.0 /dbhome_1/dbs/spfilejingyu.ora
[oracle@JY-DB /]$ cd $ORACLE_HOME/dbs[oracle@JY-DB dbs]$ more initjingyu.ora jingyu.__db_cache_size=6677331968jingyu.__java_pool_size=33554432jingyu.__large_pool_size=33554432jingyu.__oracle_base="/opt/app/oracle"#ORACLE_BASE set from environmentjingyu.__pga_aggregate_target=5402263552jingyu.__sga_target=8086618112jingyu.__shared_io_pool_size=0jingyu.__shared_pool_size=1275068416jingyu.__streams_pool_size=0*.audit_file_dest="/opt/app/oracle/admin/jingyu/adump"*.audit_trail="db"*.compatible="11.2.0.0.0"*.control_files="/oradata/sysdata/jingyu/control01.ctl","/opt/app/oracle/fast_recovery_area/jingyu/control02.ctl"*.db_block_size=8192*.db_domain=""*.db_name="jingyu"*.db_recovery_file_dest="/opt/app/oracle/fast_recovery_area"*.db_recovery_file_dest_size=10737418240*.diagnostic_dest="/opt/app/oracle"*.dispatchers="(PROTOCOL=TCP) (SERVICE=jingyuXDB)"*.memory_target=13459521536*.open_cursors=1000*.processes=1500*.remote_login_passwordfile="EXCLUSIVE"*.sessions=1655*.undo_tablespace="UNDOTBS1"SQL> startup pfile="$ORACLE_HOME/dbs/initjingyu.ora" nomountORACLE instance started.Total System Global Area 1.3429E+10 bytesFixed Size2241064 bytesVariable Size6744444376 bytesDatabase Buffers 6677331968 bytesRedo Buffers4636672 bytesSQL> alter database mount;Database altered.
4.重定向数据库的所有数据文件、日志文件路径,然后正常打开数据库。
SQL> alter database rename file "/oradata/sysdata/jingyu/system01.dbf" to "/usr2/oradata/sysdata/jingyu/system01.dbf";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/sysaux01.dbf" to "/usr2/oradata/sysdata/jingyu/sysaux01.dbf";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/undotbs01.dbf" to "/usr2/oradata/sysdata/jingyu/undotbs01.dbf"; Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/temp01.dbf" to "/usr2/oradata/sysdata/jingyu/temp01.dbf";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/users01.dbf" to "/usr2/oradata/sysdata/jingyu/users01.dbf";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/redo01.log" to "/usr2/oradata/sysdata/jingyu/redo01.log";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/redo02.log" to "/usr2/oradata/sysdata/jingyu/redo02.log";Database altered.SQL> alter database rename file "/oradata/sysdata/jingyu/redo03.log" to "/usr2/oradata/sysdata/jingyu/redo03.log";Database altered.SQL> alter database open;Database altered.
5.核查各文件路径没有问题,根据当前pfile创建spfile,重启数据库实例。
SQL> select name from v$datafile;NAME--------------------------------------------------------------------------------/usr2/oradata/sysdata/jingyu/system01.dbf/usr2/oradata/sysdata/jingyu/sysaux01.dbf/usr2/oradata/sysdata/jingyu/undotbs01.dbf/usr2/oradata/sysdata/jingyu/users01.dbfSQL> select name from v$tempfile; NAME--------------------------------------------------------------------------------/usr2/oradata/sysdata/jingyu/temp01.dbfSQL> select member from v$logfile;MEMBER--------------------------------------------------------------------------------/usr2/oradata/sysdata/jingyu/redo03.log/usr2/oradata/sysdata/jingyu/redo02.log/usr2/oradata/sysdata/jingyu/redo01.logSQL> select name from v$controlfile;NAME--------------------------------------------------------------------------------/usr2/oradata/sysdata/jingyu/control01.ctl/opt/app/oracle/fast_recovery_area/jingyu/control02.ctlSQL> show parameter pfileNAME TYPEVALUE------------------------------------ ----------- ------------------------------spfile stringSQL> create spfile from pfile;File created.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1.3429E+10 bytesFixed Size2241064 bytesVariable Size6744444376 bytesDatabase Buffers 6677331968 bytesRedo Buffers4636672 bytesDatabase mounted.Database opened. 更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12本文永久更新链接地址