|
上完1Z0-063多租户部分第4和5章
1Z0-063多租户部分共9章(上完5章)
总共上完全部49章中的45章
CDB2:
- select t.CON_ID,t.STATUS,t.TABLESPACE_NAME
- from cdb_tablespaces t
- order by 1,3;
-
- ----
- select df.CON_ID, df.FILE_ID,df.FILE_NAME,df.ONLINE_STATUS
- from cdb_data_files df
- order by df.CON_ID, 3;
- ---
- create tablespace cdata
- datafile '/u01/app/oracle/oradata/cdb2/cdata_01.dbf'
- size 10M;
- -----
-
- select t.CON_ID,t.STATUS,t.TABLESPACE_NAME
- from cdb_tablespaces t
- order by 1,3;
- --------------------
- select t.con_id, t.name, f.name, f.status
- from v$tablespace t , v$tempfile f
- where t.ts#=f.ts# and
- t.con_id=f.con_id
- order by 1,2;
- -----
- create temporary tablespace temp_root
- tempfile '/u01/app/oracle/oradata/cdb2/temproot_01.dbf'
- size 500M;
- select t.con_id, t.name, f.name, f.status
- from v$tablespace t , v$tempfile f
- where t.ts#=f.ts# and
- t.con_id=f.con_id
- order by 1,2;
-
- ---
-
- select * from database_properties;
-
- alter database default temporary tablespace temp_root;
-
- select * from database_properties;
-
- alter pluggable database pdb2 default temporary
- tablespace temp;
- --------------
复制代码
各个PDBs:
- SQL> col property_name format a40 trunc
- SQL> col property_value format a60 trunc
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE USERS
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE 00:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME CDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 17B21F905CE739E2759E6FB99745650E
- OLS_OID_STATUS 0
- 38 rows selected.
- SQL> select con_id, name , open_mode from v$pdbs;
- CON_ID NAME OPEN_MODE
- ---------- ------------------------------ ----------
- 2 PDB$SEED READ ONLY
- 3 PDB2 READ WRITE
- 4 PDB2_2 READ WRITE
- 5 PDB_ORCL2 READ WRITE
- 6 PDB1_1 READ WRITE
- SQL> conn sys/oracle_4U@pdb2 as sysdba
- Connected.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE SYSTEM
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> conn sys/oracle_4U@pdb2_2 as sysdba
- Connected.
- SQL> /
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE SYSTEM
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2_2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> conn sys/oracle_4U@pdb_orcl2 as sysdba
- Connected.
- SQL> /
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE USERS
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE 00:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB_ORCL2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 17B21F905CE739E2759E6FB99745650E
- OLS_OID_STATUS 0
- 38 rows selected.
- SQL> conn sys/oracle_4U@pdb1_1 as sysdba
- Connected.
- SQL> /
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE USERS
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB1_1
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- DBTIMEZONE 00:00
- 38 rows selected.
- SQL> select con_id, name , open_mode from v$pdbs;
- CON_ID NAME OPEN_MODE
- ---------- ------------------------------ ----------
- 6 PDB1_1 READ WRITE
- SQL> conn / as sysdba
- Connected.
- SQL> /
- CON_ID NAME OPEN_MODE
- ---------- ------------------------------ ----------
- 2 PDB$SEED READ ONLY
- 3 PDB2 READ WRITE
- 4 PDB2_2 READ WRITE
- 5 PDB_ORCL2 READ WRITE
- 6 PDB1_1 READ WRITE
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE USERS
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE 00:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME CDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 17B21F905CE739E2759E6FB99745650E
- OLS_OID_STATUS 0
- 38 rows selected.
- SQL> alter database default tablespace cdata;
- Database altered.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE CDATA
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE 00:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME CDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 17B21F905CE739E2759E6FB99745650E
- OLS_OID_STATUS 0
- 38 rows selected.
- SQL> conn sys/oracle_4U@pdb2 as sysdba
- Connected.
- SQL> /
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE SYSTEM
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> show con_id
- CON_ID
- ------------------------------
- 3
- SQL> show con_name
- CON_NAME
- ------------------------------
- PDB2
- SQL> create tablespace ldata datafile
- '/u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf'
- size 10M; 2 3
- Tablespace created.
- SQL> selecxt tablespace_name from dba_Tablespaces;
- SP2-0734: unknown command beginning "selecxt t..." - rest of line ignored.
- SQL> select tablespace_name from dba_tablespaces;
- TABLESPACE_NAME
- ------------------------------
- SYSTEM
- SYSAUX
- TEMP
- LDATA
- SQL> select tablespace_name from cdb_tablespaces;
- TABLESPACE_NAME
- ------------------------------
- SYSTEM
- SYSAUX
- TEMP
- LDATA
- SQL> alter database default tablespace ldata;
- Database altered.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE LDATA
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> conn sys/oracle_4U@pdb2_2 as sysdba
- Connected.
- SQL> select tablespace_name from cdb_tablespaces;
- TABLESPACE_NAME
- ------------------------------
- SYSTEM
- SYSAUX
- TEMP
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE SYSTEM
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2_2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> show con_name
- CON_NAME
- ------------------------------
- PDB2_2
- SQL> conn sys/oracle_4U@pdb2 as sysdba
- Connected.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP
- DEFAULT_PERMANENT_TABLESPACE LDATA
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> create temporary tablespace temp_pdb2 tempfile
- '/u01/app/oracle/oradata/cdb2/pdb2_1/temppdb2_01.dbf'
- size 100M; 2 3
- Tablespace created.
- SQL> alter pluggable database default temporary tablespace temp_pdb2;
- Pluggable database altered.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP_PDB2
- DEFAULT_PERMANENT_TABLESPACE LDATA
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL> conn / as sysdba
- Connected.
- SQL> alter pluggable database pdb2 default temporary
- tablespace temp;
- 3 /
- alter pluggable database pdb2 default temporary
- *
- ERROR at line 1:
- ORA-65046: operation not allowed from outside a pluggable database
- SQL> conn sys/oracle_4U@pdb2 as sysdba
- Connected.
- SQL> create temporary tablespace my_temp tempfile
- '/u01/app/oracle/oradata/cdb2/pdb2_1/my_temp_pdb2_01.dbf'
- size 10M;
- 2 3
- Tablespace created.
- SQL> select property_name, property_value from database_properties;
- PROPERTY_NAME PROPERTY_VALUE
- ---------------------------------------- ------------------------------------------------------------
- DICT.BASE 2
- DEFAULT_TEMP_TABLESPACE TEMP_PDB2
- DEFAULT_PERMANENT_TABLESPACE LDATA
- DEFAULT_EDITION ORA$BASE
- Flashback Timestamp TimeZone GMT
- TDE_MASTER_KEY_ID
- DBTIMEZONE -07:00
- DEFAULT_TBS_TYPE SMALLFILE
- GLOBAL_DB_NAME PDB2
- NLS_RDBMS_VERSION 12.1.0.2.0
- NLS_NCHAR_CHARACTERSET AL16UTF16
- NLS_NCHAR_CONV_EXCP FALSE
- NLS_LENGTH_SEMANTICS BYTE
- NLS_COMP BINARY
- NLS_DUAL_CURRENCY $
- NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
- NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
- NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
- NLS_TIME_FORMAT HH.MI.SSXFF AM
- NLS_SORT BINARY
- NLS_DATE_LANGUAGE AMERICAN
- NLS_DATE_FORMAT DD-MON-RR
- NLS_CALENDAR GREGORIAN
- NLS_CHARACTERSET AL32UTF8
- NLS_NUMERIC_CHARACTERS .,
- NLS_ISO_CURRENCY AMERICA
- NLS_CURRENCY $
- NLS_TERRITORY AMERICA
- NLS_LANGUAGE AMERICAN
- DST_SECONDARY_TT_VERSION 0
- DST_PRIMARY_TT_VERSION 18
- DST_UPGRADE_STATE NONE
- MAX_STRING_SIZE STANDARD
- EXPORT_VIEWS_VERSION 8
- WORKLOAD_CAPTURE_MODE
- WORKLOAD_REPLAY_MODE
- NO_USERID_VERIFIER_SALT 98CB318693E1EEF722CAA934027EB92C
- OLS_OID_STATUS 0
- MAX_SHARED_TEMP_SIZE UNLIMITED
- MAX_PDB_STORAGE UNLIMITED
- 40 rows selected.
- SQL>
复制代码
关于CDB和PDB中的表空间和UNDO表空间:
CDB:
- create user c##u identified by x;
-
- select c.CON_ID, c.USERNAME,
- c.COMMON,
- c.DEFAULT_TABLESPACE,
- c.TEMPORARY_TABLESPACE
- from cdb_users c
- where c.USERNAME='C##U'
- order by 1;
-
- ----
-
- select t.con_id, t.name, f.name , f.status
- from v$tablespace t , v$datafile f
- where t.con_id=f.con_id
- and t.ts#=f.ts#
- and t.name like '%UNDO%'
- order by 1,2 ;
复制代码
各个PDBs:
根容器通用用户和根容器当前容器授权:
CDB:
- select u.USERNAME, u.COMMON, u.CON_ID
- from cdb_users u
- order by u.CON_ID,1;
- select u.USERNAME, u.COMMON, u.CON_ID
- from cdb_users u
- where u.USERNAME='SYSTEM'
- order by u.CON_ID;
-
-
- select u.USERNAME, u.COMMON, u.CON_ID
- from cdb_users u
- where u.COMMON='NO'
- order by u.CON_ID,1;
-
- ---
-
- select u.USERNAME, u.COMMON, u.CON_ID
- from cdb_users u
- where u.USERNAME='C##U'
- order by u.CON_ID;
- ----
- select u.USERNAME, u.COMMON
- from dba_users u
- order by 1;
- -----
- select u.CON_ID,u.USERNAME,u.DEFAULT_TABLESPACE,
- u.TEMPORARY_TABLESPACE,u.COMMON
- from cdb_users u
- where u.USERNAME='C##_USER'
- order by 1;
- ----
- create user c##_user2 identified by x container=all;
-
- grant create session to c##_user2;
-
复制代码 PDBs:
关于删除用户:
- SQL>
- SQL>
- SQL>
- SQL>
- SQL> conn c##_user/x@pdb2
- Connected.
- SQL> show user
- USER is "C##_USER"
- SQL> conn c##_user2/x@pdb2
- Connected.
- SQL> select * from dual;
- select * from dual
- *
- ERROR at line 1:
- ORA-03113: end-of-file on communication channel
- Process ID: 4379
- Session ID: 191 Serial number: 27218
- SQL>
复制代码- select u.USERNAME, u.COMMON, u.CON_ID
- from cdb_users u
- where u.USERNAME='C##_USER2'
- order by u.CON_ID;
- select * from cdb_sys_privs sp
- where sp.GRANTEE='C##_USER2'
- order by con_id;
-
- grant create session to c##_user2 container=all;
-
- select * from cdb_sys_privs sp
- where sp.GRANTEE='C##_USER2'
- order by con_id;
-
- ---
- drop user c##_user2;
- ---
- select con_id , username , sid, serial# from v$session
- where username='C##_USER2';
-
- alter system kill session '191,27218' immediate;
-
- drop user c##_user2;
复制代码
本地角色和通用角色:
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- order by 1,3;
-
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- where r.COMMON='NO';
-
- select r.COMMON, r.ROLE
- from dba_roles r;
- ------------
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- where r.CON_ID=1;
-
- ------
- create role c##_role;
-
- ----
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- order by 1,3;
-
- ----
-
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- order by 1,3;
-
- ----
-
- select r.CON_ID, r.COMMON, r.ROLE
- from cdb_roles r
- where r.COMMON='NO';
-
-
复制代码
本地角色和通用角色的本地授权或通用授权:
CDB:
- grant c##_role to c##_user;
- select GRANTEE, GRANTED_ROLE, COMMON, CON_ID
- from cdb_role_privs where grantee='C##_USER';
- grant c##_role to c##_user container=all;
- select GRANTEE, GRANTED_ROLE, COMMON, CON_ID
- from cdb_role_privs where grantee='C##_USER';
- ---
- revoke c##_role from c##_user;
- ---
- select GRANTEE, GRANTED_ROLE, COMMON, CON_ID
- from cdb_role_privs where grantee='C##_USER';
- ---
- revoke c##_role from c##_user container=all;
- ---
- select GRANTEE, GRANTED_ROLE, COMMON, CON_ID
- from cdb_role_privs where grantee='C##_USER';
- grant c##_role to c##_user;
复制代码 PDBS:
|
|