SQL> select name,
2 value
3 from v$parameter
4 where name in ('processes','sessions');
NAME VALUE
processes 300
sessions 472
SQL> alter session set container=CLONEPDB_PLUG;
Session altered.
SQL> select name,
2 value
3 from v$parameter
4 where name in ('processes','sessions');
NAME
VALUE
processes
300
sessions
472
在ORACLE 12C中参数文件只是记录了cdb的参数信息,没有记录任何的pdb的信息
SQL> select * from v$sgastat where name ='processes';
POOL NAME BYTES CON_ID
shared pool processes 2400 1
SQL> show parameter sga
NAME TYPE
allow_group_access_to_sga boolean
lock_sga boolean
pre_page_sga boolean
sga_max_size big integer
sga_min_size big integer
sga_target big integer
unified_audit_sga_queue_size integer
SQL> alter session set sql_trace=true;
会话已更改。
SQL> show parameter sga
NAME TYPE VALUE
allow_group_access_to_sga boolean FALSE
lock_sga boolean FALSE
pre_page_sga boolean TRUE
sga_max_size big integer 2640M
sga_min_size big integer 0
sga_target big integer 2640M
unified_audit_sga_queue_size integer 1048576
SQL> alter session set sql_trace=false;
会话已更改。
SQL> select value from v$diag_info where name='Default Trace File';
VALUE
C:\APP\ADMINISTRATOR
\VIRTUAL\diag\rdbms\
newtest\newtest\trac
e\newtest_ora_29296.
trc
SELECT NAME NAME_COL_PLUS_SHOW_PARAM,DECODE(TYPE,1,'boolean',2,'string',3,'integer',4,'file',5,'number', 6,'big integer', 'unknown') TYPE,DISPLAY_VALUE VALUE_COL_PLUS_SHOW_PARAM FROM V$PARAMETER WHERE UPPER(NAME) LIKE UPPER(:NMBIND_SHOW_OBJ) ORDER BY NAME_COL_PLUS_SHOW_PARAM,ROWNUM
set sqlprompt "_user'@'_connect_identifier>"这样才正确
SQL> select sid,name,value from v$spparameter where value is not null;
SID NAME VALUE
- processes 300
- nls_language SIMPLIFIED CHINESE
- nls_territory CHINA
- sga_target 2759852032
- control_files C:\app\Administrator\virtual\oradata\newtest\control01.ctl
- control_files C:\app\Administrator\virtual\oradata\newtest\control02.ctl
- db_block_size 8192
- compatible 12.2.0
- db_create_file_dest C:\app\Administrator\virtual\oradata
- undo_tablespace UNDOTBS1
- remote_login_passwordfile EXCLUSIVE
- dispatchers (PROTOCOL=TCP) (SERVICE=newtestXDB)
- local_listener LISTENER_NEWTEST
- audit_file_dest C:\app\Administrator\virtual\admin\newtest\adump
- audit_trail db
- db_name newtest
- open_cursors 300
- pga_aggregate_target 920649728
- diagnostic_dest C:\app\Administrator\virtual
- enable_pluggable_database true
20 rows selected
SYS@newtest>set line 200
SYS@newtest>col name forMat A15
SYS@newtest>col value forMat A185
SYS@newtest>select name,value from v$parameter where name='control_files';
NAME
VALUE
control_files
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL01.CTL, C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL02.CTL
SYS@newtest>col value forMat A105
SYS@newtest>select name,value from v$parameter2 where name='control_files';
NAME VALUE
control_files C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL01.CTL
control_files C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL02.CTL
SYS@newtest>show spparameter
SID NAME TYPE VALUE
- DBFIPS_140 boolean
- O7_DICTIONARY_ACCESSIBILITY boolean
- active_instance_count integer
- allow_global_dblinks boolean
- allow_group_access_to_sga boolean
- approx_for_aggregation boolean
- approx_for_count_distinct boolean
- approx_for_percentile string
- aq_tm_processes integer
- archive_lag_target integer
- asm_diskgroups string
SID NAME TYPE VALUE
- asm_diskstring string
- asm_io_processes integer
- asm_power_limit integer
SYS@newtest>show parameter memory_target
NAME TYPE VALUE
memory_target big integer 0
SYS@newtest>show spparameter memory_target
SID NAME TYPE VALUE
- memory_target big integer
SYS@newtest>create spfile from pfile;
create spfile from pfile -
第 1 行出现错误:
ORA-32002: 无法创建已由实例使用的 SPFILE
SYS@newtest>alter system set db_cache_size=24M scope=spfile;【both不报错】
alter system set db_cache_size=24M scope=spfile -
第 1 行出现错误:
ORA-01565: 标识文件
'C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\SPFILENEWTEST.ORA
' 时出错
ORA-27041: 无法打开文件
OSD-04002: ??????????
O/S-Error: (OS 2) ????????????????
SQL> select name,value from v$parameter where name='spfile';
NAME VALUE
spfile C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\SPFILENEWTEST.ORA
SYS@newtest>show parameter spfile
NAME TYPE
VALUE
spfile string
C:\APP\ADMINISTRATOR\VIRTUAL\P
RODUCT\12.2.0\DBHOME_2\DATABAS
E\SPFILENEWTEST.ORA
SYS@newtest>select count(*) from v$spparameter where value is not null;
COUNT(*)
20
SYS@newtest>select isspecified ,count(*) from v$spparameter group by isspecified
;
ISSPECIFIED COUNT(*)
TRUE 20
FALSE 397
C:\Users\Administrator>rman target /
恢复管理器: Release 12.2.0.1.0 - Production on 星期二 1月 9 15:25:14 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
已连接到目标数据库: NEWTEST (DBID=1779551310)
RMAN> show all;
使用目标数据库控制文件替代恢复目录
db_unique_name 为 NEWTEST 的数据库的 RMAN 配置参数为:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOA
D TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.
2.0\DBHOME_2\DATABASE\SNCFNEWTEST.ORA'; # default
SQL> select * from v$rman_configuration;
CONF# NAME VALUE CON_ID
SQL> select * from v$backup_spfile;
RECID STAMP SET_STAMP SET_COUNT MODIFICATION_TIME BYTES COMPLETION_TIME DB_UNIQUE_NAME CON_ID GUID
RMAN> backup database
2> ;
从位于 09-1月 -18 的 backup 开始
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=57 设备类型=DISK
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件, 文件号 = 00003 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\SYSAUX01.DBF
输入数据文件, 文件号 = 00001 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\SYSTEM01.DBF
输入数据文件, 文件号 = 00005 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\UNDOTBS01.DBF
输入数据文件, 文件号 = 00007 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\USERS01.DBF
通道 ORA_DISK_1: 正于 09-1月 -18 启动段 1
通道 ORA_DISK_1: 完成了于 09-1月 -18 启动段 1
片段句柄 = C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\01SO8IN
B_1_1 标记 = TAG20180109T153402 注释 = NONE
通道 ORA_DISK_1: 备份集完成, 用时: 00:01:05
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件, 文件号 = 00009 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBTEST\SYSAUX01.DBF
输入数据文件, 文件号 = 00010 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBTEST\UNDOTBS01.DBF
输入数据文件, 文件号 = 00008 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBTEST\SYSTEM01.DBF
输入数据文件, 文件号 = 00011 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBTEST\USERS01.DBF
通道 ORA_DISK_1: 正于 09-1月 -18 启动段 1
通道 ORA_DISK_1: 完成了于 09-1月 -18 启动段 1
片段句柄 = C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\02SO8IP
C_1_1 标记 = TAG20180109T153402 注释 = NONE
通道 ORA_DISK_1: 备份集完成, 用时: 00:00:25
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件, 文件号 = 00041 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\CLONEPDB_PLUG\SYSAUX01.DBF
输入数据文件, 文件号 = 00040 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\CLONEPDB_PLUG\SYSTEM01.DBF
输入数据文件, 文件号 = 00042 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\CLONEPDB_PLUG\UNDOTBS01.DBF
输入数据文件, 文件号 = 00043 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\CLONEPDB_PLUG\USERS01.DBF
通道 ORA_DISK_1: 正于 09-1月 -18 启动段 1
通道 ORA_DISK_1: 完成了于 09-1月 -18 启动段 1
片段句柄 = C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\03SO8IQ
6_1_1 标记 = TAG20180109T153402 注释 = NONE
通道 ORA_DISK_1: 备份集完成, 用时: 00:00:25
通道 ORA_DISK_1: 正在启动全部数据文件备份集
通道 ORA_DISK_1: 正在指定备份集内的数据文件
输入数据文件, 文件号 = 00004 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBSEED\SYSAUX01.DBF
输入数据文件, 文件号 = 00002 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBSEED\SYSTEM01.DBF
输入数据文件, 文件号 = 00006 名称 = C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST
\PDBSEED\UNDOTBS01.DBF
通道 ORA_DISK_1: 正于 09-1月 -18 启动段 1
通道 ORA_DISK_1: 完成了于 09-1月 -18 启动段 1
片段句柄 = C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\04SO8IQ
V_1_1 标记 = TAG20180109T153402 注释 = NONE
通道 ORA_DISK_1: 备份集完成, 用时: 00:00:25
在 09-1月 -18 完成了 backup
从位于 09-1月 -18 的 Control File and SPFILE Autobackup 开始
片段句柄 = C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\C-17795
51310-20180109-00 注释 = NONE
在 09-1月 -18 完成了 Control File and SPFILE Autobackup
SQL> select * from v$backup_spfile;
RECID STAMP SET_STAMP SET_COUNT MODIFICATION_TIME BYTES COMPLETION_TIME DB_UNIQUE_NAME CON_ID GUID
1 964971385 964971385 5 2018/1/9 14:51:57 32768 2018/1/9 15:36: NEWTEST 1 728E7604E58A4D8D8F564226F3889876