Home Database Mysql Tutorial How to create DBFS file system

How to create DBFS file system

Jun 07, 2016 pm 05:40 PM
oracle

DBFS是oracleExadata提供的一种的集群文件系统,他是通过创建一个表空间,并将该表空间通过一系列操作,挂载成为文件系统,为Exadata各个节点提供文件系统服务。

   DBFS是oracle Exadata提供的一种的集群文件系统,他是通过创建一个表空间,并将该表空间通过一系列操作,挂载成为文件系统,为Exadata各个节点提供文件系统服务。
   DBFS一般都是在客户初次部署的时候,由oracle远程工程师通过固定的脚本,自动化部署全部的操作系统数据库的同时,将其建立。
   这里说到的就是,在之前客户没有规划DBFS文件系统,但是后期打算手动添加的方法。
  我的OS oracle linux

1.创建fuse用户组,并将oracle添加到这个组内。(注:dcli -g ~/dbs_group -l表示后面的命令式在~/dbs_group中列出的全部服务器上执行)

  • (root)# dcli -g ~/dbs_group -l root usermod -a -G fuse oracle 
  • 2.创建/etc/fuse.conf file并添加 user_allow_other. 赋予相应的权限到这个文件.

  • (root)# dcli -g ~/dbs_group -l root chmod 644 /etc/fuse.conf 
  • 3.在所有的服务器上创建一个空的目录,用来作为DBFS文件系统的挂载点。

  • (root)# dcli -g ~/dbs_group -l root mkdir /dbfs_direct 
  •   更改目录的属组,确保oracle可以正常访问与修改.

  • (root)# dcli -g ~/dbs_group -l root chown oracle:dba /dbfs_direct 
  • 4.To pick up the additional group (fuse) membership for the oracle user on Linux or the workaround above on Solaris, Clusterware must be restarted. For example, to restart Clusterware on all nodes at the same time (non-rolling), you can use the following commands as root:

    5.创建一个数据库表空间,作为DBFS文件系统的存储空间. 如何创建表空间,请参考 Note 1191144.1
    创建一个表空间(表空间名dbfsts)为将来存储文件使用,可以根据你的需求创建:大小,是否扩展和bigfile or small file等,完全随意

  • SQL> create bigfile tablespace dbfsts datafile '+DBFS_DG' size 32g autoextend on next 8g maxsize 300g NOLOGGING EXTENT MANAGEMENT LOCAL AUTOALLOCATE  SEGMENT SPACE MANAGEMENT AUTO ; 
  • 6.创建用户,该用户是后续管理DBFS使用的

  • SQL> grant create session, create table, create view, create procedure, dbfs_role to dbfs_user; 
  • 7.通过调用 dbfs_create_filesystem.sql 脚本,创建文件系统

    ---至此,已经完成DBFS文件系统的安装,下面是对DBFS的挂载和管理---

    有两种方式来挂载之前创建的表空间为DBFS
    第一种方法是通过安装rpm包,使用dbfs_client命令来实现DBFS的挂载,但是不能使用wallet的功能(注意这里的wallet不是数据库中的wallet,它只是保存 dbfs_user/dbfs_passwd 的一个加密文件)
    第二种方法是使用 Oracle Wallet来存储密码和使用mount命令

    8. The second option is to use the Oracle Wallet to store the password and make use of the mount command. The wallet directory ($HOME/dbfs/wallet in the example here) may be any oracle-writable directory (creating a new, empty directory is recommended). All commands in this section should be run by the oracle user unless otherwise noted.)

    9. Create a new TNS_ADMIN directory ($HOME/dbfs/tnsadmin) for exclusive use by the DBFS mount script.

    10. On each node, create the $HOME/dbfs/tnsadmin/sqlnet.ora file with the same contents on each node after making the proper substitution for :

    11. Create a wallet directory on one database server as the oracle user. For example:

    12. Ensure that the TNS entry specified above (fsdb.local in the example) is defined and working properly (checking with "TNS_ADMIN=/home/oracle/dbfs/tnsadmin tnsping fsdb.local" is a good test).

    下载脚本 mount-dbfs.sh 到一个DB节点上的临时位置   (如 /tmp/mount-dbfs.sh). 运行 dos2unix防止文件格式不兼容。

  • For Linux, run this: 
  • (root)# dos2unix /tmp/mount-dbfs.sh  
  • mount-dbfs.sh 脚本是后续挂载DBFS文件系统的时候都要调用的,其中涉及一下参数,需要根据实际环境进行设置

    13. 修改后将文件拷贝到每个服务器的适当目录下,这里就使用GI_HOME/crs/script,香港服务器,并使用root设置相应的权限

    14. 通过以下脚本,来实现将DBFS作为一种资源注册到CRS,以使用CRS来管理DBFS。使用数据库的owner(既oracle)来执行以下脚本,根据实际情况适当修改ORACLE_HOME(其为grid home) 和DBNAME(数据库名),还可以注册多个DBFS文件系统到CRS,香港服务器,不过这里就不讲了,有机会再更新。

    15.通过Oracle Clusterware来管理 DBFS挂载与卸载

    资源注册成功后,网站空间,可以通过crsctl  stat res dbfs_mount  来查看到 dbfs_mount 资源,其所有的节点状态是 OFFLINE:

                        
    17.执行crsctl start resource dbfs_mount,将会挂载DBFS到全部的节点:

            
    18.挂载成功后,你可以通过df -h查看到DBFS文件系统的信息 Also, the default startup for this resource is "restore" which means that if it is online before Clusterware is stopped, it will attempt to come online after Clusterware is restarted. For example:

    19.DBFS配置过程中,遇到一段插曲
    通过crsctl显示状态是online,但是文件系统不能被访问,当访问的时候,会遇到df: `/dbfs_direct': Input/output error错误,后来应用patch 13340960,问题解决。

    详情请参考oracle官方文档:
    Configuring DBFS on Oracle Database Machine (Doc ID 1054431.1)
    Accessing Dbfs Using Oracle Wallet Fails With Input/output error (Doc ID 1358194.1)

    本文出自 “小小狗窝” 博客,谢绝转载!

    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    How to check tablespace size of oracle How to check tablespace size of oracle Apr 11, 2025 pm 08:15 PM

    To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

    How to encrypt oracle view How to encrypt oracle view Apr 11, 2025 pm 08:30 PM

    Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

    How to view instance name of oracle How to view instance name of oracle Apr 11, 2025 pm 08:18 PM

    There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

    How to uninstall Oracle installation failed How to uninstall Oracle installation failed Apr 11, 2025 pm 08:24 PM

    Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

    How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

    The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

    How to check invalid numbers of oracle How to check invalid numbers of oracle Apr 11, 2025 pm 08:27 PM

    Oracle Invalid numeric errors may be caused by data type mismatch, numeric overflow, data conversion errors, or data corruption. Troubleshooting steps include checking data types, detecting digital overflows, checking data conversions, checking data corruption, and exploring other possible solutions such as configuring the NLS_NUMERIC_CHARACTERS parameter and enabling data verification logging.

    How to delete all data from oracle How to delete all data from oracle Apr 11, 2025 pm 08:36 PM

    Deleting all data in Oracle requires the following steps: 1. Establish a connection; 2. Disable foreign key constraints; 3. Delete table data; 4. Submit transactions; 5. Enable foreign key constraints (optional). Be sure to back up the database before execution to prevent data loss.

    How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

    In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

    See all articles