天天看點

修改執行個體名稱修改執行個體名稱

修改執行個體名稱

wndb -> orcl

目前執行個體狀态檢查
[[email protected] ~]$ srvctl config db
wndb
[[email protected] ~]$ srvctl status db -d wndb
Instance wndb1 is running on node wndb1
Instance wndb2 is running on node wndb2
           
建立pfile檔案
SQL>  create pfile='/home/oracle/pfile.ora' from spfile;

File created.
           
關閉資料庫
[[email protected] ~]$ srvctl stop db -d wndb -o immediate
[[email protected] ~]$ srvctl status db -d wndb
Instance wndb1 is not running on node wndb1
Instance wndb2 is not running on node wndb2
           
修改參數檔案執行個體字首
wndb1 -> orcl1

wndb2 -> orcl2
           
啟動orcl1執行個體
export ORACLE_SID=orcl1
sqlplus / as sysdba
startup nomount pfile='/home/oracle/pfile.ora'
           
建立spfile
create spfile='+datadg/wndb/spfileorcl.ora' from pfile='/home/oracle/pfile.ora';
shutdown abort
ORACLE instance shut down.
           
修改相應節點initsid.ora
[[email protected] dbs]$ cat initwndb1.ora 
SPFILE='+DATADG/wndb/spfileorcl.ora'
[[email protected] dbs]$ cat initwndb2.ora 
SPFILE='+DATADG/wndb/spfileorcl.ora'
           
[[email protected] dbs]$ srvctl remove db -d wndb
[[email protected] dbs]$ srvctl add db -d wndb -o /u01/app/oracle/product/11.2.0/db_home1 -p '+DATADG/wndb/spfileorcl.ora' -r primary -a DATADG,FRADG
[[email protected] dbs]$ srvctl add instance -d wndb -i orcl1 -n wndb1
[o[email protected] dbs]$ srvctl add instance -d wndb -i orcl2 -n wndb2
           
啟動資料庫
[[email protected] dbs]$ srvctl status db -d wndb
Instance orcl1 is running on node wndb1
Instance orcl2 is running on node wndb2

SQL> select instance_name,status from gv$instance;

INSTANCE_NAME	 STATUS
---------------- ------------
orcl1		 OPEN
orcl2		 OPEN

           
修改密碼檔案
orapwd password='*****' file='/xxx/xxx/xxx/orapwxxx'