oracle手動建立另外一個例項
一.準備資料庫物理檔案存放的相關路徑
例如:計劃將控制檔案,資料檔案,日誌檔案等存放到/u02目錄下
# mkdir /u02
# chown oracle:oinstall /u02
# chmod 755 /u02
# su - oracle
$ export ORACLE_BASE=/u02
$ export ORACLE_SID=test
$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/adump
$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/bdump
$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/cdump
$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/udump
$ mkdir -p $ORACLE_BASE/oradata/$ORACLE_SID/
二、 連線到另外一個例項,得到引數檔案
$sqlplus / as sysdba
SQL> CREATE PFILE='/u02/inittest.ora' from spfile;
SQL> exit
$ vim /u02/inittest.ora
$ vim /u02/inittest.ora
三、修改引數檔案:將引數檔案inittest.ora中的與例項名有關的引數改為test,相應的路徑也需改掉
如:
test.__db_cache_size=83886080
test.__java_pool_size=4194304
test.__large_pool_size=4194304
test.__shared_pool_size=67108864
test.__streams_pool_size=0
*.audit_file_dest='/u02/admin/test/adump'
*.background_dump_dest='/u02/admin/test/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u02/oradata/test/control01.ctl','/u02/oradata/test/control02.c
tl','/u02/oradata/test/control03.ctl'
*.core_dump_dest='/u02/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.db_recovery_file_dest='/u02/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=/archive1'
*.O7_DICTIONARY_ACCESSIBILITY=FALSE
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u02/admin/test/udump'
test.__java_pool_size=4194304
test.__large_pool_size=4194304
test.__shared_pool_size=67108864
test.__streams_pool_size=0
*.audit_file_dest='/u02/admin/test/adump'
*.background_dump_dest='/u02/admin/test/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u02/oradata/test/control01.ctl','/u02/oradata/test/control02.c
tl','/u02/oradata/test/control03.ctl'
*.core_dump_dest='/u02/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.db_recovery_file_dest='/u02/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=/archive1'
*.O7_DICTIONARY_ACCESSIBILITY=FALSE
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u02/admin/test/udump'
四、以dba的身份連入,將例項啟動到nomount狀態
[oracle@test1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 27 09:34:28 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='/u02/inittest.ora'
ORACLE instance started.
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218292 bytes
Variable Size 75499788 bytes
Database Buffers 83886080 bytes
Redo Buffers 7168000 bytes
Fixed Size 1218292 bytes
Variable Size 75499788 bytes
Database Buffers 83886080 bytes
Redo Buffers 7168000 bytes
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string test
db_unique_name string test
global_names boolean FALSE
instance_name string test
lock_name_space string
log_file_name_convert string
service_names string test
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string test
db_unique_name string test
global_names boolean FALSE
instance_name string test
lock_name_space string
log_file_name_convert string
service_names string test
五、建立資料庫
CREATE DATABASE TEST
maxinstances 8
maxloghistory 1
maxlogfiles 16
maxlogmembers 3
maxdatafiles 100
DATAFILE
'$ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf' size 300m autoextend on next 10m
extent management local
sysaux datafile
'$ORACLE_BASE/oradata/$ORACLE_SID/sysaux01.dbf' size 120m autoextend on next 10m
default temporary tablespace temp tempfile
'$ORACLE_BASE/oradata/$ORACLE_SID/temp01.dbf' size 20m
undo tablespace undotbs1 datafile
'$ORACLE_BASE/oradata/$ORACLE_SID/undotbs01.dbf' size 50m
CHARACTER set AL32UTF8
NATIONAL character set AL16UTF16
SET TIME_ZONE='+08:00'
LOGFILE
group 1 '$ORACLE_BASE/oradata/$ORACLE_SID/redo01.log' size 50m,
group 2 '$ORACLE_BASE/oradata/$ORACLE_SID/redo02.log' size 50m,
group 3 '$ORACLE_BASE/oradata/$ORACLE_SID/redo03.log' size 50m
/
maxinstances 8
maxloghistory 1
maxlogfiles 16
maxlogmembers 3
maxdatafiles 100
DATAFILE
'$ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf' size 300m autoextend on next 10m
extent management local
sysaux datafile
'$ORACLE_BASE/oradata/$ORACLE_SID/sysaux01.dbf' size 120m autoextend on next 10m
default temporary tablespace temp tempfile
'$ORACLE_BASE/oradata/$ORACLE_SID/temp01.dbf' size 20m
undo tablespace undotbs1 datafile
'$ORACLE_BASE/oradata/$ORACLE_SID/undotbs01.dbf' size 50m
CHARACTER set AL32UTF8
NATIONAL character set AL16UTF16
SET TIME_ZONE='+08:00'
LOGFILE
group 1 '$ORACLE_BASE/oradata/$ORACLE_SID/redo01.log' size 50m,
group 2 '$ORACLE_BASE/oradata/$ORACLE_SID/redo02.log' size 50m,
group 3 '$ORACLE_BASE/oradata/$ORACLE_SID/redo03.log' size 50m
/
六、檢視資料庫狀態
SQL> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE
----------
READ WRITE
說明資料庫已經啟動到了open狀態
七、建立spfile
SQL> create spfile from pfile='/u02/inittest.ora';
File created.
八、建立資料字典
SQL> @?/rdbms/admin/catalog
SQL> @?/rdbms/admin/catproc
SQL> @?/rdbms/admin/catproc
九、建立users表空間 建立scott使用者
SQL> create tablespace users datafile '$ORACLE_BASE/oradata/$ORACLE_SID/user01.dbf' size 10m autoextend on;
Tablespace created.
SQL> @?/rdbms/admin/utlsampl
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dba dbs]$sql /nolog
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dba dbs]$sql /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 7 06:06:50 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> alter user scott account unlock identified by tiger;
Connected.
SQL> alter user scott account unlock identified by tiger;
User altered.
十、連線到scott使用者有錯誤提示 根據提示執行PUPBLD指令碼
SQL> conn scott/tiger
SQL> conn scott/tiger
Error accessing PRODUCT_USER_PROFILE
Warning: Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
Connected.
SQL>
SQL> conn system/manager
Connected.
Warning: Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
Connected.
SQL>
SQL> conn system/manager
Connected.
SQL>
SQL> show user
USER is "SYSTEM"
建立安全稽核概要表:
SQL> @?/sqlplus/admin/pupbld
SQL> conn scott/tiger
SQL> show user
USER is "SYSTEM"
建立安全稽核概要表:
SQL> @?/sqlplus/admin/pupbld
SQL> conn scott/tiger
Connected.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26077805/viewspace-702910/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 手動建立Oracle例項Oracle
- Oracle10G手動建立例項Oracle
- jafka安裝配置和啟動一個自帶例項和手寫一個例項
- Oracle JOB 建立例項Oracle
- javascript如何建立一個物件例項JavaScript物件
- frida 建立一個ArrayList例項
- oracle多個例項啟動方法Oracle
- 如何建立一個新的SQL Server例項SQLServer
- c#如何只能建立類的一個例項(一)C#
- oracle 手動建立ASMOracleASM
- 為同一個資料庫建立新的例項資料庫
- SQL Server 2000 如何建立一個新例項 ?SQLServer
- oracle例項啟動異常慢案例一Oracle
- Oracle Restart啟動資料庫例項故障一例OracleREST資料庫
- oracle一個例項配置多個listener或多個埠Oracle
- oracle一個listener偵聽多個例項的配置Oracle
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- javascript動態建立元素程式碼例項JavaScript
- oracle一個別例項配置多個listener或多個埠Oracle
- linux自動automatic啟動停止多個oracle例項LinuxOracle
- Angular 如何根據一個 class 的定義和資料,動態建立一個該類的例項Angular
- Oracle 10g R2建立ASM例項Step By Step(一)Oracle 10gASM
- 單例模式 - 只有一個例項單例模式
- 自動重新啟動oracle例項 for windowsOracleWindows
- 如何為一個例項動態替換方法
- 手動建立oracle資料庫Oracle資料庫
- Oracle 手動建立資料庫Oracle資料庫
- Solaris10上啟動Oracle11g例項遇到的一個bugOracle
- js動態建立文字框程式碼例項JS
- js動態建立HTML元素程式碼例項JSHTML
- oracle 關於例項恢復的一個討論Oracle
- android apk巢狀 從一個apk啟動另外一個apkAndroidAPK巢狀
- 啟動oracle例項最少引數Oracle
- Oracle 物化檢視 例項一Oracle
- Oracle診斷事件例項(一)Oracle事件
- oracle create function的兩個例項OracleFunction
- oracle 多個例項監聽不到Oracle
- Jersey—建立restfulwebservice—例項RESTWeb