2014年12月5日星期五

有些乱,做个进程关系的笔记

has,Oracle High Availability Services
css,  Cluster Synchronization Services
crs,  Cluster Ready Services
ons,   Oracle Notification Services
 
多了/etc/init.d/ohasd文件,这里是入口了。

crsctl start has -nowait启动了has,has后,启动css,再crs

最低层,硬件和OS
第一层,css,负责节点同步监控等
第二层,crs,我们用crsctl来操作这一层
第三层,各种资源,我们用srvctl来操作这一层,ons也是一个资源,vip等也是,asm的instance也是




2014年12月1日星期一

pdb索引表空间dbf丢失后,如何修复

在pdb里面我手动删了一个索引表空dbf,12c里恢复方法如下

[oracle@orasrv ~]$ sqlplus / as sysdba;

SQL*Plus: Release 12.1.0.1.0 Production on Mon Dec 1 20:56:43 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> !rm /u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf

SQL> shutdown;
ORA-01116: error in opening database file 26
ORA-01110: data file 26: '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> drop tablespace zyzidx including contents and datafiles;
drop tablespace zyzidx including contents and datafiles
*
ERROR at line 1:
ORA-00959: tablespace 'ZYZIDX' does not exist


SQL> alter session set container=pdborcl;

Session altered.

SQL> drop tablespace zyzidx including contents and datafiles;
drop tablespace zyzidx including contents and datafiles
*
ERROR at line 1:
ORA-01116: error in opening database file 26
ORA-01110: data file 26: '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3


SQL> alter session set container=cdb$root;

Session altered.

SQL> shutdown abort;
ORACLE instance shut down.
SQL>  startup  mount;
ORACLE instance started.

Total System Global Area 3206836224 bytes
Fixed Size                  2293496 bytes
Variable Size             771752200 bytes
Database Buffers         2415919104 bytes
Redo Buffers               16871424 bytes
Database mounted.
SQL> alter database datafile '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf' offline drop;
alter database datafile '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf' offline drop
*
ERROR at line 1:
ORA-01516: nonexistent log file, data file, or temporary file
"/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf"


SQL> alter session set container=pdborcl;

Session altered.

SQL> alter database datafile '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf' offline drop;

Database altered.

SQL> alter session set container=cdb$root;

Session altered.

SQL> alter database open;

Database altered.

SQL>  alter session set container=pdborcl;

Session altered.

SQL> drop tablespace zyzidx including contents and datafiles;
drop tablespace zyzidx including contents and datafiles
*
ERROR at line 1:
ORA-01109: database not open


SQL> alter session set container=cdb$root;

Session altered.

SQL> alter pluggable database pdborcl open;

Pluggable database altered.

SQL>  alter session set container=pdborcl;

Session altered.

SQL> drop tablespace zyzidx including contents and datafiles;

Tablespace dropped.

SQL> create tablespace zyzidx datafile '/u01/app/oracle/oradata/orcl/pdborcl/zyzidx01.dbf' size 10m;   

Tablespace created.