手順
yoheia% /usr/sbin/system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: MacBook
Model Identifier: MacBook6,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2.26 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 3 MB
Memory: 4 GB
Bus Speed: 1.07 GHz
Boot ROM Version: MB61.00C8.B00
SMC Version (system): 1.51f53
Serial Number (system): 450100LG8PX
Hardware UUID: A1BA8EDD-F573-5A0E-B5C7-1680D531DDD9
Sudden Motion Sensor:
State: Enabled
yoheia% sw_vers
ProductName: Mac OS X
ProductVersion: 10.6.3
BuildVersion: 10D578
yoheia% df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 233Gi 34Gi 198Gi 15% /
devfs 108Ki 108Ki 0Bi 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% /net
map auto_home 0Bi 0Bi 0Bi 100% /home
yoheia% uname -a
Darwin yoheia-no-macbook.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
yoheia% gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
yoheia% java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
yoheia% system_profiler SPApplicationsDataType | grep Xcode
Xcode:
Get Info String: Xcode version 3.2.2
Location: /Developer/Applications/Xcode.app
About Xcode:
Get Info String: About Xcode
Location: /Developer/About Xcode.app
yoheia% sudo dscl . -list /groups gid name
...
netusers 52
network 69
nobody -2
nogroup -1
...
yoheia% sudo dscl . -create /groups/oinstall
yoheia% sudo dscl . -append /groups/oinstall gid 501
yoheia% sudo dscl . -append /groups/oinstall passwd "*"
yoheia% sudo dscl . -create /groups/dba
yoheia% sudo dscl . -append /groups/dba gid 502
yoheia% sudo dscl . -append /groups/dba passwd "*"
yoheia% sudo dscl . -list /groups gid name | grep -E '(dba|oinstall)'
dba 502
oinstall 501
yoheia% sudo dscl . -list /users uid name
...
daemon 1
nobody -2
root 0
yoheia 501
yoheia% sudo dscl . -create /users/oracle
yoheia% sudo dscl . -append /users/oracle uid 502
yoheia% sudo dscl . -append /users/oracle gid 501
yoheia% sudo dscl . -append /users/oracle shell /bin/zsh
yoheia% sudo dscl . -append /users/oracle home /Users/oracle
yoheia% sudo dscl . -append /users/oracle realname "Oracle software owner"
yoheia% sudo mkdir /Users/oracle
yoheia% sudo chown oracle:oinstall /Users/oracle
yoheia% sudo passwd oracle
Changing password for oracle.
New password:
Retype new password:
yoheia% sudo dscl . -append /groups/dba GroupMembership oracle
yoheia% id oracle
uid=502(oracle) gid=501(oinstall) groups=501(oinstall),61(localaccounts),12(everyone),502(dba),402(com.apple.sharepoint.group.1)
yoheia% sudo dscl . -read /users/oracle
AppleMetaNodeLocation: /Local/Default
AuthenticationAuthority: ;ShadowHash; ;Kerberosv5;;oracle@LKDC:SHA1.3D90B573C80BFCA3D3AA92183DB78C62A54DD8A4;LKDC:SHA1.3D90B573C80BFCA3D3AA92183DB78C62A54DD8A4;
GeneratedUID: C22640BC-A49A-4F01-A4BD-4CD2FD8BA12D
NFSHomeDirectory: /Users/oracle
Password: ********
PrimaryGroupID: 501
RealName:
Oracle software owner
RecordName: oracle
RecordType: dsRecTypeNative:users
UniqueID: 502
UserShell: /bin/zsh
yoheia% sudo dscl . -read /groups/dba
AppleMetaNodeLocation: /Local/Default
GroupMembership: oracle
Password: *
PrimaryGroupID: 502
RecordName: dba
RecordType: dsRecTypeNative:groups
yoheia% sudo vi /etc/sysctl.conf
kern.sysv.shmall=2097152
kern.sysv.shmmni=4096
kern.sysv.shmmax=1073741824
kern.maxfiles=65536
kern.maxfilesperproc=65536
net.inet.ip.portrange.first=1024
kern.maxproc=2068
kern.maxprocperuid=2068
yoheia% sudo vi /etc/launchd.conf
limit maxproc 2068 2068
limit maxfiles 65536 65536
yoheia% mkdir -p /Users/oracle/u01/app/oracle
yoheia% sudo chown -R oracle:oinstall /Users/oracle/u01
yoheia% sudo chmod -R 755 /Users/oarcle/u01
- 変更したカーネルパラメータと shell limit を確認する。
yoheia-no-macbook% sysctl -a | grep -E '(portrange.last|portrange.first|shmall|shmmni|shmmax|maxfiles|maxfilesperproc|maxproc|macprocperuid)'
kern.maxproc = 2068
kern.maxfiles = 65536
kern.maxfilesperproc = 65536
kern.maxprocperuid = 2068
kern.maxproc: 2068
kern.maxfiles: 65536
kern.maxfilesperproc: 65536
kern.maxprocperuid: 2068
kern.sysv.shmmax: 1073741824
kern.sysv.shmmni: 4096
kern.sysv.shmall: 2097152
net.inet.ip.portrange.first: 1024
net.inet.ip.portrange.last: 65535
yoheia-no-macbook% launchctl limit
cpu unlimited unlimited
filesize unlimited unlimited
data unlimited unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 2068 2068
maxfiles 65536 65536
yoheia-no-macbook% vi ~/.zshenv
export ORACLE_BASE=/Users/oracle/u01/app/oracle
export ORACLE_SID=orcl
yoheia-no-macbook% source ~/.zshenv
yoheia-no-macbook% mkdir -p /Users/oracle/software
yoheia-no-macbook% cd /Users/oracle/software
yoheia-no-macbook% unzip db.zip
yoheia-no-macbook% cd db/Disk1
yoheia-no-macbook% export LANG=C
yoheia-no-macbook% export NLS_LANG=American_America.JA16SJISTILDE
yoheia-no-macbook% ./runInstaller -J-d32
- 「Error in invoking target ‘all_no_orcl ipc_g ihsodbc32′ …」とエラーが出力されたら $ORACLE_HOME/rdbms/lib/ins_rdbms.mk を開いて「HSODBC_LINKLINE」を含む行を「#」でコメントあうとして[再試行]を押す。
yoheia-no-macbook% cd ~/u01/app/oracle/oracle/product/10.2.0/db_1/rdbms/lib
yoheia-no-macbook% vi ins_rdbms.mk
yoheia-no-macbook% su -
yoheia-no-macbook:~ root# /Users/oracle/u01/app/oracle/oracle/product/10.2.0/db_1/root.sh
yoheia-no-macbook% cd $ORACLE_HOME/bin
yoheia-no-macbook% curl -O http://rayapps.com/downloads/oracle_ee.zip
yoheia-no-macbook% unzip oracle_ee.zip
yoheia-no-macbook% chmod ug+s oracle
yoheia-no-macbook% rm oracle_ee.zip
- 差し替えなかった場合、dbca でデータベースを作成しようとすると「ORA-3113: end-of-file on communication channel」というエラーが出力されて失敗する。この場合、アラートログを確認するとインスタンス起動時に以下のようにコアダンプを吐いて起動に失敗している。
yoheia-no-macbook% tail -n 4 $ORACLE_BASE/admin/orcl/bdump/alert_orcl.log
Sun Apr 25 14:42:55 2010
Errors in file /Users/oracle/u01/app/oracle/admin/orcl/bdump/orcl_ora_1244.trc:
ORA-07445: exception encountered: core dump [kslgetl()+213] [SIGSEGV] [Address not mapped to object] [0x000000208] [] []
ORA-00108: failed to set up dispatcher to accept connection asynchronously
yoheia-no-macbook% vi .zshenv
export ORACLE_BASE=/Users/oracle/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=.:$ORACLE_HOME/bin:$PATH
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=American_America.JA16SJISTILDE
export ORACLE_SID=orcl
- netca と dbca を32bitモードで実行するため $ORACLE_HOME/jdk/bin/java を編集し、java の起動オプションに -d32 を追加する。
yoheia-no-macbook% cd $ORACLE_HOME/jdk/bin
yoheia-no-macbook% cp java java.org
yoheia-no-macbook% vi java
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin/java -d32 -Xbootclasspath/a:/Users/oracle/u01/app/oracle/product/10.2.0/db_1/jdk/jre/lib/ext:/Users/oracle/u01/app/oracle/product/10.2.0/db_1/jdk/lib/ext $*
yoheia-no-macbook% dbca
yoheia-no-macbook% cd /Users/oracle/u01/app/oracle/admin/orcl/scripts
yoheia-no-macbook% ./orcl.sh
specify a password for sys as parameter 1
Enter value for 1: manager
specify a password for system as parameter 2
Enter value for 2: manager
yoheia-no-macbook% vi $ORACLE_HOME/network/admin/listener.ora
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
)
)
yoheia-no-macbook% sqlplus / as sysdba
SQL> alter system set local_listener = 'localhost' scope=both;