ORA-01506: missing or illegal database name 故障分析一例
今天在做RAC-DG实验时,碰到了不少的问题,这个问题是在操作用pifle创建spifle时出现的,由于在配置RAC-DG主库参数时,大部分人喜
今天在做RAC-DG实验时,碰到了不少的问题,这个问题是在操作用pifle创建spifle时出现的
由于在配置RAC-DG主库参数时,大部分人喜欢直接用alter system set xxx='xxx.xxx' scope=spfile;
而我由于不想一条条敲命令,所以先用主库参数创建一个pifle,然后对pfile进行修改,加上我们所需的DG配置参数,然后再把pfile写回spfile参数文件,再用spfile来启动RAC数据库
步骤如下:
1.在主库正常启动状态下执行:
SQL> create pfile='/rmanbackup/initora11dg.ora' from spfile;
File created.
2.修改生成的pfile参数文件的内容,主要添加以下内容:
#装完GI后原有参数
*.audit_file_dest='/u01/app/Oracle/admin/ora11rac/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA/ora11rac/controlfile/current.260.823440203','+BACKUPDG/ora11rac/controlfile/current.256.823440203'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='ora11rac'
*.db_recovery_file_dest='+BACKUPDG'
*.db_recovery_file_dest_size=4558159872
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora11racXDB)'
ora11rac2.instance_number=2
ora11rac1.instance_number=1
*.memory_target=838860800
*.open_cursors=300
*.processes=150
*.remote_listener='zlm-cluster-scan:1521'
*.remote_login_passwordfile='exclusive'
ora11rac2.thread=2
ora11rac1.thread=1
ora11rac2.undo_tablespace='UNDOTBS2'
ora11rac1.undo_tablespace='UNDOTBS1'
#以下为配置DG而添加的内容
*.db_unique_name='ora11rac'
*.log_archive_config='dg_config=(ora11rac,ora11dg)'
*.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=ora11rac'
*.log_archive_dest_2='service=ora11dg valid_for=(online_logfiles,primary_role) db_unique_name=ora11dg'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format='arc_%t_%s_%r.arc'
#为switchover或failover而设置的参数
*.fal_server=ora11dg
*.standby_file_management='auto'
*.db_file_name_convert='/u01/app/oracle/oradata/ora11dg/datafile','+DATA/ora11rac/datafile','/u01/app/oracle/oradata/ora11dg/datafile','+DATA/ora11rac/tempfile'
*.log_file_name_convert='/u01/app/oracle/oradata/ora11dg/datafile','+DATA/ora11rac/onlinelog','/u01/app/oracle/oradata/ora11dg/datafile','+BACKUPDG/ora11rac/onlinelog'
3.保存退出后,执行以下命令:
SQL> create spfile='+DATA/ora11rac/spfileora11rac.ora' from pfile;
File created.
本来以为这样就完成了我的预定目标->用pfile修改spfile,但是当我再startup启动数据库时,,报了ORA-01506的错误
SQL> startup force
ORA-01506: missing or illegal database name
这个错误,按字面理解就是丢失数据库名,就是参数中没有db_name这项内容或者配置错误。
发生这个错误是因为没有之前的创建spfile语句没有指定pfile路径所致。其实和单实例本地路径存放不同(单实例环境直接执行create spifle from pfile是不会有问题的,因为这2个文件都存放在$ORACLE_HOME/dbs路径下),如果pfile不指定路径,默认使用的只是dbs下的initora11rac1.ora去生成spfile,由于在ASM中,此文件是用来指向ASM中spfile文件的存放路径,内容只有一句“+DATA/ora11rac/spfileora11rac.ora”,知道了问题所在,那么把上面那条创建spifle的语句修改如下:
SQL> create spfile='+DATA/ora11rac/spfileora11rac.ora' from pfile='/rmanbackup/initora11rac.ora';
File created.
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2232960 bytes
Variable Size 578817408 bytes
Database Buffers 251658240 bytes
Redo Buffers 2396160 bytes
Database mounted.
Database opened.
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA/ora11rac/spfileora11rac.
ora
此时再用spfile启动正常,问题解决了。
总结:发现问题不要慌张,根据oracle的错误提示,去思考错误发生的原因,如果自己不能得出有效的判断,可以借助一些手段,比如google,很多ora-xxxxx错误搜索一下就能得出很多条结果,虽然产生的原因和解决的办法不尽相同,但是我想说的是,可以为你提供一种思路。很多情况下,别人可以用的方法,可以执行的命令是ok的,但是到了自己的环境,却不一定是一样的。
以上的这个问题,其实是因为自己初学,对ASM的RAC环境还不够熟悉所致,如果知道默认是去dbs使用pfile的这个规则,那么很容易就能发现问题所在,而这个也是一个经验积累的过程,碰到一个问题就解决一个,假以时日,你就会成为truble shooting的高手了。
推荐阅读:
Data Guard 配置 Standby Redo Log
RMAN duplicate for Standby失败解决过程
Data Gurad物理备份方式下以READ ONLY/WRITE模式打开物理Standby
RAC primary+Single Standby DG配置实践
Oracle Standby 策略 PPT

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.
