[Oracle]ORACLE EXP导出提示EXP-00091 Exporting questionable statistics


1、问题原因

该提示是因为当前的环境变量NLS_LANG和数据库字符language不一致造成的,查看当前的数据字符集

1
2
3
4
10:56:39 SYS@ boston> Select userenv('LANGUAGE') FROM DUAL;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK

2、查看当前的环境变量NLS_LANG

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[oracle@node3 bin]$ echo $NLS_LANG

[oracle@node3 bin]$
值为空,设置该值于数据库字符集语言一致,再次使用exp导出
[oracle@node3 bin]$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
[oracle@node3 bin]$ ./exp test/Test12345678@boston177 file=/tmp/daochu.dmp log=/tmp/daochu.log
Export: Release 11.2.0.3.0 - Production on Thu Sep 5 10:57:41 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table TEST 3 rows exported
. . exporting table TEST1 0 rows exported
. . exporting table TEST2 0 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.

导出正常

点击阅读

[Oracle]expdp导出报错ORA-39014 ORA-39029 ORA-04063 ORA-06508


1、使用expdp导出命令

1
2
3
4
5
6
7
8
9
10
11
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "ZEVEN"."SYS_EXPORT_SCHEMA_01": zeven/********
dumpfile=zeven.dmpdirectory=exp_data_dir cluster=n
ORA-39014: One or more workers have prematurely exited.
ORA-39029: worker 1 with process name "DW00" prematurely terminated
ORA-31671: Worker process DW00 had an unhandled exception.
ORA-04063: package body "SYS.KUPW$WORKER" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYS.KUPW$WORKER"
ORA-06512: at line 2
Job "ZEVEN"."SYS_EXPORT_SCHEMA_01" stopped due to fatal error at Tue Sep 3 14:29:49 2019 elapsed 0 00:00:30

2、查看SYS.KUPW$WORKE包的状态

1
2
3
4
5
6
7
8
15:19:08 SYS@ oibs11> select owner,object_name,object_type,status from dba_objects where status <> 'VALID' order by object_name;

OWNER OBJECT_NAME OBJECT_TYPE STATUS
------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------- --------------
.....
SYS KUPW$WORKER PACKAGE BODY INVALID
......
10 rows selected.

3、根据mos提示执行下面脚本

1
2
3
4
5
6
7
8
9
15:15:33 SYS@ oibs11> @?/rdbms/admin/prvtbpw.plb;
Warning: Package Body created with compilation errors.
Elapsed: 00:00:00.72
15:16:05 SYS@ oibs11> show errors;
Errors for PACKAGE BODY KUPW$WORKER:
LINE/COL ERROR
-------- -----------------------------------------------------------------
22308/5 PL/SQL: SQL Statement ignored
22308/34 PL/SQL: ORA-00942: table or view does not exist

提示报错,表或者视图不存在,执行下面两个脚本

1
2
@?/rdbms/admin/catdpb.sql
@?/rdbms/admin/utlrp.sql

执行正常,再次查看包的状态,包恢复正常

1
2
3
4
5
6
15:35:14 SYS@ boston> select owner,object_name,object_type,status from dba_objects where status = 'VALID' and object_name = 'KUPW$WORKER';

OWNER OBJECT_NAME OBJECT_TYPE STATUS
------------------------------ -------------------------------------------------------------------------------------------------------------------------------- ------------------- -------
SYS KUPW$WORKER PACKAGE VALID
SYS KUPW$WORKER PACKAGE BODY VALID

4、再次执行导出服务,恢复正常

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
[oracle@dax-mysql-slave tmp]$ expdp te/te12345678  dumpfile=zeven.dmp directory=exp_data_dir cluster=n logfile=expdp_zeven.log
Export: Release 11.2.0.4.0 - Production on Tue Sep 3 15:10:46 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TE"."SYS_EXPORT_SCHEMA_01": te/******** dumpfile=zeven.dmp directory=exp_data_dir cluster=n logfile=expdp_zeven.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PASSWORD_HISTORY
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
. . exported "TE"."TEST1" 0 KB 0 rows
Master table "TE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TE.SYS_EXPORT_SCHEMA_01 is:
/tmp/backup/zeven.dmp
Job "TE"."SYS_EXPORT_SCHEMA_01" successfully completed at Tue Sep 3 15:11:06 2019 elapsed 0 00:00:19

点击阅读

[Oracle]oracle启动报错ORA-00845


1、当oracle下pfile文件中设置的memory_target参数设置的值大于/dev/shm参数时就会提示错误

ORA-00845: MEMORY_TARGET not supported on this system

2、这是需要调整/dev/shm参数使其大于或者等于memory_target参数

1
2
mount -t tmpfs shmfs -o size=22288M /dev/shm
mount -o remount,size=22288M /dev/shm

3、为保证系统重启,参数恢复为默认,需要添加到/etc/fstab下:

tmpfs /dev/shm tmpfs defaults,size=22288M 0 0

点击阅读

[Oracle]oracle11.2.0.4数据库修改用户名称


1、用sysdba账号登入数据库,然后查询到要更改的用户信息

SELECT user#,name FROM user$;

2、更改用户名并提交

1
2
UPDATE USER$ SET NAME='VTEBANK' WHERE user#=84;
COMMIT;

3、强制刷新

ALTER SYSTEM CHECKPOINT;
ALTER SYSTEM FLUSH SHARED_POOL;

4、更新用户的密码

ALTER USER VTEBANK IDENTIFIED BY VTEBANK;

点击阅读

[Oracle]oracle Blob字段转字符串


select dbms_lob.substr(IOF_CONTEXT) FROM IM_OPERATION_FLOW WHERE IOF_BATCHNO='3652';
转换的时候如果报错
[Err] ORA-06502: PL/SQL: 数字或值错误 : raw variable length too long
使用下面方法截取字符串
SELECT trim(dbms_lob.substr(IOF_CONTEXT,2000)) FROM IM_OPERATION_FLOW WHERE IOF_BATCHNO='3652'

点击阅读

[Oracle] oracle的jdbc连接方式:oci和thin


1、thin和oci区别

1
2
thin是一种瘦客户端的连接方式,即采用这种连接方式不需要安装oracle客户端,只要求classpath中包含jdbc驱动的jar包就行。thin就是纯粹用Java写的ORACLE数据库访问接口。
oci是一种胖客户端的连接方式,即采用这种连接方式需要安装oracle客户端。oci是Oracle Call Interface的首字母缩写,是ORACLE公司提供了访问接口,就是使用Java来调用本机的Oracle客户端,然后再访问数据库,优点是速度 快,但是需要安装和配置数据库。

2、thin的连接方法

1
2
3
4
5
6
7
8
9
jdbc:oracle:thin:@host:port:SID
例如: jdbc:oracle:thin:@localhost:1521:orcl

jdbc:oracle:thin:@//host:port/service_name
例如: jdbc:oracle:thin:@//localhost:1521/orcl.city.com

jdbc:oracle:thin:@TNSName
例如: jdbc:oracle:thin:@TNS_ALIAS_NAME
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.16.91)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl)))

3、oci的连接方法

1
jdbc:oracle:oci:@service_name

点击阅读

[Oracle]oracle ONS服务


1、ONS(Oracle Notification Service)是Oracle Clusterware 实现FAN Event Push模型的基础。

1
在传统模型中,客户端需要定期检索服务器来判断服务端的状态,本质上是一个PULL模型。ORACLE10引入了一种全新的PUSH机制--FAN(Fast Application Notification),当服务端发生某些事件时,服务器会主动的通知客户端这种变化,这样客户端就能尽早得知服务器端变化。而这种机制就是依赖ONS实现的。通常使用onsctl命令管理配置ONS,使用onsctl命令之前,需要先配置ONS服务。

2、ons配置文件在grid的安装目录下/u01/app/11.2.0.4/grid/opmn/conf
more ons.config

1
2
3
4
5
usesharedinstall=true
allowgroup=true
localport=6100 # line added by Agent
remoteport=6200 # line added by Agent
nodes=rac1:6200,rac2:6200 # line added by Agent

<1>localport:这个参数代表本地监听端口,这里的”本地”特指127.0.0.1这个回环地址,用来和运行在本地的客户端进行通信。
<2>remoteport:这个参数代表的远程监听端口,也就是除了127.0.0.1以外的所有本机IP地址,用来和远程的客户端进行通信。
<3>loglevel:Oracle允许跟踪ONS进程的运行,并把日志记录到本地文件中。这个参数用来定义ONS进程要记录的日志级别, 从1~9,缺省值为3。
<4>logfile:这个参数和loglevel参数一起使用,用于定义ONS进程日志文件的位置,缺省是 $CRS_HOME/opmn/logs/opmn.log。
<5>nodes和useocr:这两个参数共同决定了本机的ONS daemon要和哪些节点上的ONS daemon进行通信。

3、查看ons启动端口

1
2
3
4
5
6
7
netstat -tunlp|grep ons
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
tcp 0 0 127.0.0.1:6100 0.0.0.0:* LISTEN 2230/ons
tcp6 0 0 ::1:6100 :::* LISTEN 2230/ons
tcp6 0 0 :::6200 :::* LISTEN 2230/ons

4、onsctl命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[grid@rac1 opmn]$ onsctl help
usage: onsctl [verbose] <command> [<options>]
The verbose option enables debug tracing and logging (for the server start).
Permitted <command>/<options> combinations are:
command options
------- ---------
start - Start ons
shutdown - Shutdown ons
reload - Trigger ons to reread its configuration file
debug [<attr>=<val> ..] - Display ons server debug information
set [<attr>=<val> ..] - Set ons log parameters
query [<attr>=<val>] - Query ons log parameters
ping [<max-retry>] - Ping local ons
help - Print brief usage description (this)
usage [<command>] - Print detailed usage description

ons进程在的情况下,不一定能确保ons状态正常,需要使用ping参数确认一下

1
2
[grid@rac1 opmn]$ onsctl ping
ons is running ...

5、停止启动ons服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
停止ons服务
[grid@rac1 opmn]$ onsctl stop
CRS-2673: Attempting to stop 'ora.ons' on 'rac1'
CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded
查看ons服务在节点1上已经offline
[grid@rac1 opmn]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ons
OFFLINE OFFLINE rac1
ONLINE ONLINE rac2
使用ons的ping参数去测试节点,提示ons已经没有运行了
[grid@rac1 opmn]$ onsctl ping
ons is not running ...
重新启动ons
[grid@rac1 opmn]$ onsctl start
CRS-2672: Attempting to start 'ora.ons' on 'rac1'
CRS-2676: Start of 'ora.ons' on 'rac1' succeeded

6、配置ONS

1
2
3
4
5
6
7
使用racgons参数之前,需要修改ons.config配置文件,添加userocr=on参数
添加ONS:
racgons add_config hostname:port [hostname:port] [hostname:port]
$ racgons add_config rac1:6200 rac2:6200
删除ONS:
racgons remove_config hostname[:port] [hostname:port] [hostname:port]
$ racgons remove_config rac1:6200 rac2:6200

注意:racgons命令建议用root身份执行,如果使用oracle、grid身份执行这个命令,不会提示任何错误信息,但是也不会更改任何配置。

7、ONS服务也可以由srvctl工具来维护,还可以跟踪ons的信息。下面是查看ons配置信息

1
2
3
$srvctl config nodeapps -s
[grid@rac1 ~]$ srvctl config nodeapps -s
ONS exists: Local port 6100, remote port 6200, EM port 2016

点击阅读

[Oracle] sqlplus连接数据库缓慢问题


1、使用strace跟踪用户空间进程

strace -t -T -o /tmp/sqlplus.log sqlplus / as sysdba
将日志打印到/tmp/sqlplus.log目录下,查看日志文件,发现去请求202.106.0.20这个ip耗时较长

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
15:26:40 munmap(0x7fbb152d3000, 28871)  = 0 <0.000024>
15:26:40 socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 9 <0.000021>
15:26:40 connect(9, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("202.106.0.20")}, 16) = 0 <0.000043>
15:26:40 poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ([{fd=9, revents=POLLOUT}]) <0.000017>
15:26:40 sendmmsg(9, {{{msg_name(0)=NULL, msg_iov(1)=[{"|\266\1\0\0\1\0\0\0\0\0\0\7centos7\0015\0\0\1\0\1", 27}], msg_controllen=0, msg_flags=MSG_EOR|MSG_WAITALL|MSG_SYN|MSG_CONFIRM|MSG_ERRQUEUE|MSG_NOSIGNAL|MSG_WAITFORONE|MSG_FASTOPEN|0x9a8a0000}, 27}, {{msg_name(0)=NULL, msg_iov(1)=[{"\320\1\1\0\0\1\0\0\0\0\0\0\7centos7\0015\0\0\34\0\1", 27}], msg_controllen=0, msg_flags=MSG_CONFIRM}, 27}}, 2, MSG_NOSIGNAL) = 2 <0.000088>
15:26:40 poll([{fd=9, events=POLLIN}], 1, 5000) = 0 (Timeout) <5.005164>
15:26:45 poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ([{fd=9, revents=POLLOUT}]) <0.000023>
15:26:45 sendmmsg(9, {{{msg_name(0)=NULL, msg_iov(1)=[{"|\266\1\0\0\1\0\0\0\0\0\0\7centos7\0015\0\0\1\0\1", 27}], msg_controllen=0, msg_flags=MSG_EOR|MSG_WAITALL|MSG_SYN|MSG_CONFIRM|MSG_ERRQUEUE|MSG_NOSIGNAL|MSG_WAITFORONE|MSG_FASTOPEN|0x9a8a0000}, 27}, {{msg_name(0)=NULL, msg_iov(1)=[{"\320\1\1\0\0\1\0\0\0\0\0\0\7centos7\0015\0\0\34\0\1", 27}], msg_controllen=0, msg_flags=MSG_CONFIRM}, 27}}, 2, MSG_NOSIGNAL) = 2 <0.000149>
15:26:45 poll([{fd=9, events=POLLIN}], 1, 5000) = 1 ([{fd=9, revents=POLLIN}]) <0.219407>
15:26:45 ioctl(9, FIONREAD, [102]) = 0 <0.000026>
15:26:45 recvfrom(9, "|\266\201\203\0\1\0\0\0\1\0\0\7centos7\0015\0\0\1\0\1\0\0\6\0\1"..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("202.106.0.20")}, [16]) = 102 <0.000041>
15:26:45 poll([{fd=9, events=POLLIN}], 1, 4779) = 0 (Timeout) <4.783905>
15:26:50 poll([{fd=9, events=POLLOUT}], 1, 0) = 1 ([{fd=9, revents=POLLOUT}]) <0.000022>
15:26:50 sendto(9, "|\266\1\0\0\1\0\0\0\0\0\0\7centos7\0015\0\0\1\0\1", 27, MSG_NOSIGNAL, NULL, 0) = 27 <0.000118>
15:26:50 poll([{fd=9, events=POLLIN}], 1, 5000) = 0 (Timeout) <5.005199>

2、查看这个ip是用于dns解析的ip,发现当前网络去请求这个ip有问题,连接较慢,因此将该dns配置ip修改为其他,如(114.114.114.114),修改完成重启网络,再次使用命令sqlplus / as sysdba,访问恢复正常。

点击阅读

[Oracle] oracle报错ora01113,ORA-01110尝试恢复数据库,又报错ORA-00279,ORA-00289,ORA-00280


1、数据库服务器异常宕机,之后重启数据库出现如下报错

1
2
3
4
5
6
7
8
9
10
11
16:55:28 SYS@ boston> startup;
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size 2253664 bytes
Variable Size 587205792 bytes
Database Buffers 1006632960 bytes
Redo Buffers 7319552 bytes
Database mounted.
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/home/oracle/test11101.dbf'

2、先将数据文件offline

1
2
3
16:55:42 SYS@ boston> alter database datafile '/home/oracle/test11101.dbf' offline;
Database altered.
Elapsed: 00:00:00.11

3、尝试恢复数据文件,报错

1
2
3
4
5
6
7
8
16:57:47 SYS@ boston> alter database recover datafile '/home/oracle/test11101.dbf';
alter database recover datafile '/home/oracle/test11101.dbf'
*
ERROR at line 1:
ORA-00279: change 55845310493 generated at 06/25/2019 11:00:37 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc
ORA-00280: change 55845310493 for thread 1 is in sequence #491
Elapsed: 00:00:00.20

4、根据提示,使用logfile文件修复数据库

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
28
29
30
31
32
33
34
35
17:04:09 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc'
*
ERROR at line 1:
ORA-00279: change 55845334483 generated at 07/02/2019 15:46:11 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc
ORA-00280: change 55845334483 for thread 1 is in sequence #492

Elapsed: 00:00:00.14
17:11:25 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc'
*
ERROR at line 1:
ORA-00279: change 55845337765 generated at 07/02/2019 16:16:14 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc
ORA-00280: change 55845337765 for thread 1 is in sequence #493

Elapsed: 00:00:00.23
17:12:04 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc'
*
ERROR at line 1:
ORA-00279: change 55845337802 generated at 07/02/2019 16:16:19 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc
ORA-00280: change 55845337802 for thread 1 is in sequence #494

Elapsed: 00:00:00.21
17:14:50 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc';

Database altered.

Elapsed: 00:00:00.47
17:15:13 SYS@ boston> alter database datafile '/home/oracle/test11101.dbf' online;

Database altered.

5、至此test11101.dbf数据文件修复完成,尝试打开数据库

1
2
3
4
5
6
7
8

17:15:43 SYS@ boston> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 7 needs media recovery
ORA-01110: data file 7: '/home/oracle/zeven01.dbf'
Elapsed: 00:00:00.16

6、提示另一个数据文件也需要恢复

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
28
17:15:52 SYS@ boston> recover databases;
ORA-00905: missing keyword

17:16:05 SYS@ boston> recover database;(这里选择让auto修复数据库)
ORA-00279: change 55845310493 generated at 06/25/2019 11:00:37 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc
ORA-00280: change 55845310493 for thread 1 is in sequence #491

17:19:35 Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 55845334483 generated at 07/02/2019 15:46:11 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc
ORA-00280: change 55845334483 for thread 1 is in sequence #492

ORA-00279: change 55845337765 generated at 07/02/2019 16:16:14 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc
ORA-00280: change 55845337765 for thread 1 is in sequence #493

ORA-00279: change 55845337802 generated at 07/02/2019 16:16:19 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc
ORA-00280: change 55845337802 for thread 1 is in sequence #494

Log applied.
Media recovery complete.
oracle修复数据库完成,打开数据库
17:20:02 SYS@ boston> alter database open;

Database altered.

7、查看数据文件和表空间均已正常

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
17:21:57 SYS@ boston> select file_name,status from dba_data_files;
FILE_NAME STATUS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------
/data/u01/app/oracle/oradata/boston/users01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/undotbs01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/sysaux01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/system01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/test001.dbf AVAILABLE
/home/oracle/test11101.dbf AVAILABLE
/home/oracle/zeven01.dbf AVAILABLE
7 rows selected.
Elapsed: 00:00:00.04

17:22:21 SYS@ boston> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
TEST ONLINE
TEST11 ONLINE
ZEVEN ONLINE
8 rows selected.
Elapsed: 00:00:00.03
17:22:59 SYS@ boston>

点击阅读

[Oracle] 数据库驱动程序Oracle's Driver (Thin)与Oracle's Driver(Thin XA)的区别


1
2
3
XA连接区别于非XA连接。要记住的是XA连接是一个JTA事务中的参与者。这就意味着XA连接不支持JDBC的自动提交特性。也就是说应用程序不必在XA连接上调用java.sql.Connection.commit()或java.sql.Connection.rollback()。相反,应用程序应该使用UserTransaction.begin()、UserTransaction.commit()和UserTransaction.rollback().

JTA事务比JDBC事务更强大。一个JTA事务可以有多个参与者,而一个JDBC事务则被限定在一个单一的数据库连接。下列任一个Java平台的组件都可以参与到一个JTA事务中:JDBC连接、JDO PersistenceManager 对象、JMS 队列、JMS 主题、企业JavaBeans(EJB)、一个用J2EE Connector Architecture 规范编译的资源分配器。

点击阅读

Proudly powered by Hexo and Theme by Lap
本站访客数人次
© 2020 zeven0707's blog