跳到主要内容

Oracle相关问题处理

安装步骤

安装步骤地址

报错处理一

ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/data/oracle/product/11.2.0/db_1/dbs/initorcl.ora

处理方案

报错处理二

ORA-00205: error in identifying control file, check alert log for more info

处理方案

具体操作步骤:

  • 使用命令dbca创建数据库jc中,去/usr/oracle/app中执行如下命令:即可拿到control_files路径。 find . -name control0*
  • 在SQL>窗口中执行如下命令,看control_files的路径如查找到的是否一致
show parameter control_files
alter system set control_files='/usr/oracle/app/oradata/jc/control01.ctl' scope=spfile;
alter system set control_files='/usr/oracle/app/flash_recovery_area/jc/control02.ctl' scope=spfile;

Oralce数据库配置文件

.bash_profile initjc.ora

linux 版 ORACLE自启

参见博客

Oracle数据库 字符集中文乱码

参见博客

Oracle 时间判断

不要使用trim(column)>someDate

直接 column > someDate

oracle数据库连接串

  1. ;表达式 SID格式
  2. /表达式 ServiceName格式

修复Oracle密码过期问题

Select * FROM dba_profiles s Where s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME'; 

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;


alter user jc identified by 123456;
alter user syste identified by 123456;

Mybtis主键自增处理

oracle

@Bean
public IKeyGenerator keyGenerator() {
return new H2KeyGenerator();
}

@KeySequence(value="xxx_sequence)
@TableId(type=IdType.INPUT)
prive Long primaryKey;

mysql

@TableId(type=IdType.AUTO)
// 在Mapper上面写
@Insert(xxx)
@Options(useGeneratedKeys=true, keyProperty="id")
int insertOne(XxxPo po)