閱讀193 返回首頁    go 阿裏雲 go 技術社區[雲棲]


oracle初使用遇到的問題

問題1:
[oracle@iZ2zeh44pi6rlahxj7s9azZ ~]$ sqlplus monitor/monitor123

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 31 18:51:59 2017

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

ERROR:
ORA-01034: ORACLE not available
ORA-27102: out of memory
Linux-x86_64 Error: 12: Cannot allocate memory
Additional information: 26
Additional information: 229378
Additional information: 1619001344
Process ID: 0
Session ID: 0 Serial number: 0

Enter user-name:

解決:
1、首先檢查linux服務器的當前內存使用情況:
free -m
發現已經沒有空閑內存
2、查看內核允許的最大共享內存段大小
/proc/sys/kernel/shmmax
發現設置的足夠大
3、使用top 查看當前消耗內存大的進程
發現oracle有好幾個進程消耗了大量的資源
4、kill掉這幾個進程
kill -s 9   11111(進程號)
5、清理內存
echo 1 > /proc/sys/vm/drop_caches
6、重啟數據庫
sqlplus / as sysdba
shutdown immediate
startup

問題2:鎖賬號(原因是密碼錯誤次數過多)
[oracle@iZ2zeh44pi6rlahxj7s9azZ ~]$ sqlplus monitor/monitor123

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 31 18:57:23 2017

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

ERROR:
ORA-28000: the account is locked
解決:
[oracle@iZ2zeh44pi6rlahxj7s9azZ ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 31 18:50:39 2017

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> alter user monitor account unlock;

User altered.

問題3:初始化出現:local nodename
[oracle@172-16-10-109 /home/u01/database] $./runInstaller -silent -force -noconfig -responseFile /u01/database/response/db_install_dtstack.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 27734 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-09-29_11-43-52AM. Please wait ...
[oracle@172-16-10-109 /home/u01/database]
$[FATAL] PRVF-0002 : Could not retrieve local nodename
A log of this session is currently saved as: /tmp/OraInstall2017-09-29_11-43-52AM/installActions2017-09-29_11-43-52AM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.

[root@172-16-10-109 /root] #hostname
172-16-10-109
[root@172-16-10-109 /root] #vim /etc/hosts

127.0.0.1       172-16-10-109  localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             172-16-10-109  localhost localhost.localdomain localhost6 localhost6.localdomain6


問題4:啟動Oracle出現:MEMORY_TARGET not supported
[oracle@iz2zec57gfl6i9vbtdksl1z home]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 13 19:33:17 2017

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

Connected to an idle instance.

SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

[root@iZ0xi8vpz0koiwz9zzl6qrZ ~]# df -h | grep shm
tmpfs           497M  205M  292M  42% /dev/shm
[root@iZ0xi8vpz0koiwz9zzl6qrZ ~]# cat /etc/fstab | grep tmpfs
[root@iZ0xi8vpz0koiwz9zzl6qrZ ~]# mount -o remount,size=4G /dev/shm
[root@iZ0xi8vpz0koiwz9zzl6qrZ ~]# df -h | grep shm
tmpfs           4.0G  205M  3.9G   5% /dev/shm

刪除其他用戶登錄oracle進程


問題5:啟動Oracle出現:cannot mount
SQL> startup
ORACLE instance started.

Total System Global Area  413372416 bytes
Fixed Size            2253784 bytes
Variable Size          327158824 bytes
Database Buffers       79691776 bytes
Redo Buffers            4268032 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode

[oracle@iZ0xi8vpz0koiwz9zzl6qrZ database]$ ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0xbcf2a624 491520     oracle     640        154
0x50f506b0 884737     oracle     640        154

[oracle@iZ0xi8vpz0koiwz9zzl6qrZ database]$ ipcrm -s 491520
[oracle@iZ0xi8vpz0koiwz9zzl6qrZ database]$ ipcrm -s 884737
[oracle@iZ0xi8vpz0koiwz9zzl6qrZ database]$ ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems


問題6:重新安裝Oracle時,沒有orainstRoot.sh文件

[oracle@iz2zec57gfl6i9vbtdksl1z database]$  ./runInstaller -silent -force -noconfig -responseFile /u01/database/response/db_install_dtstack.rsp
Starting Oracle Universal Installer...
·
·
·
As a root user, execute the following script(s):
    1. /home/u01/app/oracle/product/11.2.4/db_1/root.sh

Successfully Setup Software.

重新安裝Oracle時,沒有orainstRoot.sh文件  
重新安裝RAC時,到excute configuration scripts時,隻提示運行:/opt/ora10g/product/10.2.0/crs_1/root.sh這個文件,
不提示/opt/ora10g/oraInventory/orainstRoot.sh;這個文件,是為什麼?

原因:
沒刪除/etc/oraInst.loc文件

[oracle@iz2zec57gfl6i9vbtdksl1z database]$  ./runInstaller -silent -force -noconfig -responseFile /u01/database/response/db_install_dtstack.rsp
Starting Oracle Universal Installer...
·
·
·
As a root user, execute the following script(s):
    1. /home/u01/app/oraInventory/orainstRoot.sh
    2. /home/u01/app/oracle/product/11.2.4/db_1/root.sh

Successfully Setup Software.

最後更新:2017-10-13 23:04:26

  上一篇:go  Java 25天基礎-DAY 06-麵向對象-ststic關鍵字
  下一篇:go  Java 25天基礎-DAY 05-麵向對象-構造函數