您好,登錄后才能下訂單哦!
這篇文章主要講解了“Oracle 12c的ASM新特性是什么”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“Oracle 12c的ASM新特性是什么”吧!
|
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之前大家都知道密碼文件是存放在?/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) |
Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.
Automatic Password file synchronization in 12.2 Dataguard Standby database
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. 新的密碼認證協議
以下將介紹其中幾個內容:
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 的驗證數據部分是隨機生成。更加安全。
在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
在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
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
從主庫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/
查詢ASM信息
|
查詢crs中關于db配置
|
這里db的password file為空,即表示使用默認值,也就是為$ORACLE_HOME/dbs/orapworcl
創建密碼文件存儲在ASM中
|
查看ASM中密碼文件
|
配置crs中password file項
|
查詢crs中關于db配置
|
至此數據庫啟動使用密碼ASM中的密碼文件完成。
補充說明,該方式配置在ASM中的密碼文件,只能是通過crs方式啟動db才會生效,如果手工使用sqlplus啟動數據庫不會使用該密碼文件,還是使用默認密碼文件。
這里也就提醒大家操作規范: 在RAC環境(包含單節點的GI環境)中,對數據庫的啟動關閉操作強烈建議使用crs相關命令來完成,而不推薦使用sqlplus命令。
感謝各位的閱讀,以上就是“Oracle 12c的ASM新特性是什么”的內容了,經過本文的學習后,相信大家對Oracle 12c的ASM新特性是什么這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。