叢集修改OCR中記錄的db_unique_name以及db_name
場景:
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string racdb
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string prod
SQL> alter system set db_unique_name=orcl scope=spfile sid='*';
System altered.
重啟節點1節點2例項:
節點1:
SQL> shutdown immediate;
SQL> startup;
節點2:
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string ORCL
db_unique_name修改完畢
[grid@rac1 ~]$ crsctl status res -t
檢視資源狀態:
ora.racdb.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE Instance Shutdown
真實資料庫例項狀態:
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
racdb1 OPEN
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
racdb2 OPEN
叢集資料庫資源狀態與真實資料庫例項狀態不一致。
是因為OCR中記錄的db_unique_name與實際資料庫的db_unique_name不一致導致的。
並且ora.racdb.db資源是按db_unqiue_name識別的ora.<db_unique_name>.db
檢視資料庫資源資訊:
[grid@rac1 ~]$ srvctl config database -d racdb //-d db_unique_name
Database unique name: racdb
Database name: prod
Oracle home: /oracle/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA
Mount point paths:
Services: session
Type: RAC
Database is administrator managed
[grid@rac1 ~]$ crsctl status res ora.racdb.db -f
....
....
DB_UNIQUE_NAME=racdb
....
....
可以看出OCR中記錄的db_unique_name皆為racdb,而資料庫實際db_unique_name為orcl
解決方法:
方式一:srvctl 與 crsctl修改資源屬性
首先使用srvctl進行修改
srvctl modify database -d <db_unique_name> [-n <db_name>]
[grid@rac1 ~]$ srvctl modify database -d orcl
PRCD-1120 : The resource for database prod could not be found.
PRCR-1001 : Resource ora.prod.db does not exist
提示ora.prod.db資源不存在,說明該資源是根據db_unique_name來識別的,srvctl無法修改。
使用crsctl修改OCR中記錄的db_unique_name資訊:
[root@rac1 ~]# /oracle/grid/crs_1/bin/crsctl modify res ora.racdb.db -attr 'DB_UNIQUE_NAME=orcl';
[grid@rac1 ~]$ crsctl status res ora.racdb.db -f
....
DB_UNIQUE_NAME=orcl
....
[grid@rac1 ~]$ srvctl config database -d racdb
Database unique name: orcl
Database name: prod
Oracle home: /oracle/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
PRCD-1120 : The resource for database orcl could not be found.
PRCR-1001 : Resource ora.orcl.db does not exist
修改成功,但是這種方式僅僅修改了OCR中記錄的db_unique_name,修改後叢集資料庫資源狀態與真實資料庫例項狀態仍不一致。
認為是db_unique_name變化後,資源名稱也隨之變化的問題
方式二:新增新資料庫資源
方式二:新增一個資料庫資源
[oracle@rac1 ~]$ srvctl add database -d orcl -o /oracle/app/product/11.2.0/db_1 -n prod -p +DATA/racdb/spfileracdb.ora -r PRIMARY -s open -t immediate -y AUTOMATIC
選項列表:
-d <db_unique_name> Unique name for the database
-o <oracle_home> ORACLE_HOME path
-c <type> Type of database: RAC One Node, RAC, or Single Instance
-e <server_list> Candidate server list for RAC One Node database
-i <inst_name> Instance name prefix for administrator-managed RAC One Node database
-w <timeout> Online relocation timeout in minutes
-x <node_name> Node name. -x option is specified for single-instance databases
-m <domain> Domain for database. Must be set if database has DB_DOMAIN set.
-p <spfile> Server parameter file path
-r <role> Role of the database (primary, physical_standby, logical_standby, snapshot_standby)
-s <start_options> Startup options for the database. Examples of startup options are OPEN, MOUNT, or 'READ ONLY'.
-t <stop_options> Stop options for the database. Examples of shutdown options are NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT.
-n <db_name> Database name (DB_NAME), if different from the unique name given by the -d option
-y <dbpolicy> Management policy for the database (AUTOMATIC, MANUAL, or NORESTART)
-g "<serverpool_list>" Comma separated list of database server pool names
-a "<diskgroup_list>" Comma separated list of disk groups
-j "<acfs_path_list>" Comma separated list of ACFS paths where database's dependency will be set
-h Print usage
嘗試啟動新新增資料庫資源:
[grid@rac1 ~]$ srvctl start database -d orcl
PRKO-3119 : Database orcl cannot be started since it has no configured instances
[grid@rac1 ~]$ srvctl config database -d orcl
Database unique name: orcl
Database name: prod
Oracle home: /oracle/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
向資料庫資源新增例項://新增例項該方式新增
[oracle@rac1 ~]$ srvctl add instance -d orcl -i racdb1 -n rac1
[oracle@rac1 ~]$ srvctl add instance -d orcl -i racdb2 -n rac2
[grid@rac1 ~]$ srvctl config database -d orcl
Database unique name: orcl
Database name: prod
Oracle home: /oracle/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances: racdb1,racdb2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
再次啟動:
[grid@rac1 ~]$ srvctl start database -d orcl
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
此時叢集資料庫資源狀態與真實資料庫例項狀態保持一致。
待例項關閉後,刪除舊資料庫資源
[root@rac1 ~]#crsctl delete res ora.racdb.db
附加: 修改OCR中的DB_NAME
修改OCR中的DB_NAME
[root@rac1 ~]# /oracle/grid/crs_1/bin/srvctl modify database -d racdb -n prod // -n代表修改後的名字
[grid@rac1 ~]$ srvctl config database -d racdb
Database unique name: racdb
Database name: prod
Oracle home: /oracle/app/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA
Mount point paths:
Services: session
Type: RAC
Database is administrator managed
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23825935/viewspace-2917425/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle修改instance_name、db_name、db_unique_name、service_namesOracle
- GBase XDM(單機/分片叢集)資料庫修改記錄資料庫
- 安全叢集訪問非安全叢集問題記錄
- 將Standard標準叢集修改為Flex叢集Flex
- tidb dm叢集修改某個dm-worker的儲存目錄TiDB
- Oracle叢集軟體管理-OCR和Voting Files管理Oracle
- ProxySQL Cluster 高可用叢集環境部署記錄SQL
- Haproxy+Heartbeat 高可用叢集方案操作記錄
- LVS+Heartbeat 高可用叢集方案操作記錄
- kubernetes叢集證書期限修改(三)
- SAP中如何檢視BOM的修改記錄呢?
- 替換OCR和表決磁碟後,重啟叢集,資料庫資源的叢集狀態為OFFLINE資料庫
- GBase XDM(單機/分片叢集)資料庫 新增記錄資料庫
- Redis Cluster高可用叢集線上遷移操作記錄Redis
- ELK批量刪除索引及叢集相關操作記錄索引
- maven中scope標籤以及exclusions 記錄Maven
- redis 叢集搭建以及redislive監測部署Redis
- 通過memberlist庫實現gossip管理叢集以及叢集資料互動Go
- Centos7安裝Nacos單機模式以及叢集模式(包含nignx安裝以及實現叢集)的相關配置CentOS模式
- powershell無法修改字符集,非修改登錄檔修改powershell的方法
- GBase XDM(單機/分片叢集)資料庫 刪除記錄資料庫
- kafka 基礎知識梳理及叢集環境部署記錄Kafka
- Linux中Mysql的叢集搭建LinuxMySql
- 記錄一次OCR程式開發的嘗試
- 記錄一下oracle 19c的叢集節點移除、新增操作Oracle
- Redis操作及叢集搭建以及高可用配置Redis
- 13、nginx服務叢集搭建以及優化Nginx優化
- MONGO 叢集 修改linux主機時間後的影響GoLinux
- ZooKeeper-3.4.6叢集選舉Bug踩坑與恢復記錄
- 達夢資料庫DM8共享叢集測試記錄資料庫
- 叢集ARM伺服器技術規格-記錄我們的研發生活伺服器
- GBase 8a 叢集修改 IP 地址操作步驟
- CREATE CONTROLFILE修改DB_NAME一定不能使用REUSE
- BottomNavigationView的通用修改記錄(新解決方案)NavigationView
- Git的修改提交記錄和變基Git
- 達夢資料庫DM8主備叢集測試記錄資料庫
- Centos7下GlusterFS分散式儲存叢集環境部署記錄CentOS分散式
- 運維除錯記錄:Ubuntu14.04下部署Opendaylight Nitrogen叢集運維除錯Ubuntu