重庆思庄Oracle、Redhat认证学习论坛

标题: oracle 19c 如何使数据库不随GI启动而启动 [打印本页]

作者: 郑全    时间: 2021-1-27 13:48
标题: oracle 19c 如何使数据库不随GI启动而启动
应该说是12c以上版本,如何使数据库不随GI启动而启动

以下提供了几种方式,几种方式,只需要提供其中一种即可。


1.修改策略为手工
[grid@dbserver ~]$ srvctl modify database -d orcl1 -h

Modifies the configuration for the database.

Usage: srvctl modify database -db <db_unique_name> [-dbname <db_name>] [-instance <inst_name>] [-oraclehome <oracle_home>] [-user <oracle_user>] [-domain <domain>] [-spfile <spfile>] [-pwfile <password_file_path>] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] [-startoption <start_options>] [-stopoption <stop_options>] [-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY}] [-diskgroup "<diskgroup_list>"|-nodiskgroup] [-force]
    -db <db_unique_name>           Unique name for the database
    -dbname <db_name>              Database name (DB_NAME), if different from the unique name given by the -db option
    -instance <inst_name>          Instance name
    -oraclehome <path>             Oracle home path
    -user <oracle_user>            Oracle user
    -domain <domain_name>          Domain for database. Must be set if database has DB_DOMAIN set.
    -spfile <spfile>               Server parameter file path
    -pwfile <password_file_path>   Password file path
    -role <role>                   Role of the database (PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY, SNAPSHOT_STANDBY)
    -startoption <start_options>   Startup options for the database. Examples of startup options are OPEN, MOUNT, or "READ ONLY".
    -stopoption <stop_options>     Stop options for the database. Examples of shutdown options are NORMAL, TRANSACTIONAL, IMMEDIATE, or ABORT.
    -policy <dbpolicy>             Management policy for the database (AUTOMATIC, MANUAL, NORESTART or USERONLY)
    -diskgroup "<diskgroup_list>"  Comma separated list of disk group names
    -nodiskgroup                   To remove database's dependency upon disk groups
    -force                         Force the modify operation to stop database and service resources on some nodes as necessary, or to change management policy of all service to match new database management policy
    -verbose                       Verbose output
    -help                          Print usage



[grid@dbserver ~]$ srvctl modify database -db orcl1 -policy  MANUAL



[grid@dbserver ~]$ srvctl config database -d orcl1
Database unique name: orcl1
Database name: orcl1
Oracle home: /u01/app/oracle/product/19.10.0/db_1
Oracle user: grid
Spfile: +DATA/ORCL1/PARAMETERFILE/spfile.277.1062774613
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Disk Groups: DATA
Services:
OSDBA group:
OSOPER group:
Database instance: orcl1


2.使用srvctl disable database

  srvctl disable database -d orcl1

  [grid@dbserver ~]$ srvctl disable database -db orcl1

3.使用 crsctl modify resource
[grid@dbserver ~]$ crsctl modify resource ora.orcl1.db -attr AUTO_START=never
CRS-4995:  The command 'Modify  resource' is invalid in crsctl. Use srvctl for this command.

12c以前,这样可以,12c以后,需要加上  -unsupported

[grid@dbserver ~]$  crsctl modify resource ora.orcl1.db -attr AUTO_START=never  -unsupported

[grid@dbserver ~]$ crsctl stat res ora.orcl1.db -p |grep -i auto_start
AUTO_START=never








欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2