oracle查看实例和数据库名,查看Oracle数据库名和实例名

查看数据库名

SQL> select name from v$database;

NAME

---------

ORCL

SQL> desc v$database;

名称                                      是否为空? 类型

----------------------------------------- -------- ----------------------------

DBID                                               NUMBER

NAME                                               VARCHAR2(9)

CREATED                                            DATE

RESETLOGS_CHANGE#                                  NUMBER

RESETLOGS_TIME                                     DATE

PRIOR_RESETLOGS_CHANGE#                            NUMBER

PRIOR_RESETLOGS_TIME                               DATE

LOG_MODE                                           VARCHAR2(12)

CHECKPOINT_CHANGE#                                 NUMBER

ARCHIVE_CHANGE#                                    NUMBER

CONTROLFILE_TYPE                                   VARCHAR2(7)

CONTROLFILE_CREATED                                DATE

CONTROLFILE_SEQUENCE#                              NUMBER

CONTROLFILE_CHANGE#                                NUMBER

CONTROLFILE_TIME                                   DATE

OPEN_RESETLOGS                                     VARCHAR2(11)

VERSION_TIME                                       DATE

OPEN_MODE                                          VARCHAR2(10)

PROTECTION_MODE                                    VARCHAR2(20)

PROTECTION_LEVEL                                   VARCHAR2(20)

REMOTE_ARCHIVE                                     VARCHAR2(8)

ACTIVATION#                                        NUMBER

SWITCHOVER#                                        NUMBER

DATABASE_ROLE                                      VARCHAR2(16)

ARCHIVELOG_CHANGE#                                 NUMBER

ARCHIVELOG_COMPRESSION                             VARCHAR2(8)

SWITCHOVER_STATUS                                  VARCHAR2(20)

DATAGUARD_BROKER                                   VARCHAR2(8)

GUARD_STATUS                                       VARCHAR2(7)

SUPPLEMENTAL_LOG_DATA_MIN                          VARCHAR2(8)

SUPPLEMENTAL_LOG_DATA_PK                           VARCHAR2(3)

SUPPLEMENTAL_LOG_DATA_UI                           VARCHAR2(3)

FORCE_LOGGING                                      VARCHAR2(3)

PLATFORM_ID                                        NUMBER

PLATFORM_NAME                                      VARCHAR2(101)

RECOVERY_TARGET_INCARNATION#                       NUMBER

LAST_OPEN_INCARNATION#                             NUMBER

CURRENT_SCN                                        NUMBER

FLASHBACK_ON                                       VARCHAR2(18)

SUPPLEMENTAL_LOG_DATA_FK                           VARCHAR2(3)

SUPPLEMENTAL_LOG_DATA_ALL                          VARCHAR2(3)

DB_UNIQUE_NAME                                     VARCHAR2(30)

STANDBY_BECAME_PRIMARY_SCN                         NUMBER

FS_FAILOVER_STATUS                                 VARCHAR2(21)

FS_FAILOVER_CURRENT_TARGET                         VARCHAR2(30)

FS_FAILOVER_THRESHOLD                              NUMBER

FS_FAILOVER_OBSERVER_PRESENT                       VARCHAR2(7)

FS_FAILOVER_OBSERVER_HOST                          VARCHAR2(512)

---------------------------------------

查看实例名

SQL> select instance_name from v$instance;

INSTANCE_NAME

----------------

orcl

SQL> desc v$instance;  名称                                      是否为空? 类型  ----------------------------------------- -------- --------------  INSTANCE_NUMBER                                    NUMBER  INSTANCE_NAME                                      VARCHAR2(16)  HOST_NAME                                          VARCHAR2(64)  VERSION                                            VARCHAR2(17)  STARTUP_TIME                                       DATE  STATUS                                             VARCHAR2(12)  PARALLEL                                           VARCHAR2(3)  THREAD#                                            NUMBER  ARCHIVER                                           VARCHAR2(7)  LOG_SWITCH_WAIT                                    VARCHAR2(15)  LOGINS                                             VARCHAR2(10)  SHUTDOWN_PENDING                                   VARCHAR2(3)  DATABASE_STATUS                                    VARCHAR2(17)  INSTANCE_ROLE                                      VARCHAR2(18)  ACTIVE_STATE                                       VARCHAR2(9)  BLOCKED                                            VARCHAR2(3)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值