Terry.Li-彬

          虛其心,可解天下之問;專其心,可治天下之學;靜其心,可悟天下之理;恒其心,可成天下之業(yè)。

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks
           

          工作流下載地址http://sourceforge.net/project/downloading.php?group_id=70542&use_mirror=jaist&filename=jbpm-jpdl-suite-3.2.1.zip&5744684

          sheclipse里面啟動tomcat+db2項目,報錯:不能找到db2

          解決方法:在eclipse 中配置tomcat中加入如下語句

          -Djava.library.path=D:"Java"IBM"SQLLIB"BIN

          Linux命令

          查看文本

          Vi

          退出vi編輯

          Esc -> :q

          動態(tài)查看日志文件

          Tail –f 文件名

          Linux下命令啟動ldap

          [root@sl /]# cd /etc/init.d/

          [root@sl init.d]# pwd

          /etc/init.d

          [root@sl init.d]# ./ldap stop

          停止 slapd                                               [ 確定 ]

          [root@sl init.d]# ./ldap start

          檢查 的配置文件:config file testing succeeded

          啟動 slapd                                               [ 確定 ]

          [root@sl init.d]# ./ldap restart

          停止 slapd                                               [ 確定 ]

          檢查 slapd 的配置文件:config file testing succeeded

          啟動 slapd                                               [ 確定 ]

          [root@sl init.d]# pwd

          /etc/init.d

          [root@sl init.d]#

          方法二:

          如果ldap服務器配置好了,用下面命令可以啟動

          Service ldap restart

          Service ldap start

          Service ldap stop

          linux下查看ldap的調用方法

          [root@sl init.d]# ./ldap help

          用法:./ldap {start|stop|restart|status|condrestart}

          org/hibernate/cfg/HbmBinder$SecondPass 錯誤

          在練習SSH框架的時候出現如下錯誤:

          org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryId' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass

          java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass

                 at java.lang.ClassLoader.defineClass1(Native Method)

                 at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

                 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

                 at

          原因是項目中hibernate.jar hibernate-annotations.jar兩個包的版本低

          解決方法:1、直接刪除hibernate-annotations.jar

                    2、將這兩個包替換為最新的

          Windows下啟動ldap

          Slapd –d 1

          -ivf

          -ivh

          linux下啟動ssh

          /etc/init.d/./sshd restart

          配置root用戶可否訪問

          /etc/ssh/

          Vi sshd_config

          linux下配置weblogic用戶域

          [root@sl bin]# pwd

          /bea/weblogic92/common/bin

          [root@sl bin]# ls

          commEnv.sh         quickstart.sh             stopPointBase.sh wlsifconfig.sh

          config_builder.sh startManagedWebLogic.sh   unpack.sh         wlst.sh

          config.sh          startPointBaseConsole.sh upgrade.sh

          pack.sh            startPointBase.sh         wlscontrol.sh

          [root@sl bin]# ./config.sh

          啟動監(jiān)聽 oracle用戶下執(zhí)行

          lsnrctl start

          >192.168.1.242

          現在好了。

          [oracle@localhost ~]$ lsnrctl start

          LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 31-1 -2007 15:12:34

          Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

          Starting /opt/oracle/9.2.0/bin/tnslsnr: please wait...

          TNSLSNR for Linux: Version 9.2.0.4.0 - Production

          System parameter file is /opt/oracle/9.2.0/network/admin/listener.ora

          Log messages written to /opt/oracle/9.2.0/network/log/listener.log

          Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

          Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

          Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))

          STATUS of the LISTENER

          ------------------------

          Alias                     LISTENER

          Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production

          Start Date                31-1 -2007 15:12:35

          Uptime                    0 days 0 hr. 0 min. 0 sec

          Trace Level               off

          Security                  OFF

          SNMP                      OFF

          Listener Parameter File   /opt/oracle/9.2.0/network/admin/listener.ora

          Listener Log File         /opt/oracle/9.2.0/network/log/listener.log

          Listening Endpoints Summary...

           (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

           (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

          Services Summary...

          Service "PLSExtProc" has 1 instance(s).

           Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

          Service "futuredb" has 1 instance(s).

           Instance "futuredb", status UNKNOWN, has 1 handler(s) for this service...

          The command completed successfully

          查看linux正在使用的端口命令   netstat -an

          動態(tài)查看日志文件 tail -f 文件名

          解壓tar文件 tar -xvf 文件名.tar

          打包tar文件 tar -cvf 文件名.tar

          解壓gz文件   gunzip 文件名.gz

          解壓縮gz文件 gzip 文件名

          解壓cpio文件 cpio -idmv < *.cpio

          Struts中使用Spring代理找不到其他Spring配置文件中的定義,是因為系統(tǒng)在啟動時候首先加載Struts對應的Config文件,通知加載該Config配置的插件Spring配置文件,如果Struts中只配置了本模塊對應的Spring配置文件,而本Spring配置文件中又用到了其他的Spring配置文件的話,就發(fā)生找不到其他Spring配置文件中定義的bean,這時要將所有用到的Spring配置文件都配置在該Struts對應的Config文件中,在系統(tǒng)啟動時候同時加載。

          <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">

                 <set-property property="contextConfigLocation" value="/WEB-INF/classes/conf/hibernate-context.xml,/WEB-INF/classes/conf/governmentinfo-context.xml"/>

              </plug-in>

          Struts中使用Spring代理,在Spring中配置Action的時候名稱應該加上Struts的模塊名,例如:Kt 刊頭Action struts-config-governmentinfo.xml中定義的path名稱為 kt,將他配置到Spring配置文件中時候應該加上Struts模塊名稱governmentinfo

          <bean name="/governmentinfo/kt"

                 class="com.futuresoftware.oa.governmentinfo.web.action.KtAction">

                 <property name="kt_service">

                     <ref local="ktManager"/>

                 </property>

              </bean>

          Linux 下掛載移動硬盤

          Mount –o iocharset=cp936 /dev/sdb1 /mnt/usb1

          Umount /mnt/usb1

          myeclipse+struts+tomcat下啟動tomcat出現以下錯誤:

          - Parsing error processing resource path

          java.net.UnknownHostException: struts.apache.org

              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)

              at java.net.Socket.connect(Socket.java:507)

              at java.net.Socket.connect(Socket.java:457)

              at sun.net.NetworkClient.doConnect(NetworkClient.java:157)

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)

          這是由于struts-config.xml中的dtd校驗中的地址為http://struts.apache.org/dtds/struts-config_1_2.dtd,按照這個地址將struts-config_1_2.dtd下載后放到和struts-config.xml同一文件夾下,然后將struts-config.xml中替換為struts-config_1_2.dtd就可以了

          解決方法1、將struts-config.xml文件中的命名空間<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_1.dtd">

          中的1.2該為1.1就可以(這里項目用的是struts1.1

          Could not initialize proxy - the owning Session was closed

          是因為hibernate session關閉了,由于lazy=trueaction 中調用session.load()得到的對象是游離態(tài)的,不能修改,該方法要放在dao

          關于hibernatelazy問題詳解(經典)

          Could not initialize proxy - the owning Session was closed (篇幅一)

          2007-05-11 09:52

          其實這個異常寫的非常之清楚,就是會話關閉,無法對Hibernate實體進行操作。造成這樣的情況有很多,什么書寫錯誤啊,邏輯錯誤啊。

          但就此說一下關于lazy機制:

          延遲初始化錯誤是運用Hibernate開發(fā)項目時最常見的錯誤。如果對一個類或者集合配置了延遲檢索策略,那么必須當代理類實例或代理集合處于持久化狀態(tài)(即處于Session范圍內)時,才能初始化它。如果在游離狀態(tài)時才初始化它,就會產生延遲初始化錯誤。

          下面把Customer.hbm.xml文件的<class>元素的lazy屬性設為true,表示使用延遲檢索策略:

          <class name="mypack.Customer" table="CUSTOMERS" lazy="true">

          當執(zhí)行
          Session的load()方法時,Hibernate不會立即執(zhí)行查詢CUSTOMERS表的select語句,僅僅返回Customer類的代理類的實例,這個代理類具由以下特征:

          (1) 由Hibernate在運行時動態(tài)生成,它擴展了Customer類,因此它繼承了Customer類的所有屬性和方法,但它的實現對于應用程序是透明的。
          (2) 當Hibernate創(chuàng)建Customer代理類實例時,僅僅初始化了它的OID屬性,其他屬性都為null,因此這個代理類實例占用的內存很少。
          (3)當應用程序第一次訪問Customer代理類實例時(例如調用customer.getXXX()或customer.setXXX()方法), Hibernate會初始化代理類實例,在初始化過程中執(zhí)行select語句,真正從數據庫中加載Customer對象的所有數據。但有個例外,那就是當應用程序訪問Customer代理類實例的getId()方法時,Hibernate不會初始化代理類實例,因為在創(chuàng)建代理類實例時OID就存在了,不必到數據庫中去查詢。

          提示:Hibernate采用CGLIB工具來生成持久化類的代理類。CGLIB是一個功能強大的Java字節(jié)碼生成工具,它能夠在程序運行時動態(tài)生成擴展 Java類或者實現Java接口的代理類。關于CGLIB的更多知識,請參考:http://cglib.sourceforge.net/。

          以下代碼先通過
          Session的load()方法加載Customer對象,然后訪問它的name屬性:

          tx =
          session.beginTransaction();
          Customer customer=(Customer)
          session.load(Customer.class,new Long(1));
          customer.getName();
          tx.commit();

          在運行session.load()方法時Hibernate不執(zhí)行任何select語句,僅僅返回Customer類的代理類的實例,它的OID為1,這是由load()方法的第二個參數指定的。當應用程序調用customer.getName()方法時,Hibernate會初始化Customer代理類實例,從數據庫中加載Customer對象的數據,執(zhí)行以下select語句:

          select * from CUSTOMERS where ID=1;
          select * from ORDERS where CUSTOMER_ID=1;

          當<class>元素的lazy屬性為true,會影響
          Session的load()方法的各種運行時行為,下面舉例說明。

          1.如果加載的Customer對象在數據庫中不存在,
          Session的load()方法不會拋出異常,只有當運行customer.getName()方法時才會拋出以下異常:

          ERROR LazyInitializer:63
          - Exception initializing proxy
          net.sf.hibernate.ObjectNotFoundException: No row with the given identifier exists: 1, of class:
          mypack.Customer

          2
          .如果在整個Session范圍內,應用程序沒有訪問過Customer對象,那么Customer代理類的實例一直不會被初始化,Hibernate不會執(zhí)行任何select語句。以下代碼試圖在關閉Session后訪問Customer游離對象:

          tx =
          session.beginTransaction();
          Customer customer=(Customer)
          session.load(Customer.class,new Long(1));
          tx.commit();
          session.close();
          customer.getName();

          由于引用變量customer引用的Customer代理類的實例在Session范圍內始終沒有被初始化,因此在執(zhí)行customer.getName()方法時,Hibernate會拋出以下異常:

          ERROR LazyInitializer:63
          - Exception initializing proxy
          net.sf.hibernate.HibernateException: Couldnotinitializeproxy-theowningSessionwasclosed

          由此可見,Customer代理類的實例只有在當前Session范圍內才能被初始化。

          3.net.sf.hibernate.Hibernate類的
          initialize()靜態(tài)方法用于在Session范圍內顯式初始化代理類實例,isInitialized()方法用于判斷代理類實例是否已經被初始化。例如:

          tx =
          session.beginTransaction();
          Customer customer=(Customer)
          session.load(Customer.class,new Long(1));
          if(!Hibernate.isInitialized(customer))
          Hibernate.
          initialize(customer);
          tx.commit();
          session.close();
          customer.getName();

          以上代碼在Session范圍內通過Hibernate類的initialize()方法顯式初始化了Customer代理類實例,因此當Session關閉后,可以正常訪問Customer游離對象。

          4.當應用程序訪問代理類實例的getId()方法時,不會觸發(fā)Hibernate初始化代理類實例的行為,例如:

          tx =
          session.beginTransaction();
          Customer customer=(Customer)
          session.load(Customer.class,new Long(1));
          customer.getId();
          tx.commit();
          session.close();
          customer.getName();

          當應用程序訪問customer.getId()方法時,該方法直接返回Customer代理類實例的OID值,無需查詢數據庫。由于引用變量 customer始終引用的是沒有被初始化的Customer代理類實例,因此當Session關閉后再執(zhí)行customer.getName()方法, Hibernate會拋出以下異常:

          ERROR LazyInitializer:63 - Exception initializing proxy
          net.sf.hibernate.HibernateException: Couldnotinitializeproxy-theowningSessionwasclosed

          解決方法:

          由于hibernate采用了lazy=true,這樣當你用hibernate查詢時,返回實際為利用cglib增強的代理類,但其并沒有實際填充;當你在前端,利用它來取值(getXXX)時,這時Hibernate才會到數據庫執(zhí)行查詢,并填充對象,但此時如果和這個代理類相關的session已關閉掉,就會產生種錯誤.
          在做一對多時,有時會出現"could not initialize proxy - clothe owning Session was sed,這個好像是hibernate的緩存問題.問題解決:需要在<many-to-one>里設置lazy="false". 但有可能會引發(fā)另一個異常叫

          failed to lazily initialize a collection of role: XXXXXXXX, no session or session was closed

          此異常解決方案請察看本人博客(http://hi.baidu.com/kekemao1)的Hibernate異常中的《failed to lazily initialize a collection of role異常》

          ?
          解決方法:在web.xml中加入
          <filter>
              <filter-name>hibernateFilter</filter-name>
              <filter-class>
               org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
              </filter-class>
          </filter
          <filter-mapping>
              <filter-name>hibernateFilter</filter-name>
              <url-pattern>*.do</url-pattern>
          </filter-mapping>
          就可以了;

          參考了:
          Hibernate與延遲加載:

          Hibernate對象關系映射提供延遲的與非延遲的對象初始化。非延遲加載在讀取一個對象的時候會將與這個對象所有相關的其他對象一起讀取出來。這有時會導致成百的(如果不是成千的話)select語句在讀取對象的時候執(zhí)行。這個問題有時出現在使用雙向關系的時候,經常會導致整個數據庫都在初始化的階段被讀出來了。當然,你可以不厭其煩地檢查每一個對象與其他對象的關系,并把那些最昂貴的刪除,但是到最后,我們可能會因此失去了本想在ORM工具中獲得的便利。


          一個明顯的解決方法是使用Hibernate提供的延遲加載機制。這種初始化策略只在一個對象調用它的一對多或多對多關系時才將關系對象讀取出來。這個過程對開發(fā)者來說是透明的,而且只進行了很少的數據庫操作請求,因此會得到比較明顯的性能提升。這項技術的一個缺陷是延遲加載技術要求一個Hibernate會話要在對象使用的時候一直開著。這會成為通過使用DAO模式將持久層抽象出來時的一個主要問題。為了將持久化機制完全地抽象出來,所有的數據庫邏輯,包括打開或關閉會話,都不能在應用層出現。最常見的是,一些實現了簡單接口的DAO實現類將數據庫邏輯完全封裝起來了。一種快速但是笨拙的解決方法是放棄DAO模式,將數據庫連接邏輯加到應用層中來。這可能對一些小的應用程序有效,但是在大的系統(tǒng)中,這是一個嚴重的設計缺陷,妨礙了系統(tǒng)的可擴展性。

          在Web層進行延遲加載

          幸運的是,Spring框架為Hibernate延遲加載與DAO模式的整合提供了一種方便的解決方法。對那些不熟悉Spring與Hibernate集成使用的人,我不會在這里討論過多的細節(jié),但是我建議你去了解Hibernate與Spring集成的數據訪問。以一個Web應用為例,Spring提供了OpenSessionInViewFilter和OpenSessionInViewInterceptor。我們可以隨意選擇一個類來實現相同的功能。兩種方法唯一的不同就在于interceptor在Spring容器中運行并被配置在web應用的上下文中,而Filter在Spring之前運行并被配置在web.xml中。不管用哪個,他們都在請求將當前會話與當前(數據庫)線程綁定時打開Hibernate會話。一旦已綁定到線程,這個打開了的Hibernate會話可以在DAO實現類中透明地使用。這個會話會為延遲加載數據庫中值對象的視圖保持打開狀態(tài)。一旦這個邏輯視圖完成了,Hibernate會話會在Filter的doFilter方法或者Interceptor的postHandle方法中被關閉。下面是每個組件的配置示例:


          Interceptor的配置:

          <beans>
          <bean id="urlMapping"
          class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
          <property name="interceptors">
          <list>
          <ref bean="openSessionInViewInterceptor"/>
          </list>
          </property>
          <property name="mappings">

          </bean>

          <bean name="openSessionInViewInterceptor"
          class="org.springframework.orm.hibernate.support.OpenSessionInViewInterceptor">
          <property name="sessionFactory"><ref bean="sessionFactory"/></property>
          </bean>
          </beans>

          Filter的配置

          <web-app>

          <filter>
          <filter-name>hibernateFilter</filter-name>
          <filter-class>
          org.springframework.orm.hibernate.support.OpenSessionInViewFilter
          </filter-class>
          </filter>

          <filter-mapping>
          <filter-name>hibernateFilter</filter-name>
          <url-pattern>*. spring </url-pattern>
          </filter-mapping>

          </web-app>


          實現Hibernate的Dao接口來使用打開的會話是很容易的。事實上,如果你已經使用了Spring框架來實現你的Hibernate Dao,很可能你不需要改變任何東西。方便的HibernateTemplate公用組件使訪問數據庫變成小菜一碟,而DAO接口只有通過這個組件才可以訪問到數據庫。下面是一個示例的DAO:


          public class HibernateProductDAO extends HibernateDaoSupport implements ProductDAO {

          public Product getProduct(Integer productId) {
          return (Product)getHibernateTemplate().load(Product.class, productId);
          }

          public Integer saveProduct(Product product) {
          return (Integer) getHibernateTemplate().save(product);
          }

          public void updateProduct(Product product) {
          getHibernateTemplate().update(product);
          }
          }

          在業(yè)務邏輯層中使用延遲加載

          即使在視圖外面,Spring框架也通過使用AOP 攔截器 HibernateInterceptor來使得延遲加載變得很容易實現。這個Hibernate 攔截器透明地將調用配置在Spring應用程序上下文中的業(yè)務對象中方法的請求攔截下來,在調用方法之前打開一個Hibernate會話,然后在方法執(zhí)行完之后將會話關閉。讓我們來看一個簡單的例子,假設我們有一個接口BussinessObject:


          public     interface    BusinessObject     {
          public     void    doSomethingThatInvolvesDaos();
          }
          類BusinessObjectImpl實現了BusinessObject接口:

          public     class    BusinessObjectImpl    implements    BusinessObject     {
          public     void    doSomethingThatInvolvesDaos()     {
          //    lots of logic that calls
          //    DAO classes Which access
          //    data objects lazily  
          }  
          }  


          通過在Spring應用程序上下文中的一些配置,我們可以讓將調用BusinessObject的方法攔截下來,再令它的方法支持延遲加載。看看下面的一個程序片段:


          <beans>
          <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.HibernateInterceptor">
          <property name="sessionFactory">
          <ref bean="sessionFactory"/>
          </property>
          </bean>
          <bean id="businessObjectTarget" class="com.acompany.BusinessObjectImpl">
          <property name="someDAO"><ref bean="someDAO"/></property>
          </bean>
          <bean id="businessObject" class="org.springframework.aop.framework.ProxyFactoryBean">
          <property name="target"><ref bean="businessObjectTarget"/></property>
          <property name="proxyInterfaces">
          <value>com.acompany.BusinessObject</value>
          </property>
          <property name="interceptorNames">
          <list>
          <value>hibernateInterceptor</value>
          </list>
          </property>
          </bean>
          </beans>

          當businessObject被調用的時候,HibernateInterceptor打開一個Hibernate會話,并將調用請求傳遞給BusinessObjectImpl對象。當BusinessObjectImpl執(zhí)行完成后,HibernateInterceptor透明地關閉了會話。應用層的代碼不用了解任何持久層邏輯,還是實現了延遲加載。


          在單元測試中測試延遲加載

          最后,我們需要用J-Unit來測試我們的延遲加載程序。我們可以輕易地通過重寫TestCase類中的setUp和tearDown方法來實現這個要求。我比較喜歡用這個方便的抽象類作為我所有測試類的基類。


          public abstract class MyLazyTestCase extends TestCase {

          private SessionFactory sessionFactory;
          private Session session;

          public void setUp() throws Exception {
          super.setUp();
          SessionFactory sessionFactory = (SessionFactory) getBean("sessionFactory");
          session = SessionFactoryUtils.getSession(sessionFactory, true);
          Session s = sessionFactory.openSession();
          TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(s));

          }

          protected Object getBean(String beanName) {
          //Code to get objects from Spring application context
          }

          public void tearDown() throws Exception {
          super.tearDown();
          SessionHolder holder = (SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
          Session s = holder.getSession();
          s.flush();
          TransactionSynchronizationManager.unbindResource(sessionFactory);
          SessionFactoryUtils.closeSessionIfNecessary(s, sessionFactory);
          }
          }

           

          Html 屏蔽鼠標右鍵

          <body oncontextmenu="self.event.returnValue=false">

          啟動監(jiān)聽 oracle用戶下執(zhí)行

          lsnrctl start

          >192.168.1.242

          現在好了。

          [oracle@localhost ~]$ lsnrctl start

          LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 31-1 -2007 15:12:34

          Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

          Starting /opt/oracle/9.2.0/bin/tnslsnr: please wait...

          TNSLSNR for Linux: Version 9.2.0.4.0 - Production

          System parameter file is /opt/oracle/9.2.0/network/admin/listener.ora

          Log messages written to /opt/oracle/9.2.0/network/log/listener.log

          Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

          Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

          Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))

          STATUS of the LISTENER

          ------------------------

          Alias                     LISTENER

          Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production

          Start Date                31-1 -2007 15:12:35

          Uptime                    0 days 0 hr. 0 min. 0 sec

          Trace Level               off

          Security                  OFF

          SNMP                      OFF

          Listener Parameter File   /opt/oracle/9.2.0/network/admin/listener.ora

          Listener Log File         /opt/oracle/9.2.0/network/log/listener.log

          Listening Endpoints Summary...

           (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))

           (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

          Services Summary...

          Service "PLSExtProc" has 1 instance(s).

           Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

          Service "futuredb" has 1 instance(s).

           Instance "futuredb", status UNKNOWN, has 1 handler(s) for this service...

          The command completed successfully

          查看linux正在使用的端口命令   netstat -an

          動態(tài)查看日志文件 tail -f 文件名

          解壓tar文件 tar -xvf 文件名.tar

          打包tar文件 tar -cvf 文件名.tar

          解壓gz文件   gunzip 文件名.gz

          解壓縮gz文件 gzip 文件名

          解壓cpio文件 cpio -idmv < *.cpio

          1、 安全拷貝

          Scp 文件名 IP/目錄

          注意:SSH必須啟動 SSH 端口22

          2、 移動

          Mv 文件名 路徑 將某個文件移動到某個路徑下

          3、 刪除

          Rm –rf /文件名 刪除文件或者文件夾 -rf 命令將不提示徹底刪除

          4、 oracle 狀態(tài)進程

          ps –eflgrep ora

          5、 啟動oralce監(jiān)聽

          lsnrctl start

          6、查看oralce監(jiān)聽

          Lsnrctl status

          7、啟動oracle服務

          進入oralce 用戶

          Sqlplus ‘/as sysdba’

          Startup

          Exit

          8、查看所有IP

          Ifconfig –a

          9、查看oracle端口正常不

                 Netstat –an|grep 1521

          10、登錄oracle sqlplus

                 oracle目錄下

                 Sqlplus neme/password@sid_IP

          11、查看命令

                 命令 –help

                 Man 命令

                 Info 命令

          12、查看歷史

                 History |more

                 History 5

          Html 禁止鼠標右鍵

          oncontextmenu="self.event.returnValue=false"

          Linux下安裝配置Oralce

          安裝好Oracle 后在Oracle用戶下/home/Oracle目錄下用 vi .bash_profile 命令,在里面配置環(huán)境變量

          # .bash_profile

          # Get the aliases and functions

          if [ -f ~/.bashrc ]; then

                  . ~/.bashrc

          fi

          # User specific environment and startup programs

          PATH=$PATH:$HOME/bin

          export PATH

          export ORACLE_BASE=/backup/oracle

          export ORACLE_HOME=/backup/oracle/product/10.2.0

          export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH

          export ORACLE_OWNER=oracle

          export ORACLE_SID=futureoa

          #export ORACLE_SID

          export ORACLE_TERM=xterm

          #export ORACLE_TERM

          export LD_ASSUME_KERNEL=2.6.9

          #export THREADS_FLAG=native

          LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

          LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

          export LD_LIBRARY_PATH

          export PATH=$PATH:$ORACLE_HOME/bin

          export NLS_LANG=AMERICAN_AMERICA.UTF8

          #export LANG=en_US

          export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

          CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

          CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib

          export CLASSPATH

          unset USERNAME

          # Oracle Settings

          # Oracle Settings

          ~

          ".bash_profile" 36L, 954C       

          在啟動WebSphere應用服務器的時候報告端口沖突
          最常見的情況是已有一個應用服務器實例在運行了。這樣的話,要么只啟動一個實例,要么更改一個實例的端口號。還有一個常見的問題是在AIX 5L環(huán)境上報9090端口沖突。其原因是在AIX 5L中缺省會有一個wsmservr啟動,并占用9090端口。因此在啟動或安裝WebSphere應用服務器前,要確認系統(tǒng)wsmserver沒有啟動。如果這個服務已經啟動,我們用下面命令停止wsmserver服務:/usr/websm/bin/wsmserver -disable。如果說需要保留這個占用9090端口的服務,那么我們只能通過更改應用服務器的管理控制臺應用的端口。由于控制臺本身的端口被占用了,因此我們不能通過控制臺來操作,而只能直接修改配置文件。這里我們要修改兩個文件。一個是virtualhosts.xml文件,它的路徑為WebSphere應用服務器安裝目錄/config/cells/單元名/。把其中的9090端口改成沒有沖突的端口,比如9091。另一個要更改的文件是server.xml,它的路徑為WebSphere應用服務器安裝目錄/config/cells/單元名/nodes/節(jié)點名/servers/server1。同樣把其中的9090端口更改成9091。注意兩個文件的更改需要一致。

          使用命令建立“概要文件管理工具”中的“應用服務器”即單元節(jié)點

          命令D:"Java"IBM"WebSphere"AppServer"bin"ProfileManagement>pmt.bat可以打開建立“概要文件管理工具”的窗口

          Windows下刪除Websphere的服務

          在注冊表中 運行-regedit

          HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services

          HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services

          HKEY_LOCAL_MACHINE/SYSTEM/ControlSet003/Services

          下面找到IBMWAS61Service - DBF01A8E0E0F455Node03

          Websphere的服務刪除就可以了

          >啟動Oracle的命令是啥丫

          啟動監(jiān)聽: lsnrctl start

          sqlplus '/as sysdba'

          startup

           

           

           

           

          動態(tài)瀏覽vi 內容

          tail -f filename.txt

          linux 時間

          顯示當前時間

          date

          設置時間

          date -s "2007-6-25 15:14:00"

          clock -w

          WebSphere 日志跟蹤${SERVER_LOG_ROOT}/SystemOut.log

          linux下設置ldap隨系統(tǒng)自動啟動

          在終端命令行輸入

          Ntsysv

          在出現對界面中選中ldap就可以了

          posted on 2007-11-12 09:43 禮物 閱讀(1748) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。

          網站導航:
           
          主站蜘蛛池模板: 法库县| 崇明县| 磐安县| 六枝特区| 承德市| 水城县| 五莲县| 望都县| 张家港市| 东海县| 遂川县| 扶余县| 侯马市| 岢岚县| 抚远县| 河西区| 司法| 永仁县| 常山县| 特克斯县| 宁都县| 和静县| 光山县| 宣化县| 屏山县| 辛集市| 静安区| 兴业县| 伊吾县| 瑞金市| 岑溪市| 金平| 霸州市| 张家港市| 宜宾县| 丹寨县| 呈贡县| 内黄县| 河池市| 微山县| 扬中市|