Posts tagged ‘DATABASE’

install oracle 11g steps

記錄一下, 方便查詢

ORACLE URL : Installing Oracle Database 11g Release 1 on Enterprise Linux 5 (32- and 64-bit)
- http://www.oracle.com/technology/pub/articles/smiley-11gr1-install.html?rssid=rss_otn_articles

ORACLE wiki : http://wiki.oracle.com/

step-by-step screenshots : http://www.thegeekstuff.com/2008/10/oracle-11g-step-by-step-installation-guide-with-screenshots/

Install Oracle 11g on CentOS with VMware ( Mac )
- http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook

Oracle 11g R1 Enterprise安裝研究(CentOS 5.2) : http://forum.icst.org.tw/phpbb/viewtopic.php?f=21&t=16411&start=0&sid=866700eee479d130d126967c3160e7f4

Oracle 11g R2 Enterprise (CentOS 5.3 x86_64) 安裝筆記 : http://hans0713.blogspot.com/2009/10/oracle-11g-r2-enterprise-centos-53.html

Oracle 9i Streams 安裝步驟 – http://www.oracle-base.com/articles/9i/Streams9i.php

Oracle 11g Release 2 RAC On Linux Using VMware Server 2 -
http://www.oracle-base.com/articles/11g/OracleDB11gR2RACInstallationOnOEL5UsingVMwareServer2.php

筆記一下網上看到的:

Linux OS 下這些調整 sysctl

fs.file-max = 65535
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144

http://forum.icst.org.tw/phpbb/viewtopic.php?f=21&t=16411&start=0&sid=866700eee479d130d126967c3160e7f4

一些 memcache 的資料

Protected: Oracle down time / problem records / 經典

This post is password protected. To view it please enter your password below:


Database administrator

A database administrator (DBA) is a person who is responsible for the environmental aspects of a database. The role of a database administrator has changed according to the technology of database management systems (DBMSs) as well as the needs of the owners of the databases. For example, although logical and physical database design are traditionally the duties of a database analyst or database designer, a DBA may be tasked to perform those duties.

Duties

The duties of a database administrator vary and depend on the job description, corporate and Information Technology (IT) policies and the technical features and capabilities of the DBMS being administered. They nearly always include disaster recovery (backups and testing of backups), performance analysis and tuning, data dictionary maintenance, and some database design.

Some of the roles of the DBA may include

  • Installation of new software — It is primarily the job of the DBA to install new versions of DBMS software, application software, and other software related to DBMS administration. It is important that the DBA or other IS staff members test this new software before it is moved into a production environment.
  • Configuration of hardware and software with the system administrator — In many cases the system software can only be accessed by the system administrator. In this case, the DBA must work closely with the system administrator to perform software installations, and to configure hardware and software so that it functions optimally with the DBMS.
  • Security administration — One of the main duties of the DBA is to monitor and administer DBMS security. This involves adding and removing users, administering quotas, auditing, and checking for security problems.
  • Data analysis — The DBA will frequently be called on to analyze the data stored in the database and to make recommendations relating to performance and efficiency of that data storage. This might relate to the more effective use of indexes, enabling "Parallel Query" execution, or other DBMS specific features.
  • Database design (preliminary) — The DBA is often involved at the preliminary database-design stages. Through the involvement of the DBA, many problems that might occur can be eliminated. The DBA knows the DBMS and system, can point out potential problems, and can help the development team with special performance considerations.
  • Data modeling and optimization — By modeling the data, it is possible to optimize the system layouts to take the most advantage of the I/O subsystem.
  • Responsible for the administration of existing enterprise databases and the analysis, design, and creation of new databases.
    • Data modeling, database optimization, understanding and implementation of schemas, and the ability to interpret and write complex Structured Query Language (SQL) queries
    • Proactively monitor systems for optimum performance and capacity constraints
    • Establish standards and best practices for SQL
    • Interact with and coach developers in SQL scripting

 

http://metalink.oracle.com/

在 gentoo 裝 oracle sqlplus package

5a7d294f8002b7cbcefa422e9598e2cf

去 Oracle 那邊 download
05a6575d78ea1ec511646bd57e002b71

那個 instantclient-sqlplus-linux32-11.1.0.7.zip
放到 /usr/portage/distfiles

下 emerge -av dev-db/oracle-instantclient-sqlplus

Graphical Database Schema Metadata Browser – SchemaSpy

wordpress 的 schema

ver 2.7:

wp_2.7

幾個查詢例:

SELECT m.* FROM  wp_posts  p , wp_postmeta m
where p.id=m.post_id
order by post_id desc

SELECT tr.*
FROM  wp_posts  p , wp_term_relationships tr
where p.id=tr.object_id
order by p.id desc

SELECT p.id , w.*
FROM  wp_posts  p , wp_term_relationships tr , wp_term_taxonomy t
where p.id=tr.object_id
and tr.term_taxonomy_id=t.term_taxonomy_id
order by p.id desc

SELECT p.id , w.*
FROM  wp_posts  p , wp_term_relationships tr , wp_term_taxonomy t ,  wp_terms w
where p.id=tr.object_id
and tr.term_taxonomy_id=t.term_taxonomy_id
and t.term_id = w.term_id
order by p.id desc

Oracle documentation library

MySQL – Optimizing Database Structure

參考: http://dev.mysql.com/doc/refman/5.0/en/optimizing-database-structure.html

7.4.1. Make Your Data as Small as Possible
7.4.2. Column Indexes
7.4.3. Multiple-Column Indexes
7.4.4. How MySQL Uses Indexes
7.4.5. The MyISAM Key Cache
7.4.6. MyISAM Index Statistics Collection
7.4.7. How MySQL Opens and Closes Tables
7.4.8. Disadvantages of Creating Many Tables in the Same Database

減少 record structure 的大小 – Numeric Types 參考表
(用 MEDIUMINT 3bytes 比 INT 4bytes 好 , 若資料內容不可能有負值那加上 UNSIGNED , 則數值範圍可多一倍!)

fd5aa2a415b47b898c229846a7644cf8

Protected: 規格表 schema

This post is password protected. To view it please enter your password below:


mysql index 的建立/使用 , Multiple-Column Indexes

http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html

CREATE TABLE test (
    id         INT NOT NULL,
    last_name  CHAR(30) NOT NULL,
    first_name CHAR(30) NOT NULL,
    PRIMARY KEY (id),
    INDEX name (last_name,first_name)
);

The name index is an index over the last_name and first_name columns. The index can be used for queries that specify values in a known range for last_name, or for both last_name and first_name. Therefore, the name index is used in the following queries:

SELECT * FROM test WHERE last_name='Widenius';

SELECT * FROM test
  WHERE last_name='Widenius' AND first_name='Michael';

SELECT * FROM test
  WHERE last_name='Widenius'
  AND (first_name='Michael' OR first_name='Monty');

SELECT * FROM test
  WHERE last_name='Widenius'
  AND first_name >='M' AND first_name < 'N';

However, the name index is not used in the following queries, 以下的 query 用不到 index —> 多重 index 有先後區別.

SELECT * FROM test WHERE first_name='Michael';

SELECT * FROM test
  WHERE last_name='Widenius' OR first_name='Michael';

Protected: ★★★ Oracle streams standby architecture 架構圖 – 很多值得參考的範例

This post is password protected. To view it please enter your password below:


Manage Oracle Streams Advanced Queuing – DBMS_AQADM

 

官網資料 : http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_aqadm.htm#i1015375

The DBMS_AQADM package provides procedures to manage Oracle Streams Advanced Queuing (AQ) configuration and administration information.

See Also:

This chapter contains the following topics:

Protected: 最近遇上的 Oracle 問題, 2009.0608 心得

This post is password protected. To view it please enter your password below:


Protected: Oracle’s V$ Views

This post is password protected. To view it please enter your password below:


筆記 oracle sqlplus 連線 不用 tnsname 檔案的方法 / syntax

sqlplus account/password@172.25.0.18x/service_name

sqlplus sys/password@172.30.0.48/oradb as sysdba

sqlplus /nolog

conn account/password@172.25.0.18x/service_name

SQL 的 union 的作法

The UNION query allows you to combine the result sets of 2 or more “select” queries. It removes duplicate rows between the various “select” statements.

select count(1) from (
      — 賣家
      select ctrl_rowid
      from bidleader.sold_record s
      where s.ctrl_date like ’200701%’
      group by ctrl_rowid
      union
      — 買家
      select p_ctrl_rowid  ctrl_rowid
      from bidleader.sold_record s
      where s.ctrl_date like ’200701%’
      group by p_ctrl_rowid
) t

Sun 買 MySQL , Oracle 買 Sun

Protected: 一箱 oracle 的問與答 / tunning / password 公司統編

This post is password protected. To view it please enter your password below:


mysql的資料移轉到oracle, MySQL to Oracle Migration / convert Tool