当前位置: 代码迷 >> Web前端 >> Solaris 系统上安装Oracle11g R2和WebLogic10.3.0.0
  详细解决方案

Solaris 系统上安装Oracle11g R2和WebLogic10.3.0.0

热度:322   发布时间:2012-07-22 19:31:15.0
Solaris 系统下安装Oracle11g R2和WebLogic10.3.0.0

1.首先创建系统用户和组

?

?

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d /export/home/oracle -s /usr/bin/bash oracle
passwd oracle
mkdir -p /export/home/oracle/product/11.2.0/db_1
mkdir /export/home/oracle/tmp
chown -R oracle:oinstall /export/home/oracle

?2.修改一些系统内核的参数

?

projadd -U oracle -K "project.max-shm-memory=(priv,4g,deny)" oracle
projmod -sK "project.max-sem-nsems=(priv,256,deny)" oracle
projmod -sK "project.max-sem-ids=(priv,100,deny)" oracle
projmod -sK "project.max-shm-ids=(priv,100,deny)" oracle
echo "set maxuprc=16384" >> /etc/system
echo "set max_nprocs=30000" >> /etc/system
echo "set shmsys:shminfo_shmmax=4294967295" >> /etc/system

?Now reboot the machine and login with an oracle user. Let’s create a new swap file with 1Gb size, as it’s required for the Oracle installation

3.创建oracle的交换空间

?

mkfile 1024m /export/home/oracle/orcl_swap
swap -a /export/home/oracle/orcl_swap

?4.设置用户环境变量编辑文件(vi?/export/home/oracle/.profile)

?

export ORACLE_BASE=/export/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export TMP=/export/home/oracle/tmp
export TMPDIR=/export/home/oracle/tmp
export DISPLAY=:0.0

?5.将数据库安装文件传到服务器上,然后解压运行(在图形化界面进行操作)

?

unzip your_file1.zip
 
unzip your_file2.zip
 
cd database
 
./runInstaller
?

?

?

Uncheck the checkbox and click next. If you can’t see the Next button, use Alt+N combination

?

?

Select the first option and click next

?

?

?

?

Click Next

?

?

?

Defint the folder for Oracle installation, database name and passwords and click next

?

?

?

Click Next

?

?

?

Click Finish to start the installation.

?

?

?

?

After the installation of the software finishes, installer automatically runs the DBCA to create the database

?

?

After a while, installation finishes.

?

?

?

Click OK and you’ll be prompted to run orainstRoot.sh and root.sh

?

?

Switch to the previous Terminal, create new window, login with a root user and run both shell scripts

?

?

At last, you’ll get success message

?

?

?

?

Now let’s connect to the database from Sql*Plus

?

?

?

进入sqlplus界面之后启动数据库实例,由上图所示执行命令如下:

?

?

export ORACLE_SID=数据库实例名称
cd /export/home/oracle/product/11.2.0/db_1/bin
./sqlplus / as sysdba

startup  /*启动实例*/
?

?

?

?

退出(exit)sqlplus配置数据库监听器(vi /export/home/oracle/product/11.2.0/db_1/network/admin/listener.ora)

?

?

# listener.ora Network Configuration File: /export/home/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
(SID_LIST =
        (SID_DESC =
                (SID_NAME = PLSExtProc)
                (ORACLE_HOME = /export/home/oracle/product/11.2.0/db_1)
                (PROGRAM = extproc)
        )
		 (SID_DESC =
                (GLOBAL_NAME = orcl)
                (ORACLE_HOME = /export/home/oracle/product/11.2.0/db_1)
                (SID_NAME = orcl)
        )
		(SID_DESC =
                (GLOBAL_NAME = vanceinfo)
                (ORACLE_HOME = /export/home/oracle/product/11.2.0/db_1)
                (SID_NAME = vanceinfo)
        )
      
)
ADR_BASE_LISTENER = /export/home/oracle
?

?

vi?/export/home/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

?

?

# tnsnames.ora Network Configuration File: /export/home/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
vanceinfo =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = vanceinfo)
    )
  )
?

启动监听器命令,切换到oracle用户(su oracle):

?

./lsnrctl start
?

工作基本全部搞定,可以用pl/sql develop 进行连接了,客户端的配置文件tnsnames.ora如下:

?

Solaris =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.5.235)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = vanceinfo)
    )
  )
ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

LISTENER_VANCEINFO =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
?

?

?

另:如果在Solaris系统中创建新的数据库实例的话步骤如下:

?

在图形化界面系统中root登陆之后打开终端命令窗口执行如下命令:

?

export DISPLAY=127.0.0.1:0.0
xhost +
su oracle
cd /export/home/oracle/product/11.2.0/db_1/bin
./dbca

?此时弹出图形化界面窗口进行创建数据库的操作步骤.

?

?

?

修改Oracle的编码步骤:

?

?

export ORACLE_SID=数据库实例名称
cd /export/home/oracle/product/11.2.0/db_1/bin
./sqlplus / as sysdba
startup mount ; 
alter system enable restricted session ;  
alter system set JOB_QUEUE_PROCESSES=0;  
alter system set AQ_TM_PROCESSES=0;  
alter database open ;  
alter database character set internal_use AL32UTF8;  
shutdown immediate ; 
startup ;


查询编码:
select * from v$nls_parameters;
select * from nls_database_parameters;
select userenv('language') from dual;

?

启动web访问方式的em管理界面:

export ORACLE_SID=数据库实例名称
cd /export/home/oracle/product/11.2.0/db_1/bin
emctl start dbconsole
?

然后打开浏览器输入:http://ip:1158/em

如果是第二个实例的话端口为5500(默认)

?

?

*****************Weblogic 的安装****************

?

将weblogic 10.3.0.0 通用版本 jar格式的文件拷贝到服务器的/usr/local目录下:

执行命令:

?

java -jar server103_generic.jar
?

弹出图形化界面此时选择自定义安装,将WORKSHOP选项去掉,然后一路下一步根据自己的选择进行安装.

?

安装完成后,进行domain配置

?

进入weblogic安装目录:

cd /usr/local/bea/wlserver_10.3/common/bin

./startManagedWebLogic.sh

?

弹出图形化界面进行配置domain.

?

?