今回は、東京リージョンのOracle AMIについてご紹介します。

東京リージョンのEC2にOracleをインストールにてOracleのインストールを行いましたが、ついにOracleのインストールされたAMIが利用出来るようになっていました。
この中に11gR2も有ると良かったのですが、無いみたいです。

AMI ID: ami-dadd77db
Name: Oracle Database 10gR2 x86_64 – OVM

AMI ID: ami-d8dd77d9
Name: Oracle Database 11gR1 x86_64 – OVM

早速ですが、11gR1の方を起動してrootにてログインしてみました。

まず、DBが整理された状態から始めようと思い、
下記コマンドを実行してみました。

# cd /u01
# /u01/db-cleanup.sh

実行後にネットワークが再起動され、
その後、ログインが出来なくなってしまいました。

そこで、インスタンスをリブートしてみたところ、ログインが出来るようになりました。
(もしかしたらこのコマンドは、実行しなくてもいいものかもしれません。)

次に、下記の設定関連のコマンドを実行してみると、対話形式で設定が進み、完了後、Oracleが利用出来るようになりました。
↓↓↓↓↓↓↓↓
↑↑↑↑↑↑↑↑がユーザー入力部分です。

# cd /u01
# /u01/db-reconfig.sh 
--------
Configuring network.
↓↓↓↓↓↓↓↓
Use DHCP? y/n [n] y
↑↑↑↑↑↑↑↑
Stopping network...
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Configuring DHCP.
Starting network...
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
                                                           [  OK  ]
Starting Oracle database reconfiguration.
Oracle Database Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database.
The following questions will determine whether the database
should be starting upon system boot, the ports it will use,
and the passwords that will be used for database accounts.
Press to accept the defaults. 
↓↓↓↓↓↓↓↓
Do you want to relink binaries? (y/n) [n] y
↑↑↑↑↑↑↑↑
↓↓↓↓↓↓↓↓
Specify the HTTP port that will be used for Oracle Application Express [8080]:
↑↑↑↑↑↑↑↑
↓↓↓↓↓↓↓↓
Specify a port that will be used for the database listener [1521]:
↑↑↑↑↑↑↑↑
Specify a password to be used for database accounts.
Note that the samepassword will be used for SYS, SYSTEM
and ADMIN for APEX.  Oracle recommendsthe use of different passwords
for each database account.
↓↓↓↓↓↓↓↓
This can be doneafter initial configuration:
↑↑↑↑↑↑↑↑
Confirm the password:
↓↓↓↓↓↓↓↓
Do you want Oracle Database to be started on boot (y/n) [y]:
↑↑↑↑↑↑↑↑

Relinking Oracle Binaries...
Oracle Relinking Completed Successfully
Logs: /home/oracle/relink.log

Running orainstRoot.sh and root.sh...
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete
Running Oracle 11g root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.1.0/db_1
↓↓↓↓↓↓↓↓
Enter the full pathname of the local bin directory: [/usr/local/bin]:
↑↑↑↑↑↑↑↑
Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

Starting CSS.
Waiting for CSS available.

ASM instance started
Total System Global Area  283930624 bytes
Fixed Size    2143704 bytes
Variable Size  256621096 bytes
ASM Cache   25165824 bytes
ASM diskgroups mounted

ORACLE instance started.
Total System Global Area  839282688 bytes
Fixed Size    2149040 bytes
Variable Size  482346320 bytes
Database Buffers  348127232 bytes
Redo Buffers    6660096 bytes
File created.
Database altered.
Database altered.
Database closed.
Database dismounted.
ORACLE instance shut down.

ORACLE instance started.
Total System Global Area  839282688 bytes
Fixed Size    2149040 bytes
Variable Size  482346320 bytes
Database Buffers  348127232 bytes
Redo Buffers    6660096 bytes
Database mounted.
Database opened.

User altered.
User altered.
User altered.
System altered.
Session altered.
...changing password for ADMIN
PL/SQL procedure successfully completed.
Commit complete.
PL/SQL procedure successfully completed.
Commit complete.
PL/SQL procedure successfully completed.
Configuration Completed Successfully.

To access the Oracle Application Express go to "http://xxx.xxx:8080/apex"
Press any key to continue...

設定完了後に下記コマンドを実行すると

# /etc/init.d/init.cssd start
# /etc/init.d/dbstart start

データベースとリスナーが起動します。
停止するには、下記コマンドを実行します。

# /etc/init.d/dbstart stop
# /etc/init.d/init.cssd stop

今回、Oracle AMIを試してみましたが、まだ、CSSやASMの理解までにはいたりませんでした。

こちらの記事はなかの人(suz-lab)監修のもと掲載しています。
元記事は、こちら