Database Incarnations

数据库在经历完整恢复、DBPITR或使用备份控制文件恢复后,需使用OPEN RESETLOGS打开,创建新的转世以避免redo流混淆。OPEN RESETLOGS会更新数据文件、归档在线重做日志并初始化控制文件记录。重置日志SCN确保了数据文件不会应用不匹配的归档日志,防止数据库损坏。不同数据库转世间存在当前、父代和祖先关系,RMAN在OPEN RESETLOGS操作中处理相关事务。孤儿备份是在非直接祖先路径中的备份,可用于恢复到非当前路径的SCN。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

INCARNATION可以翻译为转世

在使用数据库的时间点恢复或使用备份控制文件恢复后必须使用OPEN RESETLOGS

After complete recovery, you can resume normal operations without an OPEN RESETLOGS . After a DBPITR or recovery with a backup control file, however, you must open the database with the RESETLOGS option, thereby creating a new incarnation of the database.

The database requires a new incarnation to avoid confusion when two different redo streams have the same SCNs, but occurred at different times. If you apply the wrong redo to your database, then you corrupt it.

  • RMAN OPEN RESETLOGS Operations

RMAN performs certain actions when you open the database with the RESETLOGS option.

The action performed are as follows:

  1. Archives the current online redo logs (if they are accessible) and then erases the contents of the online redo logs and resets the log sequence number to 1.
  2. Creates the online redo log files if they do not currently exist.
  3. Initializes redo thread records and online redo log records in the control file to the beginning of the new database incarnation.
  4. Updates all current data files and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.

RESETLOGS SCN保证了数据文件不会应用不匹配的归档日志

Because the database does not apply an archived redo log to a data file unless the RESETLOGS SCN and time stamps match, the RESETLOGS requirement prevents you from corrupting data files with archived logs that are not from direct parent incarnations of the current incarnation.

没必要在OPEN RESETLOGS后进行全备

In previous releases, it was recommended that you back up the database immediately after the OPEN RESETLOGS. Because you can now easily recover a pre-RESETLOGS backup like any other backup, making a new database backup is optional.

  • Relationship Among Database Incarnations

Database incarnations can stand in the following relationships to each other:

  1. The current incarnation is the one in which the database is currently operating.
  2. The incarnation from which the current incarnation branched following an OPEN RESETLOGS operation is the parent incarnation of the current incarnation.
  3. The parent of the parent incarnation is an ancestor incarnation. Any parent of an ancestor incarnation is also an ancestor of the current incarnation.
  4. The direct ancestral path of the current incarnation begins with the earliest incarnation and includes only the branches to an ancestor of the current incarnation, the parent incarnation, or the current incarnation. 直接祖先路径只包含当前及父、第一个祖先

An incarnation number is used to uniquely tag and identify a stream of redo. 

Figure 14-1 illustrates a database that goes through several incarnations, each with a different incarnation number.

Incarnation 1 of the database starts at SCN 1 and continues through SCN 1000 to SCN 2000. Suppose that at SCN 2000 in incarnation 1, you perform a point-in-time recovery back to SCN 1000, and then open the database with the RESETLOGS option. Incarnation 2 now begins at SCN 1000 and continues to SCN 3000. In this example, incarnation 1 is the parent of incarnation 2.

Suppose that at SCN 3000 in incarnation 2, you perform a point-in-time recovery to SCN 2000 and open the database with the RESETLOGS option. In this case, incarnation 2 is the parent of incarnation 3. Incarnation 1 is an ancestor of incarnation 3.

The RESET DATABASE TO INCARNATION command is required when you use FLASHBACK, RESTORE, or RECOVER to return to an SCN in a noncurrent database incarnation. However, RMAN executes the RESET DATABASE TO INCARNATION command implicitly with Flashback

Incarnation的相关命令

  1. 查看incarnation

RMAN> list incarnation;

V$database_incarnation包含所有incarnations, v$database只包含当前及上个incarnation

V$DATABASE_INCARNATION displays information about all database incarnations. Records about the current and immediately previous incarnation are also contained in the V$DATABASE view.

SQL> select INCARNATION#, RESETLOGS_TIME,STATUS, PRIOR_INCARNATION#, FLASHBACK_DATABASE_ALLOWED from V$DATABASE_INCARNATION;

  1. 切换incarnation:

RMAN> reset database to incarnation 11;    --数据库mount状态

  • Incarnations of PDBs

A pluggable database (PDB) incarnation is a subincarnation of the multitenant container database (CDB) and is expressed as (database_incarnation, pdb_incarnation).

For example, if the CDB is incarnation 5, and a PDB is incarnation 3, then the fully specified incarnation number of the PDB is (5, 3). The initial incarnation of a PDB is 0. Subsequent incarnations are unique but not always sequential numbers.

The V$PDB_INCARNATION view contains information about all PDB incarnations. Use the following query to display the current incarnation of a PDB:

SELECT PDB_INCARNATION# FROM V$PDB_INCARNATION

   WHERE STATUS = 'CURRENT' AND CON_ID = PDB_container_id;

  • Orphaned Backups

不在direct ancestral path的备份称为孤立备份Orphaned backup. 未在direct ancestral path的incarnations称为abandoned incarnations或orphaned incarnations

When a database goes through multiple incarnations, some backups can become orphaned backups. Orphaned backups are backups created during incarnations of the database that are not in the direct ancestral path.

Assume the scenario shown in Figure 14-1. If incarnation 3 is the current incarnation, then the following backups are orphaned:

All backups from incarnation 1 after SCN 1000

All backups from incarnation 2 after SCN 2000

In contrast, the following backups are not orphaned because they are in the direct ancestral path:

All backups from incarnation 1 before SCN 1000

All backups from incarnation 2 before SCN 2000

All backups from incarnation 3

RMAN可以直接使用direct ancestral path中备份恢复到任意子incarnation

You can use orphaned backups when you intend to restore the database to an SCN not in the direct ancestral path. RMAN can restore backups from parent and ancestor incarnations and recover to the current time, even across OPEN RESETLOGS operations, if a continuous path of archived logs exists from the earliest backups to the point to which you want to recover.

如果还原了direct ancestral path的控制文件就可以使用orphaned backups

If you restore a control file from an incarnation in which the changes represented in the backups had not been abandoned, then RMAN can also restore and recover orphaned backups.

  • Orphaned PDB Backups

Orphan PDB backups can result when you perform point-in-time recovery on a pluggable database (PDB) and then open the PDB using the RESETLOGS option.

Orphan PDB backups are backups that were created when the SCN or time value was between the SCN or time to which the PDB was recovered and the SCN or time at which the PDB was opened in RESETLOGS mode.

The END_RESETLOGS_SCN column of the V$PDB_INCARNATION view contains the SCN at which the PDB is opened in RESETLOGS mode.

  • Flashback and Database Point-in-Time Recovery Scenarios

闪回数据库与数据库的时间点恢复均可以回到任意incarnations,详见各文档说明

  1. 闪回数据库可回到direct ancestral path中,不需要执行RESET DATABASE TO INCARNATION
  2. 闪回数据库如果想回到abandoned incarnations才执行RESET DATABASE TO INCARNATION
  3. 数据库时间点恢复到非当前incarnations均要执行RESET DATABASE TO INCARNATION
  4. 数据库时间点恢复还需要还原相应incarnation的控制文件

如下图所示,如果想从incarnation 3 scn 3000回到incarnation 1 scn 500时,闪回直接flashback database to scn 500即可,而DBPITR则要执行reset database to incarnation 1

如果想从incarnation 3 scn 3000回到incarnation 1 scn 1500时,闪回与数据库均需要先执行reset database to incarnation 1然后执行flashback database to scn 1500或run{set until scn 1500; restore controlfile; alter database mount; restore database; recover database; }

### DINOv2 Compared to Other Versions or Models In the realm of deep learning architectures, particularly focusing on vision transformers (ViTs), DINOv2 represents an advanced iteration that builds upon previous models like DINOv1. The primary distinctions lie in architectural improvements and performance enhancements. #### Architectural Improvements DINOv2 incorporates a shared nothing architecture which allows for reduced coordination overhead and increased scalability when distributing computations across multiple nodes[^1]. This design choice leads to more efficient parallel processing capabilities compared to earlier versions where inter-node communication might have been more frequent and resource-intensive. #### Performance Enhancements The training methodology employed by DINOv2 has also seen significant advancements over prior iterations. Once the model type is chosen, subsequent phases involve refining it through extensive supervised learning processes utilizing large datasets annotated with labels specific to target tasks such as image classification or object detection[^3]. During this phase, adjustments made to internal parameters aim at minimizing discrepancies between predicted outcomes generated by the neural network versus ground truth values provided within these labeled examples. Moreover, optimizations introduced in DINOv2 contribute towards lowering computational costs associated with pre-training stages while simultaneously enhancing stability during fine-tuning operations performed post-initialization[^4]. #### Comparative Analysis Against Predecessors When juxtaposed against predecessors including but not limited to vanilla Vision Transformers (ViT) or even initial incarnations under the same family name i.e., DINOv1; noticeable gains become apparent: - **Accuracy**: Improved accuracy metrics observed across various benchmarks. - **Efficiency**: Greater efficiency achieved both computationally and temporally due largely thanks to streamlined algorithms alongside hardware acceleration techniques implemented throughout development cycles. - **Stability & Robustness**: Enhanced robustness ensuring consistent behavior regardless of environmental factors impacting deployment scenarios ranging from edge devices up until cloud-based services. ```python import torch from torchvision import transforms from timm.models import create_model model = create_model('dinov2_vits14', pretrained=True) transform = transforms.Compose([ transforms.Resize((224, 224)), transforms.ToTensor(), ]) image_tensor = transform(image).unsqueeze(0) output = model(image_tensor) predicted_class_idx = output.argmax().item() print(f"Predicted class index: {predicted_class_idx}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值