----》于是删除刚创建没成功的一些文件,然后修改创建数据库语句重新来
SQL> conn sys/mydb as sysdba
Connected to an idle instance.
SQL> startup nomount
Oracle instance started.
----》这次原本是创建成功了,但我为了记录错误原因,将创建好的数据库文件全部删除又来一次,
然后像下面这样修改,又处错了。
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145750508 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
SQL> l12
12* undo tablespace undotbs01 datafile 'd:Oracleproduct10.1.0oradatamydbundotbs1.dbf' size 20m
SQL> c /undotbs01/undotbs1/
12* undo tablespace undotbs1 datafile 'd:Oracleproduct10.1.0oradatamydbundotbs1.dbf' size 20m
SQL> run
......
create database mydb
*
ERROR at line 1:
ORA-01092: Oracle instance terminated. Disconnection forced
----》还是这个错误,但错误原因不一样了
Wed Apr 11 13:55:39 2007
Errors in file d:Oracleproduct10.1.0adminmydbudumpmydb_ora_1344.trc:
ORA-01501: CREATE DATABASE failed
ORA-01991: invalid password file 'D:Oracleproduct10.1.0Db_1DATABASEPWDmydb.ORA'
----》显示口令文件不可用,估计与刚才的删除有关,重新创建口令文件吧
见第三步
----》执行创建数据库的语句创建成功。
----》数据库创建后,自动处于OPEN状态,所有V $...都可以查询,但其他则不可,如:
SQL> select * from dba_users;
select * from dba_users
*
ERROR at line 1:
ORA-00942: table or view does not exist
----》解决上面的问题的是加载常用的数据字典包
SQL>@d:Oracleproduct10.1.0db_1rdbmsadmincatalog.sql
----》使用system用户出现的问题
SQL> conn system/zhiqiao
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to Oracle.
SQL> conn sys/mydb as sysdba
Connected.
SQL> grant connect to system identified by mydb;
Grant succeeded.
SQL> conn system/mydb
ERROR:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_APPLICATION_INFO.SET_MODULE' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error accessing package DBMS_APPLICATION_INFO
Connected.
----》出现错误,但连接上了,连接orcl,或者用向导创建时没有这个问题。
SQL> show user;
USER is "SYSTEM"
----》除了数据字典包外,通常还要加载以下包
1:PL/SQL程序包 catproc.sql
2:远程数据复制 catrep.sql
3:Java程序包 initjvm.sql
4:系统环境文件,必须以system用户登陆 db_1sqlplusadminpupbld.sql
加载PL/SQL程序包时出现很多错误,表或视图不存在,不知道为什么。