[oracle@jumper dbs]$ grep name initeygle.ora *.db_name=''eygle'' *.instance_name=''eygle''
当前参数设置下的数据库:
SQL> select name from v$datafile;
NAME ----------------------------------------------------- /opt/oracle/oradata/eygle/system01.dbf /opt/oracle/oradata/eygle/undotbs01.dbf /opt/oracle/oradata/eygle/users01.dbf /opt/oracle/oradata/eygle/eygle01.dbf
SQL> show parameter db_name
NAME TYPE VALUE ------------------------------------ ----------- ----------- db_name string eygle SQL> show parameter instance_name
NAME TYPE VALUE ------------------------------------ ----------- ----------- instance_name string eygle SQL> create pfile from spfile;
File created.
SQL> exit Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option JServer Release 9.2.0.4.0 - Production
[oracle@jumper dbs]$ grep name initjulia.ora *.db_name=''eygle'' *.instance_name=''julia''
然后我们启动实例名称为julia的instance:
[oracle@jumper dbs]$ export ORACLE_SID=julia [oracle@jumper dbs]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 25 14:04:15 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup mount; ORACLE instance started.
Total System Global Area 139531744 bytes Fixed Size 452064 bytes Variable Size 121634816 bytes Database Buffers 16777216 bytes Redo Buffers 667648 bytes ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> exit Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option JServer Release 9.2.0.4.0 - Production
[oracle@jumper dbs]$ export ORACLE_SID=eygle [oracle@jumper dbs]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 25 14:04:39 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option JServer Release 9.2.0.4.0 - Production
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option JServer Release 9.2.0.4.0 - Production
此时就可以通过实例julia加载并打开db_name=eygle的数据库了:
[oracle@jumper dbs]$ export ORACLE_SID=julia [oracle@jumper dbs]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 25 14:05:06 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning option JServer Release 9.2.0.4.0 - Production
SQL> alter database mount; alter database mount * ERROR at line 1: ORA-01990: error opening password file ''/opt/oracle/product/9.2.0/dbs/orapw'' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3
SQL> alter database open;
Database altered.
SQL> select name from v$datafile;
NAME ---------------------------------------------------------------------------- /opt/oracle/oradata/eygle/system01.dbf /opt/oracle/oradata/eygle/undotbs01.dbf /opt/oracle/oradata/eygle/users01.dbf /opt/oracle/oradata/eygle/eygle01.dbf
Total System Global Area 139531744 bytes Fixed Size 452064 bytes Variable Size 121634816 bytes Database Buffers 16777216 bytes Redo Buffers 667648 bytes SQL> alter database mount; alter database mount * ERROR at line 1: ORA-01103: database name ''EYGLE'' in controlfile is not ''JULIA''