Sunday, April 13, 2008

Creating an oracle 9i database.

Hi Everyone,

To create a new oracle database we need to complete the following steps:

1. As root create the oracle directory under the /u01 volume, which created in the last posting.
And change the owner to the oracle:oinstall account

[root@cent4 ~]# cd /u01/ [root@cent4 u01]# mkdir oracle [root@cent4 u01]# chown oracle:oinstall ./oracle
2. Change the current ID to oracle and create an oradata directory.
[root@cent4 ~]# su - oracle [oracle@cent4 ~]$ cd /u01/oracle [oracle@cent4 ora]$ mkdir oradata
3. In the parallel terminal window as root execute the xhost command:
[root@cent4 ~]# xhost + access control disabled, clients can connect from any host
4. And in the oracle window run the dbca command:
[oracle@cent4 oradata]$ cd $ORACLE_HOME/bin [oracle@cent4 bin]$ ./dbca
5.1. In the "Database Configuration Assistant: Welcome" just click ("Next").
5.2. In the "Database Configuration Assistant, Step 1 of 8: Operations"
choose "Create a database" and then click ("Next").
5.3. In the "Database Configuration Assistant, Step 2 of 8: Database Templates"
choose "General Purpose" and then click ("Next").
5.4. In the "Database Configuration Assistant, Step 3 of 7: Database Identification"(It is strange that there is 7 instead of 8) set up the following values for those fields:
Global Database Name: test.ssl.world
SID: test
(Obviously you can set up any name what you want in these fields.) then click (“Next”).
5.5. In the "Database Configuration Assistant, Step 4 of 7: Database Configuration Options" choose: "Dedicated Server Mode" then click ("Next").
5.6. In the "Database Configuration Assistant, Step 5 of 7: Initialization Parameters" stay all parameters as default then click (“Next”).
5.7. In the "Database Configuration Assistant, Step 6 of 7: Database Storage" replace all {ORACLE_BASE} variables to /u01/oracle for control files, Datafiles, Redo Log Groups then click ("Next").
5.8. In the "Database Configuration Assistant, Step 7 of 7: Creation Options" stay a default value "Create Database" and click ("Finish").
5.9. In the following window set up your favorite passwords for sys and system accounts. So, the database has been successfully created. Now you can startup or shutdown it using the following commands under the oracle linux account:
[oracle@cent4 ~]$ . oraenv
ORACLE_SID = [test1] ? test
[oracle@cent4 ~]$ sqlplus /nolog

SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

In the next article I am planning to upgrade this database to the Oracle 10G version.

Thanks,
Sergey.

No comments: