手工建立mysql的服務 手工建立資料庫的完整步驟

2021-10-19 23:50:24 字數 4915 閱讀 2822

手工建立資料庫具體步驟

一建立存放資料庫檔案的目錄和日誌相關的檔案目錄

分別在$oracle_base\oradata和$oracle_base\admin目錄下建立newdb目錄

使用命令檢視目錄結構

[oracle@wang newdb]$ pwd

[oracle@wang newdb]$ pwd

二確定oracle例項名

[oracle@wang newdb]$ export

oracle_sid=newdb

三建立初始化引數檔案

1建立引數檔案

vi $oracle_base/dbs/initnewdb.ora

control_files=

db_name= newdb

db_domain= newdb.oracle.com

log_archive_dest_1=

log_archive_dest_state_1= enable

db_block_size= 8192

pga_aggregate_target= 90m

processes= 100

sessions= 120

open_cursors= 200

undo_management= auto

undo_tablespace= undotbs

compatible= 10.2.0

sga_target= 270m

nls_language= american

nls_territory= america

db_recovery_file_dest_size = 1g

2建立spfile引數檔案

[oracle@wang dbs]$ sqlplus / as sysdba

sql*plus: release 10.2.0.1.0 - production

on sun feb 23 14:37:08 2014

connected to an idle instance.

sql> create spfile from pfile;

file created.

四建立資料庫

1 startup nomount;

2編寫建立資料庫指令碼

vi temp

create database newdb

user sys identified by oracle

user system identified by oracle

maxlogfiles 5

maxlogmembers 5

maxloghistory 1

maxdatafiles 100

maxinstances 1

character set us7ascii

national character set al16utf16

extent management local

default temporary tablespace tempts1

size 20m reuse

undo tablespace undotbs

size 200m reuse autoextend on maxsize unlimited;

3執行指令碼

sql> create database newdb

user sys identified by oracle

user system identified by oracle

maxlogfiles 5

maxlogmembers 5

maxloghistory 1

maxdatafiles 100

maxinstances 1

character set us7ascii

national

character set al16utf16

extent management local

default temporary tablespace tempts1

size 20m reuse

undo tablespace undotbs

size 200m reuse autoextend on maxsize unlimited;

database created.

五建立資料字典

sql>@?/rdbms/admin/catalog.sql

view created.

synonym created.

grant succeeded.

view created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

synonym created.

grant succeeded.

grant succeeded.

view created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

comment created.

synonym created.

grant succeeded.

view created.

synonym created.

grant succeeded.

commit complete.

view created.

synonym created.

grant succeeded.

view created.

synonym created.

grant succeeded.

view created.

comment created.

comment created.

comment created.

comment created.

synonym created.

grant succeeded.

pl/sql procedure successfully completed.

sql> @?/rdbms/admin/catproc.sql

synonym created.

grant succeeded.

library created.

package created.

package body created.

package created.

package body created.

library created.

function created.

pl/sql procedure successfully completed.

pl/sql procedure successfully completed.

package body created.

no errors.

package body created.

pl/sql procedure successfully completed.

sql> @?/rdbms/admin/catblock.sql

view created.

synonym created.

grant succeeded.

sql> connect system/oracle

connected.

sql> @?/sqlplus/admin/pupbld.sql

synonym created.

drop public synonym product_user_profile

error at line 1:

ora-01432: public synonym to be dropped

does not exist

synonym created.

建立help表並插入help的資料,非常值得參考

sql> @?/sqlplus/admin/help/hlpbld.sql

helpus.sql

view created.

58 rows created.

commit complete.

手動建庫的時候執行到最後,需要使用system使用者執行sql指令碼,但在執行hlpbld.sql的時候要求輸入引數,@?/sqlplus/admin/help/hlpbld.sql

?代表oracle home實際就是建立了一張名為help的表,用於支援help命令,而hlpbld.sql本身是沒有插入資料的語句的,所以需要傳遞乙個引數,而這個引數實際上就是插入help資料的指令碼。將helpus.sql作為輸入引數的命令 就是

@?/sqlplus/admin/help/hlpbld.sql helpus.sql

Windows手工建立服務方法

需要將程式設定成windows服務的情況,可以利用一下windows自帶的sc命令來建立服務.該命令的基本用法如下 開啟cmd命令,輸入如下資訊 1 建立服務 sc create secserver binpath e deskmaster mainconsole securitymagcenter...

Windows手工建立服務方法

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!需要將程式設定成windows服務的情況,可以利用一下windows自帶的sc命令來建立服務.該命令的基本用法如下 開啟cmd命令,輸入如下資訊 1 建立服務 sc create secserver binpath e deskmaster mai...

手工建立Informix的監聽服務

正常情況下informix資料庫初始化啟動之後就會有乙個監聽服務,可以通過onstat g ntt看到。也可以通過onstat g ath grep soc 看到有兩類執行緒一類是pollthread 另外一類是監聽執行緒。在某些特殊的時候為了應急或其他特殊的應用,需要手工新增乙個監聽服務,而不需要...