10046 解決 Oracle error

How to Offline a PDB Datafile in NOARCHIVELOG mode CDB which is not Open in Read Write (Doc ID 2240730.1)

1. pdb 下的datafile 只能在pdb下操作,不能在cdb下操作


For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

Container Database Name: CDB1
Pluggable Database Names: PDB1
Datafile Name: /tmp/STATSPACK.dbf

*********************

Attempt to offline a datafile results in error when the database is running in NOARCHIVELOG mode and is not open in read write mode:?

SQL> alter database datafile '/tmp/STATSPACK.dbf' offline;
alter database datafile '/tmp/STATSPACK.dbf' offline
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only

Changes

Unable to open the CDB, when one of the datafiles, belonging to PDB is missing from the filesystem.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 23 - see DBWR trace file
ORA-01110: data file 23: '/tmp/STATSPACK.dbf'

But I cannot offline the datafile:

SQL> select name, open_mode from v$pdbs;

NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
PDB$SEED
MOUNTED

PDB1
MOUNTED

SQL> alter session set container=PDB1;

Session altered.

SQL> alter database datafile '/tmp/STATSPACK.dbf' offline;
alter database datafile '/tmp/STATSPACK.dbf' offline
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01219: database or pluggable database not open: queries allowed on fixed
tables or views only

Cause

To determine the cause, enable 10046 trace event and try to offline the datafile:

alter session set tracefile_identifier='event_10046';
alter session set events '10046 trace name context forever,level 12';
alter database datafile '/tmp/STATSPACK.dbf' offline;

Review the trace file generated by the 10046 event. ?

Processing Oradebug command 'setmypid'

*** 2017-02-21T13:36:28.630992+01:00 (PDB1(3))
Oradebug command 'setmypid' console output: <none>

*** 2017-02-21T13:36:38.063286+01:00 (PDB1(3))
Processing Oradebug command 'EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'?? +++++++++ 10046 trace event at level 12

*** 2017-02-21T13:36:38.121570+01:00 (PDB1(3))
Oradebug command 'EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12' console output: <none>
WAIT #0: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=198174189201

*** 2017-02-21T13:36:43.936339+01:00 (PDB1(3))
WAIT #0: nam='SQL*Net message from client' ela= 5814615 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=198180003894
WAIT #0: nam='Disk file operations I/O' ela= 17 FileOperation=8 fileno=0 filetype=8 obj#=-1 tim=198180004004

*** 2017-02-21T13:36:43.936438+01:00 (PDB1(3))
Processing Oradebug command 'TRACEFILE_NAME'

*** 2017-02-21T13:36:43.936469+01:00 (PDB1(3))
Oradebug command 'TRACEFILE_NAME' console output:
/u01/app/oracle/diag/rdbms/cdb1/CDB1/trace/CDB1_ora_32744.trc
WAIT #0: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=198180004067

*** 2017-02-21T13:36:51.167762+01:00 (PDB1(3))
WAIT #0: nam='SQL*Net message from client' ela= 7231241 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=198187235319
XCTEND rlbk=0, rd_only=1, tim=198187235540

*** 2017-02-21T13:36:51.168323+01:00 (CDB$ROOT(1))
=====================
PARSING IN CURSOR #140359700677696 len=248 dep=1 uid=0 oct=3 lid=0 tim=198187235894 hv=1954812753 ad='7b67d9c8' sqlid='6qpmyqju884uj'
select ruletyp#, ruleval, status, ltime from lockdown_prof$ where prof#=:1 and level#=:2 order by ltime
END OF STMT
PARSE #140359700677696:c=0,e=130,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=198187235890
=====================
PARSE ERROR #140359700677696:len=249 dep=1 uid=0 oct=3 lid=0 tim=198187236029 err=1219
select ruletyp#, ruleval, status, ltime from lockdown_prof$??? +++++++++++++++++ error while performing select operation on?lockdown_prof$

Information in trace file shows that there is a lockdown profile. ?Thus any command will attempt to read the lockdown_prof$ table in CDB$ROOT. ?This will wait as the?CDB$ROOT is not open.

In other words, an ORA-01219 error raised for any command when:


1) CDB is not opened?
AND
2) a lockdown profile is set at CDB level

Solution

?Set pdb_lockdown= Null and attempt to offline/drop the datafile:

SQL> alter system set pdb_lockdown='';

System altered.

SQL> alter session set container=pdb1;

Session altered.

SQL> alter database datafile 23 offline for drop; Database altered.

Database altered.

SQL> alter session set container=cdb$root;

Session altered.

SQL> alter database open;

Database altered.

1.252?PDB_LOCKDOWN

PDB_LOCKDOWN?determines the PDB lockdown profile that applies to a PDB.

PropertyDescription

Parameter type

String

Syntax

PDB_LOCKDOWN = pdb-lockdown-profile-name

Default value

NULL

Modifiable

ALTER SESSION,?ALTER SYSTEM

Modifiable in a PDB

Yes

Basic

No

Oracle RAC

All instances should have the same value

A PDB lockdown profile is a mechanism to restrict operations (such as setting values of certain parameters and using certain options) that can be performed by users connected to a given PDB. You can also restrict execution of any packages that allow network access, for example,?UTL_SMTP.

You create lockdown profiles using the SQL?CREATE LOCKDOWN PROFILE?statement. Then you can set a profile using the SQL?ALTER SESSION?or?ALTER SYSTEM?statement. See the Examples section.

This parameter can be set using the?ALTER SYSTEM?statement with scope set to?MEMORY,?SPFILE, or?BOTH.

The lockdown profile for PDBs can be specified by a common user with common?ALTER SYSTEM?or common?SYSDBA?privilege.

If a PDB lockdown profile is dropped, any PDB to which the dropped profile was assigned (by means of storing the dropped profile name in the?PDB_LOCKDOWN?parameter) will continue to have its?PDB_LOCKDOWN?parameter set to the dropped lockdown profile name. However, the PDB will not have any restrictions imposed by the dropped lockdown profile.

Lockdown profiles can now be created in an application root and are referred to as application lockdown profiles.

A CDB common user with common?SYSDBA?or common?ALTER SYSTEM?privilege can only set?PDB_LOCKDOWN?to a CDB lockdown profile. Similarly, an application common user with application common?SYSDBA?or application common?ALTER SYSTEM?privilege can only set?PDB_LOCKDOWN?to an application lockdown profile.

An application common user cannot overwrite?PDB_LOCKDOWN?if?PDB_LOCKDOWN?is already set to a CDB lockdown profile in an application root or application PDB.

If the?PDB_LOCKDOWN?parameter in a PDB is set to the name of a lockdown profile different from that in its ancestor (for a CDB, the CDB root or, for application PDBs, the application root), the following will govern the interaction between restrictions imposed by these profiles:

  • If the?PDB_LOCKDOWN?parameter in a PDB (including an application PDB) is set to a CDB lockdown profile, lockdown profiles specified by the?PDB_LOCKDOWN?parameter in CDB root (and for application PDBs, the application root) are ignored.

  • If the?PDB_LOCKDOWN?parameter in an application PDB is set to an application lockdown profile while the?PDB_LOCKDOWN?parameter in the application root or CDB root is set to a CDB lockdown profile, in addition to the rules stipulated in the application lockdown profile, the DISABLE rules from the CDB lockdown profile set in its nearest ancestor (that is, an application root or CDB root) are inherited.

  • If there are conflicts between rules comprising the CDB lockdown profile and the application lockdown profile, the rules in the CDB lockdown profile will take precedence (for example, the?OPTION_VALUE?clause of a CDB lockdown profile will take precedence over the?OPTION_VALUE?clause of an application lockdown profile).

Examples

This example shows how the?SYS?user can connect to the database?AS SYSDBA?and use the?CREATE LOCKDOWN PROFILE?statement in the root of a CDB to define a new lockdown profile. After defining the new lockdown profile, the?SYS?user can assign the new lockdown profile to a PDB using the?PDB_LOCKDOWN?parameter:

Copy

SQL> ALTER SESSION SET CONTAINER=CDB$ROOT; Session altered. SQL> CREATE LOCKDOWN PROFILE MYPROFILE; Lockdown Profile created. SQL> ALTER SESSION SET CONTAINER=CDB1_PDB1; Session altered. SQL> ALTER SYSTEM SET PDB_LOCKDOWN=MYPROFILE; System altered. SQL> SHOW PARAMETER PDB_LOCKDOWN NAME TYPE VALUE -------------- ----------- --------- pdb_lockdown string MYPROFILE SQL>

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/90195.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/90195.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/90195.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

在HP暗影精靈Ubuntu20.04上修復IntelAX211Wi-Fi不可用的全過程記錄——系統安裝以后沒有WIFI圖標無法使用無線網

在 HP 暗影精靈 Ubuntu 20.04 上修復 Intel AX211 Wi-Fi 不可用的全過程記錄 2025 年 7 月初 系統環境&#xff1a;HP OMEN&#xff08;暗影精靈&#xff09;筆記本?|?雙系統 Windows 11 & Ubuntu 20.04?|?內核 5.15 / 6.15 mainline 問題關鍵詞&#xff1a;Intel AX21…

Sql server 中關閉ID自增字段(SQL取消ID自動增長)

sql server在導入數據的時候&#xff0c;有時候要考慮id不變&#xff0c;就要先取消自動增長再導入數據&#xff0c;導完后恢復自增。 比如網站改版從舊數據庫導入新數據庫&#xff0c;數據庫結構不相同&#xff0c;可能會使用insert into xx select ..from yy的語句導入數據。…

Python實現文件夾中文件名與Excel中存在的文件名進行對比,并進行刪除操作

以下python程序版本為Python3.13.01.請寫一個python程序&#xff0c;實現以下邏輯&#xff1a;從文件夾獲取所有文件名&#xff0c;與Excel中的fileName列進行對比&#xff0c;凡是不在該文件夾下的文件名&#xff0c;從Excel文檔中刪除后&#xff0c;并將Excel中fileName和fil…

廣告業務動態查詢架構設計:從數據建模到可視化呈現

在數字化營銷領域&#xff0c;廣告主每天面臨著海量數據帶來的分析挑戰&#xff1a;從賬戶整體投放效果&#xff0c;到分渠道、分地域的精細化運營&#xff0c;每一層級的數據洞察都需要靈活高效的查詢能力。我們的廣告業務動態查詢系統&#xff0c;正是為解決這類需求而生 &am…

pytorch、torchvision與python版本對應關系

pytorch、torchvision與python版本對應關系 可以查看官網&#xff1a; https://github.com/pytorch/vision#installation

【機器學習筆記 Ⅲ】3 異常檢測算法

異常檢測算法&#xff08;Anomaly Detection&#xff09;詳解 異常檢測是識別數據中顯著偏離正常模式的樣本&#xff08;離群點&#xff09;的技術&#xff0c;廣泛應用于欺詐檢測、故障診斷、網絡安全等領域。以下是系統化的解析&#xff1a;1. 異常類型類型描述示例點異常單個…

【ssh】在 Windows 上生成 SSH 公鑰并實現免密登錄 Linux

在 Windows 上生成 SSH 公鑰并實現免密登錄 Linux&#xff0c;可以使用 ssh-keygen 命令&#xff0c;這是 Windows 10 和 Windows 11 中默認包含的 OpenSSH 工具的一部分。下面是詳細步驟&#xff1a; 在 Windows 上生成 SSH 公鑰 打開 PowerShell 或命令提示符&#xff1a; 在…

MS51224 一款 16 位、3MSPS、雙通道、同步采樣模數轉換器(ADC)

MS51224 是一款 16 位、3MSPS、雙通道、同步采樣模數轉換器&#xff08;ADC&#xff09;&#xff0c;具有集成的內部參考和參考電壓緩沖器。芯片可由 5V 單電源供電&#xff0c;支持單極性和全差分模擬信號輸入&#xff0c;具有出色的直流和交流性能。芯片模擬輸入信號頻率高達…

WPF學習(四)

文章目錄一、用戶控價1.1 依賴屬性的注冊1.2 具體使用一、用戶控價 1.1 依賴屬性的注冊 using System.Windows; using System.Windows.Controls;namespace WpfApp {public partial class MyUserControl : UserControl{// 依賴屬性&#xff1a;外部可綁定的文本public static …

vue3+typescript項目配置路徑別名@

1. vite.config.ts配置//方法1 import { defineConfig } from vite; import vue from vitejs/plugin-vue; import path from path;export default defineConfig({plugins: [vue()],resolve: {alias: {: path.resolve(__dirname, src)}} });//方法2,需要執行npm install -D type…

MySql 常用SQL語句、 SQL優化

???????????????SQL語句主要分為哪幾類 SQL&#xff08;結構化查詢語言&#xff09;是用于管理和操作關系型數據庫的標準語言&#xff0c;其語句通常根據功能劃分為以下幾大類&#xff0c;每類包含不同的子句和命令&#xff0c;用于實現特定的數據庫操作需求&am…

代理模式實戰指南:打造高性能RPC調用與智能圖片加載系統

代理模式實戰指南&#xff1a;打造高性能RPC調用與智能圖片加載系統 &#x1f31f; 嗨&#xff0c;我是IRpickstars&#xff01; &#x1f30c; 總有一行代碼&#xff0c;能點亮萬千星辰。 &#x1f50d; 在技術的宇宙中&#xff0c;我愿做永不停歇的探索者。 ? 用代碼丈量…

登山第二十六梯:單目3D檢測一切——一只眼看世界

文章目錄 一 摘要 二 資源 三 內容 一 摘要 盡管深度學習在近距離 3D 對象檢測方面取得了成功&#xff0c;但現有方法難以實現對新對象和相機配置的零鏡頭泛化。我們介紹了 DetAny3D&#xff0c;這是一種可提示的 3D 檢測基礎模型&#xff0c;能夠在任意相機配置下僅使用單目…

ROS2簡記一:第一個ros2程序,海龜模擬與C++和python的《你好,世界!》

目錄 引言 一、控制小海龜 二、鍵盤控制海龜 三、控制海龜案例的簡單分析 四、ROS2之linux基礎 4.1 linux終端命令 4.1.1 查看當前終端所在目錄 pwd 4.1.2 切換終端所在目錄 cd 4.1.3 查看當前目錄下的文件 ls 4.1.4 主目錄 ~ 4.1.5 文件的操作 4.1.6 命令使用幫助…

監控的基本理論和prometheus安裝

監控的基本理論和prometheus安裝 前言 這篇博客主要講的是關于理論的知識&#xff0c;大家盡可能的消化和吸收&#xff0c;也能擴展大家的知識面 監控的基本概念 監控俗稱為運維的第三只眼。沒有了監控&#xff0c;業務運維都是“瞎子”。所以說監控室運維這個職業的根本&…

互聯網生態下贏家群體的崛起與“開源AI智能名片鏈動2+1模式S2B2C商城小程序“的賦能效應

摘要&#xff1a;本文聚焦未來互聯網贏家群體的構成特征&#xff0c;剖析網紅經濟與專業主播的差異化發展路徑&#xff0c;結合開源AI智能名片鏈動21模式與S2B2C商城小程序的融合創新&#xff0c;提出技術賦能下互聯網商業生態的重構路徑。研究表明&#xff0c;開源AI技術通過智…

OneCode 圖表組件核心優勢解析

一、全方位的可視化能力 OneCode 圖表組件提供了15種專業圖表類型&#xff0c;覆蓋從基礎到高級的數據可視化需求&#xff1a; 基礎圖表&#xff1a;柱狀圖、折線圖、餅圖、面積圖等高級圖表&#xff1a;金字塔圖、雷達圖、儀表盤、LED圖表等實時圖表&#xff1a;實時折線圖、實…

【Linux】RHCE中ansible的配置

1.安裝并配置ansible 第一步先安裝ansible所需軟件 #安裝ansible所需軟件 [devopsworkstation ~]$ sudo dnf install ansible ansible-navigator rhel-system-roles -y 第二步登錄鏡像倉庫&#xff0c;在鏡像倉庫下載鏡像容器來運行ansible 由于ansible-navigator 知ansible…

ubuntu server系統 安裝寶塔

更新系統軟件包sudo apt update && sudo apt upgrade -y提示&#xff0c;如果想博主這樣是存綠色liunx系統&#xff0c;要先安裝python3腳本才可以python3 --version有pyhton版本號就是安裝了&#xff0c;沒有的話就要安裝安裝 Pythonsudo apt update sudo apt install…

用C++實現五子棋游戲

#include <iostream> #include <vector> #include <string> #include <iomanip> // 用于控制輸出格式 #include <limits> // 用于numeric_limitsusing namespace std;// 游戲常量定義 const int BOARD_SIZE 15; // 定義棋盤大小為15x15// 棋…