灌溉梦想,记录脚步
标签类目:oracle

Oracle启用归档

1、单实例

Oracle 9i

ALTER SYSTEM SET log_archive_start=TRUE SCOPE=spfile;
ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYSID/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s.arc' SCOPE=spfile;
 
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ARCHIVE LOG START;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

Oracle 10g

ALTER SYSTEM SET log_archive_dest_1='location=/u01/oradata/MYSID/archive/' SCOPE=spfile;
ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;
 
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

继续阅读 »

命令创建ACFS

创建挂载点

mkdir -p /u01/app/oracle/acfsmounts/data_acfsvol3
chown oracle:oinstall /u01/app/oracle/acfsmounts/data_acfsvol3

连接到ASM创建Volume

su - oracle
[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [RAC1] ? +ASM1
The Oracle base for ORACLE_HOME=/u01/app/11.2.0/grid is /u01/app/oracle
[oracle@rac1 ~]$ dbhome
/u01/app/11.2.0/grid
[oracle@rac1 ~]$ sqlplus / as sysasm
Issue to the following command to create a new volume.
 
SQL> ALTER DISKGROUP DATA ADD VOLUME ACFSVOL3 SIZE 10G;
 
Diskgroup altered.
 
SQL>
Exit the SQL*Plus session, then create a file system on the volume.

继续阅读 »

在11gR2中使用RMAN复制数据库

RMAN 可以通过复制或者克隆,从一个运行的库中复制一个备份。可以用来在远程站点上复制数据库,下面示例中源库和复制库使用同样的SID:DB11G

在源库中创建备份。

$ rman target=/
 
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG

为目标库创建password文件

$ orapwd file=/u01/app/oracle/product/11.2.0/db_1/dbs/orapwDB11G password=password entries=10

在”$ORACLE_HOME/network/admin” 中增加”tnsnames.ora” 允许目标库访问源库。

# Added to the tnsnames.ora
DB11G-SOURCE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ol5-112-dup1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (ORACLE_SID = DB11G)
    )
  )

继续阅读 »

关于VIP的奇怪故障一例

OS:HP-UX 11.31 DB:Oracle 10.0.2.5 RAC (2nodes)

问题描述:节点二在服务启动后,经过1分钟至3分钟会发生VIP导致的服务切换,切换后节点二VIP在节点一上启动,检查日志主要报错为:

1
Invalid parameters, or failed to bring up VIP (host=essrzc2)

经过检查,系统网关配置正常,响应速度正常,系统日志无异常。开启服务debug后收获如下日志:

1
2
3
4
5
6
7
8
2013-12-16 14:57:08.192: [    RACG][1] [21721][1][ora.essrzc2.vip]: Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] Checking interface existance
Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] Calling getifbyip
Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] getifbyip:  started for 132.42.37.144
 
2013-12-16 14:57:08.192: [    RACG][1] [21721][1][ora.essrzc2.vip]: Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] Completed getifbyip lan900:801
Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] Completed with initial interface test
Mon Dec 16 14:57:03 EAT 2013 [ 21730 ] Broadcast = 132.42.37.255
 <a href="https://www.forzw.com/archives/707#more-707" class="more-link">继续阅读 &raquo;</a>

ORA-65086: cannot open/close the pluggable database

在Oracle 12C中执行卸载命令后,如果执行PDB的OPEN操作,将会提示错误,如下:

1
2
3
4
5
6
7
8
SQL> alter pluggable database pdb01 unplug into '/opt/oracle/pdb01.xml';
 
Pluggable database altered.
 
SQL> ALTER PLUGGABLE DATABASE pdb01 OPEN;
*
ERROR at line 1:
ORA-65086: cannot open/close the pluggable database

继续阅读 »

crs_stop 错误一列

grid 与 oracle 版本为11.2.0.4,为两节点RAC,在通过crs_stop -all命令关闭oracle服务时出现下面问题:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[oracle@rac01 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATA.dg    ora....up.type OFFLINE   OFFLINE               
ora.FRA.dg     ora....up.type OFFLINE   OFFLINE               
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               
ora....N1.lsnr ora....er.type OFFLINE   OFFLINE               
ora.OCR.dg     ora....up.type OFFLINE   OFFLINE               
ora.asm        ora.asm.type   OFFLINE   ONLINE    rac02       
ora.cvu        ora.cvu.type   OFFLINE   OFFLINE               
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type OFFLINE   OFFLINE               
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
ora.ons        ora.ons.type   OFFLINE   OFFLINE               
ora.rac.db     ora....se.type OFFLINE   OFFLINE               
ora....SM1.asm application    OFFLINE   ONLINE    rac01       
ora....01.lsnr application    OFFLINE   OFFLINE               
ora.rac01.gsd  application    OFFLINE   OFFLINE               
ora.rac01.ons  application    OFFLINE   OFFLINE               
ora.rac01.vip  ora....t1.type OFFLINE   OFFLINE               
ora....SM2.asm application    OFFLINE   ONLINE    rac02       
ora....02.lsnr application    OFFLINE   OFFLINE               
ora.rac02.gsd  application    OFFLINE   OFFLINE               
ora.rac02.ons  application    OFFLINE   OFFLINE               
ora.rac02.vip  ora....t1.type OFFLINE   OFFLINE               
ora....ry.acfs ora....fs.type OFFLINE   OFFLINE               
ora.scan1.vip  ora....ip.type OFFLINE   OFFLINE

继续阅读 »

Oracle Database 12C 体验

oracle版本:12.1.0.1.0
redhat版本:RedHat EL5.6 x64

安装过程分以下四个步骤

一,安装准备
二,下载安装
三,过程详解
四,常见错误

一,安装准备
1,创建oracle用户
继续阅读 »