Oracle 11g 手工创建数据库实验

时间:2022-12-16 08:31:09


Oracle数据库的手工建库是依据Oracle数据库的体系结构,依次创建实例、创建物理结构、创建逻辑结构。


手工建库一般需要八个步骤:
1.设置oracle用户环境变量
2.准备数据库相关目录
3.生成实例的口令文件
4.生成实例的pfile参数文件
5.生成实例的spfile文件,并启动到nomount
6.执行数据库创建语句
7.执行动态性能视图创建脚本
8.确认数据库运行状态


具体操作过程如下:

1.设置oracle用户环境变量
$ cd
$ vim .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ENMOEDU
export PATH=$ORACLE_HOME/bin:$PATH
生效:
source .bash_profile
验证:
echo $ORACLE_HOME
echo $ORACLE_SID

2.创建所需的目录
创建目录:
$ cd $ORACLE_BASE
$ mkdir -p admin/ENMOEDU/adump
$ mkdir -p oradata/ENMOEDU

注意:这里的目录路径,与后面pfile文件中的路径一定要对应,否则后面会报错,比如:
ORA-09925: Unable to create audit trail file


3.生产密码文件
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapwENMOEDU password=oracle entries=30

4.生成实例的pfile参数文件
根据已经由的init.ora内容生成待调整的pfile参数文件
$ df -h
$ cd $ORACLE_HOME/dbs
$ cat init.ora | grep -v ^# | grep -v ^$ > initENMOEDU.ora
将注释和空行去掉,得到参数文件


需要修改的六个参数为: 
$ vim initENMOEDU.ora
db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'

多次出现的<ORACLE_BASE> 可以用下面的命令替代:
:%s+<ORACLE_BASE>+/u01/app/oracle/g
其他的直接用vim命令修改即可;

注:参数文件中的路径参数要与实际的路径对应;内存大小的设置,需要先通过 df -h 命令确认一下,如果设置过大,会报错:
ORA-00845: MEMORY_TARGET not supported on this system

5.生产spfile参数文件
echo $ORACLE_SID
sqlplus /nolog
conn /as sysdba
sql> create spfile from pfile;
sql> startup nomount;

6.执行创建数据库语句
根据官方文档改写——官方文档参考位置:
Books - Administrator Guide - 2 Create and Configurating an Oracle Database - Step 9:Issue the Create Database Statement

sql> !
$ cd /home/oracle/scripts
$ vim cdb.sh
添加如下内容:
$ cat createdb.sh
CREATE DATABASE mynewdb
   USER SYS IDENTIFIED BY sys_password
   USER SYSTEM IDENTIFIED BY system_password
   LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/my/redo01b.log') SIZE 100M BLOCKSIZE 512,
           GROUP 2 ('/u01/logs/my/redo02a.log','/u02/logs/my/redo02b.log') SIZE 100M BLOCKSIZE 512,
           GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   CHARACTER SET US7ASCII
   NATIONAL CHARACTER SET AL16UTF16
   EXTENT MANAGEMENT LOCAL
   DATAFILE '/u01/app/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
   SYSAUX DATAFILE '/u01/app/oracle/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE users
      DATAFILE '/u01/app/oracle/oradata/mynewdb/users01.dbf'
      SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/u01/app/oracle/oradata/mynewdb/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/u01/app/oracle/oradata/mynewdb/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

脚本编写好后,执行脚本:
$ exit
SQL> @createdb.sql
Database created.
SQL>
SQL> select instance_name,status from V$instance;

INSTANCE_NAME    STATUS
---------------- ------------
ENMOEDU          OPEN

该步骤预计会执行2分钟左右,数据库创建完毕后,自动启动到open状态;

7.执行catalog.sql 和 catproc.sql 脚本
Books - Administrator Guide - 2 Create and Configurating an Oracle Database - Step 11:Run Scripts to build Data Dictionary views

执行必选脚本:
sql> !
$ cd /home/oracle/scripts
$ vim 1.sh
添加如下内容:
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
conn /as sysdba
@?/sqlplus/admin/pupbld.sql
EXIT
$ exit
sql> @1.sh


数据字典动态性能视图创建过程:
$ cat cdfixed.sql
$ cat cdcore.sql

8.最后的校验
sql> select * from v$version;
sql> select instance_name,status from v$instance;


实际的创建过程如下:

[root@enmoedu1 ~]# 
[root@enmoedu1 ~]# echo "CREATE DATABASE by mamual"
CREATE DATABASE by mamual
[root@enmoedu1 ~]#
[root@enmoedu1 ~]# ssh oracle@192.0.2.12
oracle@192.0.2.12's password:
Last login: Mon Apr 27 16:30:10 2015 from enmoedu1.example.com
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ echo "Step 1: confrate enviroment"
Step 1: confrate enviroment
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ cd
[oracle@enmoedu2 ~]$ ls
Desktop profile_agent profile_emrep profile_oms scripts
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ ls -a
. .bash_logout Desktop .emacs .fontconfig .gnome .gstreamer-0.10 .java .nautilus profile_oms

.ssh .zshrc
.. .bash_profile .dmrc .emcli .gconf .gnome2 .gtkrc-1.2-gnome2 .metacity profile_agent .redhat

.Trash
.bash_history .bashrc .eggcups .emcli.installations .gconfd .gnome2_private .ICEauthority .mozilla profile_emrep scripts

.viminfo
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ ps -ef|grep ora_
oracle 4987 4946 0 15:29 pts/1 00:00:00 grep ora_
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ vim .bash_profile
# .bash_profile

# Get the aliases and functions
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ENMOEDU
export PATH=$ORACLE_HOME/bin:$PATH
~
~
~
~
~
~
~
".bash_profile" 17L, 325C written
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ source .bash_profile
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ echo $ORACLE_BASE
/u01/app/oracle
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ echo $ORACLE_SID
ENMOEDU
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ echo "Step 2: mkdir directory for database"
Step 2: mkdir directory for database
[oracle@enmoedu2 ~]$
[oracle@enmoedu2 ~]$ cd $ORACLE_BASE
[oracle@enmoedu2 oracle]$ ll
total 28
drwxr-x--- 5 oracle oinstall 4096 Apr 27 12:45 admin
drwxr-xr-x 7 oracle oinstall 4096 Oct 14 2014 cfgtoollogs
drwxr-xr-x 2 oracle oinstall 4096 Oct 14 2014 checkpoints
drwxrwxr-x 11 oracle oinstall 4096 Oct 14 2014 diag
drwxr-x--- 4 oracle oinstall 4096 Oct 14 2014 fast_recovery_area
drwxr-x--- 5 oracle oinstall 4096 Apr 27 12:45 oradata
drwxr-xr-x 5 oracle oinstall 4096 Oct 14 2014 product
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$ cd admin
[oracle@enmoedu2 admin]$ ll
total 12
drwxr-x--- 5 oracle oinstall 4096 Oct 14 2014 EMREP
drwxr-xr-x 3 oracle oinstall 4096 Apr 27 12:45 ENMOEDU
drwxr-x--- 5 oracle oinstall 4096 Oct 14 2014 PROD4
[oracle@enmoedu2 admin]$ rm -fR ENMOEDU/
[oracle@enmoedu2 admin]$
[oracle@enmoedu2 admin]$ mkir -p ENOMEDU/admin
-bash: mkir: command not found
[oracle@enmoedu2 admin]$
[oracle@enmoedu2 admin]$ mkdir -p ENMOEDU/admin
[oracle@enmoedu2 admin]$ cd ..
[oracle@enmoedu2 oracle]$ pwd
/u01/app/oracle
[oracle@enmoedu2 oracle]$ ll
total 28
drwxr-x--- 5 oracle oinstall 4096 Apr 29 15:32 admin
drwxr-xr-x 7 oracle oinstall 4096 Oct 14 2014 cfgtoollogs
drwxr-xr-x 2 oracle oinstall 4096 Oct 14 2014 checkpoints
drwxrwxr-x 11 oracle oinstall 4096 Oct 14 2014 diag
drwxr-x--- 4 oracle oinstall 4096 Oct 14 2014 fast_recovery_area
drwxr-x--- 5 oracle oinstall 4096 Apr 27 12:45 oradata
drwxr-xr-x 5 oracle oinstall 4096 Oct 14 2014 product
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$ cd oradata/
[oracle@enmoedu2 oradata]$ ll
total 12
drwxr-x--- 2 oracle oinstall 4096 Oct 14 2014 EMREP
drwxr-xr-x 2 oracle oinstall 4096 Apr 27 15:31 ENMOEDU
drwxr-x--- 2 oracle oinstall 4096 Oct 18 2014 PROD4
[oracle@enmoedu2 oradata]$
[oracle@enmoedu2 oradata]$ rm -fR ENMOEDU/
[oracle@enmoedu2 oradata]$
[oracle@enmoedu2 oradata]$ mkdir -p ENMOEDU/
[oracle@enmoedu2 oradata]$
[oracle@enmoedu2 oradata]$ ll
total 12
drwxr-x--- 2 oracle oinstall 4096 Oct 14 2014 EMREP
drwxr-xr-x 2 oracle oinstall 4096 Apr 29 15:34 ENMOEDU
drwxr-x--- 2 oracle oinstall 4096 Oct 18 2014 PROD4
[oracle@enmoedu2 oradata]$ cd ..
[oracle@enmoedu2 oracle]$ pwd
/u01/app/oracle
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$ echo "Step 3: create password file for database"
Step 3: create password file for database
[oracle@enmoedu2 oracle]$
[oracle@enmoedu2 oracle]$ cd $ORACLE_HOME
[oracle@enmoedu2 db_1]$ ll
[oracle@enmoedu2 db_1]$ cd dbs/
[oracle@enmoedu2 dbs]$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ ls
hc_EMREP.dat hc_PROD4.dat init.ora lkENMOEDU orapwEMREP orapwPROD4 spfileENMOEDU.ora
hc_ENMOEDU.dat initENMOEDU.ora lkEMREP lkPROD4 orapwENMOEDU spfileEMREP.ora spfilePROD4.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ rm orapwENMOEDU
[oracle@enmoedu2 dbs]$ rm initENMOEDU.ora
[oracle@enmoedu2 dbs]$ rm spfileENMOEDU.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ orapwd file=orapwENMOEDU password='oracle' entries=30
[oracle@enmoedu2 dbs]$ ls
hc_EMREP.dat hc_ENMOEDU.dat hc_PROD4.dat init.ora lkEMREP lkENMOEDU lkPROD4 orapwEMREP orapwENMOEDU orapwPROD4 spfileEMREP.ora

spfilePROD4.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ echo " Step 4:create pfile from init.ora"
Step 4:create pfile from init.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ ls
hc_EMREP.dat hc_ENMOEDU.dat hc_PROD4.dat init.ora lkEMREP lkENMOEDU lkPROD4 orapwEMREP orapwENMOEDU orapwPROD4 spfileEMREP.ora

spfilePROD4.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ cat init.ora | grep -v ^# | grep -v ^$ > initENMOEDU.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ cat initENMOEDU.ora
db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 433G 25G 385G 7% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ vim initENMOEDU.ora
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ echo " Step 5: cteate spfile and startup nomount"
Step 5: cteate spfile and startup nomount
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ echo $ORACLE_SID
ENMOEDU
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 dbs]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 29 15:42:52 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

SQL>
SQL> conn /as sysdba
Connected to an idle instance.
SQL>
SQL> create spfile from pfile;

File created.

SQL>
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 836976640 bytes
Fixed Size 1348160 bytes
Variable Size 490737088 bytes
Database Buffers 339738624 bytes
Redo Buffers 5152768 bytes
SQL>
SQL>
[oracle@enmoedu2 dbs]$ cat initENMOEDU.ora
[oracle@enmoedu2 scripts]$ cat cdb.sql
CREATE DATABASE mynewdb
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_password
LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/my/redo01b.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/logs/my/redo02a.log','/u02/logs/my/redo02b.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/mynewdb/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/mynewdb/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/mynewdb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
[oracle@enmoedu2 scripts]$
[oracle@enmoedu2 scripts]$ vim cdb.sql
CREATE DATABASE mynewdb
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_password
GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
SIZE 20M REUSE
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
~
~
db_name='ENMOEDU'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/oracle/admin/ENMOEDU/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle/'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = (/u01/app/oracle/oradata/ENMOEDU/control01.ctl,/u01/app/oracle/oradata/ENMOEDU/control02.ctl)
compatible ='11.2.0'
[oracle@enmoedu2 dbs]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 29 15:58:46 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 836976640 bytes
Fixed Size 1348160 bytes
Variable Size 490737088 bytes
Database Buffers 339738624 bytes
Redo Buffers 5152768 bytes
SQL>
SQL>
SQL> !
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ echo "Step 6 : Crate database"
Step 6 : Crate database
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ cd /home/oracle/scripts/
[oracle@enmoedu2 scripts]$ pwd
/home/oracle/scripts
[oracle@enmoedu2 scripts]$ ll
total 8
-rw-r--r-- 1 oracle oinstall 106 Apr 27 15:35 1.sql
-rw-r--r-- 1 oracle oinstall 1097 Apr 27 15:20 createdb.sql
[oracle@enmoedu2 scripts]$
[oracle@enmoedu2 scripts]$ vim cdb.sql
[oracle@enmoedu2 scripts]$ exit
exit
SQL>
SQL>
SQL> @/home/oracle/scripts/cdb.sql

Database created.

SQL>
SQL>
SQL> !
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ echo "Step 7 : create dictionaries with scripts"
Step 7 : create dictionaries with scripts
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ exit
exit

SQL>
SQL> !
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ pwd
/u01/app/oracle/admin/ENMOEDU/adump
[oracle@enmoedu2 adump]$ ll
total 12
-rw-r----- 1 oracle oinstall 732 Apr 29 15:58 ENMOEDU_ora_5813_1.aud
-rw-r----- 1 oracle oinstall 766 Apr 29 15:58 ENMOEDU_ora_5813_2.aud
-rw-r----- 1 oracle oinstall 772 Apr 29 15:58 ENMOEDU_ora_5893_1.aud
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ cd /home/oracle/scripts/
[oracle@enmoedu2 scripts]$ ll
total 12
-rw-r--r-- 1 oracle oinstall 106 Apr 27 15:35 1.sql
-rw-r--r-- 1 oracle oinstall 1096 Apr 29 16:05 cdb.sql
-rw-r--r-- 1 oracle oinstall 1097 Apr 27 15:20 createdb.sql
[oracle@enmoedu2 scripts]$
[oracle@enmoedu2 scripts]$ cat 1.sql
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
conn system/oracle
@?/sqlplus/admin/pupbld.sql
EXIT
[oracle@enmoedu2 scripts]$
[oracle@enmoedu2 scripts]$
[oracle@enmoedu2 scripts]$ exit
exit

SQL>
SQL>
SQL> select instance_name,status from V$instance;

INSTANCE_NAME STATUS
---------------- ------------
ENMOEDU OPEN

SQL>
SQL>
SQL>
SQL> @/home/oralce/scripts/1.sql
SP2-0310: unable to open file "/home/oralce/scripts/1.sql"
SQL>
SQL> @/home/oracle/scripts/1.sql
DOC>######################################################################
DOC>######################################################################
DOC> The following statement will cause an "ORA-01722: invalid number"
DOC> error and terminate the SQLPLUS session if the user is not SYS.
DOC> Disconnect and reconnect with AS SYSDBA.
DOC>######################################################################
DOC>######################################################################
DOC>#

no rows selected


Session altered.


TIMESTAMP
------------------------------------------------------------
COMP_TIMESTAMP CATALG_BGN 2015-04-29 16:13:23 2457142 58403


Package created.


Package body created.


Grant succeeded.

...................................

这个是oracle运行自身脚本的过程;
时间比较长;
中间会报出一些空对象无法删除的错误;
不用担心,等待全部运行完毕即可。


...................................
QL> DROP SYNONYM PRODUCT_USER_PROFILE;
DROP SYNONYM PRODUCT_USER_PROFILE
*
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist


SQL> CREATE SYNONYM PRODUCT_USER_PROFILE FOR SYSTEM.SQLPLUS_PRODUCT_PROFILE;

Synonym created.

SQL> DROP PUBLIC SYNONYM PRODUCT_USER_PROFILE;
DROP PUBLIC SYNONYM PRODUCT_USER_PROFILE
*
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist


SQL> CREATE PUBLIC SYNONYM PRODUCT_USER_PROFILE FOR SYSTEM.PRODUCT_PRIVS;

Synonym created.

SQL>
SQL> -- End of pupbld.sql
SQL> EXIT
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ echo "Step 8 : check the new database status"
Step 8 : check the new database status
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$
[oracle@enmoedu2 adump]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 29 16:21:28 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

SQL> conn /as sysdba
Connected.
SQL>
SQL>
SQL>
SQL> select instance_name,status from v$instance;

INSTANCE_NAME STATUS
---------------- ------------
ENMOEDU OPEN

SQL>
SQL>
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL>
SQL>