共計 18433 個字符,預計需要花費 47 分鐘才能閱讀完成。
這篇文章主要講解了“Oracle 12c 的 ASM 新特性是什么”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著丸趣 TV 小編的思路慢慢深入,一起來研究和學習“Oracle 12c 的 ASM 新特性是什么”吧!
orapwd file= +data/HTZXDBPRI/password/orapwhtzxdbpri force=y dbuniquename=htzxdbpri format=12 sys=oracle sysbackup=oracle sysdg=oracle syskm=oracle
orapwd input_file= +data/HTZXDBPRI/password/orapwhtzxdbpri file= +ocr/asm/password/orapwASM asm=y force=y
srvctl config db -d htzxdbpri -a
srvctl modify db -d htzxdbpri -pwfile +data/HTZXDBPRI/password/orapwhtzxdbpri
— 密碼文件 linux 區分 $ORACLE_SID 大小寫 sysdba select* from v$pwfile_users;
–linux:orapw+$ORACLE_SID
–windows: pwd+$ORACLE_SID.ora
– 密碼文件存放在 ASM 中:
orapwd file= +data/lhrracphy/PASSWORD/pwdlhrracphy force=y dbuniquename=lhrracphy format=12 password=lhr
orapwd file= +data force=y dbuniquename=lhrracphy format=12 password=lhr
orapwd file= +data/HTZXDBPRI/password/orapwhtzxdbpri force=y dbuniquename=htzxdbpri format=12 sys=oracle sysbackup=oracle sysdg=oracle syskm=oracle
– 使用老密碼文件替換新密碼文件
orapwd input_file= +data/HTZXDBPRI/password/orapwhtzxdbpri file= +ocr/asm/password/orapwASM force=y
orapwd input_file= +data/HTZXDBPRI/password/orapwhtzxdbpri file= +ocr/asm/password/orapwASM asm=y force=y
– 備份密碼文件
ASMCMD pwcopy pwdorcl.378.98780432 /home/grid/
– 配置數據庫的密碼文件
srvctl config db -d htzxdbpri -a
srvctl modify db -d htzxdbpri -pwfile +data/HTZXDBPRI/password/orapwhtzxdbpri
oradim -NEW -sid orcl9i -INTPWD admin -pfile d:\oracle\ora90\database\initstorm.ora;
C:\Users\Administrator orapwd file= E:\oracle\ora8i\DATABASE\PWDortest.ORA password=lhr
[oracle@robinson dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle force=y
asmcmd 同樣也可以創建密碼文件:
$ asmcmd
ASMCMD pwcreate
ASMCMD [+] pwcreate –asm +DG/mydir/mypwfile oracle -f –format 12
ASMCMD [+] pwcreate –dbuniquename racdb +DG/mydir/mypwfile oracle -f –format 12
其它命令:
pwcreate、pwdelete、pwcopy、pwmove、pwset、pwget
ASMCMD pwget –dbuniquename htzxdbpri
+data/HTZXDBPRI/password/orapwhtzxdbpri
ASM 存儲密碼文件前提條件是 ASM 磁盤組的 COMPATIBLE.ASM = 12.1
select name,compatibility from v$asm_diskgroup;
— create new password in ASM
orapwd file= +data/ASM/orapwasm asm=y
— create new password in ASM from location
orapwd input_file= /oraclegrid/dbs/orapwasm file= +data/ASM/orapwasm [asm=y]
— move password file from A asm diskgroup to another
ASMCMD pwmove –asm +CRS/asm/password/orapwasm +data/orapwasm
oracle 11g 12c dg 環境 SYS 密碼同步的問題
When password file is used for Redo Transport Authentication, the password of redo transport user should be same across primary and all its physical and snapshot standby databases. By default SYS user is used to authenticate redo transport sessions when password file is used.
Till 12cR1 Dataguard setup, if there is a change in password file of Primary database like Changes in password or Changes in admin privileges, then the password file needs to be copied from Primary database to standby database server and rename it according to standby database Instance name. If the password file of Primary and Standby databases are not same, then errors will be seen.
In 12cR2, the password file of standby database gets synchronized automatically when there is a change in Primary database password file. The password file change of Primary will be included in Redo and when the Redo is applied to standby, the synchronization happens in the background.
這里延伸幾個知識點:
1、11g 中口令文件并不能實現存放于 asm 共享訪問,修改 SYS 密碼,需要再每個 RAC 節點手動實施同步,同樣備庫的口令文件也要手動進行更新覆蓋
2、12.1 版本可以實現口令文件 ASM 共享存儲,RAC 中只需要一個節點執行 alter user sys 就可以實現主庫所有節點同步,這點是 11g 中無法實現。但是備庫中口令文件依然需要手動同步主庫的口令文件過來覆蓋
3、12.2 版本 oracle 在口令文件 ASM 共享存儲的前提下,實現了口令文件自動同步主備所有節點
MOS —
Automatic Password file synchronization in 12.2 Dataguard Standby database
Data Guard Standby Automatic Password file Synchronization in 12.2 (文檔 ID 2307365.1)
1 概念
This feature automatically synchronizes password files across Oracle Data Guard configurations. When the passwords of SYS, SYSDG, and so on, are changed, the password file at the primary database is updated and then the changes are propagated to all standby databases in the configuration.
該特性自動同步 Oracle 數據保護配置中的密碼文件。當 SYS、SYSDG 等的密碼發生更改時,主數據庫中的密碼文件被更新,然后將更改傳播到配置中的所有備用數據庫。
This feature provides additional automation that further simplifies management of Oracle Data Guard configurations.
這個特性提供了額外的自動化,進一步簡化了 Oracle 數據保護配置的管理。
Redo Transport Authentication Using a Password File
In an Oracle Data Guard configuration, all physical and snapshot standby databases must use a copy of the password file from the primary database. That copy is automatically refreshed whenever an administrative privilege (SYSDG, SYSOPER, SYSDBA, and so on) is granted or revoked, and after the password of any user with administrative privileges is changed. The only exception to this is far sync instances. Updated password files must still be manually copied to far sync instances because far sync instances receive redo, but do not apply it. Once the password file is up-to-date at the far sync instance the redo containing the password update at the primary is automatically propagated to any standby databases that are set up to receive redo from that far sync instance. The password file is updated on the standby when the redo is applied.
在 Oracle 數據保護配置中,所有物理和快照備用數據庫必須使用來自主數據庫的密碼文件副本。當管理員權限 (SYSDG、SYSOPER、SYSDBA 等) 被授予或撤銷時,該副本將自動刷新,并且任何具有管理員權限的用戶的密碼發生更改后,該副本將自動刷新。唯一的例外是 far sync instances。更新的密碼文件必須手動復制到 far sync instances,因為 far sync instances 接收重做,但不應用它。一旦密碼文件在遠同步實例中是最新的,那么在主服務器上包含密碼更新的重做就會自動傳播到任何準備 far sync instances 接收重做的備用數據庫。在應用重做時,在備用服務器上更新密碼文件。
2 實驗
2.1 tnsname.ora 中配置主備庫的網絡服務
PDBCNDBA_P =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.74)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = cndba)
)
)
PDBCNDBA_S =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.75)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = cndba)
)
)
2.2 修改主庫 sys 用戶密碼
[oracle@dg1 admin]$ sqlplus sys/PDBCNDBA_P@cndba as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Aug 15 10:55:49 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL alter user sys identified by oracle_p;
User altered.
2.3 驗證備庫密碼也跟著改變。SQL connect sys/oracle_p@PDBCNDBA_P as sysdba
Connected.
SQL connect sys/oracle_p@ PDBCNDBA_S as sysdba
Connected.
3 參考鏈接
http://docs.oracle.com/database/122/NEWFT/new-features.htm#NEWFT-GUID-A6211BAC-0534-44B9-B988-A7CC2B97044F
https://petesdbablog.wordpress.com/2017/03/11/12-2-new-feature-automatically-synchronize-password-files-in-oracle-data-guard/
https://uhesse.com/2017/01/10/auto-sync-for-password-files-in-oracle-12c-data-guard/
ORACLE 12C ASM 新特性:共享密碼文件
在 ORACLE 12C 之前大家都知道密碼文件是存放在?/dbs 或者?/database 中, 如果要修改修改 sysdba 權限的用戶密碼時候, 會去修改密碼文件, 而在 rac 數據庫的 sys 密碼文件是存在各個節點中, 這個時候修改 sysdba 權限的密碼就需要在兩個節點都要做同樣的操作, 而對于數據庫來說本身是只要在一個節點上修改即可, 因為密碼是記錄在 user$ 中, 就是因為密碼文件非共享且在各個節點中都有, 因此需要在各個節點均要執行修改密碼命令, 確保密碼文件被正常修改。因為 rac 密碼文件非共享的機制存在, 導致修改 sysdba 權限密碼繁瑣, 有些時候甚至有節點忘記修改, 導致需要使用密碼文件操作數據庫的時候不能正常進行,DG 傳輸日志異常等故障。在 ORACLE 12C 中為了解決這個問題, 引入了密碼文件可以存入 ASM 新特性, 從而使得密碼文件存儲在 ASM 中實現所有節點共享, 從而解決該問題.
ASM 存儲密碼文件前提條件 COMPATIBLE.ASM = 12.1
查詢 ASM 信息
SQL select * from v$version;
BANNER CON_ID
——————————————————————————– ———-
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 – 64bit Production 0
PL/SQL Release 12.1.0.1.0 – Production 0
CORE 12.1.0.1.0 Production 0
TNS for Linux: Version 12.1.0.1.0 – Production 0
NLSRTL Version 12.1.0.1.0 – Production 0
SQL select NAME,COMPATIBILITY from v$asm_diskgroup;
NAME COMPATIBILITY
—————————— ————————————————————
DATA 12.1.0.0.0
查詢 crs 中關于 db 配置
[grid@xifenfei ~]$ srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home: /u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services:
這里 db 的 password file 為空, 即表示使用默認值, 也就是為 $ORACLE_HOME/dbs/orapwxifenfei
創建密碼文件存儲在 ASM 中
– 創建 db 新密碼文件
[oracle@xifenfei ~]$ orapwd file= +data/CDB/orapwdxifenfei dbuniquename= cdb
Enter password for SYS:
—- 輸入 sys 用戶密碼
– 創建 asm 新密碼文件
orapwd file= +data/ASM/orapwasm asm=y
—-asm=y 表示創建的密碼文件為 asm 的
– 使用老密碼文件創建 db/asm 新密碼文件
orapwd input_file= /oraclegrid/dbs/orapwasm file= +data/ASM/orapwasm [asm=y]
—-input_file 表示使用老的密碼文件創建新的存儲在 ASM 中的密碼文件
查看 ASM 中密碼文件
ASMCMD showversion
ASM version : 12.1.0.1.0
ASMCMD pwd
+data/cdb
ASMCMD ls -l orapwdxifenfei
Type Redund Striped Time Sys Name
PASSWORD UNPROT COARSE MAY 31 19:00:00 N orapwdxifenfei = +DATA/CDB/PASSWORD/pwdcdb.290.816897265
配置 crs 中 password file 項
[grid@xifenfei ~]$ srvctl modify database -db cdb -pwfile +data/CDB/orapwdxifenfei
查詢 crs 中關于 db 配置
[grid@xifenfei ~]$ srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home: /u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password file: +data/CDB/orapwdxifenfei
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services:
至此數據庫啟動使用密碼 ASM 中的密碼文件完成, 補充說明, 該方式配置在 ASM 中的密碼文件, 只能是通過 crs 方式啟動 db 才會生效, 如果手工使用 sqlplus 啟動數據庫不會使用該密碼文件, 還是使用默認密碼文件。這里也就提醒大家操作規范: 在 RAC 環境 (包含單節點的 GI 環境) 中, 對數據庫的啟動關閉操作強烈建議使用 crs 相關命令來完成, 而不推薦使用 sqlplus 命令
Data Guard Standby Automatic Password file Synchronization in 12.2 (文檔 ID 2307365.1)APPLIES TO:
Oracle Database – Enterprise Edition – Version 12.2.0.1 and later
Information in this document applies to any platform.
GOAL
Automatic Password file synchronization in 12.2 Dataguard Standby database
SOLUTION
When password file is used for Redo Transport Authentication, the password of redo transport user should be same across primary and all its physical and snapshot standby databases. By default SYS user is used to authenticate redo transport sessions when password file is used.
Till 12cR1 Dataguard setup, if there is a change in password file of Primary database like Changes in password or Changes in admin privileges, then the password file needs to be copied from Primary database to standby database server and rename it according to standby database Instance name. If the password file of Primary and Standby databases are not same, then errors will be seen.
In 12cR2, the password file of standby database gets synchronized automatically when there is a change in Primary database password file. The password file change of Primary will be included in Redo and when the Redo is applied to standby, the synchronization happens in the background.
Exception: Far-sync Instances (where the redo will not be applied). We need to manually copy the password file. Once the password file is sync at Far-Sync instance, the redo having password file information will get transmitted to standby which are suppose to receive from Far-sync instance.
Example:
PRIMARY select username, sysdba, sysoper, sysasm,sysbackup,authentication_type AT from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA AT
——————– —– —– —– —– ——–
SYS TRUE TRUE FALSE FALSE PASSWORD
SYSDG FALSE FALSE FALSE FALSE PASSWORD
SYSBACKUP FALSE FALSE FALSE TRUE PASSWORD
SYSKM FALSE FALSE FALSE FALSE PASSWORD
STANDBY select username, sysdba, sysoper, sysasm,sysbackup,authentication_type AT from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA AT
———- —– —– —– —– ——–
SYS TRUE TRUE FALSE FALSE PASSWORD
SYSDG FALSE FALSE FALSE FALSE PASSWORD
SYSBACKUP FALSE FALSE FALSE TRUE PASSWORD
SYSKM FALSE FALSE FALSE FALSE PASSWORD
Let s grant a role to a user at Primary database which will make changes in Password file
PRIMARY Grant SYSOPER to user1;
Grant succeeded.
PRIMARY select username, sysdba, sysoper, sysasm,sysbackup,authentication_type AT from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA AT
——————– —– —– —– —– ——–
SYS TRUE TRUE FALSE FALSE PASSWORD
SYSDG FALSE FALSE FALSE FALSE PASSWORD
SYSBACKUP FALSE FALSE FALSE TRUE PASSWORD
SYSKM FALSE FALSE FALSE FALSE PASSWORD
USER1 FALSE TRUE FALSE FALSE PASSWORD
Password file of Primary database:
-rw-r—–. 1 oracle oinstall 4096 /u01/app/oracle/product/12.2.0/dbhome_1/dbs/orapwprimdb
Switch the logfile, so that the Redo reach its standby databases
PRIMARY alter system switch logfile;
System altered.
At standby Media recovery is not active. Verify v$pwfile_users for the granted role
STANDBY select username, sysdba, sysoper, sysasm,sysbackup,authentication_type AT from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA AT
———- —– —– —– —– ——–
SYS TRUE TRUE FALSE FALSE PASSWORD
SYSDG FALSE FALSE FALSE FALSE PASSWORD
SYSBACKUP FALSE FALSE FALSE TRUE PASSWORD
SYSKM FALSE FALSE FALSE FALSE PASSWORD
Password file of Standby database:
-rw-r—–. 1 oracle oinstall 3584 /u01/app/oracle/product/12.2.0/dbhome_2/dbs/orapwstdbydb
Newly granted role is not reflected in Standby, lets start Media recovery and then query v$pwfile_users.
STANDBY recover managed standby database disconnect;
Media recovery complete.
STANDBY select username, sysdba, sysoper, sysasm,sysbackup,authentication_type AT from v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS SYSBA AT
———- —– —– —– —– ——–
SYS TRUE TRUE FALSE FALSE PASSWORD
SYSDG FALSE FALSE FALSE FALSE PASSWORD
SYSBACKUP FALSE FALSE FALSE TRUE PASSWORD
SYSKM FALSE FALSE FALSE FALSE PASSWORD
USER1 FALSE TRUE FALSE FALSE PASSWORD
Password file of standby database:
-rw-r—–. 1 oracle oinstall 4096 /u01/app/oracle/product/12.2.0/dbhome_2/dbs/orapwstdbydb
We could see after media recovery v$pwfile_users has been updated
oracle 數據庫軟件是獲得過最高級別的安全認證,完全超越其它所有數據庫軟件,并且在可維護性上基于大量的實踐需要穩步前行,這里簡單列舉幾個 12c 關于 password 幾個新特性。
1. 新的 password hash 算法
2. 新的 password verify function
3. 密碼文件可以存儲到 ASM
4. 密碼自動從 primary 同步到 standby 端在 Dataguard 環境中
5. 新的密碼認證協議
以下將介紹其中幾個內容:
1. 新的 password hash 算法
Oracle 對 Oracle Database 12c 中的用戶密碼哈希進行了改進,通過使用基于 PBKDF2 的 SHA512 哈希算法,而不是簡單的 SHA1 哈希,密碼哈希更安全, 從 11g 起 user$.spare4 列存儲著密碼的哈希值。在 12.1.0.2 版本時 spare4 列有 3 部分組成(S:H:T).12.2 時只剩下(S:T)2 部分。
S 部分和 11g 時的算法一樣,長度 60 chars, 是基于 SHA1 的哈希。
H 部分是基于 MD5 的哈希,長度為 32 chars, 也可能是因為 MD5 hash 更方便入侵者的暴力破解,在 12.2 版本時從 Spare4 列去掉該部分。
T 部分是從 12.1.0.2 版本增加,長度為 160 chars, 使用的是基于 PBKDF2-based SHA512 的算法。該算法后部分 32chars 的驗證數據部分是隨機生成。更加安全。
2. 新的 password verify function
在 12c 中 default profile 除了 password verify function 和 11g 不同,其它資源限制都是相同的。
不過國防安全要求有個建議值:
RESOURCE NAME LIMIT
PASSWORD_LIFE_TIME 60
PASSWORD_REUSE_TIME 365
PASSWORD_REUSE_MAX 5
FAILED_LOGIN_ATTEMPTS 3
PASSWORD_VERIFY_FUNCTION ora12c_strong_verify_function
12c 新引入了 verify function 有 ora12c_verify_function, ora12c_strong_verify_function (ora12c_stig_verify_function),而且可能在 12.1.0.1 ,12.1.0.2, 12.2.0.1 profile 默認的 verify function 名都不一樣。
比如 STIG 有以下限制:
Password at least 9 characters
at least 2 capital letters
at least 2 small letters
at least 2 digits
at least 2 special characters
password must differ by at least 4 characters from the old password
3. 密碼文件可以存儲到 ASM
在 Oracle Database 12c 之前,密碼文件始終位于 $ ORACLE_HOME / dbs 文件下,即使對于 RAC 實例和 RAC ASM 集群也是如此。對于 RAC 而言,DBA 必須設法保持這一點密碼文件在每個節點上同步。現在,在 Oracle 12c 中,可以將密碼文件存儲在 ASM 上。這意味著一個共享密碼文件 Oracle RAC 數據庫為集群中的所有實例共享,與 ASM spfile 不同,ASM 密碼文件的訪問只有在啟動 ASM,并且在磁盤組 mount 后才可以訪問。用于創建密碼文件的命令實用程序仍然是相同的:“orapwd”
asmcmd 同樣也可以創建密碼文件
$ asmcmd
ASMCMD pwcreate
ASM 存儲密碼文件前提條件 COMPATIBLE.ASM = 12.1
-- create new password in ASM
orapwd file= +data/ASM/orapwasm asm=y
-- create new password in ASM from location
orapwd input_file= /oraclegrid/dbs/orapwasm file= +data/ASM/orapwasm [asm=y]
-- move password file from A asm diskgroup to another
ASMCMD pwmove --asm +CRS/asm/password/orapwasm +data/orapwasm
2. 密碼自動從 primary 同步到 standby 端在 Dataguard 環境中
12cR2 中一個有用的增強功能是密碼文件在 Data Guard 環境中自動同步,如果在 primary database 上更改了 sys 的密碼,并且它自動也在 standby database 上進行了更改。在早期版本中必須手動完成的,通常通過使用 primary database 密碼文件替換 standby database 上的密碼文件。
5. 新的密碼認證協議
升級 12C 注意事項: 連接失敗 ORA-28040 ORA-1017
之前寫過關于認證的協議的。如果你的數據庫是從 12c 以前的版本升上來的,在升級時會提示去掉 SEC_CASE_SENSITIVE_LOGON=FALSE 參數如下,但是如果你沒有去掉 SEC_CASE_SENSITIVE_LOGON=FALSE,那么升級后登錄可以會遇到 ora-1017 錯誤,即使密碼是正確的,甚至修改在升級后再修改密碼(新的密碼版本將為”11G 12C”)。解決方法是:change SEC_CASE_SENSITIVE_LOGON=TRUE, –the default. 另外注意如果是 Data Pump 導入創建的用戶,密碼版本會和導出時版本一致。RECOMMENDED ACTIONS
===================
+ Consider removing the following DEPRECATED initialization parameters.
They are not OBSOLETE in version 12.2.0.1.0
but probably will be OBSOLETE in a future release.
Parameter
——————————
sec_case_sensitive_logon
Note:
Oracle notes that the term “version” in the allowed_logon_version_server parameter name refers to the version of the authentication protocol. It does NOT refer to the Oracle release version.
sqlnet.allowed_logon_version_server, depending on the version of the authentication protocol.
sqlnet.allowed_logon_version_server=12a: For Oracle Database 12c Release 1 (12.1) release 12.1.0.2 or later.
sqlnet.allowed_logon_version_server=12: For the critical patch updates CPUOct2012 and later Oracle Database 11g authentication protocols (recommended).
sqlnet.allowed_logon_version_server=11: For Oracle Database 11g authentication protocols (default).
sqlnet.allowed_logon_version_server=10: For Oracle Database 10g authentication protocols.
sqlnet.allowed_logon_version_server=8: For Oracle8i authentication protocol
3. 將主庫 RAC 中的密碼文件手動拷貝到備庫中
從主庫 ASM 拷貝到文件系統中:
ASMCMD pwcopy +DATA/HISS/PASSWORD/pwdhis.256.918602833/home/grid/
使用 scp 或者其它方式拷貝到備庫的主機中并重命名為 hiss:
$ scp /home/grid/pwdhis.256.91860283310.241.8.9:/home/grid
$ mv pwdhis.256.918602833 orapwhiss
從備庫文件系統拷貝到 ASM 中:
ASMCMD pwcopy /home/grid/orapwhiss +DATA/HISS/PASSWORD/
4. 密碼文件管理
查詢 ASM 信息
SQL
select *
from v$version;
BANNER CON_ID
——————————————————————————– ———-
Oracle
Database 12c Enterprise Edition Release 12.1.0.1.0 – 64bit Production 0
PL/SQL Release 12.1.0.1.0 – Production 0
CORE 12.1.0.1.0 Production 0
TNS
for Linux: Version 12.1.0.1.0 – Production 0
NLSRTL Version 12.1.0.1.0 – Production 0
SQL
select NAME,COMPATIBILITY
from v$asm_diskgroup;
NAME COMPATIBILITY
—————————— ————————————————————
DATA 12.1.0.0.0
查詢 crs 中關于 db 配置
[grid@orcl ~]$ srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home:
/u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password
file:
Domain:
Start options:
open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services:
這里 db 的 password file 為空, 即表示使用默認值, 也就是為 $ORACLE_HOME/dbs/orapworcl
創建密碼文件存儲在 ASM 中
– 創建 db 新密碼文件
[oracle@orcl ~]$ orapwd
file= +data/CDB/orapwdorcl dbuniquename= cdb
Enter password
for SYS:
—- 輸入 sys 用戶密碼
– 創建 asm 新密碼文件
orapwd
file= +data/ASM/orapwasm asm=y
—-asm=y 表示創建的密碼文件為 asm 的
– 使用老密碼文件創建 db/asm 新密碼文件
orapwd input_file= /oraclegrid/dbs/orapwasm file= +data/ASM/orapwasm [asm=y]
—-input_file 表示使用老的密碼文件創建新的存儲在 ASM 中的密碼文件
查看 ASM 中密碼文件
ASMCMD showversion
ASM version : 12.1.0.1.0
ASMCMD
pwd
+data/cdb
ASMCMD
ls -l orapwdorcl
Type Redund Striped Time Sys Name
PASSWORD UNPROT COARSE MAY 31 19:00:00 N orapwdorcl = +DATA/CDB/PASSWORD/pwdcdb.290.816897265
配置 crs 中 password file 項
[grid@orcl ~]$ srvctl modify database -db cdb -pwfile +data/CDB/orapwdorcl
查詢 crs 中關于 db 配置
[grid@orcl ~]$ srvctl config database -d cdb
Database unique name: cdb
Database name: cdb
Oracle home:
/u01/app/oracle/product/12.1/db_1
Oracle user: oracle
Spfile: +DATA/cdb/spfilecdb.ora
Password
file: +data/CDB/orapwdorcl
Domain:
Start options:
open
Stop options: immediate
Database role: PRIMARY
Management policy: MANUAL
Database instance: cdb
Disk Groups: DATA
Services:
至此數據庫啟動使用密碼 ASM 中的密碼文件完成。
補充說明, 該方式配置在 ASM 中的密碼文件, 只能是通過 crs 方式啟動 db 才會生效, 如果手工使用 sqlplus 啟動數據庫不會使用該密碼文件, 還是使用默認密碼文件。
這里也就提醒大家操作規范: 在 RAC 環境 (包含單節點的 GI 環境) 中, 對數據庫的啟動關閉操作強烈建議使用 crs 相關命令來完成, 而不推薦使用 sqlplus 命令。
感謝各位的閱讀,以上就是“Oracle 12c 的 ASM 新特性是什么”的內容了,經過本文的學習后,相信大家對 Oracle 12c 的 ASM 新特性是什么這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是丸趣 TV,丸趣 TV 小編將為大家推送更多相關知識點的文章,歡迎關注!