2019年10月31日 星期四

常見的誤解 - 人不為己天誅地滅

節錄自 https://linriva.pixnet.net/blog/post/62534027-%E5%8D%97%E6%87%B7%E7%91%BE%EF%BC%9A%E3%80%8C%E4%BA%BA%E4%B8%8D%E7%82%BA%E5%B7%B1%EF%BC%8C%E5%A4%A9%E8%AA%85%E5%9C%B0%E6%BB%85%E3%80%8D%E5%8E%9F%E4%BE%86%E6%98%AF%E9%80%99%E5%80%8B

我一直以為,這句話的意思是:人如果不為自己謀利、謀權、謀色,就要招到天地誅殺。其實,這是誤解。

  現在才知道,「人不為己天誅地滅」,出處是《佛說十善業道經》第二十四集::人生為己,天經地義,人不為己,天誅地滅。佛家的意思是:不殺生、不偷盜、不邪淫、不妄語、不兩舌、不绮語、不惡口、不貪欲、不嗔恚、不邪見,才是「為自己」。不為自己製造新的惡果,不為自己造成新的災禍,這才是「為自己」。只有這樣才不會天誅地滅。

2019年10月25日 星期五

SAP - Profile Administration (transaction RZ10) 參數設定










SAP建議使用事務T-CODE RZ10調整SAP配置文件。 但是,例如,如果由於錯誤的配置而無法再啟動SAP系統,則可以在文件系統級別上更改相應文件中的SAP參數。


下方例子
1. 修改參數 login/min_password_lng
2. 新增參數 login/min_password_digits

When using the helper file, remember to reload the profiles with transaction RZ10 afterwards! Utilities → Import profiles → Of active servers
a) First look up the current values of the profile parameters you want to change. Go to transaction RZ11 and enter the Param. Name, for example login/min_password_lng. Choose Display. Note the Current value. Repeat this for the other parameters you want to change.
b) To change the parameters in the SAP system, go to transaction RZ10. By using the F4 help select DEFAULT as Profile, select Extended Maintenance and choose Change.
c) To change an already existing parameter, for example login/min_password_lng, simply click into this row and choose Change
d) Enter the new value in the Parameter val. field, for example 8. Choose Copy and Back.
e) To add a new parameter choose Create. Enter the Parameter name, for example login/min_password_digits. Enter the Parameter val., for example 1. Choose Copy twice and Back.
f) In the parameter list choose Copy and Back.
g) Choose Save and in the popup choose No. In the Activate profile popup choose Yes. Then Continue twice.
h) Now restart your SAP system. First stop the Dialog Instance and afterwards the Central Instance. Start in the opposite order. Log on to operating system level of your SAP system and double click the desktop shortcut SAP Management Console. In the new window right click on one instance of your system and choose Stop. After it is stopped, right click and choose Start.
i) After the system is started again, log on and change your password in transaction SU3. If you set parameter login/password_compliance_to_current_ policy to 1 you may need to change your password directly after logging on. Try to violate any parameter you set. You successfully changed some password parameters of your AS ABAP based SAP system.



login/min_password_diff = 3
--Defines the minimum number of characters that must be different in the new password compared to the old password.

login/password_expiration_time = 90
#login/password_expiration_time 密碼有效期
#Default: 0
#Permissible values: 0 - 1000

login/min_password_lng = 6
--Default: 6
--Permissible values: 3 - 40
--Defines the minimum length of the password.

login/failed_user_auto_unlock = 0
--Defines whether user locks due to unsuccessful logon attempts are automatically removed at midnight.

login/no_automatic_user_sapstar = 0
--login/no_automatic_user_sapstar 用戶SAP* 能不能登錄, 0代表SAP*可以登錄,1代表SAP*不能登陸!


login/fails_to_user_lock = 6
--login/fails_to_user_lock 密碼輸錯多少次後鎖定

login/min_password_letters = 2
--Defines the minimum number of letters (A-Z) in passwords.

login/min_password_digits = 2
--Defines the minimum number of digits (0-9) in passwords.

login/system_client = 800
--login/system_client 登錄時默認的Client號

2019年10月24日 星期四

Oracle DB - Creating Linux Services for DB auto-start auto-stop Oracle 19c On OEL7


創建 Linux Services - dbora
Create a new service to automatically start/stop an Oracle database. This assumes the Oracle database is not using Oracle Restart and the "start_all.sh" and "stop_all.sh" scripts are already present.

# vi /lib/systemd/system/dbora.service

[Unit]
Description=The Oracle Database Service
After=syslog.target network.target

[Service]
# systemd ignores PAM limits, so set any necessary limits in the service.
# Not really a bug, but a feature.
# https://bugzilla.redhat.com/show_bug.cgi?id=754285
LimitMEMLOCK=infinity
LimitNOFILE=65535

#Type=simple
# idle: similar to simple, the actual execution of the service binary is delayed
#       until all jobs are finished, which avoids mixing the status output with shell output of services.
RemainAfterExit=yes
User=oracle
Group=oinstall
Restart=no
ExecStart=/bin/bash -c '/home/oracle/scripts/start_all.sh'
ExecStop=/bin/bash -c '/home/oracle/scripts/stop_all.sh'

[Install]
WantedBy=multi-user.target


Reload systemd so it can see the new service.
# systemctl daemon-reload


Start the service and enable so it is automatically restarted on reboot.
# systemctl start dbora.service
# systemctl enable dbora.service
# systemctl status dbora.service

參考資訊:
Linux Services (systemd, systemctl)

Oracle DB - 安裝Oracle Database 19c 在 Oracle Linux 7



下載軟體

Download the Oracle software from OTN or MOS depending on your support status.
OTN: Oracle Database 19c (19.3) Software (64-bit)
edelivery: Oracle Database 19c (19.3) Software (64-bit)


修改 Hosts File

“ /etc/hosts”文件必須包含服務器的標準名稱。


安裝前置作業

[root@testdb81 ~]# yum install -y oracle-database-preinstall-19c
Loaded plugins: langpacks, ulninfo
ol7_latest                                                                                               | 2.7 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: ksh for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-database-preinstall-19c-1.0-1.el7.x86_64
--> Running transaction check
---> Package ksh.x86_64 0:20120801-139.0.1.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
 Package                                    Arch               Version                             Repository              Size
================================================================================================================================
Installing:
 oracle-database-preinstall-19c             x86_64             1.0-1.el7                           ol7_latest              18 k
Installing for dependencies:
 ksh                                        x86_64             20120801-139.0.1.el7                ol7_latest             883 k
 libaio-devel                               x86_64             0.3.109-13.el7                      ol7_latest              12 k

Transaction Summary
================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 913 k
Installed size: 3.2 M
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/libaio-devel-0.3.109-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for libaio-devel-0.3.109-13.el7.x86_64.rpm is not installed
(1/3): libaio-devel-0.3.109-13.el7.x86_64.rpm                                                            |  12 kB  00:00:00
(2/3): ksh-20120801-139.0.1.el7.x86_64.rpm                                                               | 883 kB  00:00:00
(3/3): oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm                                               |  18 kB  00:00:02
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           328 kB/s | 913 kB  00:00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 Package    : 7:oraclelinux-release-7.6-1.0.15.el7.x86_64 (@anaconda/7.6)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ksh-20120801-139.0.1.el7.x86_64                                                                              1/3
  Installing : libaio-devel-0.3.109-13.el7.x86_64                                                                           2/3
  Installing : oracle-database-preinstall-19c-1.0-1.el7.x86_64                                                              3/3
  Verifying  : libaio-devel-0.3.109-13.el7.x86_64                                                                           1/3
  Verifying  : ksh-20120801-139.0.1.el7.x86_64                                                                              2/3
  Verifying  : oracle-database-preinstall-19c-1.0-1.el7.x86_64                                                              3/3

Installed:
  oracle-database-preinstall-19c.x86_64 0:1.0-1.el7

Dependency Installed:
  ksh.x86_64 0:20120801-139.0.1.el7                             libaio-devel.x86_64 0:0.3.109-13.el7

Complete!


如果用 RHEL7 or CentOS7, 可以安裝 OL7 repository. It will pull the dependencies from your normal repositories.
# yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm



Additional Setup

Set the password for the "oracle" user.
passwd oracle

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
SELINUX=permissive

Once the change is complete, restart the server or run the following command.
# setenforce Permissive

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here. To disable it, do the following.
# systemctl stop firewalld
# systemctl disable firewalld


Create the directories in which the Oracle software will be installed.
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02



Create a "scripts" directory.
mkdir /home/oracle/scripts

Create an environment file called "setEnv.sh". The "$" characters are escaped using "\". If you are not creating the file with the cat command, you will need to remove the escape characters.
cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_HOSTNAME=testdb81
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
EOF

Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile


Create a "start_all.sh" and "stop_all.sh" script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.
cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbstart \$ORACLE_HOME
EOF


cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES

dbshut \$ORACLE_HOME
EOF

chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh



Installation 安裝

# xhost +

cd $ORACLE_HOME
unzip -oq /path/to/software/LINUX.X64_193000_db_home.zip

DISPLAY=0.0:0; export DISPLAY

# Silent mode.
./runInstaller -ignorePrereq -waitforcompletion -silent                        \
    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
    oracle.install.option=INSTALL_DB_SWONLY                                    \
    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \
    UNIX_GROUP_NAME=oinstall                                                   \
    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \
    SELECTED_LANGUAGES=en,en_GB                                                \
    ORACLE_HOME=${ORACLE_HOME}                                                 \
    ORACLE_BASE=${ORACLE_BASE}                                                 \
    oracle.install.db.InstallEdition=SE2                                        \
    oracle.install.db.OSDBA_GROUP=dba                                          \
    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \
    oracle.install.db.OSDGDBA_GROUP=dba                                        \
    oracle.install.db.OSKMDBA_GROUP=dba                                        \
    oracle.install.db.OSRACDBA_GROUP=dba                                       \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \
    DECLINE_SECURITY_UPDATES=true



Database Creation

# Interactive mode.
dbca

# Silent mode.
dbca -silent -createDatabase                                                   \
     -templateName General_Purpose.dbc                                         \
     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \
     -characterSet AL32UTF8                                                    \
     -sysPassword SysPassword1                                                 \
     -systemPassword SysPassword1                                              \
     -createAsContainerDatabase true                                           \
     -numberOfPDBs 1                                                           \
     -pdbName ${PDB_NAME}                                                      \
     -pdbAdminPassword PdbPassword1                                            \
     -databaseType MULTIPURPOSE                                                \
     -automaticMemoryManagement false                                          \
     -totalMemory 1500                                                         \
     -storageType FS                                                           \
     -datafileDestination "${DATA_DIR}"                                        \
     -redoLogFileSize 50                                                       \
     -emConfiguration NONE                                                     \
     -ignorePreReqs



收尾


Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.
cdb1:/u01/app/oracle/product/19.0.0/db_1:Y

Enable Oracle Managed Files (OMF) and make sure the PDB starts when the instance starts.
sqlplus / as sysdba <<EOF
alter pluggable database ${PDB_NAME} save state;
exit;
EOF






參考資訊:
Oracle Database 19c Installation On Oracle Linux 7 (OL7)
Multitenant : Connecting to Container Databases (CDB) and Pluggable Databases (PDB) in Oracle Database 12c Release 1 (12.1)
Multitenant : Startup and Shutdown Container Databases (CDB) and Pluggable Databases (PDB) in Oracle Database 12c Release 1 (12.1)

Planning, Decision, Execution, and Assessment (PDEA) Cycle





Planning, Decision, Execution, and Assessment (PDEA) Cycle. The PDEA cycle describes the process the commander and his staff use to plan operations, make accurate and timely decisions, direct effective execution of operations, and assess the results of those operations to attain understanding. It is a framework that supports the commander’s efforts to assimilate information in a chaotic environment to increase tempo through timely and decisive actions. Decisions are made throughout each phase of the PDE&A cycle. Understanding is required to support each decision. The CTF Battle Rhythm and Reports Matrix are developed to facilitate the CCTF’s PDE&A cycle.



參考資訊:
http://hestories.info/chapter-c-8-information-management.html#Planning,_Decision,_Execution,_and_Assessment_(PDEA)_Cycle



The Decision Execution Cycle
https://www.researchgate.net/figure/The-Decision-Execution-Cycle_fig3_235320642

2019年10月21日 星期一

Oracle DB - 價格 Price 試算










  1. Software Update License & Support價格是 License價格的22%。
  2. 1個Processor License的價格等於50個NUP的價格。
  3. 單一Processor授權價格,EE是SE2的2.71倍。
  4. 單一主機授權價格,EE是SE2的9~24倍。
  5. SE2一個Processor License約台幣50萬。
  6. EE一個Processor License約台幣140萬。


簡單計算:
版本NUPSoftware Update
License & Support
Licese:MAProcessor
License
Software Update
License & Support
Licese:MAProcessor:NUP
SE2350770.2217,5003,8500.2250
EE9502090.2247,50010,4500.2250
2.7142857142.714285714
SE2(台幣)10,5002,310525,000115,500
EE(台幣)28,5006,2701,425,000313,500
一台Server with E5-2630v2 2.60GHz (6 Cores) *2來計算 SE2
1,050,000
一台Server with E5-2630v2 2.60GHz (6 Cores) *2來計算 EE
8,550,000
8.142857143
一台Server with E5-2640v4 2.40GHz(10 Cores)*2來計算 SE2
1,050,000
一台Server with E5-2640v4 2.40GHz(10 Cores)*2來計算 EE
14,250,000
13.57142857








2019年10月18日 星期五

Oracle DB - 修改主機hostname and ip address 之後 DB Control/DB Console (OEM) 無法啟動



將Oracle DB主機 hostname and ip address 修改之後,database and listener可以正常啟動。

但是 DB Control/DB Console (OEM) 無法啟動,錯誤訊息如下:
[oracle@testdb88 ~]$ emctl start dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_testdb88_DB11G not found.



1) Set  $ORACLE_HOSTNAME to the old hostname:

[oracle@testdb88 ~]$ export ORACLE_HOSTNAME=oradb02



2) De-configure the old DB Console:

[oracle@testdb88 ~]$ $ORACLE_HOME/bin/emca -deconfig dbcontrol db

STARTED EMCA at Oct 18, 2019 4:39:26 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: DB11G

Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 18, 2019 4:39:33 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/DB11G/emca_2019_10_18_16_39_26.log.
Oct 18, 2019 4:39:33 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 18, 2019 4:39:36 PM



3) Un-set $ORACLE_HOSTNAME:



4) Create the new DB Console:

[oracle@testdb88 ~]$ $ORACLE_HOME/bin/emca -config dbcontrol db -repos recreate

STARTED EMCA at Oct 18, 2019 4:42:21 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: DB11G
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1

Local hostname ................ testdb88
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ DB11G
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 18, 2019 4:43:34 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/DB11G/emca_2019_10_18_16_42_21.log.
Oct 18, 2019 4:43:35 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Oct 18, 2019 4:44:36 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Oct 18, 2019 4:44:37 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Oct 18, 2019 4:48:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Oct 18, 2019 4:48:07 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Oct 18, 2019 4:48:53 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Oct 18, 2019 4:48:55 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Oct 18, 2019 4:49:01 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Oct 18, 2019 4:49:01 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Oct 18, 2019 4:49:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Oct 18, 2019 4:49:34 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://testdb88:1158/em <<<<<<<<<<<
Oct 18, 2019 4:49:36 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/db_1/testdb88_DB11G/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 18, 2019 4:49:36 PM



4) 確認 dbconsole已經正常啟動:

[oracle@testdb88 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://testdb88:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/testdb88_DB11G/sysman/log





2019年10月16日 星期三

Oracle DB - 修改資料庫參數 memory_max_target 重啟DB遭遇錯誤



修改資料庫參數 memory_max_target 之後重啟DB遭遇錯誤

1. ORA-00845: MEMORY_TARGET not supported on this system










SQL> ALTER SYSTEM SET memory_max_target = 1887436800 SCOPE=SPFILE;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

[解決方式]
從alert log 可以看到類似的警告訊息。
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 1996488704 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 1936601088 and used is 237568 bytes. Ensure that the mount point is /dev/shm for this directory.
memory_target needs larger /dev/shm




1. vi /etc/fstab

tmpfs                   /dev/shm                tmpfs   defaults,size=96g        0 0

2. reboot os




3. startup database

2. ORA-27102: out of memory








SQL> ALTER SYSTEM SET memory_max_target ='16G' SCOPE=SPFILE;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORA-27102: out of memory
Linux-x86_64 Error: 12: Cannot allocate memory
Additional information: 26
Additional information: 327685
Additional information: 1711276032



[解決方式]
 memory_max_target 不可超過 實體記憶體 + Swap Space。

$ free
             total       used       free     shared    buffers     cached
Mem:       3782888    1674632    2108256     232144      34832     914080
-/+ buffers/cache:     725720    3057168
Swap:     10239996          0   10239996


1. 把  memory_max_target 調整到適合大小,再 startup database
2. 增加實體記憶體或swap space,,再 startup database

3. 其他注意事項








If AMM is enabled.

(Do not)勿調整SGA_MAX_SIZE

SGA_MAX_SIZE會自動調整成和MEMORY_MAX_TARGET相同值。





If AMM is disabled.

(Do not)勿調整SGA_MAX_SIZE超過 MEMORY_MAX_TARGET

SQL> startup
ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account

ORA-00849: SGA_TARGET 12884901888 cannot be set to more than MEMORY_MAX_TARGET 2013265920.

2019年10月1日 星期二

在 Red Hat Enterprise Linux/CentOS 7 上安裝 Zabbix Server 4.2


Install Zabbix 4.2 在 RHEL7 

常見的開源監控軟體,有Zabbix、Nagios、Prometheus.......。
其中 Zabbix Server非常容易安裝,參考原廠安裝手冊,以下分享整個安裝過程與詳細指令。一個小時內可以完成安裝設定。




安裝元件介紹

使用標準的LAMP組合


  1. RHEL7
  2. Apache
  3. MySQL (Mariadb 5.5)
  4. PHP
  5. zabbix-4.2-2.el7 rpm pacakge


關閉Linux防火牆

systemctl stop firewalld
systemctl disable firewalld

SELinux

To do this edit the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
If SELinux is configured after installation, the server will need a reboot for the change to take effect.

SELINUX=permissive

getenforce
setenforce permissive
getenforce

Frontend installation prerequisites

Zabbix frontend requires additional packages not available in basic installation. You need to enable repository of optional rpms in the system you will run Zabbix frontend on:

ll /etc/yum.repos.d/
vi public-yum-ol7.repo

[root@aot-zbx02 yum.repos.d]# vi public-yum-ol7.repo
[ol7_optional_latest]
name=Oracle Linux $releasever Optional Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1


安裝MariaDB

yum repolist
yum list mariadb*
yum install mariadb*


安裝 php, httpd

yum install nmap httpd policycoreutils-python net-snmp net-snmp-utils php-bcmath php-mbstring php-xml curl curl-devel net-snmp-devel perl-DBI
yum install php php-gd php-ldap php-mysql php-odbc php-pdo php-pear php-pecl-memcache php-soap php-xmlrpc


Start MariaDB

systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb


修改資料庫root密碼 (選用)

mysqladmin -uroot password 1234qwer


Adding Zabbix repository

rpm -Uvh http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpm


Install Zabbix Server, Zabbix Forntend and Zabbix Agent

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent


Creating database

MySQL - Character set utf8 and utf8_bin collation is required for Zabbix server to work properly with MySQL database.

mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';


Importing data

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix

mysql -uzabbix -pzabbix zabbix

mysql> SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "zabbix";


Configure database for Zabbix server

vi /etc/zabbix/zabbix_server.conf

LogFileSize=10
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix


Starting Zabbix server process

systemctl start zabbix-server
systemctl enable zabbix-server
systemctl status zabbix-server


Zabbix frontend configuration

For RHEL 7 and later the Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf.

vi /etc/httpd/conf.d/zabbix.conf

        # php_value date.timezone Europe/Riga
        php_value date.timezone Asia/Taipei


systemctl start httpd
systemctl enable httpd


Frontend installation steps 

Allow you to access your newly installed Zabbix.
Note that a Zabbix proxy does not have a frontend; it communicates with Zabbix server only.

http://zabbix-frontend-hostname/zabbix

Enter password of zabbix




Configure and start Zabbix Agent


vi /etc/zabbix/zabbix_agentd.conf
LogFileSize=10
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server


systemctl start zabbix-agent
systemctl status zabbix-agent
systemctl enable zabbix-agent


All jobs are completed 


Zabbix frontend is available at http://zabbix-frontend-hostname/zabbix in the browser. Default username/password is Admin/zabbix.



參考資訊~~原廠手冊 

https://www.zabbix.com/documentation/4.2/manual/installation/install_from_packages/rhel_centos