Home  >  Article  >  Database  >  RedHat Linux 5.5 X64 安装 Oracle 10g 遇到的两个问题

RedHat Linux 5.5 X64 安装 Oracle 10g 遇到的两个问题

WBOY
WBOYOriginal
2016-06-07 16:59:07879browse

一、如何扩大linux的swap空间a) Login as the root userb) Type following command to create 512MB swap file (1024 * 512MB =

一、如何扩大linux的swap空间
a) Login as the root user

b) Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288

c) Set up a Linux swap area:
# mkswap /swapfile1

d) Activate /swapfile1 swap space immediately:
# swapon /swapfile1

e) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:
# vi /etc/fstab

Append following line:
/swapfile1 swap swap defaults 0 0

So next time Linux comes up after reboot, it enables the new swap file for you automatically.

二、could not open parameter file initOrcl.ora

今天开发服务器突然连接不上,sqlplus /nolog、conn /as sysdba、startup命令后显示

SQL> startup

ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/opt/Oracle10g/product/10.2/db_1/dbs/initORA10G.ora'

查找文件,果然不存在。估计是非法关机造成的。

这是因为在oracle9i和oracle10g中,oracle默认将使用spfile启动数据库,如果spfile不存在,则就会出现上述错误。

解决方法1(已经验证):

将$ORACLE_BASE/admin /数据库名称/pfile目录下的init.ora.012009233838形式的文件copy到$ORACLE_HOME/dbs目录下 initoracle.ora即可。(注:initoracle.ora中的oracle为你的实例名 ORACLE_SID)

解决方法2:

用oraenv命令來改變當前環境的SID,然後用pfile重新產生spfile,就可以啟動數據庫了.

改變SID:

[oracle@willie root]$ source oraenv     (这个命令是用来修改SID的)

ORACLE_SID = [oracle] ? test1

bash: /root/.bashrc: Permission denied

重新產生spfile:

SQL> create spfile from pfile;       

(我做到这一步的时候,SID虽然改变了,但是还是说找不到parameter file,因为我的SID是PDBQZ.开始是找不到Orcl,我就将init.ora.012009233838形式的文件拷贝到$ORACLE_HOME/dbs目录下,然后重命名为initPDBQZ.ora,这样就成功了。我是两种方式结合,遇到的情况有点特殊。自己重建了SID)

File created.

SQL> startup

ORACLE instance started.

 

附:Linux下oracle操作命令

重启oracle
lsnrctl stop
sqlplus /nolog
conn /as sysdba
shutdown (startup)
exit
lsnrctl start

启动oracle
sqlplus /nolog
conn /as sysdba
startup
exit
lsnrctl start

关闭oracle
lsnrctl stop
sqlplus /nolog
conn /as sysdba
shutdown
exit

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn