분류 전체보기 (658) 썸네일형 리스트형 23 - [Oracle 19C] To query data files SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> SQL> select name,open_mode,con_id from v$pdbs; NAME OPEN_MODE CON_ID -------------------- ---------- ---------- PDB$SEED READ ONLY 2 ORCLPDB READ WRITE 3 SQL> col file_name for a50 SQL> select file_name,file_id,tablespace_name,con_id from cdb_data_files; 2 FILE_NAME FILE_ID TABLESPACE_NAME CON_ID ---------------------------.. 22 - [Oracle 19C] to change container (cdb_, dba_) SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB READ WRITE NO SQL> select count(1) from cdb_tables; COUNT(1) ---------- 4363 SQL> 컨테이너를 변경하면 변경된 컨테이너에 관련된 테이블만 조회가 되므로 카운트 개수가 다르다. SQL> SQL> alter session set container=orclpdb; .. 21 - [Oracle 19C] Dynamic Performance Views(v$ views) show con_name /* CON_NAME ------------------------------ CDB$ROOT */ --show pdbs alter pluggable database orclpdb open; /* */ alter session set container=orclpdb /* Session altered. */ show con_name /* CON_NAME ------------------------------ ORCLPDB */ select oracle_username, os_user_name, locked_mode, object_name, object_type from v$locked_object a,dba_objects b where a.object_id = b.object_id;.. 20 - [Oracle 19C] Common users VS local users • A CDB common user is a database account that is created in the root container and is inherited by all PDBs in the CDB, including future PDBs • A common user can not have the same name as any local user across all the PDBs. • Oracle supplied administrative accounts such SYS user and system user are common user. • You can create common user , but you need user defined prefix C## , example C##KHA.. 19 - [Oracle 19C] Oracle Data Dictionary • Oracle data dictionary is the metadata about the database . • The data dictionary is structured in tables and views. • Is maintained by oracle database server . • Is owned by SYS user. • Should never modified direct using SQL . CDB_ & DBA_ Restricted to DBA accounts Users that have : Sysdba privileg Select any dictionary privilege SELECT_CATALOG_ROLE role ALL_ & USER_ available to any user sho.. 18 - [Oracle 19C] saving and running scripts sqlplus 에서 스크립트 저장 및 실행하는 방법 [oracle@test ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Wed Nov 15 22:57:10 2023 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- orcl SQL> .. 17 - [Oracle 19C] unlock the HR schema To unlock the HR schema in the pluggable database SQL> startup; ORACLE instance started. Total System Global Area 1526723608 bytes Fixed Size 9135128 bytes Variable Size 889192448 bytes Database Buffers 620756992 bytes Redo Buffers 7639040 bytes Database mounted. Database opened. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2.. 16 - [Oracle 19C] connecting using tnsnames.ora 파일위치 : /u01/app/oracle/product/19/db_1/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/19/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = test.com)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = test.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDIC.. 이전 1 ··· 25 26 27 28 29 30 31 ··· 83 다음