分享更有价值
被信任是一种快乐

如何手工创建数据库

文章页正文上

这篇文章给大家分享的是有关如何手工创建数据库的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。Refer Doc:Administrator’s Guide->2 Creating and Configuring an Oracle Database->Creating a Database with the CREATE DATABASE StatementStep 1: Specify an Instance Identifier (SID)[oracle@OCM ~]$ export ORACLE_SID=PROD3Step 2: Ensure That the Required Environment Variables Are Set[oracle@OCM ~]$ env |grep ORACLEORACLE_SID=PROD3ORACLE_BASE=/u01/app/oracle/productORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1Step 3: Choose a Database Administrator Authentication Method[oracle@OCM ~]$ cd $ORACLE_HOME/dbs[oracle@OCM dbs]$ orapwd file=orapwPROD3 password=oracle entries=30[oracle@OCM dbs]$ lltotal 12-rw-r–r– 1 oracle oinstall 2851 May 15 2009 init.ora-rw-r—– 1 oracle oinstall 5120 Dec 5 07:51 orapwPROD3Step 4: Create the Initialization Parameter File[oracle@OCM scripts]$ cat initPROD3.oradb_name=’PROD3’db_recovery_file_dest=’
/u01/app/oracle/p免费主机域名roduct/flash_recovery_area’db_recovery_file_dest_size=2G[oracle@OCM product]$ mkdir –p /u01/app/oracle/product/flash_recovery_areaStep 5: (Windows Only) Create an InstanceStep 6: Connect to the Instance[oracle@OCM scripts]$ sqlplus / as sysdbaStep 7: Create a Server Parameter FileSQL> CREATE SPFILE FROM PFILE;Step 8: Start the InstanceSQL> startup nomountORACLE instance started.Total System Global Area 217157632 bytesFixed Size 2251816 bytesVariable Size 159384536 bytesDatabase Buffers 50331648 bytesRedo Buffers 5189632 bytesStep 9: Issue the CREATE DATABASE Statement[root@OCM ~]# mkdir -p /u01/app/oracle/oradata/PROD3/redo[root@OCM ~]# mkdir -p /u01/logs/PROD3[root@OCM ~]# mkdir -p /u02/logs/PROD3[root@OCM u01]# cat createdb.sqlCREATE DATABASE PROD3 USER SYS IDENTIFIED BY sys_password USER SYSTEM IDENTIFIED BY system_password LOGFILE GROUP 1 (‘/u01/app/oracle/oradata/PROD3/redo/redo01a.log’,’/u01/app/oracle/oradata/PROD3/redo/redo01b.log’) SIZE 100M BLOCKSIZE 512, GROUP 2 (‘/u01/app/oracle/oradata/PROD3/redo/redo02a.log’,’/u01/app/oracle/oradata/PROD3/redo/redo02b.log’) SIZE 100M BLOCKSIZE 512, GROUP 3 (‘/u01/app/oracle/oradata/PROD3/redo/redo03a.log’,’/u01/app/oracle/oradata/PROD3/redo/redo03b.log’) SIZE 100M BLOCKSIZE 512 MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 EXTENT MANAGEMENT LOCAL DATAFILE ‘/u01/app/oracle/oradata/PROD3/system01.dbf’ SIZE 325M REUSE SYSAUX DATAFILE ‘/u01/ap免费主机域名p/oracle/oradata/PROD3/sysaux01.dbf’ SIZE 325M REUSE DEFAULT TABLESPACE users DATAFILE ‘/u01/app/oracle/oradata/PROD3/users01.dbf’ SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE ‘/u01/app/oracle/oradata/PROD3/temp01.dbf’ SIZE 20M REUSE UNDO TABLESPACE undotbs DATAFILE ‘/u01/app/oracle/oradata/PROD3/undotbs01.dbf’ SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;SQL> @/u01/createdb.sqlDatabase created.Step 10: Create Additional TablespacesStep 11: Run Scripts to Build Data Dictionary ViewsSQL> @?/rdbms/admin/catalog.sqlSQL> @?/rdbms/admin/catproc.sqlSQL> @?/rdbms/admin/utlrp.sqlStep 12: (Optional) Run Scripts to Install Additional OptionsStep 13: Back Up the Database.SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 217157632 bytesFixed Size 2251816 bytesVariable Size 159384536 bytesDatabase Buffers 50331648 bytesRedo Buffers 5189632 bytesDatabase mounted.SQL> alter database archivelog;Database altered.SQL> alter database open;Database altered.Step 14: (Optional) Enable Automatic Instance Startup感谢各位的阅读!关于“如何手工创建数据库”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

相关推荐: MONGO集群修改linux主机时间后的影响有哪些

小编给大家分享一下MONGO集群修改linux主机时间后的影响有哪些,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!生产环境是 一主一从一仲裁3分片的集群,现在发现其中一个节点比当前时间大了好几天,后使用NTP将时间往回调整副本集上。原来时间是…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册