2011年10月18日 星期二

ASDM cannot be launched - Cisco bug ID CSCsr89144

Problem: Exception in thread "SGZ Loader:
launchSgzApplet" java.lang.NumberFormatException: For
input string: "1 year 0"
This problem is caused by Cisco bug ID CSCsr89144 (registered customers only) in ASA running for more
than one year with ASDM 6.0.3 or 6.1. As a result, ASDM cannot be launched.
Solution
This error can be resolved by reloading the ASA.

參考:
http://www.cisco.com/image/gif/paws/110282/asdm-tshoot.pdf

umount device

相信很多人都遇過在linux下要umount某個device時發生"umount: /u01: device is busy" 的錯誤.這個訊息代表要被umount的device正被process使用/user占用中.

此問題通常可用採以下幾個解法:

* 執行 lsof |grep XXX (XXX為要umount的目錄名稱)找出目前佔用此device的ProcessID/user,剔除掉該PID或請user離開該目錄後進行正常umount.

* 執行 fuser -m /dev/sdd1 則更直接的列出佔用此device的PID,剔除掉該PID後進行正常umount.

* 執行 umount -f /dev/sdd1 強制umount

* 若以上指令都無法生效時,就只剩下 umount -l /dev/sdd1 這種暴力umount的指令可以用了.這個指令常用於Networked File System(NFS)的 mount device.

PS: 但正常的作法應該是先停掉nfs service之後就可以umount了.


出處:

2011年7月24日 星期日

Configuring networking from the ESX service console command line




To configure networking from the ESX service console command line:
  1. Ensure the network adapter you want to use is currently connected with the command:

    [root@server root]# esxcfg-nics –l

    The output appears similar to:

    Name PCI Driver Link Speed Duplex Description
    vmnic0 06:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet
    vmnic1 07:00.00 tg3 Up 1000Mbps Full Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet

    In the Link column, Up indicates that the network adapter is available and functioning.
  1. List the current virtual switches with the command:

    [root@server root]# esxcfg-vswitch –l

    The output appears similar to:

    Switch Name Num Ports Used Ports Configured Ports Uplinks
    vSwitch0 32 3 32 vmnic0

    PortGroup Name Internal ID VLAN ID Used Ports Uplinks
    VM Network portgroup2 0 0 vmnic0

    In the example output, there exists a virtual machine network named VM Network with no Service Console portgroup. For illustration, the proceeding steps show you how to create a new virtual switch and place the service console port group on it.

  2. Create a new virtual switch with the command:

    [root@server root]
    # esxcfg-vswitch –a vSwitch1

  3. Create the Service Console portgroup on this new virtual switch:

    [root@server root]# esxcfg-vswitch –A “Service Console” vSwitch1

    Because there is a space in the name (Service Console), you must enclose it in quotation marks.

    Note: To create Service Consoles one at time, you may need to delete all previous settings. For more information, see Recreating Service Console Networking from the command line (1000266).

  4. Up-link vmnic1 to the new virtual switch with the command:

    [root@server root]# esxcfg-vswitch –L vmnic1 vSwitch1

  5. If you need to assign a VLAN, use the command:

    [root@server root]# esxcfg-vswitch -v -p “Service Console” vSwitch0

    where is the VLAN number. A zero here specifies no VLAN.

  6. Verify the new virtual switch configuration with the command:

    [root@server root]# esxcfg-vswitch –l

    The output appears similar to:

    Switch Name Num Ports Used Ports Configured Ports Uplinks
    vSwitch0 32 3 32 vmnic0

    PortGroup Name Internal ID VLAN ID Used Ports Uplinks
    Service Console portgroup5 0 1 vmnic0

    Switch Name Num Ports Used Ports Configured Ports Uplinks
    vSwitch1 64 1 64 vmnic1

    PortGroup Name Internal ID VLAN ID Used Ports Uplinks
    Service Console portgroup14 0 1 vmnic1

  7. Create the vswif (Service Console) interface. For example, run the command:

    [root@server root]# esxcfg-vswif –a vswif0 –i 192.168.1.10 –n 255.255.255.0 –p “Service Console”
    [‘Vnic’ warning] Generated New Mac address, 00:50:xx:xx:xx:xx for vswif0

    Nothing to flush.

  8. Verify the configuration with the command:

    [root@esx]# esxcfg-vswif –l
    Name Port Group IP Address Netmask Broadcast Enabled DHCP
    v
    swif0 Service Console 192.168.1.10 255.255.255.0 192.168.1.255 true false

  9. Verify the networking configuration on the ESX host. See Verifying ESX host networking configuration on the service console (1003796) .

    URL:

2011年7月7日 星期四

Oracle DDL,DML,DCL,TCL 基礎概念

DDL

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT - add comments to the data dictionary
  • RENAME - rename an object

DML

Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
  • SELECT - retrieve data from the a database
  • INSERT - insert data into a table
  • UPDATE - updates existing data within a table
  • DELETE - deletes all records from a table, the space for the records remain
  • MERGE - UPSERT operation (insert or update)
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency

DCL

Data Control Language (DCL) statements. Some examples:
  • GRANT - gives user's access privileges to database
  • REVOKE - withdraw access privileges given with the GRANT command

TCL

Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
  • COMMIT - save work done
  • SAVEPOINT - identify a point in a transaction to which you can later roll back
  • ROLLBACK - restore database to original since the last COMMIT
  • SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use


轉至:
http://www.cnblogs.com/gnielee/archive/2009/07/31/1535621.html

2011年6月20日 星期一

Oracle disable the maintenance mode


Warning

The system has not been taken off maintenance mode completely. Please contact your System Administrator.

This problem usually arises when you start the application tier services before bringing the system out of the "Maintenance Mode".

Please follow these steps:

1) Shutdown all the application tier services and ensure that the Concurrent Manager (FNDLIBR) and JAVA processes are stopped completely.
The java processes may still be running kill the parent process using
kill -9 PID command.

2) Through adadmin "DISABLE" maintenance mode.

3) Run autoconfig once

4) Start the application tier services

root#su - ap user
ap user$adadmin

[appltest@au10dmzh49 scripts]$ adadmin

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

Oracle Applications AD Administration

Version 12.0.0

NOTE: You may not use this utility for custom development
unless you have written permission from Oracle Corporation.

Your default directory is '/d01/oracle/PROD/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ?

AD Administration records your AD Administration session in a text file
you specify. Enter your AD Administration log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adadmin.log] :

************* Start of AD Administration session *************
AD Administration version: 12.0.0
AD Administration started at: Tue Jun 21 2011 14:54:06

APPL_TOP is set to /d01/oracle/PROD/apps/apps_st/appl

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ?

Please enter the batchsize [1000] :


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and
"Development_2".

Applications System Name [PROD] : PROD *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle Applications will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle Applications
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [au10dmzh49] : au10dmzh49 *



You are about to use or modify Oracle Applications product tables
in your ORACLE database 'PROD'
using ORACLE executables in '/d01/oracle/PROD/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ?

AD Administration needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema:manager


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] :apps

AD Administration is verifying your username/password.
The status of various features in this run of AD Administration is:

<-Feature version in->
Feature Active? APPLTOP Data model Flags
------------------------------ ------- -------- ----------- -----------
CHECKFILE Yes 1 1 Y N N Y N Y
PREREQ Yes 6 6 Y N N Y N Y
CONCURRENT_SESSIONS No 2 2 Y Y N Y Y N
PATCH_TIMING Yes 2 2 Y N N Y N Y
PATCH_HIST_IN_DB Yes 6 6 Y N N Y N Y
SCHEMA_SWAP Yes 1 1 Y N N Y Y Y
JAVA_WORKER Yes 1 1 Y N N Y N Y
CODELEVEL Yes 1 1 Y N N Y N Y



Identifier for the current session is 16760

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

AD Administration warning:
Product Data File
/d01/oracle/PROD/apps/apps_st/appl/admin/zfaprod.txt
does not exist for product "zfa".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


AD Administration warning:
Product Data File
/d01/oracle/PROD/apps/apps_st/appl/admin/zsaprod.txt
does not exist for product "zsa".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


AD Administration warning:
Product Data File
/d01/oracle/PROD/apps/apps_st/appl/admin/jtsprod.txt
does not exist for product "jts".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following language is installed:

Code Language Status
---- --------------------------------------- ---------
US American English Base

Your base language will be AMERICAN.

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.

AD code level : [B.1]

AD Administration Main Menu
--------------------------------------------------

1. Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration

select 5

2011年5月24日 星期二

ORA-19566: exceeded limit of 0 corrupt blocks for file


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on d1 channel at 05/24/2011 15:39:27
ORA-19566: exceeded limit of 0 corrupt blocks for file /d01/oracle/PROD/db/apps_st/data/system09.dbf

執行動作如下..

1. SQL>alter database datafile '/d01/oracle/PRODBTPL/db/apps_st/data/system09.dbf' resize 1000M;

2. 進行check oracle@hostname$ dbv file=/d01/oracle/PRODBTPL/db/apps_st/data/system09.dbf BLOCKSIZE=8192

Automatic archival disabled
















#Create spfile from pfile;

#mkdir /home/oracle/archivelog

First lets check the current log mode:
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Mar 20 14:33:05 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 165
Current log sequence 167

SQL> select name, log_mode from v$database;

NAME LOG_MODE
--------- ------------
TEST NOARCHIVELOG

SQL> show parameter spfile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /home/oracle/product/11g/db/db
s/spfiletest.ora
Now lets try to set the archive log destination:

SQL> alter system set log_archive_dest_1='/home/oracle/archivelog' scope=spfile;
alter system set log_archive_dest_1='/home/oracle/archivelog' scope=spfile
*
ERROR at line 1:
ORA-32017: failure in updating SPFILE
ORA-16179: incremental changes to "log_archive_dest_1" not allowed with SPFILE

I faced the above error, thought need to enable archiving first:

SQL> alter system set log_archive_start=TRUE
2 scope=spfile;

System altered.

But I received the error again.

SQL> alter system set log_archive_dest_1='/home/oracle/archivelog' scope=spfile;
alter system set log_archive_dest_1='/home/oracle/archivelog' scope=spfile
*
ERROR at line 1:
ORA-32017: failure in updating SPFILE
ORA-16179: incremental changes to "log_archive_dest_1" not allowed with SPFILE

Checked the error description:
SQL> !oerr ora 16179
16179, 00000, "incremental changes to \"%s\" not allowed with SPFILE"
// *Cause: Incremental changes to a log_archive_dest_n parameter cannot
// be made when using an SPFILE.
// *Action: Specify either LOCATION or SERVICE plus all other attributes
// to be set in one ALTER SYSTEM/SESSION SET command.

So I did some research and found that when using spfile and trying to set a parameter like log_archive_dest_1, we need to give
complete format of the parameter like:

SQL> alter system set log_archive_dest_1='location=/home/oracle/archivelog' scope=spfile;

System altered.
(Optionally we can also give other parameters in this statement like optional, reopen etc.)

Now let shutdown the database and do a startup mount:

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 422670336 bytes
Fixed Size 1300352 bytes
Variable Size 310380672 bytes
Database Buffers 104857600 bytes
Redo Buffers 6131712 bytes
Database mounted.

Enabling archivelog mode

SQL> alter database archivelog;

Database altered.

Open the database:

SQL> alter database open;

Database altered.

Test if archivelog is set properly:

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/archivelog
Oldest online log sequence 165
Next log sequence to archive 167
Current log sequence 167
SQL> select name, log_mode from v$database;

NAME LOG_MODE
--------- ------------
TEST ARCHIVELOG

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> !ls -lrt /home/oracle/archivelog
total 44496
-rw-r----- 1 oracle oracle 45509632 2009-03-20 14:43 1_167_677948664.dbf
-rw-r----- 1 oracle oracle 1024 2009-03-20 14:43 1_168_677948664.dbf

So now we have enabled archivelog mode and have some archivelog file also!!!

2011年1月23日 星期日

httpd: bad user name apache

httpd: bad user name apache

解決辦法:在系統中添加一個用戶apache

#useradd命令apache


Warning: session_start() [function.session-start]: open(/var/lib/php/session/sess_ failed: Permission denied (13)

解決辦法:

#chown -R root:apache /var/lib/php //改成 group 使用apache

參考來源:http://www.weithenn.org/cgi-bin/wiki.pl?phpmyadmin-Web_%E4%BB%8B%E9%9D%A2%E6%8E%A7%E5%88%B6_Mysql

2011年1月17日 星期一

centos5.5升級php5.2

==============安裝php5==========

http://joomlab15.exonsoft.com/zh-tw/articles/general/83-upgrade-php-to-52x-on-centos

要使用 CentOS-Testing 軟體套件庫,必須先把它加入到 YUM 的軟體套件庫設置內。只要用文字編輯器開啟 /etc/yum.repos.d/CentOS-Base.repo 檔案,在將下面的內容加到檔案最後:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.

請不要在設置裡把這個軟體套件庫啟用。當你想從該軟體套件庫取得軟體包時,在指令內啟用即可。現在讓我們先檢查看看這個軟體套件庫裡有什麼與 PHP 有關的升級包。在你的指令殼(command shell)下鍵入已下的指令:
yum --disablerepo=* --enablerepo=c5-testing check-update php*

指令內的選項告訴 YUM 把所有的軟體套件庫都停用,只使用 c5-testing,並且檢查任何名字是以 php 開頭的升級包。你會看見一份與 PHP 有關的套件包列表,上面的套件包都是可以用來升級你的 PHP 安裝。
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile

php.i386 5.2.9-2.el5.centos c5-testing
php-cli.i386 5.2.9-2.el5.centos c5-testing
php-common.i386 5.2.9-2.el5.centos c5-testing
php-gd.i386 5.2.9-2.el5.centos c5-testing
php-imap.i386 5.2.9-2.el5.centos c5-testing
php-mbstring.i386 5.2.9-2.el5.centos c5-testing
php-mcrypt.i386 5.2.9-2.el5.centos.3 c5-testing
php-mysql.i386 5.2.9-2.el5.centos c5-testing
php-pdo.i386 5.2.9-2.el5.centos c5-testing

很快地檢視這份列表。如果那些套件包看起來合理,你就可以進行安裝。你必須再次停用其他的軟體套件庫。
yum --disablerepo=* --enablerepo=c5-testing update php*

遵照螢幕上的指示,你很快就會有 PHP 5.2.x 安裝在你的 CentOS 伺服器上了。

=======安裝mysql=========
yum --disablerepo=* --enablerepo=c5-testing update mysql;*

出現錯誤code
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhos
http://ca95.pixnet.net/blog/post/6841076

[root@localhost ~]# mysqladmin -u root passwd '新密碼'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

[root@localhost ~]# service mysqld stop
[root@localhost ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[root@localhost ~]# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('新密碼') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

[root@localhost ~]# service mysqld start
[root@localhost ~]# mysql -uroot -p
Enter password: 新密碼



==================phpmyadmin=======================
http://blog.xuite.net/dragonbesta/dragonbesta/30771056
http://www.pczone.com.tw/vbb3/archive/t-103939.html



1.yum install mbstring


名稱hpmyadin
說明:先到phpmyadin,看到建立新資料庫,空白框鍵入phpmyadin

2.找到create_tables.sql
說明:檔案位址在phpmyadin目錄中的scripts文件夾,就看到
create_tables.sql檔案了

3.create_tables.sql檔copy到mysql目錄中的bin文件夾

4.用cmd模式進入bin目錄中
說明:C:\Documents and Settings\Administrator>cd\
C:\cd mysql\bin
C:\mysql\bin>

5.匯入create_tables.sql檔到phpmyadin資料庫中
說明:上面第四步驟,鍵入
C:\mysql\bin>mysql -uroot -p資料庫密碼 phpmyadin
6.更改config.inc.php
說明:檔案在phpmyadin目錄下,以下為更改數據

$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // Database used for Relation, Bookmark and PDF Features
// (see scripts/create_tables.sql)
// - leave blank for no support
// DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // Bookmark table
// - leave blank for no bookmark support
// DEFAULT: 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = 'pma_relation'; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
// DEFAULT: 'pma_relation'
$cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // table to describe the display fields
// - leave blank for no display fields support
// DEFAULT: 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // table to describe the tables position for the PDF schema
// - leave blank for no PDF schema support
// DEFAULT: 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // table to describe pages of relationpdf
// - leave blank if you don't want to use this
// DEFAULT: 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // table to store column information
// - leave blank for no column comments/mime types
// DEFAULT: 'pma_column_info'
$cfg['Servers'][$i]['history'] = 'pma_history'; // table to store SQL history
// - leave blank for no SQL query history
// DEFAULT: 'pma_history'