Linux平臺下Oracle 10.2.0.1 手工建立資料庫過程
Linux平臺下Oracle 10.2.0.1 手工建立資料庫
在原有資料庫基礎上建立另一個db
1.oracle使用者登入OS
[oracle@localhost admin]$ id
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
2.進入oracle_base目錄
[oracle@localhost admin]$ cd $ORACLE_BASE
進入admin目錄
[oracle@localhost ~]$ cd admin/
檢視當前已有的目錄
[oracle@localhost admin]$ ls -ltrh
total 4.0K
drwxr-x--- 8 oracle oinstall 4.0K Apr 11 2012 orcl
total 4.0K
drwxr-x--- 8 oracle oinstall 4.0K Apr 11 2012 orcl
檢視當前資料庫orcl目錄層次結構,有幾種dump
[oracle@localhost admin]$ ls -ltrh orcl/
total 356K
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 dpdump
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 cdump
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 pfile
drwxr-x--- 2 oracle oinstall 20K Jan 24 16:42 udump
drwxr-x--- 2 oracle oinstall 12K Jan 24 16:42 bdump
drwxr-x--- 2 oracle oinstall 308K Jan 25 15:32 adump
total 356K
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 dpdump
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 cdump
drwxr-x--- 2 oracle oinstall 4.0K Apr 11 2012 pfile
drwxr-x--- 2 oracle oinstall 20K Jan 24 16:42 udump
drwxr-x--- 2 oracle oinstall 12K Jan 24 16:42 bdump
drwxr-x--- 2 oracle oinstall 308K Jan 25 15:32 adump
3.建立相關dump目錄
[oracle@localhost admin]$ mkdir -p test/adump
[oracle@localhost admin]$ mkdir -p test/bdump
[oracle@localhost admin]$ mkdir -p test/cdump
[oracle@localhost admin]$ mkdir -p test/dpdump
[oracle@localhost admin]$ mkdir -p test/udump
[oracle@localhost admin]$ mkdir -p test/bdump
[oracle@localhost admin]$ mkdir -p test/cdump
[oracle@localhost admin]$ mkdir -p test/dpdump
[oracle@localhost admin]$ mkdir -p test/udump
4.進入通常存放資料庫檔案的目錄oradata
[oracle@localhost admin]$ cd $ORACLE_BASE/oradata
5.建立目錄
[oracle@localhost oradata]$ mkdir test
[oracle@localhost oradata]$ ls -ltrh
total 8.0K
drwxr-x--- 4 oracle oinstall 4.0K Jan 16 01:30 orcl
drwxr-xr-x 2 oracle oinstall 4.0K Jan 25 16:31 test
total 8.0K
drwxr-x--- 4 oracle oinstall 4.0K Jan 16 01:30 orcl
drwxr-xr-x 2 oracle oinstall 4.0K Jan 25 16:31 test
6.進入dbs目錄
[oracle@localhost db_1]$ cd $ORACLE_HOME/dbs
[oracle@localhost db_1]$ cd $ORACLE_HOME/dbs
[oracle@localhost dbs]$ pwd
/home/oracle/product/10.2.0/db_1/dbs
/home/oracle/product/10.2.0/db_1/dbs
7.利用已有資料庫orcl初始化引數檔案,生成新建db的初始化引數檔案
將orcl批量替換成test
[oracle@localhost dbs]$ vi initorcl.ora
......
:%s/orcl/test/g
......
:%s/orcl/test/g
8.建立新建資料庫test的密碼檔案
[oracle@localhost dbs]$ orapwd file=orapwtest password=oracle entries=5
[oracle@localhost dbs]$ ls -ltrh orapwtest
-rw-r----- 1 oracle oinstall 2.0K Jan 25 17:08 orapwtest
-rw-r----- 1 oracle oinstall 2.0K Jan 25 17:08 orapwtest
9.設定環境變數oracle_sid
[oracle@localhost dbs]$ export ORACLE_SID=test
10.sqlplus登入
[oracle@localhost dbs]$ sqlplus /nolog
[oracle@localhost dbs]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 25 16:37:21 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
ORACLE instance started.
Total System Global Area 1895825408 bytes
Fixed Size 1220072 bytes
Variable Size 687866392 bytes
Database Buffers 1191182336 bytes
Redo Buffers 15556608 bytes
Fixed Size 1220072 bytes
Variable Size 687866392 bytes
Database Buffers 1191182336 bytes
Redo Buffers 15556608 bytes
11.執行建立資料庫test
SQL> create database test
2 datafile '/home/oracle/oradata/test/system01.dbf' size 300M reuse autoextend on next 10240K maxsize unlimited extent management local
3 sysaux datafile '/home/oracle/oradata/test/sysaux01.dbf' size 120M reuse autoextend on next 10240K maxsize unlimited
4 default temporary tablespace temp tempfile '/home/oracle/oradata/test/temp01.dbf' size 200M reuse autoextend on next 640K maxsize unlimited
5 undo tablespace "UNDOTBS1" datafile '/home/oracle/oradata/test/undotbs01.dbf' size 500M reuse autoextend on next 5120K maxsize unlimited
6 logfile group 1 ('/home/oracle/oradata/test/redo01.log') size 100m,
7 group 2 ('/home/oracle/oradata/test/redo02.log') size 100m,
8 group 3 ('/home/oracle/oradata/test/redo03.log') size 100m
9 character set ZHS16GBK national character set UTF8;
Database created.
2 datafile '/home/oracle/oradata/test/system01.dbf' size 300M reuse autoextend on next 10240K maxsize unlimited extent management local
3 sysaux datafile '/home/oracle/oradata/test/sysaux01.dbf' size 120M reuse autoextend on next 10240K maxsize unlimited
4 default temporary tablespace temp tempfile '/home/oracle/oradata/test/temp01.dbf' size 200M reuse autoextend on next 640K maxsize unlimited
5 undo tablespace "UNDOTBS1" datafile '/home/oracle/oradata/test/undotbs01.dbf' size 500M reuse autoextend on next 5120K maxsize unlimited
6 logfile group 1 ('/home/oracle/oradata/test/redo01.log') size 100m,
7 group 2 ('/home/oracle/oradata/test/redo02.log') size 100m,
8 group 3 ('/home/oracle/oradata/test/redo03.log') size 100m
9 character set ZHS16GBK national character set UTF8;
Database created.
12.執行catalog,建立系統基表及相關檢視等
SQL> @?/rdbms/admin/catalog.sql
......
......
13.執行catproc,建立系統相關package等物件
SQL> @?/rdbms/admin/catproc.sql
......
......
生成spfile
SQL> create spfile from pfile;
File created.
14.system使用者登入
SQL> connect system/manager
Connected.
Connected.
15執行pupbld.sql
SQL> @?/sqlplus/admin/pupbld.sql
......
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-753429/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 2.4.10 Step 9:手工建立資料庫資料庫
- oracle資料庫跨平臺(AIX)從RAC恢復至(linux)下的單例項Oracle資料庫AILinux單例
- 簡單介紹Oracle 19c RAC 手工建庫的過程Oracle
- 刪除linux下的oracle資料庫LinuxOracle資料庫
- Win環境至Linux環境Oracle資料庫遷移全過程LinuxOracle資料庫
- Oracle各種版本下“示例資料庫的建立”的建立Oracle資料庫
- 使用AnalyticDB MySQL建立資料庫及表過程MySql資料庫
- Oracle資料庫SQL語句執行過程Oracle資料庫SQL
- SLM——模擬過程與資料管理平臺
- openGauss核心分析(九):資料庫表的建立過程資料庫
- 伺服器斷電Oracle資料庫修復資料過程伺服器Oracle資料庫
- Oracle同一臺伺服器建立多個資料庫Oracle伺服器資料庫
- 資料庫平臺資料庫
- Oracle資料庫啟動過程及狀態詳解Oracle資料庫
- oracle資料庫建立資料庫例項-九五小龐Oracle資料庫
- 【資料庫】資料庫儲存過程(一)資料庫儲存過程
- openGauss核心分析(十):資料庫搜尋引的建立過程資料庫
- 資料庫恢復過程資料庫
- 資料庫儲存過程資料庫儲存過程
- 【AWR】Oracle資料庫建立awr基線Oracle資料庫
- 【資料庫資料恢復】LINUX環境下ORACLE資料庫誤刪除的資料恢復資料庫資料恢復LinuxOracle
- 恢復MySQL資料庫建立儲存過程是遇到錯誤MySql資料庫儲存過程
- 使用JavaScript和Python實現Oracle資料庫的儲存過程?JavaScriptPythonOracle資料庫儲存過程
- Jtti:如何修復Oracle資料庫執行過程的問題JttiOracle資料庫
- 汽車之家資料庫服務化平臺從0到1的實踐過程資料庫
- 2.3 通過DBCA建立資料庫資料庫
- Linux下基於裸裝置建立10g資料庫Linux資料庫
- 資料庫的連線過程資料庫
- MySql資料庫——儲存過程MySql資料庫儲存過程
- oracle資料庫建立、刪除索引等操作Oracle資料庫索引
- oracle資料庫使用者建立步驟Oracle資料庫
- 揭祕Oracle雲(一):建立雲資料庫Oracle資料庫
- 【LINUX】Oracle資料庫 linux磁碟頭資料損壞修復LinuxOracle資料庫
- 通過rman為客戶實現linux下oracle11.2.0.4到windows下oracle同版本資料庫的異機恢復。LinuxOracleWindows資料庫
- Oracle 業務資料unload恢復過程Oracle
- 【資料庫學習】資料庫平臺:mysql,sql server資料庫MySqlServer
- Oracle資料庫(資料泵)遷移方案(下)Oracle資料庫
- 【資料庫資料恢復】透過資料頁恢復Sql Server資料庫資料的過程資料庫資料恢復SQLServer
- 11. Oracle for Linux安裝和配置—11.3. Oracle安裝和配置—11.3.2. 資料庫建立OracleLinux資料庫