Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

86

积分

0

好友

2

主题
1#
发表于 2012-5-19 19:33:54 | 查看: 8142| 回复: 11
SQL> startup nomount pfile='/opt/app/oracle/admin/soc/scripts/init.ora'
ORA-27123: unable to attach to shared memory segment
Linux Error: 22: Invalid argument
Additional information: 7
Additional information: 622598
Additional information: 541065216
SQL> exit
Disconnected
[oracle@soc1 ~]$ su - root
Password:
[root@soc1 ~]# free
             total       used       free     shared    buffers     cached
Mem:       1035400    1008584      26816          0      14820     417416
-/+ buffers/cache:     576348     459052
Swap:      1572856        512    1572344
[root@soc1 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@soc1 ~]#

[ 本帖最后由 lhpapa 于 2012-5-19 19:37 编辑 ]
2#
发表于 2012-5-19 19:35:01
[oracle@soc1 ~]$ cat /opt/app/oracle/admin/soc/scripts/init.ora
##############################################################################
# Copyright (c) 1991, 2001, 2002 by Oracle Corporation
##############################################################################

###########################################
# Archive
###########################################
log_archive_format=%t_%s_%r.dbf

###########################################
# Cache and I/O
###########################################
db_block_size=8192

###########################################
# Cursors and Library Cache
###########################################
open_cursors=300

###########################################
# Database Identification
###########################################
db_domain=""
db_name="soc"

###########################################
# File Configuration
###########################################
db_create_file_dest="+DATA_DG"
db_recovery_file_dest="+ARCH_DG"
db_recovery_file_dest_size=2046820352

###########################################
# Miscellaneous
###########################################
compatible=11.2.0.0.0
diagnostic_dest=/opt/app/oracle

###########################################
# Processes and Sessions
###########################################
processes=150

###########################################
# SGA Memory
###########################################
sga_target=167772160

###########################################
# Security and Auditing
###########################################
audit_file_dest="/opt/app/oracle/admin/soc/adump"
audit_trail=db
remote_login_passwordfile=EXCLUSIVE

###########################################
# Shared Server
###########################################
dispatchers="(PROTOCOL=TCP) (SERVICE=socXDB)"

###########################################
# Sort, Hash Joins, Bitmap Indexes
###########################################
pga_aggregate_target=33554432

###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_tablespace=UNDOTBS1

[oracle@soc1 ~]$

回复 只看该作者 道具 举报

3#
发表于 2012-5-19 19:38:38
[oracle@soc1 ~]$ uname -r
2.6.18-8.el5
[oracle@soc1 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)

回复 只看该作者 道具 举报

4#
发表于 2012-5-19 20:11:01
把实例关闭后,贴一下free的结果,怀疑是你的内存不足。

  1. [root@soc1 ~]# free

  2.              total       used       free     shared    buffers     cached

  3. Mem:       1035400    1008584      26816          0      14820     417416
复制代码


free的仅剩26M左右。

[ 本帖最后由 miloluo 于 2012-5-19 20:13 编辑 ]

回复 只看该作者 道具 举报

5#
发表于 2012-5-19 21:16:38
action plan:
贴出一下输出
su - oracle
ipcs -ma
uname -a
cat /proc/meminfo
ulimit -a

回复 只看该作者 道具 举报

6#
发表于 2012-5-20 16:18:31
[oracle@soc1 ~]$ ipcs -ma

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 294913     grid      640        4096       0                       
0x00000000 327682     grid      640        4096       0                       
0x724bdf0c 360451     grid      640        4096       0                       

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0xaea4b920 98304      grid      640        124      

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages   

[oracle@soc1 ~]$ uname -a
Linux soc1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
[oracle@soc1 ~]$ cat /proc/meminfo
MemTotal:      1165444 kB
MemFree:         37516 kB
Buffers:         12240 kB
Cached:         366556 kB
SwapCached:      43268 kB
Active:         914136 kB
Inactive:       160960 kB
HighTotal:      262080 kB
HighFree:          484 kB
LowTotal:       903364 kB
LowFree:         37032 kB
SwapTotal:     1572856 kB
SwapFree:      1491288 kB
Dirty:           40728 kB
Writeback:          12 kB
AnonPages:      653044 kB
Mapped:         171804 kB
Slab:            21436 kB
PageTables:      12280 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   2155576 kB
Committed_AS:  4043092 kB
VmallocTotal:   114680 kB
VmallocUsed:     15976 kB
VmallocChunk:    98012 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     4096 kB
[oracle@soc1 ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
max nice                        (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 18432
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
max rt priority                 (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[oracle@soc1 ~]$

回复 只看该作者 道具 举报

7#
发表于 2012-5-20 16:29:00
设置 max locked memory       (kbytes, -l) 32  => 50000000

并重启reboot os

回复 只看该作者 道具 举报

8#
发表于 2012-5-20 17:21:42
改过参数并重启,还是报错
[oracle@soc1 ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
max nice                        (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16384
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
max rt priority                 (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[oracle@soc1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sun May 20 17:17:38 2012

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

Connected to an idle instance.

SQL> startup nomount pfile='/opt/app/oracle/admin/soc/scripts/init.ora';
ORA-27123: unable to attach to shared memory segment
Linux Error: 22: Invalid argument
Additional information: 7
Additional information: 819215
Additional information: 541065216
SQL> exit
Disconnected
f[oracle@soc1 ~]$ free
             total       used       free     shared    buffers     cached
Mem:       1035400     982496      52904          0       8192     294848
-/+ buffers/cache:     679456     355944
Swap:      1572856     182672    1390184
[oracle@soc1 ~]$

[ 本帖最后由 lhpapa 于 2012-5-20 17:26 编辑 ]

回复 只看该作者 道具 举报

9#
发表于 2012-5-20 17:47:12
后来修改了tmpfs的大小,还是错。
[oracle@soc1 ~]$ df -hl
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       17G  9.5G  6.6G  59% /
/dev/sda1              99M   11M   83M  12% /boot
tmpfs                 1.0G  126M  899M  13% /dev/shm

回复 只看该作者 道具 举报

10#
发表于 2012-5-20 17:52:06
  1. # Kernel sysctl configuration file for Oracle Enterprise Linux
  2. #
  3. # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
  4. # sysctl.conf(5) for more details.

  5. # Controls IP packet forwarding
  6. net.ipv4.ip_forward = 0

  7. # Controls source route verification
  8. net.ipv4.conf.default.rp_filter = 1

  9. # Do not accept source routing
  10. net.ipv4.conf.default.accept_source_route = 0

  11. # Controls the System Request debugging functionality of the kernel

  12. # Controls whether core dumps will append the PID to the core filename
  13. # Useful for debugging multi-threaded applications
  14. kernel.core_uses_pid = 1

  15. # Controls the use of TCP syncookies
  16. net.ipv4.tcp_syncookies = 1

  17. # Controls the maximum size of a message, in bytes

  18. # Controls the default maxmimum size of a mesage queue

  19. # Controls the maximum shared segment size, in bytes

  20. # Controls the maximum number of shared memory segments, in pages

  21. # For 11g, Oracle-Validated setting for fs.file-max is 6815744
  22. # For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
  23. # fs.file-max = 327679
  24. fs.file-max = 6815744

  25. # Oracle-Validated setting for kernel.msgmni is 2878
  26. kernel.msgmni = 2878

  27. # Oracle-Validated setting for kernel.msgmax is 8192
  28. kernel.msgmax = 8192

  29. # Oracle-Validated setting for kernel.msgmnb is 65536
  30. kernel.msgmnb = 65536

  31. # Oracle-Validated setting for kernel.sem is '250 32000 100 142'
  32. kernel.sem = 250 32000 100 142

  33. # Oracle-Validated setting for kernel.shmmni is 4096
  34. kernel.shmmni = 4096

  35. # Oracle-Validated setting for kernel.shmall is 1073741824
  36. kernel.shmall = 1073741824

  37. # Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
  38. kernel.shmmax = 4398046511104

  39. # Oracle-Validated setting for kernel.sysrq is 1
  40. kernel.sysrq = 1

  41. # Oracle-Validated setting for net.core.rmem_default is 262144
  42. net.core.rmem_default = 262144

  43. # For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
  44. # For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
  45. # net.core.rmem_max = 2097152
  46. net.core.rmem_max = 4194304

  47. # Oracle-Validated setting for net.core.wmem_default is 262144
  48. net.core.wmem_default = 262144

  49. # For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
  50. # For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
  51. # net.core.wmem_max = 262144
  52. net.core.wmem_max = 1048576

  53. # Oracle-Validated setting for fs.aio-max-nr is 3145728
  54. fs.aio-max-nr = 3145728

  55. # For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
  56. # For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
  57. # net.ipv4.ip_local_port_range = 1024 65000
  58. net.ipv4.ip_local_port_range = 9000 65500

  59. # Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
  60. vm.min_free_kbytes = 51200
复制代码
用以上内容 彻底替换 sysctl.conf

回复 只看该作者 道具 举报

11#
发表于 2012-5-20 18:39:46
奇怪了,改了之后:
SQL> startup nomount pfile='/opt/app/oracle/admin/test/scripts/init.ora';
ORA-27102: out of memory
Linux Error: 22: Invalid argument
SQL>
SQL>
SQL> exit
Disconnected
[oracle@soc1 ~]$ more /opt/app/oracle/admin/test/scripts/init.ora
##############################################################################
# Copyright (c) 1991, 2001, 2002 by Oracle Corporation
##############################################################################

###########################################
# Database Identification
###########################################
db_name="test"
db_domain=""

###########################################
# Shared Server
###########################################
dispatchers="(PROTOCOL=TCP) (SERVICE=testXDB)"

###########################################
# Security and Auditing
###########################################
audit_file_dest="/opt/app/oracle/admin/test/adump"

###########################################
# Miscellaneous
###########################################
compatible=11.2.0.0.0

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=EXCLUSIVE

###########################################
# SGA Memory
###########################################
sga_target=167772160

###########################################
# Processes and Sessions
###########################################
processes=150

###########################################
# System Managed Undo and Rollback Segments
###########################################
undo_tablespace=UNDOTBS1

###########################################
# File Configuration
###########################################
control_files=("/opt/app/oracle/oradata/test/control01.ctl", "/opt/app/oracle/oradata/te
st/control02.ctl")

###########################################
# Miscellaneous
###########################################
diagnostic_dest=/opt/app/oracle

###########################################
# Security and Auditing
###########################################
audit_trail=db

###########################################
# Cache and I/O
###########################################
db_block_size=8192

###########################################
# Cursors and Library Cache
###########################################
open_cursors=300

###########################################
# Sort, Hash Joins, Bitmap Indexes
###########################################
pga_aggregate_target=67108864

[root@soc1 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
fs.file-max = 6815744
kernel.msgmni = 2878
kernel.msgmax = 8192
kernel.msgmnb = 65536
kernel.sem = 250 32000 100 142
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.sysrq = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 3145728
net.ipv4.ip_local_port_range = 9000 65500
vm.min_free_kbytes = 51200

回复 只看该作者 道具 举报

12#
发表于 2012-5-20 18:53:19
[oracle@soc1 ~]$ cat /proc/meminfo
MemTotal:      1165444 kB

建议你在使用 11g ASM+DB 的环境中 至少分配2GB 内存

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-26 01:10 , Processed in 0.050828 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569